Trait servers::interceptor::GrpcQueryInterceptor

source ·
pub trait GrpcQueryInterceptor {
    type Error: ErrorExt;

    // Provided methods
    fn pre_execute(
        &self,
        _request: &Request,
        _query_ctx: QueryContextRef,
    ) -> Result<(), Self::Error> { ... }
    fn post_execute(
        &self,
        output: Output,
        _query_ctx: QueryContextRef,
    ) -> Result<Output, Self::Error> { ... }
}
Expand description

GrpcQueryInterceptor can track life cycle of a grpc request and customize or abort its execution at given point.

Required Associated Types§

source

type Error: ErrorExt

Provided Methods§

source

fn pre_execute( &self, _request: &Request, _query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

Called before request is actually executed.

source

fn post_execute( &self, output: Output, _query_ctx: QueryContextRef, ) -> Result<Output, Self::Error>

Called after execution finished. The implementation can modify the output if needed.

Implementations on Foreign Types§

source§

impl<E> GrpcQueryInterceptor for Option<&GrpcQueryInterceptorRef<E>>
where E: ErrorExt,

§

type Error = E

source§

fn pre_execute( &self, _request: &Request, _query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

source§

fn post_execute( &self, output: Output, _query_ctx: QueryContextRef, ) -> Result<Output, Self::Error>

Implementors§