#[non_exhaustive]pub enum InstrumentationEvent<'a> {
#[non_exhaustive] StartEstablishConnection {
url: &'a str,
},
#[non_exhaustive] FinishEstablishConnection {
url: &'a str,
error: Option<&'a ConnectionError>,
},
#[non_exhaustive] StartQuery {
query: &'a dyn DebugQuery,
},
#[non_exhaustive] CacheQuery {
sql: &'a str,
},
#[non_exhaustive] FinishQuery {
query: &'a dyn DebugQuery,
error: Option<&'a Error>,
},
#[non_exhaustive] BeginTransaction {
depth: NonZeroU32,
},
#[non_exhaustive] CommitTransaction {
depth: NonZeroU32,
},
#[non_exhaustive] RollbackTransaction {
depth: NonZeroU32,
},
}Expand description
This enum describes possible connection events
that can be handled by an Instrumentation implementation
Some fields might contain sensitive information, like login details for the database.
Diesel does not guarantee that future versions will
emit the same events in the same order or timing.
In addition the output of the Debug and Display
implementation of the enum itself and any of its fields
is not guarantee to be stable.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]StartEstablishConnection
An event emitted by before starting establishing a new connection
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]FinishEstablishConnection
An event emitted after establishing a new connection
Fields
This variant is marked as non-exhaustive
url: &'a strThe database url the connection tries is connected to
This might contain sensitive information like the database password
error: Option<&'a ConnectionError>An optional error if the connection failed
#[non_exhaustive]StartQuery
An event that is emitted before executing a query
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]CacheQuery
An event that is emitted when a query is cached in the connection internal prepared statement cache
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]FinishQuery
An event that is emitted after executing a query
Fields
This variant is marked as non-exhaustive
query: &'a dyn DebugQuery#[non_exhaustive]BeginTransaction
An event that is emitted while starting a new transaction
Fields
This variant is marked as non-exhaustive
depth: NonZeroU32Transaction level of the newly started transaction
#[non_exhaustive]CommitTransaction
An event that is emitted while committing a transaction
Fields
This variant is marked as non-exhaustive
depth: NonZeroU32Transaction level of the to be committed transaction
#[non_exhaustive]RollbackTransaction
An event that is emitted while rolling back a transaction
Fields
This variant is marked as non-exhaustive
depth: NonZeroU32Transaction level of the to be rolled back transaction
Implementations§
Source§impl<'a> InstrumentationEvent<'a>
impl<'a> InstrumentationEvent<'a>
Sourcepub fn start_establish_connection(url: &'a str) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn start_establish_connection(url: &'a str) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::StartEstablishConnection event
Sourcepub fn finish_establish_connection(
url: &'a str,
error: Option<&'a ConnectionError>,
) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn finish_establish_connection( url: &'a str, error: Option<&'a ConnectionError>, ) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::FinishEstablishConnection event
Sourcepub fn start_query(query: &'a dyn DebugQuery) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn start_query(query: &'a dyn DebugQuery) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::StartQuery event
Sourcepub fn cache_query(sql: &'a str) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn cache_query(sql: &'a str) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::CacheQuery event
Sourcepub fn finish_query(query: &'a dyn DebugQuery, error: Option<&'a Error>) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn finish_query(query: &'a dyn DebugQuery, error: Option<&'a Error>) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::FinishQuery event
Sourcepub fn begin_transaction(depth: NonZeroU32) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn begin_transaction(depth: NonZeroU32) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::BeginTransaction event
Sourcepub fn rollback_transaction(depth: NonZeroU32) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn rollback_transaction(depth: NonZeroU32) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::RollbackTransaction event
Sourcepub fn commit_transaction(depth: NonZeroU32) -> Self
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
pub fn commit_transaction(depth: NonZeroU32) -> Self
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Create a new InstrumentationEvent::CommitTransaction event
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for InstrumentationEvent<'a>
impl<'a> !RefUnwindSafe for InstrumentationEvent<'a>
impl<'a> !Send for InstrumentationEvent<'a>
impl<'a> !Sync for InstrumentationEvent<'a>
impl<'a> Unpin for InstrumentationEvent<'a>
impl<'a> !UnwindSafe for InstrumentationEvent<'a>
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> AggregateDistinct<Self>where
Self: DistinctDsl,
fn aggregate_distinct(self) -> AggregateDistinct<Self>where
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> AggregateAll<Self>where
Self: AllDsl,
fn aggregate_all(self) -> AggregateAll<Self>where
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> AggregateFilter<Self, P>
fn aggregate_filter<P>(self, f: P) -> AggregateFilter<Self, P>
Source§fn aggregate_order<O>(self, o: O) -> AggregateOrder<Self, O>where
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> AggregateOrder<Self, O>where
Self: OrderAggregateDsl<O>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.