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: StringNetwork configuration name
start_block: BlockNumberFirst block number in file
block_count: u32Number 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: boolWhether 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
impl EreId
Sourcepub fn new(
network_name: impl Into<String>,
start_block: BlockNumber,
block_count: u32,
) -> Self
pub fn new( network_name: impl Into<String>, start_block: BlockNumber, block_count: u32, ) -> Self
Create a new EreId
Sourcepub const fn with_era_count(self) -> Self
pub const fn with_era_count(self) -> Self
Include era count in filename, for custom block-per-file exports
Sourcepub fn with_profile(self, profile: EreProfile) -> Self
pub fn with_profile(self, profile: EreProfile) -> Self
Add a subset EreProfile to this file, keeping profiles sorted and deduplicated.
Sourcepub fn with_profiles(
self,
profiles: impl IntoIterator<Item = EreProfile>,
) -> Self
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§
impl Eq for EreId
Source§impl EraFileId for EreId
impl EraFileId for EreId
Source§fn to_file_name(&self) -> String
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
const FILE_TYPE: EraFileType = EraFileType::Ere
Source§const ITEMS_PER_ERA: u64
const ITEMS_PER_ERA: u64
era, blocks for era1, per eraSource§fn network_name(&self) -> &str
fn network_name(&self) -> &str
Source§fn start_number(&self) -> u64
fn start_number(&self) -> u64
Source§fn include_era_count(&self) -> bool
fn include_era_count(&self) -> bool
Source§fn era_number(&self) -> u64
fn era_number(&self) -> u64
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> 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<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<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: 72 bytes