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

pub enum RelativeEpoch {
    Previous,
    Current,
    Next,
}

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

Spec v0.8.1

Variants

Previous

The prior epoch.

Current

The current epoch.

Next

The next epoch.

Methods

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

Errors

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>
[src]

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
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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