pub enum ProviderCall<Params, Resp, Output = Resp, Map = fn(Resp) -> Output>{
RpcCall(RpcCall<Params, Resp, Output, Map>),
Waiter(Waiter<Resp, Output, Map>),
BoxedFuture(BoxedFut<Output>),
Ready(Option<TransportResult<Output>>),
}Expand description
Variants§
RpcCall(RpcCall<Params, Resp, Output, Map>)
An underlying call to an RPC server.
Waiter(Waiter<Resp, Output, Map>)
A waiter for a batched call to a remote RPC server.
BoxedFuture(BoxedFut<Output>)
A boxed future.
Ready(Option<TransportResult<Output>>)
The output, produces synchronously.
Implementations§
Source§impl<Params, Resp, Output, Map> ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> ProviderCall<Params, Resp, Output, Map>
Sourcepub const fn ready(output: TransportResult<Output>) -> Self
pub const fn ready(output: TransportResult<Output>) -> Self
Instantiate a new ProviderCall from the output.
Sourcepub const fn is_rpc_call(&self) -> bool
pub const fn is_rpc_call(&self) -> bool
True if this is an RPC call.
Sourcepub const fn as_rpc_call(&self) -> Option<&RpcCall<Params, Resp, Output, Map>>
pub const fn as_rpc_call(&self) -> Option<&RpcCall<Params, Resp, Output, Map>>
Fallible cast to RpcCall
Sourcepub const fn as_mut_rpc_call(
&mut self,
) -> Option<&mut RpcCall<Params, Resp, Output, Map>>
pub const fn as_mut_rpc_call( &mut self, ) -> Option<&mut RpcCall<Params, Resp, Output, Map>>
Fallible cast to mutable RpcCall
Sourcepub const fn as_mut_waiter(&mut self) -> Option<&mut Waiter<Resp, Output, Map>>
pub const fn as_mut_waiter(&mut self) -> Option<&mut Waiter<Resp, Output, Map>>
Fallible cast to mutable Waiter
Sourcepub const fn is_boxed_future(&self) -> bool
pub const fn is_boxed_future(&self) -> bool
True if this is a boxed future.
Sourcepub const fn as_boxed_future(&self) -> Option<&BoxedFut<Output>>
pub const fn as_boxed_future(&self) -> Option<&BoxedFut<Output>>
Fallible cast to a boxed future.
Sourcepub const fn as_ready(&self) -> Option<&TransportResult<Output>>
pub const fn as_ready(&self) -> Option<&TransportResult<Output>>
Sourcepub fn map_resp<NewOutput, NewMap>(
self,
map: NewMap,
) -> Result<ProviderCall<Params, Resp, NewOutput, NewMap>, Self>
pub fn map_resp<NewOutput, NewMap>( self, map: NewMap, ) -> Result<ProviderCall<Params, Resp, NewOutput, NewMap>, Self>
Set a function to map the response into a different type. This is
useful for transforming the response into a more usable type, e.g.
changing U64 to u64.
This function fails if the inner future is not an RpcCall or
Waiter.
§Note
Carefully review the rust documentation on fn pointers before passing
them to this function. Unless the pointer is specifically coerced to a
fn(_) -> _, the NewMap will be inferred as that function’s unique
type. This can lead to confusing error messages.
Source§impl<Params, Resp, Output, Map> ProviderCall<&Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> ProviderCall<&Params, Resp, Output, Map>
Sourcepub fn into_owned_params(self) -> ProviderCall<Params::Owned, Resp, Output, Map> ⓘ
pub fn into_owned_params(self) -> ProviderCall<Params::Owned, Resp, Output, Map> ⓘ
Convert this call into one with owned params, by cloning the params.
§Panics
Panics if called after the request has been polled.
Trait Implementations§
Source§impl<Params, Resp> Debug for ProviderCall<Params, Resp>
impl<Params, Resp> Debug for ProviderCall<Params, Resp>
Source§impl<Params, Resp, Output, Map> From<Pin<Box<dyn Future<Output = Result<Output, RpcError<TransportErrorKind>>> + Send>>> for ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> From<Pin<Box<dyn Future<Output = Result<Output, RpcError<TransportErrorKind>>> + Send>>> for ProviderCall<Params, Resp, Output, Map>
Source§impl<Params, Resp> From<Receiver<Result<Box<RawValue>, RpcError<TransportErrorKind>>>> for ProviderCall<Params, Resp>
impl<Params, Resp> From<Receiver<Result<Box<RawValue>, RpcError<TransportErrorKind>>>> for ProviderCall<Params, Resp>
Source§impl<Params, Resp, Output, Map> From<RpcCall<Params, Resp, Output, Map>> for ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> From<RpcCall<Params, Resp, Output, Map>> for ProviderCall<Params, Resp, Output, Map>
Source§impl<Params, Resp, Output, Map> Future for ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> Future for ProviderCall<Params, Resp, Output, Map>
impl<'pin, Params, Resp, Output, Map> Unpin for ProviderCall<Params, Resp, Output, Map>
Auto Trait Implementations§
impl<Params, Resp, Output, Map> Freeze for ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output = Resp, Map = fn(Resp) -> Output> !RefUnwindSafe for ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output, Map> Send for ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output = Resp, Map = fn(Resp) -> Output> !Sync for ProviderCall<Params, Resp, Output, Map>
impl<Params, Resp, Output = Resp, Map = fn(Resp) -> Output> !UnwindSafe for ProviderCall<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> FutureExt for T
impl<T> FutureExt for T
Source§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
Source§fn map_into<U>(self) -> MapInto<Self, U>
fn map_into<U>(self) -> MapInto<Self, U>
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
f. Read moreSource§fn left_future<B>(self) -> Either<Self, B>
fn left_future<B>(self) -> Either<Self, B>
Source§fn right_future<A>(self) -> Either<A, Self>
fn right_future<A>(self) -> Either<A, Self>
Source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
Source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
poll will never again be called once it has
completed. This method can be used to turn any Future into a
FusedFuture. Read moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
() on completion and sends
its output to another future on a separate task. Read moreSource§fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
Source§fn unit_error(self) -> UnitError<Self>where
Self: Sized,
fn unit_error(self) -> UnitError<Self>where
Self: Sized,
Future<Output = T> into a
TryFuture<Ok = T, Error = ()>.Source§fn never_error(self) -> NeverError<Self>where
Self: Sized,
fn never_error(self) -> NeverError<Self>where
Self: Sized,
Future<Output = T> into a
TryFuture<Ok = T, Error = Never>.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
fn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
CancellationToken::run_until_cancelled,
but with the advantage that it is easier to write fluent call chains,
and biased towards waiting for CancellationToken to complete. Read moreSource§fn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
fn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
CancellationToken::run_until_cancelled_owned,
but with the advantage that it is easier to write fluent call chains,
and biased towards waiting for CancellationToken to complete. Read moreSource§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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Source§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> Pointable for T
impl<T> Pointable for T
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.