Struct stacks_common::types::StacksEpoch
source · pub struct StacksEpoch<L> {
pub epoch_id: StacksEpochId,
pub start_height: u64,
pub end_height: u64,
pub block_limit: L,
pub network_epoch: u8,
}
Fields§
§epoch_id: StacksEpochId
§start_height: u64
§end_height: u64
§block_limit: L
§network_epoch: u8
Implementations§
source§impl<L> StacksEpoch<L>
impl<L> StacksEpoch<L>
sourcepub fn find_epoch(epochs: &[StacksEpoch<L>], height: u64) -> Option<usize>
pub fn find_epoch(epochs: &[StacksEpoch<L>], height: u64) -> Option<usize>
Determine which epoch, if any, in a list of epochs, a given burnchain height falls into. Returns Some(index) if there is such an epoch in the list. Returns None if not.
sourcepub fn find_epoch_by_id(
epochs: &[StacksEpoch<L>],
epoch_id: StacksEpochId
) -> Option<usize>
pub fn find_epoch_by_id( epochs: &[StacksEpoch<L>], epoch_id: StacksEpochId ) -> Option<usize>
Find an epoch by its ID Returns Some(index) if the epoch is in the list Returns None if not
Trait Implementations§
source§impl<L: Clone> Clone for StacksEpoch<L>
impl<L: Clone> Clone for StacksEpoch<L>
source§fn clone(&self) -> StacksEpoch<L>
fn clone(&self) -> StacksEpoch<L>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<L: Debug> Debug for StacksEpoch<L>
impl<L: Debug> Debug for StacksEpoch<L>
source§impl<'de, L> Deserialize<'de> for StacksEpoch<L>where
L: Deserialize<'de>,
impl<'de, L> Deserialize<'de> for StacksEpoch<L>where L: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<L: Hash> Hash for StacksEpoch<L>
impl<L: Hash> Hash for StacksEpoch<L>
source§impl<L: PartialEq + Eq> Ord for StacksEpoch<L>
impl<L: PartialEq + Eq> Ord for StacksEpoch<L>
source§fn cmp(&self, other: &StacksEpoch<L>) -> Ordering
fn cmp(&self, other: &StacksEpoch<L>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<L: PartialEq> PartialEq<StacksEpoch<L>> for StacksEpoch<L>
impl<L: PartialEq> PartialEq<StacksEpoch<L>> for StacksEpoch<L>
source§fn eq(&self, other: &StacksEpoch<L>) -> bool
fn eq(&self, other: &StacksEpoch<L>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<L: PartialEq> PartialOrd<StacksEpoch<L>> for StacksEpoch<L>
impl<L: PartialEq> PartialOrd<StacksEpoch<L>> for StacksEpoch<L>
source§fn partial_cmp(&self, other: &StacksEpoch<L>) -> Option<Ordering>
fn partial_cmp(&self, other: &StacksEpoch<L>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more