[][src]Struct nimiq_database::WriteTransaction

pub struct WriteTransaction<'env>(_);

Methods

impl<'env> WriteTransaction<'env>[src]

pub fn new(env: &'env Environment) -> Self[src]

pub fn get<K: ?Sized, V>(&self, db: &Database, key: &K) -> Option<V> where
    K: AsDatabaseBytes,
    V: FromDatabaseValue
[src]

pub fn put_reserve<K: ?Sized, V: ?Sized>(
    &mut self,
    db: &Database,
    key: &K,
    value: &V
) where
    K: AsDatabaseBytes,
    V: IntoDatabaseValue
[src]

Puts a key/value pair into the database by copying it into a reserved space in the database. This works best for values that need to be serialised into the reserved space. This method will panic when called on a database with duplicate keys!

pub fn put<K: ?Sized, V: ?Sized>(&mut self, db: &Database, key: &K, value: &V) where
    K: AsDatabaseBytes,
    V: AsDatabaseBytes
[src]

Puts a key/value pair into the database by passing a reference to a byte slice. This is more efficient than put_reserve if no serialisation is needed, and the existing value can be immediately written into the database. This also works with duplicate key databases.

pub fn remove<K: ?Sized>(&mut self, db: &Database, key: &K) where
    K: AsDatabaseBytes
[src]

pub fn remove_item<K: ?Sized, V: ?Sized>(
    &mut self,
    db: &Database,
    key: &K,
    value: &V
) where
    K: AsDatabaseBytes,
    V: AsDatabaseBytes
[src]

pub fn commit(self)[src]

pub fn abort(self)[src]

pub fn cursor<'txn, 'db>(
    &'txn self,
    db: &'db Database<'env>
) -> Cursor<'txn, 'db>
[src]

Methods from Deref<Target = Transaction<'env>>

pub fn get<K: ?Sized, V>(&self, db: &Database, key: &K) -> Option<V> where
    K: AsDatabaseBytes,
    V: FromDatabaseValue
[src]

pub fn cursor<'txn, 'db>(
    &'txn self,
    db: &'db Database<'env>
) -> Cursor<'txn, 'db>
[src]

Trait Implementations

impl<'env> Debug for WriteTransaction<'env>[src]

impl<'env> Deref for WriteTransaction<'env>[src]

type Target = Transaction<'env>

The resulting type after dereferencing.

Auto Trait Implementations

impl<'env> !Send for WriteTransaction<'env>

impl<'env> !Sync for WriteTransaction<'env>

impl<'env> Unpin for WriteTransaction<'env>

impl<'env> !UnwindSafe for WriteTransaction<'env>

impl<'env> !RefUnwindSafe for WriteTransaction<'env>

Blanket Implementations

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

impl<T> From<T> for 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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Erased for T