[][src]Struct act_zero::async_fn::Closure

pub struct Closure<R, F, P> { /* fields omitted */ }

Rust does not support async closures, and is incapable of inferring the correct lifetimes for closures returning an async move { ... } block which captures a non-'static argument to the closure. To solve this problem, we introduce this explicit closure type, which takes a stand-alone async fn expecting two arguments, and binds the second argument to a closure "upvar" passed in at construction.

Implementations

impl<R, F, P> Closure<R, F, P>[src]

pub fn new(fun: F, upvar: P) -> Self[src]

Constructor. fun should implement ClosureFn or ClosureFnMut for this to be useful.

Trait Implementations

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

Output type of the returned future.

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

Output type of the returned future.

Auto Trait Implementations

impl<R, F, P> RefUnwindSafe for Closure<R, F, P> where
    F: RefUnwindSafe,
    P: RefUnwindSafe

impl<R, F, P> Send for Closure<R, F, P> where
    F: Send,
    P: Send

impl<R, F, P> Sync for Closure<R, F, P> where
    F: Sync,
    P: Sync

impl<R, F, P> Unpin for Closure<R, F, P> where
    F: Unpin,
    P: Unpin

impl<R, F, P> UnwindSafe for Closure<R, F, P> where
    F: UnwindSafe,
    P: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, E> IntoResult<T, E> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.