pub struct BlockNumber(/* private fields */);Expand description
A block’s number.
The genesis block is considered to have number 0 where following blocks’ numbers increase
incrementally by one.
As this library never works with the genesis block, as it’s constant and does not undergo the
consensus process, this library represents block numbers via NonZero. This is complete to
all block numbers this library has to consider.
Trait Implementations§
Source§impl BorshDeserialize for BlockNumber
impl BorshDeserialize for BlockNumber
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for BlockNumber
impl BorshSerialize for BlockNumber
Source§impl Clone for BlockNumber
impl Clone for BlockNumber
Source§fn clone(&self) -> BlockNumber
fn clone(&self) -> BlockNumber
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BlockNumber
Source§impl Debug for BlockNumber
impl Debug for BlockNumber
impl Eq for BlockNumber
Source§impl From<BlockNumber> for u64
impl From<BlockNumber> for u64
Source§fn from(block_number: BlockNumber) -> Self
fn from(block_number: BlockNumber) -> Self
Converts to this type from the input type.
Source§impl Hash for BlockNumber
impl Hash for BlockNumber
Source§impl Ord for BlockNumber
impl Ord for BlockNumber
Source§fn cmp(&self, other: &BlockNumber) -> Ordering
fn cmp(&self, other: &BlockNumber) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BlockNumber
impl PartialEq for BlockNumber
Source§impl PartialOrd for BlockNumber
impl PartialOrd for BlockNumber
impl StructuralPartialEq for BlockNumber
Auto Trait Implementations§
impl Freeze for BlockNumber
impl RefUnwindSafe for BlockNumber
impl Send for BlockNumber
impl Sync for BlockNumber
impl Unpin for BlockNumber
impl UnsafeUnpin for BlockNumber
impl UnwindSafe for BlockNumber
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more