Struct sp_database::Transaction[][src]

pub struct Transaction<H>(pub Vec<Change<H>>);

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]

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 stores 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: Default> Default for Transaction<H>[src]

Auto Trait Implementations

impl<H> RefUnwindSafe for Transaction<H> where
    H: RefUnwindSafe

impl<H> Send for Transaction<H> where
    H: Send

impl<H> Sync for Transaction<H> where
    H: Sync

impl<H> Unpin for Transaction<H> where
    H: Unpin

impl<H> UnwindSafe for Transaction<H> where
    H: UnwindSafe

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>, 
[src]