async_callback_manager

Trait BackendTask

Source
pub trait BackendTask<Bkend>: Send + Any {
    type Output: Send;
    type MetadataType: PartialEq;

    // Required method
    fn into_future(
        self,
        backend: &Bkend,
    ) -> impl Future<Output = Self::Output> + Send + 'static;

    // Provided method
    fn metadata() -> Vec<Self::MetadataType> { ... }
}
Expand description

A task of kind T that can be run on a backend, returning a future of output Output. The type must implement Any, as the TypeId is used as part of the task management process.

Required Associated Types§

Required Methods§

Source

fn into_future( self, backend: &Bkend, ) -> impl Future<Output = Self::Output> + Send + 'static

Provided Methods§

Source

fn metadata() -> Vec<Self::MetadataType>

Metadata provides a way of grouping different tasks for use in constraints, if you override the default implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Bkend, T, T2, F, Ct> BackendTask<Bkend> for Then<T, F>
where Bkend: Clone + Send + 'static, F: Sync + Send + 'static + FnOnce(T::Output) -> T2, T: BackendTask<Bkend, MetadataType = Ct>, T2: BackendTask<Bkend, MetadataType = Ct>, Ct: PartialEq,

Source§

type Output = <T2 as BackendTask<Bkend>>::Output

Source§

type MetadataType = Ct