referrerpolicy=no-referrer-when-downgrade
sp_consensus_babe::inherents

Type Alias InherentType

Source
pub type InherentType = Slot;
Expand description

The type of the BABE inherent.

Aliased Type§

struct InherentType(/* private fields */);

Implementations

Source§

impl Slot

Source

pub const fn from_timestamp( timestamp: Timestamp, slot_duration: SlotDuration, ) -> Slot

Create a new slot by calculating it from the given timestamp and slot duration.

Source

pub fn timestamp(&self, slot_duration: SlotDuration) -> Option<Timestamp>

Timestamp of the start of the slot.

Returns None if would overflow for given SlotDuration.

Source

pub fn saturating_add<T>(self, rhs: T) -> Slot
where T: Into<u64>,

Saturating addition.

Source

pub fn saturating_sub<T>(self, rhs: T) -> Slot
where T: Into<u64>,

Saturating subtraction.

Trait Implementations

Source§

impl Add<u64> for Slot

Source§

type Output = Slot

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add for Slot

Source§

type Output = Slot

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl AddAssign for Slot

Source§

fn add_assign(&mut self, rhs: Slot)

Performs the += operation. Read more
Source§

impl Clone for Slot

Source§

fn clone(&self) -> Slot

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 Slot

Source§

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

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

impl Decode for Slot

Source§

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

Attempt to deserialise the value from input.
Source§

fn decode_into<__CodecInputEdqy>( __codec_input_edqy: &mut __CodecInputEdqy, dst_: &mut MaybeUninit<Slot>, ) -> Result<DecodeFinished, Error>
where __CodecInputEdqy: Input,

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

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

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

fn encoded_fixed_size() -> Option<usize>

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

impl Default for Slot

Source§

fn default() -> Slot

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

impl Deref for Slot

Source§

type Target = u64

The resulting type after dereferencing.
Source§

fn deref(&self) -> &u64

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for Slot

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Slot, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Slot

Source§

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

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

impl Encode for Slot

Source§

fn size_hint(&self) -> usize

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

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

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>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
where __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn,

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

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl From<u64> for Slot

Source§

fn from(slot: u64) -> Slot

Converts to this type from the input type.
Source§

impl Hash for Slot

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl MaxEncodedLen for Slot

Source§

fn max_encoded_len() -> usize

Upper bound, in bytes, of the maximum encoded size of this item.
Source§

impl Ord for Slot

Source§

fn cmp(&self, other: &Slot) -> 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,

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

impl<T> PartialEq<T> for Slot
where T: Into<u64> + Copy,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd<T> for Slot
where T: Into<u64> + Copy,

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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Slot

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Sub for Slot

Source§

type Output = Slot

The resulting type after applying the - operator.
Source§

fn sub(self, other: Slot) -> Slot

Performs the - operation. Read more
Source§

impl SubAssign for Slot

Source§

fn sub_assign(&mut self, rhs: Slot)

Performs the -= operation. Read more
Source§

impl TypeInfo for Slot

Source§

type Identity = Slot

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl Copy for Slot

Source§

impl DecodeWithMemTracking for Slot

Source§

impl EncodeLike for Slot

Source§

impl Eq for Slot