pub struct RpcWithBlock<Params, Resp, Output = Resp, Map = fn(Resp) -> Output>{ /* private fields */ }providers only.Expand description
A struct that takes an optional BlockId parameter.
This resolves to a ProviderCall that will execute the call on the specified block.
By default this will use “latest”.
Implementations§
Source§impl<Params, Resp, Output, Map> RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> RpcWithBlock<Params, Resp, Output, Map>
Sourcepub fn new_rpc(
inner: RpcCall<Params, Resp, Output, Map>,
) -> RpcWithBlock<Params, Resp, Output, Map>
pub fn new_rpc( inner: RpcCall<Params, Resp, Output, Map>, ) -> RpcWithBlock<Params, Resp, Output, Map>
Create a new RpcWithBlock from a RpcCall.
Sourcepub fn new_provider<F>(get_call: F) -> RpcWithBlock<Params, Resp, Output, Map>
pub fn new_provider<F>(get_call: F) -> RpcWithBlock<Params, Resp, Output, Map>
Create a new RpcWithBlock from a closure producing a ProviderCall.
Source§impl<Params, Resp, Output, Map> RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> RpcWithBlock<Params, Resp, Output, Map>
Sourcepub const fn block_id(
self,
block_id: BlockId,
) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn block_id( self, block_id: BlockId, ) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id.
Sourcepub const fn pending(self) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn pending(self) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to “pending”.
Sourcepub const fn latest(self) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn latest(self) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to “latest”.
Sourcepub const fn earliest(self) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn earliest(self) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to “earliest”.
Sourcepub const fn finalized(self) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn finalized(self) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to “finalized”.
Sourcepub const fn safe(self) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn safe(self) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to “safe”.
Sourcepub const fn number(
self,
number: u64,
) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn number( self, number: u64, ) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to a specific height.
Sourcepub const fn hash(
self,
hash: FixedBytes<32>,
) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn hash( self, hash: FixedBytes<32>, ) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to a specific hash, without requiring the hash be part of the canonical chain.
Sourcepub const fn hash_canonical(
self,
hash: FixedBytes<32>,
) -> RpcWithBlock<Params, Resp, Output, Map>
pub const fn hash_canonical( self, hash: FixedBytes<32>, ) -> RpcWithBlock<Params, Resp, Output, Map>
Set the block id to a specific hash and require the hash be part of the canonical chain.
Trait Implementations§
Source§impl<Params, Resp, Output, Map> Debug for RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> Debug for RpcWithBlock<Params, Resp, Output, Map>
Source§impl<F, Params, Resp, Output, Map> From<F> for RpcWithBlock<Params, Resp, Output, Map>where
Params: RpcSend,
Resp: RpcRecv,
Map: Fn(Resp) -> Output + Clone,
F: Fn(BlockId) -> ProviderCall<ParamsWithBlock<Params>, Resp, Output, Map> + Send + 'static,
impl<F, Params, Resp, Output, Map> From<F> for RpcWithBlock<Params, Resp, Output, Map>where
Params: RpcSend,
Resp: RpcRecv,
Map: Fn(Resp) -> Output + Clone,
F: Fn(BlockId) -> ProviderCall<ParamsWithBlock<Params>, Resp, Output, Map> + Send + 'static,
Source§fn from(inner: F) -> RpcWithBlock<Params, Resp, Output, Map>
fn from(inner: F) -> RpcWithBlock<Params, Resp, Output, Map>
Source§impl<Params, Resp, Output, Map> From<RpcCall<Params, Resp, Output, Map>> for RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> From<RpcCall<Params, Resp, Output, Map>> for RpcWithBlock<Params, Resp, Output, Map>
Source§fn from(
inner: RpcCall<Params, Resp, Output, Map>,
) -> RpcWithBlock<Params, Resp, Output, Map>
fn from( inner: RpcCall<Params, Resp, Output, Map>, ) -> RpcWithBlock<Params, Resp, Output, Map>
Source§impl<Params, Resp, Output, Map> IntoFuture for RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> IntoFuture for RpcWithBlock<Params, Resp, Output, Map>
Source§type Output = Result<Output, RpcError<TransportErrorKind>>
type Output = Result<Output, RpcError<TransportErrorKind>>
Source§type IntoFuture = ProviderCall<ParamsWithBlock<Params>, Resp, Output, Map>
type IntoFuture = ProviderCall<ParamsWithBlock<Params>, Resp, Output, Map>
Source§fn into_future(
self,
) -> <RpcWithBlock<Params, Resp, Output, Map> as IntoFuture>::IntoFuture
fn into_future( self, ) -> <RpcWithBlock<Params, Resp, Output, Map> as IntoFuture>::IntoFuture
impl<'pin, Params, Resp, Output, Map> Unpin for RpcWithBlock<Params, Resp, Output, Map>
Auto Trait Implementations§
impl<Params, Resp, Output, Map> Freeze for RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output = Resp, Map = fn(Resp) -> Output> !RefUnwindSafe for RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> Send for RpcWithBlock<Params, Resp, Output, Map>where
Map: Send,
impl<Params, Resp, Output = Resp, Map = fn(Resp) -> Output> !Sync for RpcWithBlock<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> UnsafeUnpin for RpcWithBlock<Params, Resp, Output, Map>where
Map: UnsafeUnpin,
Params: UnsafeUnpin,
impl<Params, Resp, Output = Resp, Map = fn(Resp) -> Output> !UnwindSafe for RpcWithBlock<Params, Resp, Output, Map>
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.