Skip to main content

CallExt

Trait CallExt 

Source
pub trait CallExt:
    Future
    + Send
    + Sized {
    // Provided methods
    fn within<'a>(
        self,
        slot: &'a CallSlot,
        op: &'static str,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, FaucetError>> + Send + 'a>>
       where Self: 'a,
             Self::Output: Send { ... }
    fn within_ctx<'a>(
        self,
        ctx: &'a CallContext,
        op: &'static str,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, FaucetError>> + Send + 'a>>
       where Self: 'a,
             Self::Output: Send { ... }
}
Expand description

Run any future as a one-shot backend call: client.send().within(&slot, "put").await? is CallSlot::call_once for a future whose output is not a FaucetError result (an SDK response), handing that output back untouched. The outer Result is the call context running out — the deadline or the cancel token.

Provided Methods§

Source

fn within<'a>( self, slot: &'a CallSlot, op: &'static str, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, FaucetError>> + Send + 'a>>
where Self: 'a, Self::Output: Send,

self as the call op through slot’s effective context.

Source

fn within_ctx<'a>( self, ctx: &'a CallContext, op: &'static str, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, FaucetError>> + Send + 'a>>
where Self: 'a, Self::Output: Send,

within through a CallContext.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F: Future + Send> CallExt for F