pub type InherentType = Slot;
Expand description
The type of the BABE inherent.
Aliased Type§
struct InherentType(/* private fields */);
Implementations
Source§impl Slot
impl Slot
Sourcepub const fn from_timestamp(
timestamp: Timestamp,
slot_duration: SlotDuration,
) -> Slot
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.
Sourcepub fn timestamp(&self, slot_duration: SlotDuration) -> Option<Timestamp>
pub fn timestamp(&self, slot_duration: SlotDuration) -> Option<Timestamp>
Timestamp of the start of the slot.
Returns None
if would overflow for given SlotDuration
.
Sourcepub fn saturating_add<T>(self, rhs: T) -> Slot
pub fn saturating_add<T>(self, rhs: T) -> Slot
Saturating addition.
Sourcepub fn saturating_sub<T>(self, rhs: T) -> Slot
pub fn saturating_sub<T>(self, rhs: T) -> Slot
Saturating subtraction.
Trait Implementations
Source§impl AddAssign for Slot
impl AddAssign for Slot
Source§fn add_assign(&mut self, rhs: Slot)
fn add_assign(&mut self, rhs: Slot)
Performs the
+=
operation. Read moreSource§impl Decode for Slot
impl Decode for Slot
Source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Slot, Error>where
__CodecInputEdqy: Input,
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,
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,
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>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Source§impl<'de> Deserialize<'de> for Slot
impl<'de> Deserialize<'de> for Slot
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Slot, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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 Encode for Slot
impl Encode for Slot
Source§fn size_hint(&self) -> usize
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,
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 using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl MaxEncodedLen for Slot
impl MaxEncodedLen for Slot
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Source§impl Ord for Slot
impl Ord for Slot
Source§impl<T> PartialOrd<T> for Slot
impl<T> PartialOrd<T> for Slot
Source§impl Serialize for Slot
impl Serialize for Slot
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 SubAssign for Slot
impl SubAssign for Slot
Source§fn sub_assign(&mut self, rhs: Slot)
fn sub_assign(&mut self, rhs: Slot)
Performs the
-=
operation. Read more