pub enum JSONValue<'a, S: BuildHasher> {
Object(HashMap<&'a str, JSONValue<'a, S>, S>),
Array(Vec<JSONValue<'a, S>>),
String(&'a str),
Number(Number),
Boolean(bool),
Null,
}
Variants§
Object(HashMap<&'a str, JSONValue<'a, S>, S>)
Array(Vec<JSONValue<'a, S>>)
String(&'a str)
Number(Number)
Boolean(bool)
Null
Implementations§
Source§impl<'a, S: BuildHasher> JSONValue<'a, S>
impl<'a, S: BuildHasher> JSONValue<'a, S>
pub fn is_object(&self) -> bool
pub fn to_object(&self) -> Option<&HashMap<&'a str, JSONValue<'a, S>, S>>
pub fn is_array(&self) -> bool
pub fn to_array(&self) -> Option<&Vec<JSONValue<'a, S>>>
pub fn is_str(&self) -> bool
pub fn to_str(&self) -> Option<&'a str>
pub fn is_number(&self) -> bool
pub fn to_f64(&self) -> Option<f64>
pub fn to_u64(&self) -> Option<u64>
pub fn is_bool(&self) -> bool
pub fn to_bool(&self) -> Option<bool>
pub fn is_null(&self) -> bool
Trait Implementations§
Source§impl<'a, S: BuildHasher> ToString for JSONValue<'a, S>
impl<'a, S: BuildHasher> ToString for JSONValue<'a, S>
impl<'a, S: BuildHasher> StructuralPartialEq for JSONValue<'a, S>
Auto Trait Implementations§
impl<'a, S> Freeze for JSONValue<'a, S>where
S: Freeze,
impl<'a, S> RefUnwindSafe for JSONValue<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for JSONValue<'a, S>where
S: Send,
impl<'a, S> Sync for JSONValue<'a, S>where
S: Sync,
impl<'a, S> Unpin for JSONValue<'a, S>where
S: Unpin,
impl<'a, S> UnwindSafe for JSONValue<'a, S>where
S: UnwindSafe,
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