pub enum Primitive {
Int(i64),
Float(f64),
Str(String),
Bool(bool),
}
Variants§
Implementations§
Source§impl Primitive
impl Primitive
pub fn as_bool(&self) -> Option<bool>
pub fn as_int(&self) -> Option<i64>
pub fn as_float(&self) -> Option<f64>
pub fn as_str(&self) -> String
pub fn coerce_bool(&self) -> Option<bool>
pub fn to_float_lossy(&self) -> Option<f64>
pub fn as_str_lossy(&self) -> String
Trait Implementations§
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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