pub struct PublishDynStack(/* private fields */);Expand description
A single static PublishLayer wrapping a runtime-built, frozen list of
PublishDynLayer.
The publish-side counterpart of the consume-side DynStack: the opt-in
escape hatch for a middleware set decided at runtime (from config, a loop, feature flags) that
therefore cannot be a compile-time publish_layer chain.
Add it like any other middleware; only the middleware inside it pay one boxed future per layer.
use std::sync::Arc;
use ruststream::runtime::{PublishDynLayer, PublishDynStack};
fn stack(
middleware: Vec<Arc<dyn PublishDynLayer>>,
) -> PublishDynStack {
PublishDynStack::new(middleware)
}Implementations§
Source§impl PublishDynStack
impl PublishDynStack
Sourcepub fn new(
middleware: impl IntoIterator<Item = Arc<dyn PublishDynLayer>>,
) -> Self
pub fn new( middleware: impl IntoIterator<Item = Arc<dyn PublishDynLayer>>, ) -> Self
Builds a stack from a list of middleware, applied in iteration order (first runs outermost).
Trait Implementations§
Source§impl Clone for PublishDynStack
impl Clone for PublishDynStack
Source§impl Debug for PublishDynStack
impl Debug for PublishDynStack
Source§impl PublishLayer for PublishDynStack
impl PublishLayer for PublishDynStack
Source§fn on_publish<'a, N: PublishPipeline, P: Publisher>(
&'a self,
out: &'a mut Outgoing<'a>,
next: PublishNext<'a, N, P>,
) -> impl Future<Output = Result<(), Box<dyn StdError + Send + Sync>>> + Send + 'a
fn on_publish<'a, N: PublishPipeline, P: Publisher>( &'a self, out: &'a mut Outgoing<'a>, next: PublishNext<'a, N, P>, ) -> impl Future<Output = Result<(), Box<dyn StdError + Send + Sync>>> + Send + 'a
Handle the outgoing message, calling
next to continue the pipeline.Auto Trait Implementations§
impl !RefUnwindSafe for PublishDynStack
impl !UnwindSafe for PublishDynStack
impl Freeze for PublishDynStack
impl Send for PublishDynStack
impl Sync for PublishDynStack
impl Unpin for PublishDynStack
impl UnsafeUnpin for PublishDynStack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request