Skip to main content

DocumentStore

Trait DocumentStore 

Source
pub trait DocumentStore: Send + Sync {
    // Required methods
    fn read(&self) -> Result<Option<Value>, String>;
    fn write(&self, document: &Value) -> Result<(), String>;
}

Required Methods§

Source

fn read(&self) -> Result<Option<Value>, String>

The stored document, or None before the first write.

Source

fn write(&self, document: &Value) -> Result<(), String>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: DocumentStore + ?Sized> DocumentStore for Arc<T>

Source§

fn read(&self) -> Result<Option<Value>, String>

Source§

fn write(&self, document: &Value) -> Result<(), String>

Source§

impl<T: DocumentStore + ?Sized> DocumentStore for Box<T>

Source§

fn read(&self) -> Result<Option<Value>, String>

Source§

fn write(&self, document: &Value) -> Result<(), String>

Implementors§