pub trait EraFileId: Clone {
const FILE_TYPE: EraFileType;
const ITEMS_PER_ERA: u64;
// Required methods
fn network_name(&self) -> &str;
fn start_number(&self) -> u64;
fn count(&self) -> u32;
fn hash(&self) -> Option<[u8; 4]>;
fn include_era_count(&self) -> bool;
// Provided methods
fn era_number(&self) -> u64 { ... }
fn era_count(&self) -> u64 { ... }
fn to_file_name(&self) -> String { ... }
}Expand description
Era file identifiers
Required Associated Constants§
Sourceconst FILE_TYPE: EraFileType
const FILE_TYPE: EraFileType
File type for this identifier
Sourceconst ITEMS_PER_ERA: u64
const ITEMS_PER_ERA: u64
Number of items, slots for era, blocks for era1, per era
Required Methods§
Sourcefn network_name(&self) -> &str
fn network_name(&self) -> &str
Get the network name
Sourcefn start_number(&self) -> u64
fn start_number(&self) -> u64
Get the starting number (block or slot)
Sourcefn include_era_count(&self) -> bool
fn include_era_count(&self) -> bool
Whether to include era count in filename
Provided Methods§
Sourcefn era_number(&self) -> u64
fn era_number(&self) -> u64
Calculate era number
Sourcefn era_count(&self) -> u64
fn era_count(&self) -> u64
Calculate the number of eras spanned per file.
If the user can decide how many slots/blocks per era file there are, we need to calculate it. Most of the time it should be 1, but it can never be more than 2 eras per file as there is a maximum of 8192 slots/blocks per era file.
Sourcefn to_file_name(&self) -> String
fn to_file_name(&self) -> String
Convert to standardized file name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.