pub enum Property {
String(String),
Int(i32),
Float(f64),
Bool(bool),
Color([u8; 4]),
File(String),
}Expand description
A custom property
Variants§
String(String)
Int(i32)
Float(f64)
Bool(bool)
Color([u8; 4])
A color in the format [a, r, g, b]
File(String)
Implementations§
Source§impl Property
impl Property
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Return &str value if this property is a string, None otherwise.
Sourcepub fn as_int(&self) -> Option<i32>
pub fn as_int(&self) -> Option<i32>
Return i32 value if this property is an int or float, None otherwise.
Sourcepub fn as_float(&self) -> Option<f64>
pub fn as_float(&self) -> Option<f64>
Return f64 value if this property is a float or int, None otherwise.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Return bool value if this property is a bool, None otherwise.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Property
impl RefUnwindSafe for Property
impl Send for Property
impl Sync for Property
impl Unpin for Property
impl UnwindSafe for Property
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