pub enum JSONValue {
Bool(bool),
Number(f64),
String(String),
Array(Vec<JSONValue>),
Object(HashMap<String, JSONValue>),
Null,
}
Variants§
Bool(bool)
Number(f64)
String(String)
Array(Vec<JSONValue>)
Object(HashMap<String, JSONValue>)
Null
Implementations§
Source§impl JSONValue
impl JSONValue
pub fn get(&self, key: &str) -> Result<&JSONValue>
pub fn get_mut(&mut self, key: &str) -> Result<&mut JSONValue>
pub fn obj_insert(&mut self, key: &str, value: JSONValue) -> Result<()>
pub fn obj_remove(&mut self, key: &str) -> Result<(String, JSONValue)>
pub fn try_index(&self, index: usize) -> Result<&JSONValue>
pub fn try_index_mut(&mut self, index: usize) -> Result<&mut JSONValue>
pub fn arr_push(&mut self, val: JSONValue) -> Result<()>
pub fn arr_pop(&mut self) -> Result<JSONValue>
pub fn arr_insert(&mut self, pos: usize, val: JSONValue) -> Result<()>
pub fn arr_remove(&mut self, pos: usize) -> Result<JSONValue>
Trait Implementations§
impl StructuralPartialEq for JSONValue
Auto Trait Implementations§
impl Freeze for JSONValue
impl RefUnwindSafe for JSONValue
impl Send for JSONValue
impl Sync for JSONValue
impl Unpin for JSONValue
impl UnwindSafe for JSONValue
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