Struct ExtensionNode
pub struct ExtensionNode {
pub key: Nibbles,
pub child: RlpNode,
}Expand description
Re-export An extension node in an Ethereum Merkle Patricia Trie.
An intermediate node that exists solely to compress the trie’s paths. It contains a path segment (a shared prefix of keys) and a single child pointer. Essentially, an extension node can be thought of as a shortcut within the trie to reduce its overall depth.
The purpose of an extension node is to optimize the trie structure by collapsing multiple nodes with a single child into one node. This simplification reduces the space and computational complexity when performing operations on the trie.
Fields§
§key: NibblesThe key for this extension node.
child: RlpNodeA pointer to the child node.
Implementations§
§impl ExtensionNode
impl ExtensionNode
pub const EVEN_FLAG: u8 = 0x00
pub const EVEN_FLAG: u8 = 0x00
The flag representing the even number of nibbles in the extension key.
pub const fn new(key: Nibbles, child: RlpNode) -> ExtensionNode
pub const fn new(key: Nibbles, child: RlpNode) -> ExtensionNode
Creates a new extension node with the given key and a pointer to the child.
pub fn as_ref(&self) -> ExtensionNodeRef<'_>
pub fn as_ref(&self) -> ExtensionNodeRef<'_>
Return extension node as ExtensionNodeRef.
Trait Implementations§
§impl Clone for ExtensionNode
impl Clone for ExtensionNode
§fn clone(&self) -> ExtensionNode
fn clone(&self) -> ExtensionNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ExtensionNode
impl Debug for ExtensionNode
§impl Decodable for ExtensionNode
impl Decodable for ExtensionNode
§fn decode(buf: &mut &[u8]) -> Result<ExtensionNode, Error>
fn decode(buf: &mut &[u8]) -> Result<ExtensionNode, Error>
buf must be advanced past
the decoded object.§impl<'de> Deserialize<'de> for ExtensionNode
impl<'de> Deserialize<'de> for ExtensionNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExtensionNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExtensionNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Encodable for ExtensionNode
impl Encodable for ExtensionNode
impl Eq for ExtensionNode
§impl PartialEq for ExtensionNode
impl PartialEq for ExtensionNode
§impl Serialize for ExtensionNode
impl Serialize for ExtensionNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ExtensionNode
Auto Trait Implementations§
impl Freeze for ExtensionNode
impl RefUnwindSafe for ExtensionNode
impl Send for ExtensionNode
impl Sync for ExtensionNode
impl Unpin for ExtensionNode
impl UnsafeUnpin for ExtensionNode
impl UnwindSafe for ExtensionNode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes