[][src]Struct ckb_types::core::EpochNumberWithFraction

pub struct EpochNumberWithFraction(_);

Represents an epoch number with a fraction unit, it can be used to accurately represent the position for a block within an epoch.

Implementations

impl EpochNumberWithFraction[src]

pub const NUMBER_OFFSET: usize[src]

pub const NUMBER_BITS: usize[src]

pub const NUMBER_MAXIMUM_VALUE: u64[src]

pub const NUMBER_MASK: u64[src]

pub const INDEX_OFFSET: usize[src]

pub const INDEX_BITS: usize[src]

pub const INDEX_MAXIMUM_VALUE: u64[src]

pub const INDEX_MASK: u64[src]

pub const LENGTH_OFFSET: usize[src]

pub const LENGTH_BITS: usize[src]

pub const LENGTH_MAXIMUM_VALUE: u64[src]

pub const LENGTH_MASK: u64[src]

pub fn new(number: u64, index: u64, length: u64) -> EpochNumberWithFraction[src]

pub const fn new_unchecked(number: u64, index: u64, length: u64) -> Self[src]

pub fn number(self) -> EpochNumber[src]

pub fn index(self) -> u64[src]

pub fn length(self) -> u64[src]

pub const fn full_value(self) -> u64[src]

pub fn from_full_value(value: u64) -> Self[src]

pub fn to_rational(self) -> RationalU256[src]

Trait Implementations

impl Clone for EpochNumberWithFraction[src]

impl Copy for EpochNumberWithFraction[src]

impl Debug for EpochNumberWithFraction[src]

impl Default for EpochNumberWithFraction[src]

impl Display for EpochNumberWithFraction[src]

impl Eq for EpochNumberWithFraction[src]

impl FromStr for EpochNumberWithFraction[src]

type Err = ParseIntError

The associated error which can be returned from parsing.

impl Hash for EpochNumberWithFraction[src]

impl Ord for EpochNumberWithFraction[src]

impl Pack<Uint64> for EpochNumberWithFraction[src]

impl PartialEq<EpochNumberWithFraction> for EpochNumberWithFraction[src]

impl PartialOrd<EpochNumberWithFraction> for EpochNumberWithFraction[src]

impl StructuralEq for EpochNumberWithFraction[src]

impl StructuralPartialEq for EpochNumberWithFraction[src]

impl<'r> Unpack<EpochNumberWithFraction> for Uint64Reader<'r>[src]

impl Unpack<EpochNumberWithFraction> for Uint64[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.