[][src]Trait act_zero::async_fn::AsyncFnOnce

pub trait AsyncFnOnce<T> {
    type Output: Send + 'static;
    fn call(self, arg: &T) -> BoxFuture<Self::Output>;
fn call_boxed(self: Box<Self>, arg: &T) -> BoxFuture<Self::Output>; fn map<G, R>(self, g: G) -> AsyncMap<Self, G>
    where
        G: FnOnce(Self::Output, &T) -> R,
        Self: Sized
, { ... }
fn bind_output(
        self,
        tx: Sender<Self::Output>
    ) -> BindOutput<Self, Self::Output>
    where
        Self: Sized
, { ... } }

Trait for async methods which take &T as the argument type.

Associated Types

type Output: Send + 'static

Output type of the returned future.

Loading content...

Required methods

fn call(self, arg: &T) -> BoxFuture<Self::Output>

Call this function.

fn call_boxed(self: Box<Self>, arg: &T) -> BoxFuture<Self::Output>

Call this function when self is boxed.

Loading content...

Provided methods

fn map<G, R>(self, g: G) -> AsyncMap<Self, G> where
    G: FnOnce(Self::Output, &T) -> R,
    Self: Sized

Similar to FutureExt::map, except the callback also has access to the argument.

fn bind_output(self, tx: Sender<Self::Output>) -> BindOutput<Self, Self::Output> where
    Self: Sized

Bind the output of this async function to this oneshot channel: when the future completes, the output will be sent on the channel.

Loading content...

Implementations on Foreign Types

impl<T, F: ?Sized> AsyncFnOnce<T> for Box<F> where
    F: AsyncFnOnce<T>, 
[src]

type Output = F::Output

Loading content...

Implementors

impl<F, G, T, R> AsyncFnOnce<T> for AsyncMap<F, G> where
    F: AsyncFnOnce<T>,
    G: FnOnce(F::Output, &T) -> R + Send + 'static,
    R: Send + 'static,
    T: Sync
[src]

type Output = R

impl<F, T, P, R> AsyncFnOnce<T> for Closure<R, F, P> where
    F: for<'a> ClosureFn<'a, T, P, R>,
    R: Send + 'static, 
[src]

type Output = R

impl<F, T, R> AsyncFnOnce<T> for BindOutput<F, R> where
    F: AsyncFnOnce<T, Output = R>,
    R: Send + 'static, 
[src]

type Output = ()

Loading content...