pub struct StateLeaf {
pub blob_hash: CapHash,
pub cap_hash: CapHash,
}Expand description
One state-root leaf: a (blob_hash, cap_hash) pair.
Encoded as the SSZ container { blob_hash: [u8;32], cap_hash: [u8;32] }.
The leaf’s hash_tree_root is merkleize([blob_hash, cap_hash], 2) = hash(blob_hash || cap_hash) — equivalent to the legacy BMT leaf
protocol but with SHA-256 instead of Blake2b.
Fields§
§blob_hash: CapHash§cap_hash: CapHashTrait Implementations§
Source§impl Encode for StateLeaf
impl Encode for StateLeaf
Source§fn is_ssz_fixed_len() -> bool
fn is_ssz_fixed_len() -> bool
true iff this type is fixed-length (no variable-length fields).Source§fn ssz_fixed_len() -> usize
fn ssz_fixed_len() -> usize
Number of bytes this type occupies in the fixed-length portion of a
container encoding. For variable-length types this returns
[
BYTES_PER_LENGTH_OFFSET] (i.e. the size of the offset slot).Source§fn ssz_bytes_len(&self) -> usize
fn ssz_bytes_len(&self) -> usize
Total size of
self when serialized.Source§fn ssz_append(&self, buf: &mut Vec<u8>)
fn ssz_append(&self, buf: &mut Vec<u8>)
Append the encoding of
self to buf.§fn is_basic_type() -> bool
fn is_basic_type() -> bool
true for “basic” SSZ types (uintN, bool), which pack adjacent
elements into shared 32-byte chunks for merkleization. Composite
types (containers, lists, structs) return false (the default).§fn as_ssz_bytes(&self) -> Vec<u8> ⓘ
fn as_ssz_bytes(&self) -> Vec<u8> ⓘ
Serialize into a fresh
Vec<u8> allocated through the global allocator.impl Copy for StateLeaf
impl Eq for StateLeaf
impl StructuralPartialEq for StateLeaf
Auto Trait Implementations§
impl Freeze for StateLeaf
impl RefUnwindSafe for StateLeaf
impl Send for StateLeaf
impl Sync for StateLeaf
impl Unpin for StateLeaf
impl UnsafeUnpin for StateLeaf
impl UnwindSafe for StateLeaf
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Compare self to
key and return true if they are equal.§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.