Type Alias sp_timestamp::InherentType

source ·
pub type InherentType = Timestamp;
Expand description

The type of the inherent.

Aliased Type§

struct InherentType(/* private fields */);

Implementations

source§

impl Timestamp

source

pub const fn new(inner: u64) -> Self

Create new Self.

source

pub const fn as_duration(self) -> Duration

Returns self as Duration.

source

pub const fn as_millis(&self) -> u64

Returns self as a u64 representing the elapsed time since the UNIX_EPOCH in milliseconds.

source

pub fn checked_sub(self, other: Self) -> Option<Self>

Checked subtraction that returns None on an underflow.

source

pub fn current() -> Self

The current timestamp using the system time.

Trait Implementations

source§

impl Add<u64> for Timestamp

§

type Output = Timestamp

The resulting type after applying the + operator.
source§

fn add(self, other: u64) -> Self

Performs the + operation. Read more
source§

impl Add for Timestamp

§

type Output = Timestamp

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl Clone for Timestamp

source§

fn clone(&self) -> Timestamp

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Timestamp

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Timestamp

source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>

Attempt to deserialise the value from input.
source§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
source§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
source§

impl Default for Timestamp

source§

fn default() -> Timestamp

Returns the “default value” for a type. Read more
source§

impl Deref for Timestamp

§

type Target = u64

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Display for Timestamp

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Timestamp

source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
source§

fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )

Convert self to a slice and append it to the destination.
source§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
source§

fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn

Convert self to a slice and then invoke the given closure with it.
source§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
source§

impl From<Duration> for Timestamp

source§

fn from(duration: Duration) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Timestamp

source§

fn from(timestamp: u64) -> Self

Converts to this type from the input type.
source§

impl Ord for Timestamp

source§

fn cmp(&self, other: &Timestamp) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T: Into<u64> + Copy> PartialEq<T> for Timestamp

source§

fn eq(&self, eq: &T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Into<u64> + Copy> PartialOrd<T> for Timestamp

source§

fn partial_cmp(&self, other: &T) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Timestamp

source§

impl EncodeLike for Timestamp

source§

impl Eq for Timestamp