From 938e9506996df13b3f08419854aa73c7d24f2d44 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 13 Mar 2026 12:19:41 -0700 Subject: [Rust] Misc docs --- rust/src/database.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'rust/src/database.rs') 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> { 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()) } } -- cgit v1.3.1