Re-exports§
pub use utils::*;
Modules§
- boxed
- callsite
- Callsites represent the source locations from which spans or events originate.
- dispatcher
- Dispatches trace events to
Subscriber
s. - event
- Events represent single points in time during the execution of a program.
- field
Span
andEvent
key-value data.- instrument
- Attach a span to a
std::future::Future
. - level_
filters - Trace verbosity level filtering.
- metadata
- Metadata describing trace data.
- span
- Spans represent periods of time in which a program was executing in a particular context.
- subscriber
- Collects and records trace data.
- tests
- Testing utilities for working with database handlers in a mock environment
- transaction
- utils
Macros§
- boxed_
async - Macro to automatically box an async block for use with the boxed database API
- db_test
- A more ergonomic macro for database operations that hides all the boxing complexity
- debug
- Constructs an event at the debug level.
- debug_
span - Constructs a span at the debug level.
- enabled
- Checks whether a span or event is enabled based on the provided metadata.
- error
- Constructs an event at the error level.
- error_
span - Constructs a span at the error level.
- event
- Constructs a new
Event
. - event_
enabled - Tests whether an event with the specified level and target would be enabled.
- impl_
transaction_ handler - Macro to implement the TransactionHandler trait for a type
- info
- Constructs an event at the info level.
- info_
span - Constructs a span at the info level.
- metadata
- Statically constructs new span metadata.
- setup
- A macro to simplify setting up a database
- setup_
and_ transaction - A macro to simplify both setup and transaction phases
- span
- Constructs a new span.
- span_
enabled - Tests whether a span with the specified level and target would be enabled.
- trace
- Constructs an event at the trace level.
- trace_
span - Constructs a span at the trace level.
- transaction
- A macro to simplify running a transaction
- warn
- Constructs an event at the warn level.
- warn_
span - Constructs a span at the warn level.
Structs§
- AndThen
Handler - Handler that executes two handlers in sequence
- Boxed
Database Entry Point - Entry point for database operations with automatic boxing of closures
- Database
Config - Configuration for database connections
- Database
Name - A unique database name
- Database
Transaction Handler - Handler that combines a database instance with transaction management
- DbTransaction
Handler Wrapper - Helper wrapper for DatabaseTransactionHandler
- Dispatch
Dispatch
trace data to aSubscriber
.- Event
Event
s represent single points in time where something occurred during the execution of a program.- Id
- Identifies a span within the context of a subscriber.
- Level
- Describes the level of verbosity of a span or event.
- Metadata
- Metadata describing a span or event.
- Mock
Connection For - Mock
Transaction For - Setup
Handler - Handler for database setup operations
- Setup
Handler Wrapper - Helper wrapper for SetupHandler
- Span
- A handle representing a span, with the capability to enter the span if it exists.
- Test
Context - A test context that contains a database instance
- Test
Database Instance - A test database that handles setup, connections, and cleanup TODO: Create a TestManager that can handle connection pooling and cleanup
- Transaction
FnHandler - Handler for executing functions within a transaction
- Transaction
FnHandler Wrapper - Helper wrapper for TransactionFnHandler
Traits§
- Callsite
- Trait implemented by callsites.
- Database
Backend - Trait defining a test database abstraction
- Database
Handler - Trait for handlers that can be executed in the context of a database
- Database
Pool - Instrument
- Attaches spans to a
std::future::Future
. - Into
Transaction Handler - A trait for converting types into transaction handlers
- Subscriber
- Trait representing the functions required to collect trace data.
- Test
Database Connection - Transaction
Handler - A trait for handlers that can work with transactions
- Transaction
Starter - A helper trait to simplify type constraints
- Value
- A field value of an erased type.
Functions§
- init_
tracing - Initialize tracing for the application. Only initializes if RUST_ENV is set to “DEBUG”
- run_
with_ database - Helper function to run a handler with a new database
- setup
- Create a new setup handler
- with_
boxed_ database - Create a new database entry point with the given backend
- with_
boxed_ database_ config - Create a new database entry point with the given backend and config
- with_
connection - Execute a function with a newly created connection and automatically close it
- with_
connection_ string - Execute a function with a newly created connection using a connection string
- with_
database - Database handlers for the testkit crate
- with_
database_ config - Database handlers for the testkit crate
- with_
db_ transaction - Create a new database transaction handler
- with_
transaction - Create a new transaction function handler
Attribute Macros§
- instrument
- Instruments a function to create and enter a
tracing
span every time the function is called.