[][src]Trait act_zero::async_fn::AsyncMutFnOnce

pub trait AsyncMutFnOnce<T> {
    type Output: Send + 'static;
    fn call(self, arg: &mut T) -> BoxFuture<'_, Self::Output>;
fn call_boxed(self: Box<Self>, arg: &mut T) -> BoxFuture<'_, Self::Output>; fn map<G, R>(self, g: G) -> AsyncMap<Self, G>
    where
        G: FnOnce(Self::Output, &mut 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 &mut 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: &mut T) -> BoxFuture<'_, Self::Output>

Call this function.

fn call_boxed(self: Box<Self>, arg: &mut 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, &mut 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> AsyncMutFnOnce<T> for Box<F> where
    F: AsyncMutFnOnce<T>, 
[src]

type Output = F::Output

Loading content...

Implementors

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

type Output = R

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

type Output = R

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

type Output = ()

Loading content...