docs.rs failed to build mongo_drop-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
mongo_drop
A Rust library providing an RAII-style guard for MongoDB databases, designed for testing environments. It automatically rolls back changes made to the database within the guard's asynchronous scope using MongoDB change streams and the experimental AsyncDrop
trait.
🚨 WARNING: This crate relies on the experimental async_drop
feature, which is only available on nightly Rust and is subject to change or removal. It is NOT suitable for production use. Use this crate for test helpers or experimentation only.
Usage
Features
tracing
: Enables tracing support for the library.
- Automatic Rollback: Leverages
AsyncDrop
to undo database changes automatically when the guard goes out of scope in anasync
function. - Change Stream Based: Listens to MongoDB change streams to capture modification events.
- Supports DML Rollback: Undoes
Insert
,Update
,Delete
, andReplace
operations using collected pre-images. - Test-Focused: Designed to simplify database state management in integration tests.
Requirements
- Nightly Rust Toolchain: You must use a nightly build of the Rust compiler (
rustup toolchain install nightly
).