pub struct EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,{ /* private fields */ }
Expand description
A builder for an "eth_getBlockByHash"
request. This type is returned by the
Provider::call
method.
Implementations§
Source§impl<BlockResp> EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
impl<BlockResp> EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
Sourcepub fn by_hash(hash: BlockHash, client: ClientRef<'_>) -> Self
pub fn by_hash(hash: BlockHash, client: ClientRef<'_>) -> Self
Create a new EthGetBlock
request to get the block by hash i.e call
"eth_getBlockByHash"
.
Sourcepub fn by_number(number: BlockNumberOrTag, client: ClientRef<'_>) -> Self
pub fn by_number(number: BlockNumberOrTag, client: ClientRef<'_>) -> Self
Create a new EthGetBlock
request to get the block by number i.e call
"eth_getBlockByNumber"
.
Source§impl<BlockResp> EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
impl<BlockResp> EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
Sourcepub fn new_rpc(
block: BlockId,
inner: RpcCall<EthGetBlockParams, Option<BlockResp>>,
) -> Self
pub fn new_rpc( block: BlockId, inner: RpcCall<EthGetBlockParams, Option<BlockResp>>, ) -> Self
Create a new EthGetBlock
request with the given RpcCall
.
Sourcepub fn new_pending_rpc(inner: RpcCall<EthGetBlockParams, Value>) -> Self
pub fn new_pending_rpc(inner: RpcCall<EthGetBlockParams, Value>) -> Self
Create a new EthGetBlock
request with the given RpcCall
for pending block.
Sourcepub fn new_provider(
block: BlockId,
producer: Box<dyn Fn(BlockTransactionsKind) -> ProviderCall<EthGetBlockParams, Option<BlockResp>> + Send>,
) -> Self
pub fn new_provider( block: BlockId, producer: Box<dyn Fn(BlockTransactionsKind) -> ProviderCall<EthGetBlockParams, Option<BlockResp>> + Send>, ) -> Self
Create a new EthGetBlock
request with a closure that returns a ProviderCall
.
Sourcepub const fn kind(self, kind: BlockTransactionsKind) -> Self
pub const fn kind(self, kind: BlockTransactionsKind) -> Self
Set the BlockTransactionsKind
for the request.
Sourcepub const fn full(self) -> Self
pub const fn full(self) -> Self
Set the BlockTransactionsKind
to BlockTransactionsKind::Full
.
Sourcepub const fn hashes(self) -> Self
pub const fn hashes(self) -> Self
Set the BlockTransactionsKind
to BlockTransactionsKind::Hashes
.
Trait Implementations§
Source§impl<BlockResp> Debug for EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
impl<BlockResp> Debug for EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
Source§impl<BlockResp> IntoFuture for EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
impl<BlockResp> IntoFuture for EthGetBlock<BlockResp>where
BlockResp: BlockResponse + RpcRecv,
Source§type Output = Result<Option<BlockResp>, RpcError<TransportErrorKind>>
type Output = Result<Option<BlockResp>, RpcError<TransportErrorKind>>
The output that the future will produce on completion.
Source§type IntoFuture = ProviderCall<EthGetBlockParams, Option<BlockResp>>
type IntoFuture = ProviderCall<EthGetBlockParams, Option<BlockResp>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<BlockResp> Freeze for EthGetBlock<BlockResp>
impl<BlockResp> !RefUnwindSafe for EthGetBlock<BlockResp>
impl<BlockResp> Send for EthGetBlock<BlockResp>
impl<BlockResp> !Sync for EthGetBlock<BlockResp>
impl<BlockResp> Unpin for EthGetBlock<BlockResp>
impl<BlockResp> !UnwindSafe for EthGetBlock<BlockResp>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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