summaryrefslogtreecommitdiff
path: root/rust/src/database.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-03-13 12:19:41 -0700
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-03-24 18:46:48 -0700
commit938e9506996df13b3f08419854aa73c7d24f2d44 (patch)
treefe86a80be40e2ae2db4e4f34eebfeccd1672bd8b /rust/src/database.rs
parent61e4e7e772b9c427bf190f8557afc466d0488848 (diff)
[Rust] Misc docs
Diffstat (limited to 'rust/src/database.rs')
-rw-r--r--rust/src/database.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/rust/src/database.rs b/rust/src/database.rs
index 4f2b3f6a..f0627306 100644
--- a/rust/src/database.rs
+++ b/rust/src/database.rs
@@ -30,7 +30,7 @@ impl Database {
Ref::new(Self { handle })
}
- /// Get a snapshot by its id, or None if no snapshot with that id exists
+ /// Get a [`Snapshot`] by its `id`, or `None` if no snapshot with that `id` exists.
pub fn snapshot_by_id(&self, id: SnapshotId) -> Option<Ref<Snapshot>> {
let result = unsafe { BNGetDatabaseSnapshot(self.handle.as_ptr(), id.0) };
NonNull::new(result).map(|handle| unsafe { Snapshot::ref_from_raw(handle) })
@@ -113,8 +113,9 @@ impl Database {
SnapshotId(new_id)
}
- /// Trim a snapshot's contents in the database by id, but leave the parent/child
- /// hierarchy intact. Future references to this snapshot will return False for has_contents
+ /// Trim a snapshot's contents in the database but leave the parent/child hierarchy intact.
+ ///
+ /// NOTE: Future references to this snapshot will return `false` for [`Database::snapshot_has_data`]
pub fn trim_snapshot(&self, id: SnapshotId) -> Result<(), ()> {
if unsafe { BNTrimDatabaseSnapshot(self.handle.as_ptr(), id.0) } {
Ok(())
@@ -193,6 +194,7 @@ impl Database {
unsafe { KeyValueStore::ref_from_raw(NonNull::new(result).unwrap()) }
}
+ /// Closes then reopens the database.
pub fn reload_connection(&self) {
unsafe { BNDatabaseReloadConnection(self.handle.as_ptr()) }
}