Struct patricia_trie_ethereum::RlpNodeCodec [−][src]
pub struct RlpNodeCodec<H: Hasher> { /* fields omitted */ }
Concrete implementation of a NodeCodec
with Rlp encoding, generic over the Hasher
Trait Implementations
impl<H: Default + Hasher> Default for RlpNodeCodec<H>
[src]
impl<H: Default + Hasher> Default for RlpNodeCodec<H>
fn default() -> RlpNodeCodec<H>
[src]
fn default() -> RlpNodeCodec<H>
Returns the "default value" for a type. Read more
impl<H: Clone + Hasher> Clone for RlpNodeCodec<H>
[src]
impl<H: Clone + Hasher> Clone for RlpNodeCodec<H>
fn clone(&self) -> RlpNodeCodec<H>
[src]
fn clone(&self) -> RlpNodeCodec<H>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl NodeCodec<KeccakHasher> for RlpNodeCodec<KeccakHasher>
[src]
impl NodeCodec<KeccakHasher> for RlpNodeCodec<KeccakHasher>
type Error = DecoderError
Encoding error type
const HASHED_NULL_NODE: H256
HASHED_NULL_NODE: H256 = H256([86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33])
Null node type
fn decode(data: &[u8]) -> Result<Node, Self::Error>
[src]
fn decode(data: &[u8]) -> Result<Node, Self::Error>
Decode bytes to a Node
. Returns Self::E
on failure.
fn try_decode_hash(data: &[u8]) -> Option<<KeccakHasher as Hasher>::Out>
[src]
fn try_decode_hash(data: &[u8]) -> Option<<KeccakHasher as Hasher>::Out>
Decode bytes to the Hasher
s output type. Returns None
on failure.
fn is_empty_node(data: &[u8]) -> bool
[src]
fn is_empty_node(data: &[u8]) -> bool
Check if the provided bytes correspond to the codecs "empty" node.
fn empty_node() -> ElasticArray1024<u8>
[src]
fn empty_node() -> ElasticArray1024<u8>
Returns an empty node
fn leaf_node(partial: &[u8], value: &[u8]) -> ElasticArray1024<u8>
[src]
fn leaf_node(partial: &[u8], value: &[u8]) -> ElasticArray1024<u8>
Returns an encoded leaft node
fn ext_node(
partial: &[u8],
child_ref: ChildReference<<KeccakHasher as Hasher>::Out>
) -> ElasticArray1024<u8>
[src]
fn ext_node(
partial: &[u8],
child_ref: ChildReference<<KeccakHasher as Hasher>::Out>
) -> ElasticArray1024<u8>
Returns an encoded extension node
fn branch_node<I>(
children: I,
value: Option<ElasticArray128<u8>>
) -> ElasticArray1024<u8> where
I: IntoIterator<Item = Option<ChildReference<<KeccakHasher as Hasher>::Out>>>,
[src]
fn branch_node<I>(
children: I,
value: Option<ElasticArray128<u8>>
) -> ElasticArray1024<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> Send for RlpNodeCodec<H>
impl<H> Send for RlpNodeCodec<H>
impl<H> Sync for RlpNodeCodec<H>
impl<H> Sync for RlpNodeCodec<H>