Struct style::logical_geometry::LogicalMargin
source · pub struct LogicalMargin<T> {
pub block_start: T,
pub inline_end: T,
pub block_end: T,
pub inline_start: T,
debug_writing_mode: DebugWritingMode,
}
Expand description
A “margin” in flow-relative dimensions Represents the four sides of the margins, borders, or padding of a CSS box, or a combination of those. A positive “margin” can be added to a rectangle to obtain a bigger rectangle.
Fields§
§block_start: T
§inline_end: T
§block_end: T
§inline_start: T
§debug_writing_mode: DebugWritingMode
Implementations§
source§impl<T: Zero> LogicalMargin<T>
impl<T: Zero> LogicalMargin<T>
pub fn zero(mode: WritingMode) -> LogicalMargin<T>
source§impl<T> LogicalMargin<T>
impl<T> LogicalMargin<T>
pub fn new( mode: WritingMode, block_start: T, inline_end: T, block_end: T, inline_start: T, ) -> LogicalMargin<T>
pub fn from_physical( mode: WritingMode, offsets: SideOffsets2D<T>, ) -> LogicalMargin<T>
source§impl<T: Clone> LogicalMargin<T>
impl<T: Clone> LogicalMargin<T>
pub fn new_all_same(mode: WritingMode, value: T) -> LogicalMargin<T>
pub fn top(&self, mode: WritingMode) -> T
pub fn set_top(&mut self, mode: WritingMode, top: T)
pub fn right(&self, mode: WritingMode) -> T
pub fn set_right(&mut self, mode: WritingMode, right: T)
pub fn bottom(&self, mode: WritingMode) -> T
pub fn set_bottom(&mut self, mode: WritingMode, bottom: T)
pub fn left(&self, mode: WritingMode) -> T
pub fn set_left(&mut self, mode: WritingMode, left: T)
pub fn to_physical(&self, mode: WritingMode) -> SideOffsets2D<T>
pub fn convert( &self, mode_from: WritingMode, mode_to: WritingMode, ) -> LogicalMargin<T>
source§impl<T: Copy + Add<T, Output = T>> LogicalMargin<T>
impl<T: Copy + Add<T, Output = T>> LogicalMargin<T>
pub fn inline_start_end(&self) -> T
pub fn block_start_end(&self) -> T
pub fn start_end(&self, direction: Direction) -> T
pub fn top_bottom(&self, mode: WritingMode) -> T
pub fn left_right(&self, mode: WritingMode) -> T
Trait Implementations§
source§impl<T: Copy + Add<T, Output = T> + Sub<T, Output = T>> Add<LogicalMargin<T>> for LogicalRect<T>
impl<T: Copy + Add<T, Output = T> + Sub<T, Output = T>> Add<LogicalMargin<T>> for LogicalRect<T>
§type Output = LogicalRect<T>
type Output = LogicalRect<T>
The resulting type after applying the
+
operator.source§fn add(self, other: LogicalMargin<T>) -> LogicalRect<T>
fn add(self, other: LogicalMargin<T>) -> LogicalRect<T>
Performs the
+
operation. Read moresource§impl<T: Add<T, Output = T>> Add for LogicalMargin<T>
impl<T: Add<T, Output = T>> Add for LogicalMargin<T>
§type Output = LogicalMargin<T>
type Output = LogicalMargin<T>
The resulting type after applying the
+
operator.source§fn add(self, other: LogicalMargin<T>) -> LogicalMargin<T>
fn add(self, other: LogicalMargin<T>) -> LogicalMargin<T>
Performs the
+
operation. Read moresource§impl<T: Clone> Clone for LogicalMargin<T>
impl<T: Clone> Clone for LogicalMargin<T>
source§fn clone(&self) -> LogicalMargin<T>
fn clone(&self) -> LogicalMargin<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 LogicalMargin<T>
impl<T: Debug> Debug for LogicalMargin<T>
source§impl<T: PartialEq> PartialEq for LogicalMargin<T>
impl<T: PartialEq> PartialEq for LogicalMargin<T>
source§fn eq(&self, other: &LogicalMargin<T>) -> bool
fn eq(&self, other: &LogicalMargin<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T> Serialize for LogicalMargin<T>where
T: Serialize,
impl<T> Serialize for LogicalMargin<T>where
T: Serialize,
source§impl<T: Copy + Add<T, Output = T> + Sub<T, Output = T>> Sub<LogicalMargin<T>> for LogicalRect<T>
impl<T: Copy + Add<T, Output = T> + Sub<T, Output = T>> Sub<LogicalMargin<T>> for LogicalRect<T>
§type Output = LogicalRect<T>
type Output = LogicalRect<T>
The resulting type after applying the
-
operator.source§fn sub(self, other: LogicalMargin<T>) -> LogicalRect<T>
fn sub(self, other: LogicalMargin<T>) -> LogicalRect<T>
Performs the
-
operation. Read moresource§impl<T: Sub<T, Output = T>> Sub for LogicalMargin<T>
impl<T: Sub<T, Output = T>> Sub for LogicalMargin<T>
§type Output = LogicalMargin<T>
type Output = LogicalMargin<T>
The resulting type after applying the
-
operator.source§fn sub(self, other: LogicalMargin<T>) -> LogicalMargin<T>
fn sub(self, other: LogicalMargin<T>) -> LogicalMargin<T>
Performs the
-
operation. Read moreimpl<T: Copy> Copy for LogicalMargin<T>
impl<T: Eq> Eq for LogicalMargin<T>
impl<T> StructuralPartialEq for LogicalMargin<T>
Auto Trait Implementations§
impl<T> Freeze for LogicalMargin<T>where
T: Freeze,
impl<T> RefUnwindSafe for LogicalMargin<T>where
T: RefUnwindSafe,
impl<T> Send for LogicalMargin<T>where
T: Send,
impl<T> Sync for LogicalMargin<T>where
T: Sync,
impl<T> Unpin for LogicalMargin<T>where
T: Unpin,
impl<T> UnwindSafe for LogicalMargin<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<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