#[non_exhaustive]pub enum Value {
F32(f32),
Px(f32),
Color(Color),
Point(Point),
Size(Size),
}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.
Implementations§
Source§impl Value
impl Value
pub const fn f32(v: f32) -> Self
pub const fn px(v: f32) -> Self
pub const fn color(c: Color) -> Self
pub const fn point(x: f32, y: f32) -> Self
pub const fn size(w: f32, h: f32) -> Self
pub fn as_f32(&self) -> Option<f32>
pub fn as_px(&self) -> Option<f32>
pub fn as_pixels(&self) -> Option<f32>
pub fn as_color(&self) -> Option<Color>
pub fn as_point(&self) -> Option<Point>
pub fn as_size(&self) -> Option<Size>
pub fn lerp(&self, other: &Value, t: f32) -> Value
pub fn mix<'a>( samples: impl IntoIterator<Item = (&'a Value, f32)>, ) -> Option<Value>
Trait Implementations§
impl Copy for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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