Enum alloy_eips::eip1898::BlockHashOrNumber
source · pub enum BlockHashOrNumber {
Hash(B256),
Number(u64),
}Expand description
Either a block hash or a block number
Variants§
Implementations§
source§impl BlockHashOrNumber
impl BlockHashOrNumber
sourcepub const fn as_number(self) -> Option<u64>
pub const fn as_number(self) -> Option<u64>
Returns the block number if it is a BlockHashOrNumber::Number.
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for BlockHashOrNumber
impl<'arbitrary> Arbitrary<'arbitrary> for BlockHashOrNumber
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moresource§impl Clone for BlockHashOrNumber
impl Clone for BlockHashOrNumber
source§fn clone(&self) -> BlockHashOrNumber
fn clone(&self) -> BlockHashOrNumber
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 BlockHashOrNumber
impl Debug for BlockHashOrNumber
source§impl Decodable for BlockHashOrNumber
impl Decodable for BlockHashOrNumber
Allows for RLP decoding of a block hash or block number
source§impl<'de> Deserialize<'de> for BlockHashOrNumber
impl<'de> Deserialize<'de> for BlockHashOrNumber
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 BlockHashOrNumber
impl Display for BlockHashOrNumber
source§impl Encodable for BlockHashOrNumber
impl Encodable for BlockHashOrNumber
Allows for RLP encoding of either a block hash or block number
source§impl From<FixedBytes<32>> for BlockHashOrNumber
impl From<FixedBytes<32>> for BlockHashOrNumber
source§impl From<RpcBlockHash> for BlockHashOrNumber
impl From<RpcBlockHash> for BlockHashOrNumber
source§fn from(value: RpcBlockHash) -> Self
fn from(value: RpcBlockHash) -> Self
Converts to this type from the input type.
source§impl From<Uint<64, 1>> for BlockHashOrNumber
impl From<Uint<64, 1>> for BlockHashOrNumber
source§impl From<u64> for BlockHashOrNumber
impl From<u64> for BlockHashOrNumber
source§impl FromStr for BlockHashOrNumber
impl FromStr for BlockHashOrNumber
source§impl Hash for BlockHashOrNumber
impl Hash for BlockHashOrNumber
source§impl PartialEq for BlockHashOrNumber
impl PartialEq for BlockHashOrNumber
source§fn eq(&self, other: &BlockHashOrNumber) -> bool
fn eq(&self, other: &BlockHashOrNumber) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for BlockHashOrNumber
impl Serialize for BlockHashOrNumber
impl Copy for BlockHashOrNumber
impl Eq for BlockHashOrNumber
impl StructuralPartialEq for BlockHashOrNumber
Auto Trait Implementations§
impl Freeze for BlockHashOrNumber
impl RefUnwindSafe for BlockHashOrNumber
impl Send for BlockHashOrNumber
impl Sync for BlockHashOrNumber
impl Unpin for BlockHashOrNumber
impl UnwindSafe for BlockHashOrNumber
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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 more