[−][src]Struct solana_runtime::epoch_schedule::EpochSchedule
Fields
slots_per_epoch: u64
The maximum number of slots in each epoch.
stakers_slot_offset: u64
A number of slots before slot_index 0. Used to calculate finalized staked nodes.
first_normal_epoch: u64
basically: log2(slots_per_epoch) - log2(MINIMUM_SLOT_LEN)
first_normal_slot: u64
basically: 2.pow(first_normal_epoch) - MINIMUM_SLOT_LEN
Methods
impl EpochSchedule
[src]
pub fn new(slots_per_epoch: u64, stakers_slot_offset: u64, warmup: bool) -> Self
[src]
pub fn get_slots_in_epoch(&self, epoch: u64) -> u64
[src]
get the length of the given epoch (in slots)
pub fn get_stakers_epoch(&self, slot: u64) -> u64
[src]
get the epoch for which the given slot should save off information about stakers
pub fn get_epoch_and_slot_index(&self, slot: u64) -> (u64, u64)
[src]
get epoch and offset into the epoch for the given slot
pub fn get_first_slot_in_epoch(&self, epoch: u64) -> u64
[src]
pub fn get_last_slot_in_epoch(&self, epoch: u64) -> u64
[src]
Trait Implementations
impl Eq for EpochSchedule
[src]
impl PartialEq<EpochSchedule> for EpochSchedule
[src]
fn eq(&self, other: &EpochSchedule) -> bool
[src]
fn ne(&self, other: &EpochSchedule) -> bool
[src]
impl Copy for EpochSchedule
[src]
impl Clone for EpochSchedule
[src]
fn clone(&self) -> EpochSchedule
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for EpochSchedule
[src]
fn default() -> EpochSchedule
[src]
impl Debug for EpochSchedule
[src]
Auto Trait Implementations
impl Send for EpochSchedule
impl Sync for EpochSchedule
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
T: InitializableFromZeroed + ?Sized,
fn clear(&mut self)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> InitializableFromZeroed for T where
T: Default,
T: Default,
unsafe fn initialize(place: *mut T)
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,