Skip to main content

TransportInterceptor

Trait TransportInterceptor 

Source
pub trait TransportInterceptor:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn intercept<'a>(
        &'a self,
        context: TransportContext,
        next: CallHandler<'a, Option<TransportReply>>,
    ) -> BoxFuture<'a, Result<Option<TransportReply>>> { ... }
    fn before(
        &self,
        _context: TransportContext,
    ) -> BoxFuture<'static, Result<()>> { ... }
    fn after(
        &self,
        _context: TransportContext,
        reply: Option<TransportReply>,
    ) -> BoxFuture<'static, Result<Option<TransportReply>>> { ... }
}
Expand description

Around-handler hook for transport message patterns.

Provided Methods§

Source

fn intercept<'a>( &'a self, context: TransportContext, next: CallHandler<'a, Option<TransportReply>>, ) -> BoxFuture<'a, Result<Option<TransportReply>>>

Run around the remaining transport pipeline.

Override this method to recover downstream errors, retry the remaining pipeline, or return a reply without calling next. The default implementation preserves the legacy before and after hook behavior.

Source

fn before(&self, _context: TransportContext) -> BoxFuture<'static, Result<()>>

Source

fn after( &self, _context: TransportContext, reply: Option<TransportReply>, ) -> BoxFuture<'static, Result<Option<TransportReply>>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§