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

Method open_readonly

atomic-repository/src/repository/mod.rs:833–837  ·  view source on GitHub ↗

Open an existing repository in read-only mode. This method opens the repository without acquiring a write lock on the database, allowing concurrent read access from multiple processes. It's suitable for read-only operations like `status`, `diff`, `log`, and `change`. Use this method when you only need to query the repository state and don't need to make any modifications. This is especially usef

(path: P)

Source from the content-addressed store, hash-verified

831 /// Merging a legacy layout needs one writable open, exactly like a redb
832 /// format upgrade; afterwards the database is reopened read-only.
833 pub fn open_readonly<P: AsRef<Path>>(path: P) -> Result<Self, RepositoryError> {
834 Self::wait_for_database(DEFAULT_DATABASE_WAIT, || {
835 Self::open_readonly_mode(path.as_ref(), false, false)
836 })
837 }
838
839 /// Open read-only for operation-log diagnosis without performing recovery.
840 ///

Callers

nothing calls this directly

Calls 1

as_refMethod · 0.80

Tested by

no test coverage detected