pub struct LenientBlockNumberOrTag(/* private fields */);
Expand description
This is a helper type to allow for lenient parsing of block numbers.
The eth json-rpc spec requires quantities to be hex encoded, which BlockNumberOrTag
strictly
enforces.
This type can be used if you want to allow for lenient parsing of block numbers.
Implementations§
Source§impl LenientBlockNumberOrTag
impl LenientBlockNumberOrTag
Sourcepub const fn new(block_number_or_tag: BlockNumberOrTag) -> Self
pub const fn new(block_number_or_tag: BlockNumberOrTag) -> Self
Creates a new LenientBlockNumberOrTag
from a BlockNumberOrTag
.
Sourcepub const fn into_inner(self) -> BlockNumberOrTag
pub const fn into_inner(self) -> BlockNumberOrTag
Returns the inner BlockNumberOrTag
.
Trait Implementations§
Source§impl Clone for LenientBlockNumberOrTag
impl Clone for LenientBlockNumberOrTag
Source§fn clone(&self) -> LenientBlockNumberOrTag
fn clone(&self) -> LenientBlockNumberOrTag
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 LenientBlockNumberOrTag
impl Debug for LenientBlockNumberOrTag
Source§impl Default for LenientBlockNumberOrTag
impl Default for LenientBlockNumberOrTag
Source§fn default() -> LenientBlockNumberOrTag
fn default() -> LenientBlockNumberOrTag
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LenientBlockNumberOrTag
impl<'de> Deserialize<'de> for LenientBlockNumberOrTag
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 From<BlockNumberOrTag> for LenientBlockNumberOrTag
impl From<BlockNumberOrTag> for LenientBlockNumberOrTag
Source§fn from(value: BlockNumberOrTag) -> Self
fn from(value: BlockNumberOrTag) -> Self
Converts to this type from the input type.
Source§impl From<LenientBlockNumberOrTag> for BlockId
impl From<LenientBlockNumberOrTag> for BlockId
Source§fn from(value: LenientBlockNumberOrTag) -> Self
fn from(value: LenientBlockNumberOrTag) -> Self
Converts to this type from the input type.
Source§impl From<LenientBlockNumberOrTag> for BlockNumberOrTag
impl From<LenientBlockNumberOrTag> for BlockNumberOrTag
Source§fn from(value: LenientBlockNumberOrTag) -> Self
fn from(value: LenientBlockNumberOrTag) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LenientBlockNumberOrTag
impl PartialEq for LenientBlockNumberOrTag
Source§impl Serialize for LenientBlockNumberOrTag
impl Serialize for LenientBlockNumberOrTag
impl Copy for LenientBlockNumberOrTag
impl Eq for LenientBlockNumberOrTag
impl StructuralPartialEq for LenientBlockNumberOrTag
Auto Trait Implementations§
impl Freeze for LenientBlockNumberOrTag
impl RefUnwindSafe for LenientBlockNumberOrTag
impl Send for LenientBlockNumberOrTag
impl Sync for LenientBlockNumberOrTag
impl Unpin for LenientBlockNumberOrTag
impl UnwindSafe for LenientBlockNumberOrTag
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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