From 4921b29e00901c7ab70c7ce89e017a49b7dad5e7 Mon Sep 17 00:00:00 2001 From: Christofer Nolander Date: Mon, 29 Apr 2024 11:20:33 +0200 Subject: [PATCH] clarify which flags are used for `get_or_put` methods --- heed/src/database.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/heed/src/database.rs b/heed/src/database.rs index 026a2227..b46c33ff 100644 --- a/heed/src/database.rs +++ b/heed/src/database.rs @@ -1997,7 +1997,9 @@ impl Database { } /// Attempt to insert a key-value pair in this database, or if a value already exists for the - /// key, returns the previous value. The entry is written with no specific flag. + /// key, returns the previous value. + /// + /// The entry is always written with the [`NO_OVERWRITE`](PutFlags::NO_OVERWRITE) flag. /// /// ``` /// # use heed::EnvOpenOptions; @@ -2041,7 +2043,10 @@ impl Database { } /// Attempt to insert a key-value pair in this database, or if a value already exists for the - /// key, returns the previous value. The entry is written with the specified flags. + /// key, returns the previous value. + /// + /// The entry is written with the specified flags, in addition to + /// [`NO_OVERWRITE`](PutFlags::NO_OVERWRITE) which is always used. /// /// ``` /// # use heed::EnvOpenOptions; @@ -2113,7 +2118,8 @@ impl Database { /// Attempt to insert a key-value pair in this database, where the value can be directly /// written to disk, or if a value already exists for the key, returns the previous value. /// - /// The entry is written with no specific flags. + /// The entry is always written with the [`NO_OVERWRITE`](PutFlags::NO_OVERWRITE) and + /// [`MDB_RESERVE`](lmdb_master_sys::MDB_RESERVE) flags. /// /// ``` /// # use heed::EnvOpenOptions; @@ -2175,7 +2181,9 @@ impl Database { /// Attempt to insert a key-value pair in this database, where the value can be directly /// written to disk, or if a value already exists for the key, returns the previous value. /// - /// The entry is written with the specified flags. + /// The entry is written with the specified flags, in addition to + /// [`NO_OVERWRITE`](PutFlags::NO_OVERWRITE) and [`MDB_RESERVE`](lmdb_master_sys::MDB_RESERVE) + /// which are always used. /// /// ``` /// # use heed::EnvOpenOptions;