We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4952436 + c66f600 commit 8788180Copy full SHA for 8788180
src/handle.rs
@@ -60,6 +60,16 @@ impl<Db: HasStorage> Handle<Db> {
60
Arc::get_mut(self.db_mut()).expect("other threads remain active despite cancellation")
61
}
62
63
+ /// Returns the inner database, consuming the handle.
64
+ ///
65
+ /// If other handles are active, this method sets the cancellation flag
66
+ /// and blocks until they are dropped.
67
+ pub fn into_inner(mut self) -> Db {
68
+ self.cancel_others();
69
+ Arc::into_inner(self.db.take().unwrap())
70
+ .expect("other threads remain active despite cancellation")
71
+ }
72
+
73
// ANCHOR: cancel_other_workers
74
/// Sets cancellation flag and blocks until all other workers with access
75
/// to this storage have completed.
0 commit comments