pub enum Value {
Nil,
Bool(bool),
Int(Int),
Float(Float),
Str(String),
Bin(Vec<u8>),
Arr(Vec<Value>),
Map(Vec<(Value, Value)>),
Ext(Ext),
}
Variants§
Nil
Bool(bool)
Int(Int)
Float(Float)
Str(String)
Bin(Vec<u8>)
Arr(Vec<Value>)
Map(Vec<(Value, Value)>)
Ext(Ext)
Implementations§
Source§impl Value
impl Value
Sourcepub fn int<T>(value: T) -> Result<Self, TryFromIntError>
pub fn int<T>(value: T) -> Result<Self, TryFromIntError>
Attempt to create a new Value::Int for the supplied value that will be encoded in the least amount of bytes.
Positive and zero integers will become an unsigned variant, while negative integers will become a signed variant.
Sourcepub fn unsigned_int<T>(value: T) -> Result<Self, TryFromIntError>
pub fn unsigned_int<T>(value: T) -> Result<Self, TryFromIntError>
Attempt to create a new unsigned Value::Int for the supplied value that will be encoded in the least amount of bytes.
Sourcepub fn signed_int<T>(value: T) -> Result<Self, TryFromIntError>
pub fn signed_int<T>(value: T) -> Result<Self, TryFromIntError>
Attempt to create a new signed Value::Int for the supplied value that will be encoded in the least amount of bytes.
Trait Implementations§
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 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