AsyncJoin

Trait AsyncJoin 

Source
pub trait AsyncJoin {
    type Item;
    type Error: Error + 'static;

    // Required method
    fn async_join<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Asynchronous join handle

Provides an executor-agnostic abstraction over joining an asynchronous task

Required Associated Types§

Source

type Item

Item being joined

Source

type Error: Error + 'static

Error type for failed joins

Required Methods§

Source

fn async_join<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Asynchronously join this task

§Errors

Returns an error if joining the task fails

Implementations on Foreign Types§

Source§

impl<T> AsyncJoin for JoinHandle<T>
where T: Send,

Source§

type Item = T

Source§

type Error = Infallible

Source§

fn async_join<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Source§

impl<T> AsyncJoin for BoxFuture<'static, T>
where T: Send,

Source§

type Item = T

Source§

type Error = Infallible

Source§

fn async_join<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Self::Item, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Implementors§

Source§

impl<T> AsyncJoin for ThreadJoin<T>
where T: Send,