diesel::connection

Trait Instrumentation

source
pub trait Instrumentation: Send + 'static {
    // Required method
    fn on_connection_event(&mut self, event: InstrumentationEvent<'_>);
}
Expand description

A type that provides an connection Instrumentation

This trait is the basic building block for logging or otherwise instrumenting diesel connection types. It acts as callback that receives information about certain important connection states

For simple usages this trait is implemented for closures accepting a InstrumentationEvent as argument.

More complex usages and integrations with frameworks like tracing and log are supposed to be part of their own crates.

Required Methods§

source

fn on_connection_event(&mut self, event: InstrumentationEvent<'_>)

The function that is invoced for each event

Trait Implementations§

source§

impl Instrumentation for Box<dyn Instrumentation>

source§

fn on_connection_event(&mut self, event: InstrumentationEvent<'_>)

The function that is invoced for each event

Implementations on Foreign Types§

source§

impl Instrumentation for Box<dyn Instrumentation>

source§

impl<T> Instrumentation for Option<T>
where T: Instrumentation,

Implementors§

source§

impl<F> Instrumentation for F
where F: FnMut(InstrumentationEvent<'_>) + Send + 'static,