pub struct Bolt { /* private fields */ }
Expand description
The Bolt Database
Implementations§
Source§impl Bolt
impl Bolt
Sourcepub fn open<T: AsRef<Path>>(path: T) -> Result<Self>
pub fn open<T: AsRef<Path>>(path: T) -> Result<Self>
Open creates and opens a database at the given path. If the file does not exist then it will be created automatically.
Trait Implementations§
Source§impl DbApi for Bolt
impl DbApi for Bolt
Source§fn view<'tx, F: FnMut(TxRef<'tx>) -> Result<()>>(&'tx self, f: F) -> Result<()>
fn view<'tx, F: FnMut(TxRef<'tx>) -> Result<()>>(&'tx self, f: F) -> Result<()>
View executes a function within the context of a managed read-only transaction.
Any error that is returned from the function is returned from the View() method. Read more
Source§impl DbRwAPI for Bolt
impl DbRwAPI for Bolt
Source§fn begin_rw(&mut self) -> Result<impl TxRwApi<'_>>
fn begin_rw(&mut self) -> Result<impl TxRwApi<'_>>
Starts a new transaction.
Multiple read-only transactions can be used concurrently but only one
write transaction can be used at a time. Starting multiple write transactions
will cause the calls to block and be serialized until the current write
transaction finishes. Read more
Source§fn update<'tx, F: FnMut(TxRwRef<'tx>) -> Result<()>>(
&'tx mut self,
f: F,
) -> Result<()>
fn update<'tx, F: FnMut(TxRwRef<'tx>) -> Result<()>>( &'tx mut self, f: F, ) -> Result<()>
Executes a function within the context of a read-write managed transaction. Read more
Auto Trait Implementations§
impl Freeze for Bolt
impl !RefUnwindSafe for Bolt
impl Send for Bolt
impl Sync for Bolt
impl Unpin for Bolt
impl !UnwindSafe for Bolt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more