MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / shared_database

Method shared_database

atomic-core/src/pristine/txn/pristine.rs:691–696  ·  view source on GitHub ↗

The writable redb handle, for stores that keep their tables in the same repository database. `None` for a read-only pristine. A second `Database` for the same file cannot be opened while this one is alive, even in the same process, so co-located stores must share it.

(&self)

Source from the content-addressed store, hash-verified

689 /// A second `Database` for the same file cannot be opened while this one
690 /// is alive, even in the same process, so co-located stores must share it.
691 pub fn shared_database(&self) -> Option<Arc<Database>> {
692 match &self.db {
693 PristineDatabase::Writable(db, _) => Some(Arc::clone(db)),
694 PristineDatabase::ReadOnly(_) => None,
695 }
696 }
697
698 /// Begin a read-only transaction
699 ///

Calls

no outgoing calls