#[repr(u8)]pub enum NumberOrPercentageComponent {
Number(f32),
Percentage(f32),
}Expand description
Either a percentage or a number.
Variants§
Number(f32)
<number>.
Percentage(f32)
<percentage>
The value as a float, divided by 100 so that the nominal range is 0.0 to 1.0.
Implementations§
Trait Implementations§
Source§impl Clone for NumberOrPercentageComponent
impl Clone for NumberOrPercentageComponent
Source§fn clone(&self) -> NumberOrPercentageComponent
fn clone(&self) -> NumberOrPercentageComponent
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 ColorComponentType for NumberOrPercentageComponent
impl ColorComponentType for NumberOrPercentageComponent
Source§fn from_value(value: f32) -> Self
fn from_value(value: f32) -> Self
Construct a new component from a single value.
Source§impl Debug for NumberOrPercentageComponent
impl Debug for NumberOrPercentageComponent
Source§impl MallocSizeOf for NumberOrPercentageComponent
impl MallocSizeOf for NumberOrPercentageComponent
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl ToAnimatedValue for NumberOrPercentageComponent
impl ToAnimatedValue for NumberOrPercentageComponent
Source§type AnimatedValue = NumberOrPercentageComponent
type AnimatedValue = NumberOrPercentageComponent
The type of the animated value.
Source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
Source§fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
Converts this value to an animated value.
Source§impl ToCss for NumberOrPercentageComponent
impl ToCss for NumberOrPercentageComponent
Source§fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
Serialize
self in CSS syntax, writing to dest.Source§fn to_css_string(&self) -> String
fn to_css_string(&self) -> String
Serialize
self in CSS syntax and return a string. Read moreSource§fn to_css_cssstring(&self) -> String
fn to_css_cssstring(&self) -> String
Serialize
self in CSS syntax and return a CssString. Read moreimpl Copy for NumberOrPercentageComponent
impl StructuralPartialEq for NumberOrPercentageComponent
Auto Trait Implementations§
impl Freeze for NumberOrPercentageComponent
impl RefUnwindSafe for NumberOrPercentageComponent
impl Send for NumberOrPercentageComponent
impl Sync for NumberOrPercentageComponent
impl Unpin for NumberOrPercentageComponent
impl UnwindSafe for NumberOrPercentageComponent
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 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