Skip to main content

OutSlot

Derive Macro OutSlot 

Source
#[derive(OutSlot)]
Expand description

Derives OutSlot for a unit struct, making it a slot marker for Out<impl Publisher, Marker> handler parameters. The marker’s NAME is the struct’s identifier, used by startup errors and test assertions.

ⓘ
#[derive(OutSlot)]
struct Encoded;

#[subscriber("chunks", raw)]
async fn transcode(chunk: &[u8], Out(out): Out<impl Publisher, Encoded>) -> HandlerResult {
    /* ... */
}
// include site: b.include(transcode).out(Encoded, KafkaPublish::default());