Struct libpijul_compat::Repository
source · pub struct Repository { /* private fields */ }
Expand description
A repository. All operations on repositories must be done via transactions.
Implementations§
source§impl Repository
impl Repository
sourcepub fn open<P: AsRef<Path>>(path: P, size_increase: Option<u64>) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P, size_increase: Option<u64>) -> Result<Self>
Open a repository, possibly increasing the size of the
underlying file if size_increase
is Some(…)
.
sourcepub unsafe fn open_nolock<P: AsRef<Path>>(
path: P,
size_increase: Option<u64>
) -> Result<Self>
pub unsafe fn open_nolock<P: AsRef<Path>>(
path: P,
size_increase: Option<u64>
) -> Result<Self>
Open a repository, possibly increasing the size of the
underlying file if size_increase
is Some(…)
.
sourcepub unsafe fn close(&mut self)
pub unsafe fn close(&mut self)
Close a repository. It is undefined behaviour to use it afterwards.
sourcepub fn txn_begin(&self) -> Result<Txn<'_>>
pub fn txn_begin(&self) -> Result<Txn<'_>>
Start an immutable transaction. Immutable transactions can run concurrently.
sourcepub fn mut_txn_begin<R: Rng>(&self, r: R) -> Result<MutTxn<'_, R>>
pub fn mut_txn_begin<R: Rng>(&self, r: R) -> Result<MutTxn<'_, R>>
Start a mutable transaction. Mutable transactions exclude each other, but can in principle be run concurrently with immutable transactions. In that case, the immutable transaction only have access to the state of the repository immediately before the mutable transaction started.