pub enum Value {
Null,
Int(u64),
NegativeInt(u64),
String(String),
Bytes(Vec<u8>),
Text(String),
Array(Vec<Value>),
Map(BTreeMap<Value, Value>),
}Variants§
Null
Int(u64)
NegativeInt(u64)
String(String)
Bytes(Vec<u8>)
Text(String)
Array(Vec<Value>)
Map(BTreeMap<Value, Value>)
Implementations§
Source§impl Value
impl Value
pub fn as_array(&self) -> Option<&Vec<Value>>
pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
pub fn as_bytes(&self) -> Option<&Vec<u8>>
pub fn as_bytes_mut(&mut self) -> Option<&mut Vec<u8>>
pub fn as_string(&self) -> Option<&String>
pub fn as_string_mut(&mut self) -> Option<&mut String>
pub fn as_int(&self) -> Option<u64>
pub fn as_map(&self) -> Option<&BTreeMap<Value, Value>>
pub fn as_map_mut(&mut self) -> Option<&BTreeMap<Value, Value>>
Trait Implementations§
impl Eq for Value
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Value
impl PartialOrd for Value
Source§impl Serialize for Value
impl Serialize for Value
fn serialize<S>(&mut self, serializer: &mut S)where
S: Serializer,
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