Skip to main content

Module closure

Module closure 

Source
Expand description

Helpers for defining and calling ThreadAware closures.

Structs§

AsyncClosure
Async equivalent of Closure - can be called multiple times by shared reference.
AsyncClosureMut
Async equivalent of ClosureMut - can be called multiple times by mutable reference.
AsyncClosureOnce
Async equivalent of ClosureOnce - can be called exactly once, consuming self.
Closure
A common implementation of ThreadAwareFn.
ClosureMut
A common implementation of ThreadAwareFnMut.
ClosureOnce
A common implementation of ThreadAwareFnOnce.

Traits§

ThreadAwareAsyncFn
Async equivalent of ThreadAwareFn - calls the closure by shared reference, returning a BoxFuture.
ThreadAwareAsyncFnMut
Async equivalent of ThreadAwareFnMut - calls the closure by mutable reference, returning a BoxFuture.
ThreadAwareAsyncFnOnce
Async equivalent of ThreadAwareFnOnce - calls the closure once, returning a BoxFuture.
ThreadAwareFn
Marks Fn()-like closure whose captured values all implement ThreadAware.
ThreadAwareFnMut
Marks FnMut()-like closure whose captured values all implement ThreadAware.
ThreadAwareFnOnce
Marks FnOnce()-like closures whose captured values all implement ThreadAware.

Functions§

async_closure
Constructs an AsyncClosure - the async equivalent of closure.
async_closure_mut
Constructs an AsyncClosureMut - the async equivalent of closure_mut.
async_closure_once
Constructs an AsyncClosureOnce - the async equivalent of closure_once.
closure
Constructs a Closure.
closure_mut
Constructs a ClosureMut.
closure_once
Constructs a ClosureOnce.

Type Aliases§

BoxFuture
A boxed, pinned, Send future - the return type of async closure calls.