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,