pub enum BlockNumberOrTag {
Latest,
Finalized,
Safe,
Earliest,
Pending,
Number(u64),
}Expand description
A block Number (or tag - “latest”, “earliest”, “pending”)
This enum allows users to specify a block in a flexible manner.
Variants§
Latest
Latest block
Finalized
Finalized block accepted as canonical
Safe
Safe head block
Earliest
Earliest block (genesis)
Pending
Pending block (not yet part of the blockchain)
Number(u64)
Block by number from canonical chain
Implementations§
Source§impl BlockNumberOrTag
impl BlockNumberOrTag
Sourcepub const fn as_number(&self) -> Option<u64>
pub const fn as_number(&self) -> Option<u64>
Returns the numeric block number if explicitly set
Sourcepub const fn is_finalized(&self) -> bool
pub const fn is_finalized(&self) -> bool
Returns true if it’s “finalized”
Sourcepub const fn is_pending(&self) -> bool
pub const fn is_pending(&self) -> bool
Returns true if it’s “pending”
Sourcepub const fn is_earliest(&self) -> bool
pub const fn is_earliest(&self) -> bool
Returns true if it’s “earliest”
Trait Implementations§
Source§impl Clone for BlockNumberOrTag
impl Clone for BlockNumberOrTag
Source§fn clone(&self) -> BlockNumberOrTag
fn clone(&self) -> BlockNumberOrTag
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockNumberOrTag
impl Debug for BlockNumberOrTag
Source§impl Default for BlockNumberOrTag
impl Default for BlockNumberOrTag
Source§fn default() -> BlockNumberOrTag
fn default() -> BlockNumberOrTag
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BlockNumberOrTag
Available on crate feature serde only.
impl<'de> Deserialize<'de> for BlockNumberOrTag
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BlockNumberOrTag
impl Display for BlockNumberOrTag
Source§impl From<BlockNumberOrTag> for BlockId
impl From<BlockNumberOrTag> for BlockId
Source§fn from(num: BlockNumberOrTag) -> Self
fn from(num: BlockNumberOrTag) -> Self
Converts to this type from the input type.
Source§impl From<Uint<64, 1>> for BlockNumberOrTag
impl From<Uint<64, 1>> for BlockNumberOrTag
Source§impl From<u64> for BlockNumberOrTag
impl From<u64> for BlockNumberOrTag
Source§impl FromStr for BlockNumberOrTag
impl FromStr for BlockNumberOrTag
Source§impl Hash for BlockNumberOrTag
impl Hash for BlockNumberOrTag
Source§impl PartialEq for BlockNumberOrTag
impl PartialEq for BlockNumberOrTag
Source§impl Serialize for BlockNumberOrTag
Available on crate feature serde only.
impl Serialize for BlockNumberOrTag
Available on crate feature
serde only.impl Copy for BlockNumberOrTag
impl Eq for BlockNumberOrTag
impl StructuralPartialEq for BlockNumberOrTag
Auto Trait Implementations§
impl Freeze for BlockNumberOrTag
impl RefUnwindSafe for BlockNumberOrTag
impl Send for BlockNumberOrTag
impl Sync for BlockNumberOrTag
impl Unpin for BlockNumberOrTag
impl UnwindSafe for BlockNumberOrTag
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 12 bytes
Size for each variant:
Latest: 0 bytesFinalized: 0 bytesSafe: 0 bytesEarliest: 0 bytesPending: 0 bytesNumber: 8 bytes