pub enum Spacing {
Space(u16),
Overlap(u16),
}
Expand description
Represents the spacing between segments in a layout.
The Spacing
enum is used to define the spacing between segments in a layout. It can represent
either positive spacing (space between segments) or negative spacing (overlap between segments).
§Variants
Space(u16)
: Represents positive spacing between segments. The value indicates the number of cells.Overlap(u16)
: Represents negative spacing, causing overlap between segments. The value indicates the number of overlapping cells.
§Default
The default value for Spacing
is Space(0)
, which means no spacing or no overlap between
segments.
§Conversions
The Spacing
enum can be created from different integer types:
- From
u16
: Directly converts the value toSpacing::Space
. - From
i16
: Converts negative values toSpacing::Overlap
and non-negative values toSpacing::Space
. - From
i32
: Clamps the value to the range ofi16
and converts negative values toSpacing::Overlap
and non-negative values toSpacing::Space
.
See the Layout::spacing
method for details on how to use this enum.
Variants§
Trait Implementations§
impl Eq for Spacing
impl StructuralPartialEq for Spacing
Auto Trait Implementations§
impl Freeze for Spacing
impl RefUnwindSafe for Spacing
impl Send for Spacing
impl Sync for Spacing
impl Unpin for Spacing
impl UnwindSafe for Spacing
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§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 more