pub trait ReplySink<Reply, DeliveryCx, Pipeline>: Send + Sync {
type Error: Display;
// Required method
fn deliver(
&self,
name: &str,
reply: &Reply,
pipeline: &Pipeline,
cx: &PublishContext<'_, DeliveryCx>,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
}Expand description
The reply-wiring axis: how a handler’s reply value leaves the service.
Selected by the type the include site attaches: a TypedPublisher stack encodes the
reply with its codec and runs its transforms and the scope’s publish pipeline, while a bare
Publisher sends the reply’s bytes as-is (no codec, no transforms, no pipeline). One
PublishingHandler serves both, so the encoded and the byte reply forms differ only in
what pairs at the include site.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<Reply, DeliveryCx, Pipeline, Bare> ReplySink<Reply, DeliveryCx, Pipeline> for Bare
The byte wiring: a bare Publisher sends an AsRef<[u8]> reply unencoded.
impl<Reply, DeliveryCx, Pipeline, Bare> ReplySink<Reply, DeliveryCx, Pipeline> for Bare
The byte wiring: a bare Publisher sends an AsRef<[u8]> reply unencoded.
Source§impl<Reply, DeliveryCx, Pipeline, Leaf, ReplyCodec, Transforms> ReplySink<Reply, DeliveryCx, Pipeline> for TypedPublisher<Leaf, ReplyCodec, Transforms>where
Reply: Serialize + Sync,
DeliveryCx: Sync,
Pipeline: PublishPipeline,
Leaf: Publisher,
ReplyCodec: Codec,
Transforms: PublishTransform<DeliveryCx>,
The encoded wiring: the reply serializes through the stack’s reply codec, then travels the
stack’s transforms and the scope’s publish pipeline.
impl<Reply, DeliveryCx, Pipeline, Leaf, ReplyCodec, Transforms> ReplySink<Reply, DeliveryCx, Pipeline> for TypedPublisher<Leaf, ReplyCodec, Transforms>where
Reply: Serialize + Sync,
DeliveryCx: Sync,
Pipeline: PublishPipeline,
Leaf: Publisher,
ReplyCodec: Codec,
Transforms: PublishTransform<DeliveryCx>,
The encoded wiring: the reply serializes through the stack’s reply codec, then travels the stack’s transforms and the scope’s publish pipeline.