#[non_exhaustive]pub enum SkeletonSize {
Auto,
Pixels(f64),
Css(String),
}Expand description
A Skeleton width or height: pixels, or a CSS length such as 0.75rem or 60%.
Numbers and strings convert into it, so props accept width: 48 or width: "60%".
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Auto
No size; the stylesheet default applies.
Pixels(f64)
A length in pixels. Negative and non-finite values are ignored.
Css(String)
A CSS length, percentage, or math expression. Unsafe values are ignored.
Implementations§
Source§impl SkeletonSize
impl SkeletonSize
Sourcepub fn resolve(&self) -> Option<String>
pub fn resolve(&self) -> Option<String>
The CSS length, or None when the value is not safe to put in a style attribute.
Follows resolveLumenSkeletonSize in lumen-core: numbers become pixels, numeric strings
become pixels, and other strings may only use ASCII letters, digits, and math characters.
Trait Implementations§
Source§impl Clone for SkeletonSize
impl Clone for SkeletonSize
Source§impl Debug for SkeletonSize
impl Debug for SkeletonSize
Source§impl Default for SkeletonSize
impl Default for SkeletonSize
Source§impl From<&str> for SkeletonSize
impl From<&str> for SkeletonSize
Source§impl From<String> for SkeletonSize
impl From<String> for SkeletonSize
Source§impl From<f64> for SkeletonSize
impl From<f64> for SkeletonSize
Source§impl From<i32> for SkeletonSize
impl From<i32> for SkeletonSize
Source§impl From<u32> for SkeletonSize
impl From<u32> for SkeletonSize
Source§impl PartialEq for SkeletonSize
impl PartialEq for SkeletonSize
impl StructuralPartialEq for SkeletonSize
Auto Trait Implementations§
impl Forget for SkeletonSize
impl Freeze for SkeletonSize
impl Move for SkeletonSize
impl RefUnwindSafe for SkeletonSize
impl Send for SkeletonSizewhere
RawVecInner: Send,
impl Sync for SkeletonSizewhere
RawVecInner: Sync,
impl Unpin for SkeletonSize
impl UnsafeUnpin for SkeletonSize
impl UnwindSafe for SkeletonSizewhere
RawVecInner: 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,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.