pub trait MessageInterceptor: Send + Sync {
// Provided methods
fn before_handle(&self, meta: &Metadata) -> SpanGuard { ... }
fn outgoing(&self, parent: &Metadata) -> Metadata { ... }
}Expand description
A Props-level hook that observes message handling for cross-cutting concerns such as distributed tracing. Default methods are no-ops, so an interceptor only overrides what it needs.
The default [TraceContextInterceptor]-style behaviour (linking parent →
child spans) is provided by atomr-telemetry (FR-11); core only defines the
hook so domain message types stay clean.
Provided Methods§
Sourcefn before_handle(&self, meta: &Metadata) -> SpanGuard
fn before_handle(&self, meta: &Metadata) -> SpanGuard
Called immediately before Actor::handle with
the incoming message’s metadata. The returned SpanGuard is dropped
once handling completes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".