Skip to main content

Module interceptor

Module interceptor 

Source
Expand description

Inbound and outbound message interceptors. Inbound interceptor pipeline.

Interceptors form an ordered pipeline executed before the actor’s handler. Each interceptor can inspect, modify headers, delay, drop, or reject a message before it reaches the handler. After handler completion, interceptors are notified via on_complete.

Structs§

DropNotice
Information about a dropped message or stream item. Passed to DropObserver::on_drop so the runtime never silently discards items.
InboundContext
Metadata about an inbound message and its target actor.
InterceptResult
Result of running an interceptor pipeline. Pairs the final Disposition with the name of the interceptor that produced it (empty for Continue).
OutboundContext
Metadata about an outbound message, provided to outbound interceptors.

Enums§

Disposition
The decision returned by an interceptor after inspecting a message.
Outcome
Result reported to interceptors after handler execution completes.
SendMode
How the message was sent to the actor.

Traits§

DropObserver
Global observer for interceptor-driven drops.
InboundInterceptor
An interceptor that observes or modifies inbound messages. Interceptors form an ordered pipeline executed before the handler.
OutboundInterceptor
An outbound interceptor that runs on the SENDER side before the message is delivered to the target actor’s mailbox.

Functions§

intercept_outbound_stream_item
Run outbound interceptors’ on_expand_item for a single item. Returns the first non-Continue disposition with the interceptor name.
notify_drop
Notify the drop observer when an interceptor drops an item. If no observer is registered, the drop is silent — the application is responsible for registering an observer if it wants visibility.