Skip to main content

PublishPipeline

Trait PublishPipeline 

Source
pub trait PublishPipeline: Send + Sync {
    // Required method
    fn run<'a>(
        &'a self,
        out: &'a mut Outgoing<'a>,
        send: &'a dyn ErasedPublisher,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError + Send + Sync>>> + Send + 'a>>;
}
Expand description

A static, app-wide publish pipeline: an around-style chain of PublishLayer ending in the broker send.

The publish-side analog of the consume-side static Stack / Identity: the app’s publish middleware (added with RustStream::publish_layer) compose into a concrete type, so the default path (PublishIdentity, no middleware) is a zero-cost direct send with no dyn dispatch. You rarely name this trait; it is built for you. (A runtime-composed escape hatch, the publish counterpart of DynStack, can be layered in later without changing this contract.)

Required Methods§

Source

fn run<'a>( &'a self, out: &'a mut Outgoing<'a>, send: &'a dyn ErasedPublisher, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError + Send + Sync>>> + Send + 'a>>

Runs out through the remaining middleware, then sends it via send.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§