pub trait UnsendSpawner {
    type Handle<T: Send>: Future<Output = Result<T, JoinError>> + Send + Unpin;

    // Required method
    fn spawn<Fut>(future: Fut) -> Self::Handle<<Fut as Future>::Output>
       where Fut: Future + 'static,
             <Fut as Future>::Output: Send + 'static;
}
Expand description

The mechanism used to spawn Unsend futures, making them Send

Required Associated Types§

source

type Handle<T: Send>: Future<Output = Result<T, JoinError>> + Send + Unpin

The Handle to the job, implements a Send future with the Job’s output

Required Methods§

source

fn spawn<Fut>(future: Fut) -> Self::Handle<<Fut as Future>::Output>
where Fut: Future + 'static, <Fut as Future>::Output: Send + 'static,

Spawn the unsend future producing a Send handle

Object Safety§

This trait is not object safe.

Implementors§

source§

impl UnsendSpawner for ActixSpawner

§

type Handle<T: Send> = ActixHandle<T>