Trait PublisherExt

Source
pub trait PublisherExt<T>: Publisher<T> {
    // Provided methods
    fn with<F, Input, Output>(self, f: F) -> With<Self, F, Output>
       where F: Fn(&Input) -> Result<Output>,
             Self: Sized { ... }
    fn publish_all<'life0, 'async_trait, S>(
        &'life0 self,
        stream: S,
        max_concurrency: impl 'async_trait + Into<Option<usize>> + Send,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where T: Send,
             S: 'async_trait + TryStream<Ok = T, Error = Error> + Send + Unpin,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Extension trait for Publisher.

This trait provides additional functionality for Publisher, similar to how futures::SinkExt does for futures::Sink.

Provided Methods§

Source

fn with<F, Input, Output>(self, f: F) -> With<Self, F, Output>
where F: Fn(&Input) -> Result<Output>, Self: Sized,

Compose a function in front of the publisher.

Source

fn publish_all<'life0, 'async_trait, S>( &'life0 self, stream: S, max_concurrency: impl 'async_trait + Into<Option<usize>> + Send, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where T: Send, S: 'async_trait + TryStream<Ok = T, Error = Error> + Send + Unpin, Self: Sync + 'async_trait, 'life0: 'async_trait,

Drive the given stream to completion, publishing each yielded item concurrently.

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<T, Item> PublisherExt<Item> for T
where T: Publisher<Item> + ?Sized,