pub enum J {
Null,
Bool(bool),
Int(i64),
Str(String),
Arr(Vec<J>),
Obj(Vec<(String, J)>),
}Expand description
Ordered JSON value — insertion-ordered objects for byte-stable output.
Variants§
Implementations§
Source§impl J
impl J
pub fn s(v: impl Into<String>) -> J
pub fn opt_str(v: Option<String>) -> J
Sourcepub fn from_value(v: &Value) -> J
pub fn from_value(v: &Value) -> J
A value read back from JSON. Objects keep the order the reader gives
(serde_json sorts keys); a number that is not an integer becomes its
text, since nothing vitrify writes has one.
Sourcepub fn dumps_indent2(&self) -> String
pub fn dumps_indent2(&self) -> String
Two-space-indented form: separators (",", ": "), non-ASCII escaped.
Sourcepub fn dumps_default(&self) -> String
pub fn dumps_default(&self) -> String
Single-line form — separators (", ", ": "), non-ASCII escaped.
Trait Implementations§
impl StructuralPartialEq for J
Auto Trait Implementations§
impl Forget for J
impl Freeze for J
impl Move for J
impl RefUnwindSafe for J
impl Send for J
impl Sync for J
impl Unpin for J
impl UnsafeUnpin for J
impl UnwindSafe for J
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