pub struct Node {
pub ty: u8,
pub named: bool,
pub terminated: bool,
pub name: String,
pub payload: Vec<u8>,
pub children: Vec<Node>,
}Expand description
A node of the native DB tree: a type tag, an optional name, and either children (lists and objects), a payload (strings, blobs and fixed-size values) or neither.
Fields§
§ty: u8The type tag: the low 5 bits of the stored tag byte (1 list, 2 object, 7 string, 19 blob, 8 and 11 four-byte values, and so on). 0 marks the end of a container.
named: boolWhether the node has a name: bit 7 of the tag byte is clear.
terminated: boolWhether a container’s children ended with an explicit zero tag, so that writing it back reproduces the bytes.
name: StringThe node’s name as Latin-1 text; empty when the node is unnamed.
payload: Vec<u8>The stored bytes of a string, blob or fixed-size value (a string keeps its zero terminator); empty for containers.
children: Vec<Node>The nodes of a list or object, in stored order; empty for other types.
Implementations§
Trait Implementations§
impl Eq for Node
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