SubscribeExt

Trait SubscribeExt 

Source
pub trait SubscribeExt<T>: Stream<Item = T> + Sized {
    // Required method
    fn subscribe<'async_trait, F, Fut, E, OnError>(
        self,
        on_next_func: F,
        on_error_callback: OnError,
        cancellation_token: Option<CancellationToken>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where F: Fn(T, CancellationToken) -> Fut + Clone + Send + Sync + 'static + 'async_trait,
             Fut: Future<Output = Result<(), E>> + Send + 'static + 'async_trait,
             OnError: Fn(E) + Clone + Send + Sync + 'static + 'async_trait,
             T: Debug + Send + Clone + 'static,
             E: Send + 'static + 'async_trait,
             Self: 'async_trait;
}

Required Methods§

Source

fn subscribe<'async_trait, F, Fut, E, OnError>( self, on_next_func: F, on_error_callback: OnError, cancellation_token: Option<CancellationToken>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where F: Fn(T, CancellationToken) -> Fut + Clone + Send + Sync + 'static + 'async_trait, Fut: Future<Output = Result<(), E>> + Send + 'static + 'async_trait, OnError: Fn(E) + Clone + Send + Sync + 'static + 'async_trait, T: Debug + Send + Clone + 'static, E: Send + 'static + 'async_trait, Self: 'async_trait,

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<S, T> SubscribeExt<T> for S
where S: Stream<Item = T> + Send + Unpin + 'static, T: Send + 'static,