pub enum ProviderCall<Conn, Params, Resp, Output = Resp, Map = fn(_: Resp) -> Output>{
RpcCall(RpcCall<Conn, Params, Resp, Output, Map>),
Waiter(Waiter<Resp, Output, Map>),
BoxedFuture(Pin<Box<dyn Future<Output = TransportResult<Output>> + Send>>),
Ready(Option<TransportResult<Output>>),
}
Expand description
Variants§
RpcCall(RpcCall<Conn, 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(Pin<Box<dyn Future<Output = TransportResult<Output>> + Send>>)
A boxed future.
Ready(Option<TransportResult<Output>>)
The output, produces synchronously.
Implementations§
source§impl<Conn, Params, Resp, Output, Map> ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output, Map> ProviderCall<Conn, 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<Conn, Params, Resp, Output, Map>>
pub const fn as_rpc_call( &self, ) -> Option<&RpcCall<Conn, Params, Resp, Output, Map>>
Fallible cast to RpcCall
sourcepub fn as_mut_rpc_call(
&mut self,
) -> Option<&mut RpcCall<Conn, Params, Resp, Output, Map>>
pub fn as_mut_rpc_call( &mut self, ) -> Option<&mut RpcCall<Conn, Params, Resp, Output, Map>>
Fallible cast to mutable RpcCall
sourcepub fn as_mut_waiter(&mut self) -> Option<&mut Waiter<Resp, Output, Map>>
pub 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<&Pin<Box<dyn Future<Output = TransportResult<Output>> + Send>>>
pub const fn as_boxed_future( &self, ) -> Option<&Pin<Box<dyn Future<Output = TransportResult<Output>> + Send>>>
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<Conn, Params, Resp, NewOutput, NewMap>, Self>
pub fn map_resp<NewOutput, NewMap>( self, map: NewMap, ) -> Result<ProviderCall<Conn, 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<Conn, Params, Resp, Output, Map> ProviderCall<Conn, &Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output, Map> ProviderCall<Conn, &Params, Resp, Output, Map>
sourcepub fn into_owned_params(
self,
) -> ProviderCall<Conn, Params::Owned, Resp, Output, Map> ⓘ
pub fn into_owned_params( self, ) -> ProviderCall<Conn, 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<Conn, Params, Resp> Debug for ProviderCall<Conn, Params, Resp>
impl<Conn, Params, Resp> Debug for ProviderCall<Conn, Params, Resp>
source§impl<Conn, Params, Resp, Output, Map> From<Pin<Box<dyn Future<Output = Result<Output, RpcError<TransportErrorKind>>> + Send>>> for ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output, Map> From<Pin<Box<dyn Future<Output = Result<Output, RpcError<TransportErrorKind>>> + Send>>> for ProviderCall<Conn, Params, Resp, Output, Map>
source§impl<Conn, Params, Resp> From<Receiver<Result<Box<RawValue>, RpcError<TransportErrorKind>>>> for ProviderCall<Conn, Params, Resp>
impl<Conn, Params, Resp> From<Receiver<Result<Box<RawValue>, RpcError<TransportErrorKind>>>> for ProviderCall<Conn, Params, Resp>
source§impl<Conn, Params, Resp, Output, Map> From<RpcCall<Conn, Params, Resp, Output, Map>> for ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output, Map> From<RpcCall<Conn, Params, Resp, Output, Map>> for ProviderCall<Conn, Params, Resp, Output, Map>
source§impl<Conn, Params, Resp> From<Waiter<Resp>> for ProviderCall<Conn, Params, Resp, Resp, fn(_: Resp) -> Resp>
impl<Conn, Params, Resp> From<Waiter<Resp>> for ProviderCall<Conn, Params, Resp, Resp, fn(_: Resp) -> Resp>
source§impl<Conn, Params, Resp, Output, Map> Future for ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output, Map> Future for ProviderCall<Conn, Params, Resp, Output, Map>
impl<'pin, Conn, Params, Resp, Output, Map> Unpin for ProviderCall<Conn, Params, Resp, Output, Map>
Auto Trait Implementations§
impl<Conn, Params, Resp, Output, Map> Freeze for ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output = Resp, Map = fn(_: Resp) -> Output> !RefUnwindSafe for ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output, Map> Send for ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output = Resp, Map = fn(_: Resp) -> Output> !Sync for ProviderCall<Conn, Params, Resp, Output, Map>
impl<Conn, Params, Resp, Output = Resp, Map = fn(_: Resp) -> Output> !UnwindSafe for ProviderCall<Conn, 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> 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,
std
only.std
only.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,
channel
and std
only.()
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>>
alloc
only.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,
alloc
only.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> 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<Fut> TryFutureExt for Fut
impl<Fut> TryFutureExt for Fut
source§fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
sink
only.