Struct sp_database::Transaction [−][src]
A series of changes to the database that can be committed atomically. They do not take effect
until passed into Database::commit
.
Implementations
impl<H> Transaction<H>
[src]
impl<H> Transaction<H>
[src]pub fn new() -> Self
[src]
Create a new transaction to be prepared and committed atomically.
pub fn set(&mut self, col: ColumnId, key: &[u8], value: &[u8])
[src]
Set the value of key
in col
to value
, replacing anything that is there currently.
pub fn set_from_vec(&mut self, col: ColumnId, key: &[u8], value: Vec<u8>)
[src]
Set the value of key
in col
to value
, replacing anything that is there currently.
pub fn remove(&mut self, col: ColumnId, key: &[u8])
[src]
Remove the value of key
in col
.
pub fn store(&mut self, hash: H, preimage: &[u8])
[src]
Store the preimage
of hash
into the database, so that it may be looked up later with
Database::lookup
. This may be called multiple times, but Database::lookup
but subsequent
calls will ignore preimage
and simply increase the number of references on hash
.
pub fn release(&mut self, hash: H)
[src]
Release the preimage of hash
from the database. An equal number of these to the number of
corresponding store
s must have been given before it is legal for Database::lookup
to
be unable to provide the preimage.
Trait Implementations
impl<H: Clone> Clone for Transaction<H>
[src]
impl<H: Clone> Clone for Transaction<H>
[src]fn clone(&self) -> Transaction<H>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<H: Default> Default for Transaction<H>
[src]
impl<H: Default> Default for Transaction<H>
[src]fn default() -> Transaction<H>
[src]
Auto Trait Implementations
impl<H> RefUnwindSafe for Transaction<H> where
H: RefUnwindSafe,
H: RefUnwindSafe,
impl<H> Send for Transaction<H> where
H: Send,
H: Send,
impl<H> Sync for Transaction<H> where
H: Sync,
H: Sync,
impl<H> Unpin for Transaction<H> where
H: Unpin,
H: Unpin,
impl<H> UnwindSafe for Transaction<H> where
H: UnwindSafe,
H: UnwindSafe,