Trait transact::database::DatabaseWriter[][src]

pub trait DatabaseWriter: DatabaseReader {
    fn put(&mut self, key: &[u8], value: &[u8]) -> Result<(), DatabaseError>;
fn overwrite(
        &mut self,
        key: &[u8],
        value: &[u8]
    ) -> Result<(), DatabaseError>;
fn delete(&mut self, key: &[u8]) -> Result<(), DatabaseError>;
fn index_put(
        &mut self,
        index: &str,
        key: &[u8],
        value: &[u8]
    ) -> Result<(), DatabaseError>;
fn index_delete(
        &mut self,
        index: &str,
        key: &[u8]
    ) -> Result<(), DatabaseError>;
fn commit(self: Box<Self>) -> Result<(), DatabaseError>;
fn as_reader(&self) -> &dyn DatabaseReader; }
Expand description

A DatabaseReader provides read access to a database instance.

Required methods

Writes the given key/value pair. If the key/value pair already exists, it will return a DatabaseError::DuplicateEntry.

Writes the given key/value pair. If the key/value pair already exists, it overwrites the old value

Deletes the given key/value pair. If the key does exist, it returns an error,

Writes the given key/value pair at index.

Deletes the given key/value pair at index.

Implementors