Trait dinglebit_store::blob::Store[][src]

pub trait Store<B, I> where
    B: Blob,
    I: Iterator<Item = Result<B, Error>>, 
{ fn put_from<R: Read>(
        &mut self,
        key: &str,
        r: &mut R
    ) -> Result<usize, Error>;
fn get_to<W: Write>(&mut self, key: &str, w: &mut W) -> Result<usize, Error>;
fn prefix(&mut self, prefix: &str) -> I;
fn delete(&mut self, key: &str) -> Result<(), Error>; fn put(&mut self, key: &str, data: &[u8]) -> Result<(), Error> { ... }
fn get(&mut self, key: &str) -> Result<Vec<u8>, Error> { ... }
fn remove(&mut self, name: &str) -> Result<(), Error> { ... } }
Expand description

A generic Storage system for blobs.

Required methods

Save the content of r into the storage system with the given key.

Read the contents of the blob with the given key into the given writer.

Find all blobs that have the given prefix and iterate over them.

Delete the blob with the given key.

Provided methods

Similar to put_from but uses the give data instead of a reader.

Similar to get_to but reads the contents into a byte vector.

Similar to delete but it does not return an error if the error is NotFound.

Implementors