Struct patricia_trie_ethereum::RlpNodeCodec
source · [−]pub struct RlpNodeCodec<H: Hasher> { /* private fields */ }
Expand description
Concrete implementation of a NodeCodec
with Rlp encoding, generic over the Hasher
Trait Implementations
sourceimpl<H: Clone + Hasher> Clone for RlpNodeCodec<H>
impl<H: Clone + Hasher> Clone for RlpNodeCodec<H>
sourcefn clone(&self) -> RlpNodeCodec<H>
fn clone(&self) -> RlpNodeCodec<H>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<H: Default + Hasher> Default for RlpNodeCodec<H>
impl<H: Default + Hasher> Default for RlpNodeCodec<H>
sourcefn default() -> RlpNodeCodec<H>
fn default() -> RlpNodeCodec<H>
Returns the “default value” for a type. Read more
sourceimpl NodeCodec<KeccakHasher> for RlpNodeCodec<KeccakHasher>
impl NodeCodec<KeccakHasher> for RlpNodeCodec<KeccakHasher>
type Error = DecoderError
type Error = DecoderError
Codec error type
sourcefn hashed_null_node() -> <KeccakHasher as Hasher>::Out
fn hashed_null_node() -> <KeccakHasher as Hasher>::Out
Get the hashed null node.
sourcefn decode(data: &[u8]) -> Result<Node<'_>, Self::Error>
fn decode(data: &[u8]) -> Result<Node<'_>, Self::Error>
Decode bytes to a Node
. Returns Self::E
on failure.
sourcefn try_decode_hash(data: &[u8]) -> Option<<KeccakHasher as Hasher>::Out>
fn try_decode_hash(data: &[u8]) -> Option<<KeccakHasher as Hasher>::Out>
Decode bytes to the Hasher
s output type. Returns None
on failure.
sourcefn is_empty_node(data: &[u8]) -> bool
fn is_empty_node(data: &[u8]) -> bool
Check if the provided bytes correspond to the codecs “empty” node.
sourcefn empty_node() -> Vec<u8>
fn empty_node() -> Vec<u8>
Returns an empty node
sourcefn ext_node(
partial: &[u8],
child_ref: ChildReference<<KeccakHasher as Hasher>::Out>
) -> Vec<u8>
fn ext_node(
partial: &[u8],
child_ref: ChildReference<<KeccakHasher as Hasher>::Out>
) -> Vec<u8>
Returns an encoded extension node
sourcefn branch_node<I>(children: I, value: Option<ElasticArray128<u8>>) -> Vec<u8> where
I: IntoIterator<Item = Option<ChildReference<<KeccakHasher as Hasher>::Out>>>,
fn branch_node<I>(children: I, value: Option<ElasticArray128<u8>>) -> Vec<u8> where
I: IntoIterator<Item = Option<ChildReference<<KeccakHasher as Hasher>::Out>>>,
Returns an encoded branch node. Takes an iterator yielding ChildReference<H::Out>
and an optional value
Auto Trait Implementations
impl<H> RefUnwindSafe for RlpNodeCodec<H> where
H: RefUnwindSafe,
impl<H> Send for RlpNodeCodec<H>
impl<H> Sync for RlpNodeCodec<H>
impl<H> Unpin for RlpNodeCodec<H> where
H: Unpin,
impl<H> UnwindSafe for RlpNodeCodec<H> where
H: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more