pub enum RawNode {
Leaf(Scalar),
Edges(Vec<(String, RawNode)>),
}Expand description
The raw canonical Document node: either a leaf scalar, or an ordered
list of (label, child) edges that may repeat and interleave a label
arbitrarily ([("b",1),("c",2),("b",3)] is representable exactly).
This is distinct from Value: Value::Object’s IndexMap can’t hold
a repeated key, so its “repeated label” convention (a Value::Array
under one key, per child_specs) only ever expands to a contiguous
run of same-label edges. OML is the one format that must round-trip
arbitrary interleaving losslessly (per its own docs: “no adjustment ever
needed”), so its reader/writer (crate::oml) builds/walks a Doc
through this type instead of going through Value.
Variants§
Leaf(Scalar)
A leaf node holding a scalar value.
Edges(Vec<(String, RawNode)>)
An internal node holding labeled outgoing edges.
Trait Implementations§
impl StructuralPartialEq for RawNode
Auto Trait Implementations§
impl Freeze for RawNode
impl RefUnwindSafe for RawNode
impl Send for RawNode
impl Sync for RawNode
impl Unpin for RawNode
impl UnsafeUnpin for RawNode
impl UnwindSafe for RawNode
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