[][src]Struct types::slot_epoch::Epoch

pub struct Epoch(_);

Methods

impl Epoch[src]

pub fn as_u64(&self) -> u64[src]

impl Epoch[src]

pub fn as_usize(&self) -> usize[src]

impl Epoch[src]

pub fn saturating_sub<T: Into<Epoch>>(&self, other: T) -> Epoch[src]

pub fn saturating_add<T: Into<Epoch>>(&self, other: T) -> Epoch[src]

pub fn checked_div<T: Into<Epoch>>(&self, rhs: T) -> Option<Epoch>[src]

pub fn is_power_of_two(&self) -> bool[src]

impl Epoch[src]

pub fn new(slot: u64) -> Epoch[src]

pub fn max_value() -> Epoch[src]

pub fn start_slot(self, slots_per_epoch: u64) -> Slot[src]

The first slot in the epoch.

pub fn end_slot(self, slots_per_epoch: u64) -> Slot[src]

The last slot in the epoch.

pub fn position(self, slot: Slot, slots_per_epoch: u64) -> Option<usize>[src]

Position of some slot inside an epoch, if any.

E.g., the first slot in epoch is at position 0.

Important traits for SlotIter<'a>
pub fn slot_iter(&self, slots_per_epoch: u64) -> SlotIter[src]

Trait Implementations

impl TestRandom for Epoch[src]

impl Into<u64> for Epoch[src]

impl Into<usize> for Epoch[src]

impl Eq for Epoch[src]

impl Default for Epoch[src]

impl Clone for Epoch[src]

impl PartialOrd<Epoch> for Epoch[src]

fn partial_cmp(&self, other: &Epoch) -> Option<Ordering>[src]

Utilizes partial_cmp on the underlying u64.

impl PartialOrd<u64> for Epoch[src]

fn partial_cmp(&self, other: &u64) -> Option<Ordering>[src]

Utilizes partial_cmp on the underlying u64.

impl PartialEq<Epoch> for Epoch[src]

impl PartialEq<u64> for Epoch[src]

impl Ord for Epoch[src]

impl From<u64> for Epoch[src]

impl From<usize> for Epoch[src]

impl Copy for Epoch[src]

impl Hash for Epoch[src]

impl Add<Epoch> for Epoch[src]

type Output = Epoch

The resulting type after applying the + operator.

impl Add<u64> for Epoch[src]

type Output = Epoch

The resulting type after applying the + operator.

impl Sub<Epoch> for Epoch[src]

type Output = Epoch

The resulting type after applying the - operator.

impl Sub<u64> for Epoch[src]

type Output = Epoch

The resulting type after applying the - operator.

impl Mul<Epoch> for Epoch[src]

type Output = Epoch

The resulting type after applying the * operator.

impl Mul<u64> for Epoch[src]

type Output = Epoch

The resulting type after applying the * operator.

impl Div<Epoch> for Epoch[src]

type Output = Epoch

The resulting type after applying the / operator.

impl Div<u64> for Epoch[src]

type Output = Epoch

The resulting type after applying the / operator.

impl Rem<Epoch> for Epoch[src]

type Output = Epoch

The resulting type after applying the % operator.

impl Rem<u64> for Epoch[src]

type Output = Epoch

The resulting type after applying the % operator.

impl AddAssign<Epoch> for Epoch[src]

impl AddAssign<u64> for Epoch[src]

impl SubAssign<Epoch> for Epoch[src]

impl SubAssign<u64> for Epoch[src]

impl MulAssign<Epoch> for Epoch[src]

impl MulAssign<u64> for Epoch[src]

impl DivAssign<Epoch> for Epoch[src]

impl DivAssign<u64> for Epoch[src]

impl Debug for Epoch[src]

impl Display for Epoch[src]

impl TreeHash for Epoch[src]

impl Serialize for Epoch[src]

impl<'de> Deserialize<'de> for Epoch[src]

impl Decode for Epoch[src]

impl Encode for Epoch[src]

impl Value for Epoch[src]

Auto Trait Implementations

impl Send for Epoch

impl Unpin for Epoch

impl Sync for Epoch

impl UnwindSafe for Epoch

impl RefUnwindSafe for Epoch

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> ToString for T where
    T: Display + ?Sized
[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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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