Enum cw0::Duration[][src]

pub enum Duration {
    Height(u64),
    Time(u64),
}

Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined

Variants

Height(u64)
Time(u64)

Implementations

impl Duration[src]

pub fn after(&self, block: &BlockInfo) -> Expiration[src]

Create an expiration for Duration after current block

pub fn plus_one(&self) -> Duration[src]

Trait Implementations

impl Add<Duration> for Expiration[src]

type Output = StdResult<Expiration>

The resulting type after applying the + operator.

impl Add<Duration> for Duration[src]

type Output = StdResult<Duration>

The resulting type after applying the + operator.

impl Clone for Duration[src]

impl Copy for Duration[src]

impl Debug for Duration[src]

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

impl Display for Duration[src]

impl JsonSchema for Duration[src]

impl Mul<u64> for Duration[src]

type Output = Duration

The resulting type after applying the * operator.

impl PartialEq<Duration> for Duration[src]

impl Serialize for Duration[src]

impl StructuralPartialEq for Duration[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> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> FmtForward for T

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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> TryConv for T

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.