[−][src]Struct nimiq_database::WriteTransaction
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]
K: AsDatabaseBytes,
V: FromDatabaseValue,
pub fn put_reserve<K: ?Sized, V: ?Sized>(
&mut self,
db: &Database,
key: &K,
value: &V
) where
K: AsDatabaseBytes,
V: IntoDatabaseValue,
[src]
&mut self,
db: &Database,
key: &K,
value: &V
) where
K: AsDatabaseBytes,
V: IntoDatabaseValue,
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]
K: AsDatabaseBytes,
V: AsDatabaseBytes,
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]
K: AsDatabaseBytes,
pub fn remove_item<K: ?Sized, V: ?Sized>(
&mut self,
db: &Database,
key: &K,
value: &V
) where
K: AsDatabaseBytes,
V: AsDatabaseBytes,
[src]
&mut self,
db: &Database,
key: &K,
value: &V
) where
K: AsDatabaseBytes,
V: AsDatabaseBytes,
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]
&'txn self,
db: &'db Database<'env>
) -> Cursor<'txn, 'db>
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]
K: AsDatabaseBytes,
V: FromDatabaseValue,
pub fn cursor<'txn, 'db>(
&'txn self,
db: &'db Database<'env>
) -> Cursor<'txn, 'db>
[src]
&'txn self,
db: &'db Database<'env>
) -> Cursor<'txn, 'db>
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.
fn deref(&self) -> &Transaction<'env>
[src]
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]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,