Enum alloy_eips::eip1898::HashOrNumber
source · pub enum HashOrNumber {
Hash(B256),
Number(u64),
}
Expand description
Either a hash or a block number
Variants§
Implementations§
source§impl HashOrNumber
impl HashOrNumber
sourcepub const fn as_number(self) -> Option<u64>
pub const fn as_number(self) -> Option<u64>
Returns the block number if it is a HashOrNumber::Number
.
sourcepub const fn as_hash(self) -> Option<B256>
pub const fn as_hash(self) -> Option<B256>
Returns the block hash if it is a HashOrNumber::Hash
.
Trait Implementations§
source§impl Clone for HashOrNumber
impl Clone for HashOrNumber
source§fn clone(&self) -> HashOrNumber
fn clone(&self) -> HashOrNumber
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 HashOrNumber
impl Debug for HashOrNumber
source§impl Decodable for HashOrNumber
impl Decodable for HashOrNumber
Allows for RLP decoding of a hash or number
source§impl<'de> Deserialize<'de> for HashOrNumber
impl<'de> Deserialize<'de> for HashOrNumber
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 HashOrNumber
impl Display for HashOrNumber
source§impl Encodable for HashOrNumber
impl Encodable for HashOrNumber
Allows for RLP encoding of either a hash or a number
source§impl From<&FixedBytes<32>> for HashOrNumber
impl From<&FixedBytes<32>> for HashOrNumber
source§impl From<FixedBytes<32>> for HashOrNumber
impl From<FixedBytes<32>> for HashOrNumber
source§impl From<HashOrNumber> for BlockId
impl From<HashOrNumber> for BlockId
source§fn from(block: HashOrNumber) -> Self
fn from(block: HashOrNumber) -> Self
Converts to this type from the input type.
source§impl From<RpcBlockHash> for HashOrNumber
impl From<RpcBlockHash> for HashOrNumber
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 HashOrNumber
impl From<Uint<64, 1>> for HashOrNumber
source§impl From<u64> for HashOrNumber
impl From<u64> for HashOrNumber
source§impl FromStr for HashOrNumber
impl FromStr for HashOrNumber
source§impl Hash for HashOrNumber
impl Hash for HashOrNumber
source§impl PartialEq for HashOrNumber
impl PartialEq for HashOrNumber
source§fn eq(&self, other: &HashOrNumber) -> bool
fn eq(&self, other: &HashOrNumber) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for HashOrNumber
impl Serialize for HashOrNumber
impl Copy for HashOrNumber
impl Eq for HashOrNumber
impl StructuralPartialEq for HashOrNumber
Auto Trait Implementations§
impl Freeze for HashOrNumber
impl RefUnwindSafe for HashOrNumber
impl Send for HashOrNumber
impl Sync for HashOrNumber
impl Unpin for HashOrNumber
impl UnwindSafe for HashOrNumber
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: 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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.