pub enum Value {
Null,
Bool(bool),
Integer(i64),
Unsigned(u64),
Real(f64),
String(String),
Data(Vec<u8>),
Date(f64),
Url(String),
Array(Vec<Self>),
Object(BTreeMap<String, Self>),
}Available on macOS only.
Variants§
Null
Bool(bool)
Integer(i64)
Unsigned(u64)
Real(f64)
String(String)
Data(Vec<u8>)
Date(f64)
Url(String)
Array(Vec<Self>)
Object(BTreeMap<String, Self>)
Implementations§
Source§impl Value
impl Value
pub const fn is_array(&self) -> bool
pub const fn is_object(&self) -> bool
pub fn dictionary<const N: usize>(entries: [(&str, Self); N]) -> Self
pub fn get(&self, key: &str) -> Option<&Self>
pub fn as_object(&self) -> Option<&BTreeMap<String, Self>>
pub fn as_array(&self) -> Option<&[Self]>
pub fn as_str(&self) -> Option<&str>
pub const fn as_bool(&self) -> Option<bool>
pub fn as_i64(&self) -> Option<i64>
pub fn as_u64(&self) -> Option<u64>
pub fn as_f64(&self) -> Option<f64>
pub fn as_data(&self) -> Option<&[u8]>
pub const fn as_date(&self) -> Option<f64>
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 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