Trait contigious_tree::Node
source · [−]pub trait Node {
type Value;
fn write_value<W>(writer: &mut W, value: &Self::Value) -> Result<usize>
where
W: Write;
fn read_value(bytes: &[u8]) -> (usize, Self::Value);
}
Expand description
TreeVec
is generic over the value types associated with each node. Furthermore it is also
generic about the way these are serialized. E.g. A value type of i64
could be stored in
little endian, big endian or a bitpacked representation. This allows us to adapt the tree to a
wide variaty of usecases.
Required Associated Types
Required Methods
Writes the value, so Self::read_value
can extract it again. In case of success the
number of bytes written is returned.
fn read_value(bytes: &[u8]) -> (usize, Self::Value)
fn read_value(bytes: &[u8]) -> (usize, Self::Value)
Reads the value from a raw binary representation. Reads the value from the back of the passed slice.