pub enum MultiValue<T> {
Auto,
Initial,
Inherit,
Exact(T),
}Expand description
A value that can be Auto, Initial, Inherit, or an explicit value.
This preserves CSS cascade semantics better than Option
Variants§
Auto
CSS ‘auto’ keyword
Initial
CSS ‘initial’ keyword - use initial value
Inherit
CSS ‘inherit’ keyword - inherit from parent
Exact(T)
Explicit value (e.g., “10px”, “50%”)
Implementations§
Source§impl<T> MultiValue<T>
impl<T> MultiValue<T>
Sourcepub fn unwrap_or_default(self) -> Twhere
T: Default,
pub fn unwrap_or_default(self) -> Twhere
T: Default,
Gets the exact value or returns T::default()
Sourcepub fn map<U, F>(self, f: F) -> MultiValue<U>where
F: FnOnce(T) -> U,
pub fn map<U, F>(self, f: F) -> MultiValue<U>where
F: FnOnce(T) -> U,
Maps the inner value if Exact, otherwise returns self unchanged
Source§impl MultiValue<LayoutOverflow>
impl MultiValue<LayoutOverflow>
Sourcepub fn is_clipped(&self) -> bool
pub fn is_clipped(&self) -> bool
Returns true if this overflow value causes content to be clipped. This includes Hidden, Clip, Auto, and Scroll (all values except Visible).
pub fn is_scroll(&self) -> bool
pub fn is_auto_overflow(&self) -> bool
pub fn is_scroll_explicit(&self) -> bool
pub fn is_visible_or_clip(&self) -> bool
Source§impl MultiValue<LayoutPosition>
impl MultiValue<LayoutPosition>
pub fn is_absolute_or_fixed(&self) -> bool
Source§impl MultiValue<LayoutFloat>
impl MultiValue<LayoutFloat>
Trait Implementations§
Source§impl<T: Clone> Clone for MultiValue<T>
impl<T: Clone> Clone for MultiValue<T>
Source§fn clone(&self) -> MultiValue<T>
fn clone(&self) -> MultiValue<T>
Returns a duplicate 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 MultiValue<T>
impl<T: Debug> Debug for MultiValue<T>
Source§impl<T: Default> Default for MultiValue<T>
impl<T: Default> Default for MultiValue<T>
Source§impl<T: PartialEq> PartialEq for MultiValue<T>
impl<T: PartialEq> PartialEq for MultiValue<T>
impl<T: Copy> Copy for MultiValue<T>
impl<T> StructuralPartialEq for MultiValue<T>
Auto Trait Implementations§
impl<T> Freeze for MultiValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for MultiValue<T>where
T: RefUnwindSafe,
impl<T> Send for MultiValue<T>where
T: Send,
impl<T> Sync for MultiValue<T>where
T: Sync,
impl<T> Unpin for MultiValue<T>where
T: Unpin,
impl<T> UnwindSafe for MultiValue<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§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