BackendStreamingTask

Trait BackendStreamingTask 

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

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

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

A task of kind T that can be run on a backend, returning a stream of outputs 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_stream( self, backend: &Bkend, ) -> impl Stream<Item = Self::Output> + Send + Unpin + '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, S, F, Ct> BackendStreamingTask<Bkend> for Then<T, F>
where Bkend: Clone + Sync + Send + 'static, F: Sync + Send + 'static + FnOnce(T::Output) -> S, T: BackendTask<Bkend, MetadataType = Ct>, S: BackendStreamingTask<Bkend, MetadataType = Ct>, Ct: PartialEq,

Source§

impl<Bkend, T, S, F, Ct, O, E> BackendStreamingTask<Bkend> for Map<T, F>
where Bkend: Clone + Sync + Send + 'static, F: Sync + Send + 'static + FnOnce(O) -> S, T: BackendTask<Bkend, MetadataType = Ct, Output = Result<O, E>>, S: BackendStreamingTask<Bkend, MetadataType = Ct>, Ct: PartialEq, E: Send + 'static, O: Send,