Skip to main content

EreId

Struct EreId 

Source
pub struct EreId {
    pub network_name: String,
    pub start_block: BlockNumber,
    pub block_count: u32,
    pub hash: Option<[u8; 4]>,
    pub include_era_count: bool,
    pub profiles: Vec<EreProfile>,
}
Expand description

ere file identifier

Fields§

§network_name: String

Network configuration name

§start_block: BlockNumber

First block number in file

§block_count: u32

Number of blocks in the file

§hash: Option<[u8; 4]>

Optional hash identifier for this file. First 4 bytes of the hash of the last block in the file.

§include_era_count: bool

Whether to include era count in filename. It is used for custom exports when we don’t use the max number of items per file.

§profiles: Vec<EreProfile>

Subset profiles applied to this file.

Kept sorted and deduplicated by the builders so the filename postfix renders in the spec-mandated alphabetical order. Empty means the default, fully verifiable profile.

Implementations§

Source§

impl EreId

Source

pub fn new( network_name: impl Into<String>, start_block: BlockNumber, block_count: u32, ) -> Self

Create a new EreId

Source

pub const fn with_hash(self, hash: [u8; 4]) -> Self

Add a hash identifier to EreId

Source

pub const fn with_era_count(self) -> Self

Include era count in filename, for custom block-per-file exports

Source

pub fn with_profile(self, profile: EreProfile) -> Self

Add a subset EreProfile to this file, keeping profiles sorted and deduplicated.

Source

pub fn with_profiles( self, profiles: impl IntoIterator<Item = EreProfile>, ) -> Self

Add several subset profiles to this file, keeping profiles sorted and deduplicated.

Trait Implementations§

Source§

impl Clone for EreId

Source§

fn clone(&self) -> EreId

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EreId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for EreId

Source§

impl EraFileId for EreId

Source§

fn to_file_name(&self) -> String

Render the filename, appending any subset-profile postfixes before the extension.

Default profile: <network>-<era-number>-<short-block-hash>.ere. With profiles: <network>-<era-number>-<short-block-hash>-<profile>...-.ere, in alphabetical profile order, e.g. mainnet-00000-4bb7de2e-noproofs-noreceipts.ere.

See also https://github.com/eth-clients/e2store-format-specs/blob/main/formats/ere.md#file-name

Source§

const FILE_TYPE: EraFileType = EraFileType::Ere

File type for this identifier
Source§

const ITEMS_PER_ERA: u64

Number of items, slots for era, blocks for era1, per era
Source§

fn network_name(&self) -> &str

Get the network name
Source§

fn start_number(&self) -> u64

Get the starting number (block or slot)
Source§

fn count(&self) -> u32

Get the count of items
Source§

fn hash(&self) -> Option<[u8; 4]>

Get the optional hash identifier
Source§

fn include_era_count(&self) -> bool

Whether to include era count in filename
Source§

fn era_number(&self) -> u64

Calculate era number
Source§

fn era_count(&self) -> u64

Calculate the number of eras spanned per file. Read more
Source§

impl PartialEq for EreId

Source§

fn eq(&self, other: &EreId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EreId

Auto Trait Implementations§

§

impl Freeze for EreId

§

impl RefUnwindSafe for EreId

§

impl Send for EreId

§

impl Sync for EreId

§

impl Unpin for EreId

§

impl UnsafeUnpin for EreId

§

impl UnwindSafe for EreId

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

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: 72 bytes