[][src]Enum types::relative_epoch::RelativeEpoch

pub enum RelativeEpoch {

Defines the epochs relative to some epoch. Most useful when referring to the committees prior to and following some epoch.

Spec v0.8.1



The prior epoch.


The current epoch.


The next epoch.


impl RelativeEpoch[src]

pub fn into_epoch(self, base: Epoch) -> Epoch[src]

Returns the epoch that self refers to, with respect to the base epoch.

Spec v0.8.1

pub fn from_epoch(base: Epoch, other: Epoch) -> Result<Self, Error>[src]

Converts the other epoch into a RelativeEpoch, with respect to base


Returns an error when:

  • EpochTooLow when other is more than 1 prior to base.
  • EpochTooHigh when other is more than 1 after base.

Spec v0.8.1

pub fn from_slot(
    base: Slot,
    other: Slot,
    slots_per_epoch: u64
) -> Result<Self, Error>

Convenience function for Self::from_epoch where both slots are converted into epochs.

Trait Implementations

impl Clone for RelativeEpoch[src]

impl PartialEq<RelativeEpoch> for RelativeEpoch[src]

impl Copy for RelativeEpoch[src]

impl Debug for RelativeEpoch[src]

Auto Trait Implementations

impl Send for RelativeEpoch

impl Unpin for RelativeEpoch

impl Sync for RelativeEpoch

impl UnwindSafe for RelativeEpoch

impl RefUnwindSafe for RelativeEpoch

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized