pub struct BlockTuple {
pub header: CompressedHeader,
pub body: CompressedBody,
pub receipts: Option<CompressedSlimReceipts>,
pub total_difficulty: Option<TotalDifficulty>,
pub proof: Option<Proof>,
}Expand description
A single block’s components in an ERE file.
Only the header and body are mandatory; receipts, total difficulty, and the proof are optional,
so subset profiles or post-merge blocks can omit them.
component_count reports how many are present, matching the file’s
DynamicBlockIndex component-count.
See also https://github.com/eth-clients/e2store-format-specs/blob/main/formats/ere.md#specification
Fields§
§header: CompressedHeaderCompressed block header
body: CompressedBodyCompressed block body
receipts: Option<CompressedSlimReceipts>Compressed slim receipts, omitted by the noreceipts profile
total_difficulty: Option<TotalDifficulty>Total difficulty, absent once it stops advancing after the merge
proof: Option<Proof>Proof of block validity, omitted by the noproofs profile
Implementations§
Source§impl BlockTuple
impl BlockTuple
Sourcepub const fn new(header: CompressedHeader, body: CompressedBody) -> Self
pub const fn new(header: CompressedHeader, body: CompressedBody) -> Self
Create a new BlockTuple with only the mandatory header and body.
Attach the optional components with with_receipts,
with_total_difficulty, and
with_proof.
Sourcepub fn with_receipts(self, receipts: CompressedSlimReceipts) -> Self
pub fn with_receipts(self, receipts: CompressedSlimReceipts) -> Self
Attach compressed slim receipts.
Sourcepub const fn with_total_difficulty(
self,
total_difficulty: TotalDifficulty,
) -> Self
pub const fn with_total_difficulty( self, total_difficulty: TotalDifficulty, ) -> Self
Attach the total difficulty.
Sourcepub fn with_proof(self, proof: Proof) -> Self
pub fn with_proof(self, proof: Proof) -> Self
Attach a validity proof.
Sourcepub const fn component_count(&self) -> u64
pub const fn component_count(&self) -> u64
Number of index components this block contributes: the mandatory header and body plus each
optional component present. Always in the range 2-5, matching the file’s component-count.
Sourcepub fn to_alloy_block<T: Decodable>(&self) -> Result<Block<T>, E2sError>
pub fn to_alloy_block<T: Decodable>(&self) -> Result<Block<T>, E2sError>
Convert to an alloy_consensus::Block
Sourcepub fn from_alloy_block<T: Encodable, R: Encodable>(
block: &Block<T>,
receipts: &R,
total_difficulty: U256,
) -> Result<Self, E2sError>
pub fn from_alloy_block<T: Encodable, R: Encodable>( block: &Block<T>, receipts: &R, total_difficulty: U256, ) -> Result<Self, E2sError>
Create from an alloy_consensus::Block, attaching the given receipts and total difficulty.
Trait Implementations§
Source§impl Clone for BlockTuple
impl Clone for BlockTuple
Source§fn clone(&self) -> BlockTuple
fn clone(&self) -> BlockTuple
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BlockTuple
impl RefUnwindSafe for BlockTuple
impl Send for BlockTuple
impl Sync for BlockTuple
impl Unpin for BlockTuple
impl UnsafeUnpin for BlockTuple
impl UnwindSafe for BlockTuple
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 more§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: 136 bytes