pub enum JsonValue {
Null,
Bool(bool),
Number(JsonNumber),
String(String),
Array(Vec<JsonValue>),
Object(Vec<(String, JsonValue)>),
}Variants§
Null
Bool(bool)
Number(JsonNumber)
String(String)
Array(Vec<JsonValue>)
Object(Vec<(String, JsonValue)>)
Implementations§
Source§impl JsonValue
impl JsonValue
pub fn object(entries: Vec<(impl Into<String>, JsonValue)>) -> Self
pub fn array(values: Vec<JsonValue>) -> Self
pub fn to_json_string(&self) -> Result<String, JsonError>
pub fn push_field( &mut self, key: impl Into<String>, value: impl Into<JsonValue>, )
pub fn push_item(&mut self, value: impl Into<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 UnsafeUnpin 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