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.
Auto Trait Implementations§
impl !Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more