[][src]Trait orga::store::Write

pub trait Write {
    fn put(&mut self, key: Vec<u8>, value: Vec<u8>) -> Result<()>;
fn delete(&mut self, key: &[u8]) -> Result<()>; fn as_mut<'a>(&'a mut self) -> &'a mut Self { ... } }

Trait for write access to key/value stores.

Required methods

fn put(&mut self, key: Vec<u8>, value: Vec<u8>) -> Result<()>

Writes a key and value to the store.

If a value already exists for the given key, implementations should overwrite the value.

fn delete(&mut self, key: &[u8]) -> Result<()>

Deletes the value with the given key.

If no value exists for the given key, implementations should treat the operation as a no-op (but may still issue a call to delete to an underlying store).

Loading content...

Provided methods

fn as_mut<'a>(&'a mut self) -> &'a mut Self

Returns a mutable reference to the store.

Loading content...

Implementors

impl Write for MemStore[src]

impl Write for NullStore[src]

impl<'a> Write for MerkStore<'a>[src]

fn put(&mut self, key: Vec<u8>, value: Vec<u8>) -> Result<()>[src]

Writes a value to the underlying Merk store.

fn delete(&mut self, key: &[u8]) -> Result<()>[src]

Deletes a value from the underlying Merk store.

impl<S: Store> Write for BufStore<S>[src]

impl<S: Store> Write for RWLog<S>[src]

impl<S: Write, T: DerefMut<Target = S>> Write for T[src]

impl<W: Write> Write for Prefixed<W>[src]

impl<W: Write> Write for Shared<W>[src]

Loading content...