Trait pastebin::DbInterface [] [src]

pub trait DbInterface: Send + Sync {
    fn store_data(&self, id: ObjectId, data: &[u8]) -> Result<(), DbError>;
fn load_data(&self, id: ObjectId) -> Result<Option<Vec<u8>>, DbError>;
fn remove_data(&self, id: ObjectId) -> Result<(), DbError>;
fn max_data_size(&self) -> usize; }

Interface to a database.

Required Methods

Stores the data into the database.

Loads data from the database. Returns a corresponding data if found, None otherwise.

Removes data from the database. Returns None if a corresponding data is not found, Ok(()) otherwise.

Tells the maximum data size that could be handled.

Implementors