Trait servers::interceptor::LineProtocolInterceptor

source ·
pub trait LineProtocolInterceptor {
    type Error: ErrorExt;

    // Provided methods
    fn pre_execute(
        &self,
        _line: &str,
        _query_ctx: QueryContextRef,
    ) -> Result<(), Self::Error> { ... }
    fn post_lines_conversion<'life0, 'async_trait>(
        &'life0 self,
        requests: RowInsertRequests,
        query_context: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Result<RowInsertRequests, Self::Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

LineProtocolInterceptor can track life cycle of a line protocol request and customize or abort its execution at given point.

Required Associated Types§

source

type Error: ErrorExt

Provided Methods§

source

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

source

fn post_lines_conversion<'life0, 'async_trait>( &'life0 self, requests: RowInsertRequests, query_context: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<RowInsertRequests, Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Called after the lines are converted to the [RowInsertRequests]. We can then modify the resulting requests if needed. Typically used in some backward compatibility situation.

Implementations on Foreign Types§

source§

impl<E: ErrorExt> LineProtocolInterceptor for Option<LineProtocolInterceptorRef<E>>

§

type Error = E

source§

fn pre_execute( &self, line: &str, query_ctx: QueryContextRef, ) -> Result<(), Self::Error>

source§

fn post_lines_conversion<'life0, 'async_trait>( &'life0 self, requests: RowInsertRequests, query_context: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<RowInsertRequests, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§