[][src]Trait acme_lib::persist::Persist

pub trait Persist: Clone + Send {
    fn put(&self, key: &PersistKey, value: &[u8]) -> Result<()>;
fn get(&self, key: &PersistKey) -> Result<Option<Vec<u8>>>; }

Trait for a persistence implementation.

Implementation must be clonable and thread safe (Send). This can easily be done by wrapping the implemetation an Arc<Mutex<P>>.

Required methods

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

Store the given bytes under the given key.

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

Read the bytes stored under the given key.

None if the value doesn't exist.

Loading content...

Implementors

impl Persist for FilePersist[src]

impl Persist for MemoryPersist[src]

Loading content...