pub enum Node {
Null,
Bool(bool),
Number(String),
Str(String),
Array(Vec<Node>),
Object(Vec<(String, Node)>),
}Expand description
A JSON document, parsed for formatting.
Deliberately not serde_json::Value: that type parses a number into
i64/u64/f64 and loses the literal the author wrote, which is precisely
the byte the “no semantic change ever” constraint says must survive. It also
silently accepts duplicate object keys.
Variants§
Null
Bool(bool)
Number(String)
The number literal, verbatim — never re-rendered.
Str(String)
A string with all escapes decoded.
Array(Vec<Node>)
Ordered, and it stays ordered. See the module docs.
Object(Vec<(String, Node)>)
Key → value in the order the file had them; sorted only when written.
Trait Implementations§
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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