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>>
Source§type IntoFuture = ProviderCall<EthGetBlockParams, Option<BlockResp>>
type IntoFuture = ProviderCall<EthGetBlockParams, Option<BlockResp>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
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> UnsafeUnpin 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
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>
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>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 192 bytes