[][src]Struct sanakirja::MutTxn

pub struct MutTxn<E: Borrow<Env<Exclusive>>, T> { /* fields omitted */ }

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]

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]

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]

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]

Creates a new database, complexity O(1).

pub fn set_root<K: Representable, V: Representable>(
    &mut self,
    root: usize,
    value: Db<K, V>
)
[src]

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]

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]

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(mut self: 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]

Auto Trait Implementations

impl<E, T> RefUnwindSafe for MutTxn<E, T> where
    E: RefUnwindSafe,
    T: RefUnwindSafe
[src]

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]

impl<E, T> UnwindSafe for MutTxn<E, T> where
    E: UnwindSafe,
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,