Skip to main content

LineProtocolInterceptor

Trait 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.

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: ErrorExt> LineProtocolInterceptor for Option<LineProtocolInterceptorRef<E>>

Source§

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§