[−][src]Struct sanakirja::MutTxn
A mutable transaction.
Implementations
impl<E: Borrow<Env<Exclusive>> + Clone, T> MutTxn<E, T>
[src]
pub fn mut_txn_begin<'txn>(
&'txn mut self
) -> Result<MutTxn<E, &'txn mut MutTxn<E, T>>, Error>
[src]
&'txn mut self
) -> Result<MutTxn<E, &'txn mut MutTxn<E, T>>, Error>
Start a mutable sub-transaction.
impl<E: Borrow<Env<Exclusive>>, T> MutTxn<E, T>
[src]
pub fn put<R: Rng, K: Representable, V: Representable>(
&mut self,
rng: &mut R,
db: &mut Db<K, V>,
key: K,
value: V
) -> Result<bool, Error>
[src]
&mut self,
rng: &mut R,
db: &mut Db<K, V>,
key: K,
value: V
) -> Result<bool, Error>
Insert a binding to a database, returning false
if and only
if the exact same binding (key and value) was already in the database.
impl<E: Borrow<Env<Exclusive>>, T> MutTxn<E, T>
[src]
pub fn del<R: Rng, K: Representable, V: Representable>(
&mut self,
rng: &mut R,
db: &mut Db<K, V>,
key: K,
value: Option<V>
) -> Result<bool, Error>
[src]
&mut self,
rng: &mut R,
db: &mut Db<K, V>,
key: K,
value: Option<V>
) -> Result<bool, Error>
If value
is None
, delete one of the bindings associated to
key
from the database (without any specific
preference). Else, delete the specified binding if present.
impl<E: Borrow<Env<Exclusive>>, T> MutTxn<E, T>
[src]
pub fn create_db<K: Representable, V: Representable>(
&mut self
) -> Result<Db<K, V>, Error>
[src]
&mut self
) -> Result<Db<K, V>, Error>
Creates a new database, complexity O(1).
pub fn set_root<K: Representable, V: Representable>(
&mut self,
root: usize,
value: Db<K, V>
)
[src]
&mut self,
root: usize,
value: Db<K, V>
)
Sets the specified root to the given value. At most 508 different roots are allowed.
pub fn fork<R: Rng, K: Representable, V: Representable>(
&mut self,
rng: &mut R,
db: &Db<K, V>
) -> Result<Db<K, V>, Error>
[src]
&mut self,
rng: &mut R,
db: &Db<K, V>
) -> Result<Db<K, V>, Error>
Fork a database, in O(log n), where n is the number of pages with reference count at least 2 (this complexity is also O(log |db|)).
pub fn drop<R: Rng, K: Representable, V: Representable>(
&mut self,
rng: &mut R,
db: &Db<K, V>
) -> Result<(), Error>
[src]
&mut self,
rng: &mut R,
db: &Db<K, V>
) -> Result<(), Error>
Drop a database, in O(n).
Trait Implementations
impl<'a, E: Borrow<Env<Exclusive>>, T> Commit for MutTxn<E, &'a mut MutTxn<E, T>>
[src]
impl<E: Borrow<Env<Exclusive>>> Commit for MutTxn<E, ()>
[src]
pub fn commit(self) -> Result<(), Error>
[src]
Commit a transaction. This is guaranteed to be atomic: either the commit succeeds, and all the changes made during the transaction are written to disk. Or the commit doesn't succeed, and we're back to the state just before starting the transaction.
impl<E: Borrow<Env<Exclusive>>, T> Drop for MutTxn<E, T>
[src]
impl<E: Borrow<Env<Exclusive>>, A> LoadPage for MutTxn<E, A>
[src]
impl<E: Borrow<Env<Exclusive>>, T> Transaction for MutTxn<E, T>
[src]
pub fn iter<'a, K: Representable, V: Representable>(
&'a self,
db: &'a Db<K, V>,
key: Option<(K, Option<V>)>
) -> DbIterator<'a, Self, K, V>ⓘNotable traits for DbIterator<'a, T, K, V>
impl<'a, T: Transaction + 'a, K: Representable, V: Representable> Iterator for DbIterator<'a, T, K, V> type Item = (K, V);
[src]
&'a self,
db: &'a Db<K, V>,
key: Option<(K, Option<V>)>
) -> DbIterator<'a, Self, K, V>ⓘ
Notable traits for DbIterator<'a, T, K, V>
impl<'a, T: Transaction + 'a, K: Representable, V: Representable> Iterator for DbIterator<'a, T, K, V> type Item = (K, V);
pub fn rev_iter<'a, K: Representable, V: Representable>(
&'a self,
db: &'a Db<K, V>,
key: Option<(K, Option<V>)>
) -> RevDbIterator<'a, Self, K, V>ⓘNotable traits for RevDbIterator<'a, T, K, V>
impl<'a, T: Transaction + 'a, K: Representable, V: Representable> Iterator for RevDbIterator<'a, T, K, V> type Item = (K, V);
[src]
&'a self,
db: &'a Db<K, V>,
key: Option<(K, Option<V>)>
) -> RevDbIterator<'a, Self, K, V>ⓘ
Notable traits for RevDbIterator<'a, T, K, V>
impl<'a, T: Transaction + 'a, K: Representable, V: Representable> Iterator for RevDbIterator<'a, T, K, V> type Item = (K, V);
pub fn set_cursors<K: Representable, V: Representable>(
&self,
root: &Db<K, V>,
key: Option<(K, Option<V>)>
) -> (Cursor, bool)
[src]
&self,
root: &Db<K, V>,
key: Option<(K, Option<V>)>
) -> (Cursor, bool)
pub fn set_cursors_last<K: Representable, V: Representable>(
&self,
root: &Db<K, V>
) -> Cursor
[src]
&self,
root: &Db<K, V>
) -> Cursor
pub fn root<K: Representable, V: Representable>(
&self,
root: usize
) -> Option<Db<K, V>>
[src]
&self,
root: usize
) -> Option<Db<K, V>>
pub fn get<'a, K: Representable, V: Representable>(
&'a self,
root: &Db<K, V>,
key: K,
value: Option<V>
) -> Option<V>
[src]
&'a self,
root: &Db<K, V>,
key: K,
value: Option<V>
) -> Option<V>
Auto Trait Implementations
impl<E, T> RefUnwindSafe for MutTxn<E, T> where
E: RefUnwindSafe,
T: RefUnwindSafe,
[src]
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<E, T> !Send for MutTxn<E, T>
[src]
impl<E, T> !Sync for MutTxn<E, T>
[src]
impl<E, T> Unpin for MutTxn<E, T> where
E: Unpin,
T: Unpin,
[src]
E: Unpin,
T: Unpin,
impl<E, T> UnwindSafe for MutTxn<E, T> where
E: UnwindSafe,
T: UnwindSafe,
[src]
E: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,