pub struct Node { /* private fields */ }Expand description
Nodes of the Merkle Tree that are persisted to disk.
Implementations§
Trait Implementations§
Source§impl CompactEncoding for Node
impl CompactEncoding for Node
Source§fn encoded_size(&self) -> Result<usize, EncodingError>
fn encoded_size(&self) -> Result<usize, EncodingError>
The size in bytes required to encode
self.Source§fn encode<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>
fn encode<'a>( &self, buffer: &'a mut [u8], ) -> Result<&'a mut [u8], EncodingError>
Encode
self into buffer returning the remainder of buffer.Source§fn decode(buffer: &[u8]) -> Result<(Self, &[u8]), EncodingError>where
Self: Sized,
fn decode(buffer: &[u8]) -> Result<(Self, &[u8]), EncodingError>where
Self: Sized,
Decode a value from the given
buffer of the type specified by the Decode type parameter
(which defaults to Self). Returns the decoded value and remaining undecoded bytes.Source§fn to_encoded_bytes(&self) -> Result<Box<[u8]>, EncodingError>
fn to_encoded_bytes(&self) -> Result<Box<[u8]>, EncodingError>
Encode
self into a Vec<u8>. This is just a helper method for creating a buffer and
encoding to it in one step. Read moreSource§fn create_buffer(&self) -> Result<Box<[u8]>, EncodingError>
fn create_buffer(&self) -> Result<Box<[u8]>, EncodingError>
Create an empty buffer of the correct size for encoding
self to. This is just a helper
method for: encoding to it in one step. Read moreSource§fn encode_with_len<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<(&'a mut [u8], usize), EncodingError>
fn encode_with_len<'a>( &self, buffer: &'a mut [u8], ) -> Result<(&'a mut [u8], usize), EncodingError>
Like
CompactEncoding::encode but also return the number of bytes encoded.Source§fn decode_with_len(
buffer: &[u8],
) -> Result<(Decode, &[u8], usize), EncodingError>
fn decode_with_len( buffer: &[u8], ) -> Result<(Decode, &[u8], usize), EncodingError>
Like
CompactEncoding::decode but also return the number of bytes decoded.Source§impl Ord for Node
impl Ord for Node
Source§impl PartialOrd for Node
impl PartialOrd for Node
Source§impl VecEncodable for Node
impl VecEncodable for Node
Source§fn vec_encoded_size(vec: &[Self]) -> Result<usize, EncodingError>where
Self: Sized,
fn vec_encoded_size(vec: &[Self]) -> Result<usize, EncodingError>where
Self: Sized,
Calculate the resulting size in bytes of
vecSource§fn vec_encode<'a>(
vec: &[Self],
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>where
Self: Sized,
fn vec_encode<'a>(
vec: &[Self],
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>where
Self: Sized,
Encode
vec to bufferSource§fn vec_decode(buffer: &[u8]) -> Result<(Vec<Self>, &[u8]), EncodingError>where
Self: Sized,
fn vec_decode(buffer: &[u8]) -> Result<(Vec<Self>, &[u8]), EncodingError>where
Self: Sized,
Decode
Vec<Self> from bufferimpl 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 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