pub enum YarnValue {
Str(String),
Bool(bool),
Number(f32),
Null,
}
Variants§
Implementations§
source§impl YarnValue
impl YarnValue
pub fn as_string(&self) -> String
pub fn as_number(&self) -> f32
pub fn as_bool(&self) -> bool
pub fn add(&self, other: &Self) -> Option<Self>
pub fn sub(&self, other: &Self) -> Option<Self>
pub fn mul(&self, other: &Self) -> Option<Self>
pub fn div(&self, other: &Self) -> Option<Self>
pub fn neg(&self) -> Self
pub fn rem(&self, other: &Self) -> Option<Self>
Trait Implementations§
source§impl PartialEq for YarnValue
impl PartialEq for YarnValue
source§impl PartialOrd for YarnValue
impl PartialOrd for YarnValue
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for YarnValue
Auto Trait Implementations§
impl RefUnwindSafe for YarnValue
impl Send for YarnValue
impl Sync for YarnValue
impl Unpin for YarnValue
impl UnwindSafe for YarnValue
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