Skip to main content

GrpcQueryInterceptor

Trait GrpcQueryInterceptor 

Source
pub trait GrpcQueryInterceptor {
    type Error: ErrorExt;

    // Provided methods
    fn pre_execute(
        &self,
        _request: &Request,
        _query_ctx: QueryContextRef,
    ) -> Result<(), Self::Error> { ... }
    fn pre_bulk_insert(
        &self,
        _table: TableRef,
        _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 pre_bulk_insert( &self, _table: TableRef, _query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

Called before bulk insert is 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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

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

Source§

type Error = E

Source§

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

Source§

fn pre_bulk_insert( &self, _table: TableRef, _query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

Source§

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

Implementors§