diff --git a/src/trace.rs b/src/trace.rs index de03742..b3c9939 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -1,3 +1,4 @@ +//! Tracing and profiling functions. Error and warning log. use libc::{c_char, c_int, c_void}; use std::ffi::CString; use std::ptr; @@ -30,12 +31,16 @@ pub fn log(err_code: c_int, msg: &str) { } } +/// The trace callback function signature. pub type TraceCallback = Option; +/// The profile callback function signature. pub type ProfileCallback = Option; + impl SqliteConnection { /// Register or clear a callback function that can be used for tracing the execution of SQL statements. + /// /// Prepared statement placeholders are replaced/logged with their assigned values. /// There can only be a single tracer defined for each database connection. /// Setting a new tracer clears the old one. @@ -44,6 +49,7 @@ impl SqliteConnection { unsafe { ffi::sqlite3_trace(c.db(), x_trace, ptr::null_mut()); } } /// Register or clear a callback function that can be used for profiling the execution of SQL statements. + /// /// There can only be a single profiler defined for each database connection. /// Setting a new profiler clears the old one. pub fn profile(&mut self, x_profile: ProfileCallback) {