Struct style::logical_geometry::LogicalSize
source · pub struct LogicalSize<T> {
pub inline: T,
pub block: T,
debug_writing_mode: DebugWritingMode,
}
Expand description
A 2D size in flow-relative dimensions
Fields§
§inline: T
§block: T
§debug_writing_mode: DebugWritingMode
Implementations§
source§impl<T: Zero> LogicalSize<T>
impl<T: Zero> LogicalSize<T>
pub fn zero(mode: WritingMode) -> LogicalSize<T>
source§impl<T> LogicalSize<T>
impl<T> LogicalSize<T>
pub fn new(mode: WritingMode, inline: T, block: T) -> LogicalSize<T>
pub fn from_physical(mode: WritingMode, size: Size2D<T>) -> LogicalSize<T>
source§impl<T: Clone> LogicalSize<T>
impl<T: Clone> LogicalSize<T>
pub fn width(&self, mode: WritingMode) -> T
pub fn set_width(&mut self, mode: WritingMode, width: T)
pub fn height(&self, mode: WritingMode) -> T
pub fn set_height(&mut self, mode: WritingMode, height: T)
pub fn to_physical(&self, mode: WritingMode) -> Size2D<T>
pub fn convert( &self, mode_from: WritingMode, mode_to: WritingMode, ) -> LogicalSize<T>
Trait Implementations§
source§impl<T: Copy + Add<T, Output = T>> Add<LogicalSize<T>> for LogicalPoint<T>
impl<T: Copy + Add<T, Output = T>> Add<LogicalSize<T>> for LogicalPoint<T>
source§type Output = LogicalPoint<T>
type Output = LogicalPoint<T>
The resulting type after applying the
+
operator.source§fn add(self, other: LogicalSize<T>) -> LogicalPoint<T>
fn add(self, other: LogicalSize<T>) -> LogicalPoint<T>
Performs the
+
operation. Read moresource§impl<T: Add<T, Output = T>> Add for LogicalSize<T>
impl<T: Add<T, Output = T>> Add for LogicalSize<T>
source§type Output = LogicalSize<T>
type Output = LogicalSize<T>
The resulting type after applying the
+
operator.source§fn add(self, other: LogicalSize<T>) -> LogicalSize<T>
fn add(self, other: LogicalSize<T>) -> LogicalSize<T>
Performs the
+
operation. Read moresource§impl<T: Clone> Clone for LogicalSize<T>
impl<T: Clone> Clone for LogicalSize<T>
source§fn clone(&self) -> LogicalSize<T>
fn clone(&self) -> LogicalSize<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for LogicalSize<T>
impl<T: Debug> Debug for LogicalSize<T>
source§impl<T: PartialEq> PartialEq for LogicalSize<T>
impl<T: PartialEq> PartialEq for LogicalSize<T>
source§impl<T> Serialize for LogicalSize<T>where
T: Serialize,
impl<T> Serialize for LogicalSize<T>where
T: Serialize,
source§impl<T: Copy + Sub<T, Output = T>> Sub<LogicalSize<T>> for LogicalPoint<T>
impl<T: Copy + Sub<T, Output = T>> Sub<LogicalSize<T>> for LogicalPoint<T>
source§type Output = LogicalPoint<T>
type Output = LogicalPoint<T>
The resulting type after applying the
-
operator.source§fn sub(self, other: LogicalSize<T>) -> LogicalPoint<T>
fn sub(self, other: LogicalSize<T>) -> LogicalPoint<T>
Performs the
-
operation. Read moresource§impl<T: Sub<T, Output = T>> Sub for LogicalSize<T>
impl<T: Sub<T, Output = T>> Sub for LogicalSize<T>
source§type Output = LogicalSize<T>
type Output = LogicalSize<T>
The resulting type after applying the
-
operator.source§fn sub(self, other: LogicalSize<T>) -> LogicalSize<T>
fn sub(self, other: LogicalSize<T>) -> LogicalSize<T>
Performs the
-
operation. Read moreimpl<T: Copy> Copy for LogicalSize<T>
impl<T: Eq> Eq for LogicalSize<T>
impl<T> StructuralPartialEq for LogicalSize<T>
Auto Trait Implementations§
impl<T> Freeze for LogicalSize<T>where
T: Freeze,
impl<T> RefUnwindSafe for LogicalSize<T>where
T: RefUnwindSafe,
impl<T> Send for LogicalSize<T>where
T: Send,
impl<T> Sync for LogicalSize<T>where
T: Sync,
impl<T> Unpin for LogicalSize<T>where
T: Unpin,
impl<T> UnwindSafe for LogicalSize<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert