From cda37c6c22200bbeb85cca91808ab88da5fa8d01 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Sun, 3 Mar 2024 14:32:45 -0500 Subject: [PATCH] env: add `heed` invariant upholding note --- heed/src/env.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/heed/src/env.rs b/heed/src/env.rs index 842cb6bc..4bbd1cf0 100644 --- a/heed/src/env.rs +++ b/heed/src/env.rs @@ -205,30 +205,30 @@ impl EnvOpenOptions { /// /// These are some things to take note of: /// - /// - Do not call [`EnvOpenOptions::open`] twice in the same process, at the same time [^2] - /// - Avoid long-lived transactions, they will cause the database to grow quickly [^3] - /// - Avoid aborting your process with an active transaction [^4] - /// - Do not use LMDB on remote filesystems, even between processes on the same host [^5] - /// - You must manage concurrent accesses yourself if using [`EnvFlags::NO_LOCK`] [^6] + /// - Avoid long-lived transactions, they will cause the database to grow quickly [^2] + /// - Avoid aborting your process with an active transaction [^3] + /// - Do not use LMDB on remote filesystems, even between processes on the same host [^4] + /// - You must manage concurrent accesses yourself if using [`EnvFlags::NO_LOCK`] [^5] + /// - Anything that causes LMDB's lock file to be broken will cause synchronization issues and may introduce UB [^6] /// - /// Anything that causes the lock file to be broken (whether listed here or not) - /// will cause synchronization issues and may introduce UB. [^7] + /// `heed` itself upholds some safety invariants, including but not limited to: + /// - Calling [`EnvOpenOptions::open`] twice in the same process, at the same time is OK [^7] /// /// For more details, it is highly recommended to read LMDB's official documentation. [^8] /// /// [^1]: /// - /// [^2]: + /// [^2]: /// - /// [^3]: + /// [^3]: /// - /// [^4]: + /// [^4]: /// /// [^5]: /// - /// [^6]: + /// [^6]: /// - /// [^7]: + /// [^7]: /// /// [^8]: pub unsafe fn open>(&self, path: P) -> Result {