pub struct RpcBlockHash {
pub block_hash: FixedBytes<32>,
pub require_canonical: Option<bool>,
}
Expand description
A block hash which may have a boolean requireCanonical
field.
- If false, a RPC call should raise if a block matching the hash is not found.
- If true, a RPC call should additionally raise if the block is not in the canonical chain.
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1898.md#specification
Fields§
§block_hash: FixedBytes<32>
A block hash
require_canonical: Option<bool>
Whether the block must be a canonical block
Implementations§
Source§impl RpcBlockHash
impl RpcBlockHash
Sourcepub const fn from_hash(
block_hash: FixedBytes<32>,
require_canonical: Option<bool>,
) -> RpcBlockHash
pub const fn from_hash( block_hash: FixedBytes<32>, require_canonical: Option<bool>, ) -> RpcBlockHash
Returns a RpcBlockHash
from a B256
.
Trait Implementations§
Source§impl AsRef<FixedBytes<32>> for RpcBlockHash
impl AsRef<FixedBytes<32>> for RpcBlockHash
Source§fn as_ref(&self) -> &FixedBytes<32>
fn as_ref(&self) -> &FixedBytes<32>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for RpcBlockHash
impl Clone for RpcBlockHash
Source§fn clone(&self) -> RpcBlockHash
fn clone(&self) -> RpcBlockHash
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 RpcBlockHash
impl Debug for RpcBlockHash
Source§impl Display for RpcBlockHash
impl Display for RpcBlockHash
Source§impl From<FixedBytes<32>> for RpcBlockHash
impl From<FixedBytes<32>> for RpcBlockHash
Source§fn from(value: FixedBytes<32>) -> RpcBlockHash
fn from(value: FixedBytes<32>) -> RpcBlockHash
Converts to this type from the input type.
Source§impl From<RpcBlockHash> for BlockId
impl From<RpcBlockHash> for BlockId
Source§fn from(value: RpcBlockHash) -> BlockId
fn from(value: RpcBlockHash) -> BlockId
Converts to this type from the input type.
Source§impl From<RpcBlockHash> for FixedBytes<32>
impl From<RpcBlockHash> for FixedBytes<32>
Source§fn from(value: RpcBlockHash) -> FixedBytes<32>
fn from(value: RpcBlockHash) -> FixedBytes<32>
Converts to this type from the input type.
Source§impl From<RpcBlockHash> for HashOrNumber
impl From<RpcBlockHash> for HashOrNumber
Source§fn from(value: RpcBlockHash) -> HashOrNumber
fn from(value: RpcBlockHash) -> HashOrNumber
Converts to this type from the input type.
Source§impl PartialEq for RpcBlockHash
impl PartialEq for RpcBlockHash
Source§impl Serialize for RpcBlockHash
impl Serialize for RpcBlockHash
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
impl Copy for RpcBlockHash
impl Eq for RpcBlockHash
impl StructuralPartialEq for RpcBlockHash
Auto Trait Implementations§
impl Freeze for RpcBlockHash
impl RefUnwindSafe for RpcBlockHash
impl Send for RpcBlockHash
impl Sync for RpcBlockHash
impl Unpin for RpcBlockHash
impl UnwindSafe for RpcBlockHash
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§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<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 more