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§
Sourcefn on_connection_event(&mut self, event: InstrumentationEvent<'_>)
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>
impl Instrumentation for Box<dyn Instrumentation>
Source§fn on_connection_event(&mut self, event: InstrumentationEvent<'_>)
fn on_connection_event(&mut self, event: InstrumentationEvent<'_>)
The function that is invoced for each event