Skip to main content

AttachmentStore

Trait AttachmentStore 

Source
pub trait AttachmentStore {
    // Required methods
    fn put(&self, name: &str, bytes: &[u8]) -> Result<String, String>;
    fn get(&self, key: &str) -> Result<Option<Vec<u8>>, String>;
    fn remove(&self, key: &str) -> Result<(), String>;
}
Expand description

Keeps the content of files, and gives a key for each. A record holds only that key, so reading a list does not read every file.

Required Methods§

Source

fn put(&self, name: &str, bytes: &[u8]) -> Result<String, String>

Keeps a file, and says the key to find it by.

Source

fn get(&self, key: &str) -> Result<Option<Vec<u8>>, String>

The content kept under this key; nothing if it is gone.

Source

fn remove(&self, key: &str) -> Result<(), String>

Forgets what is kept under this key.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§