Skip to content

Commit

Permalink
clarify which flags are used for get_or_put methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanderc authored and Kerollmops committed Apr 29, 2024
1 parent 69b188a commit 4921b29
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions heed/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,9 @@ impl<KC, DC, C> Database<KC, DC, C> {
}

/// 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;
Expand Down Expand Up @@ -2041,7 +2043,10 @@ impl<KC, DC, C> Database<KC, DC, C> {
}

/// 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;
Expand Down Expand Up @@ -2113,7 +2118,8 @@ impl<KC, DC, C> Database<KC, DC, C> {
/// 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;
Expand Down Expand Up @@ -2175,7 +2181,9 @@ impl<KC, DC, C> Database<KC, DC, C> {
/// 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;
Expand Down

0 comments on commit 4921b29

Please sign in to comment.