Skip to main content

Persistor

Trait Persistor 

Source
pub trait Persistor<V: VersionControlled> {
    // Required methods
    fn save(&self, value: &V) -> impl Future<Output = Result<()>>;
    fn load(&self) -> impl Future<Output = Result<Option<V>>>
       where Self: Sized;
}

Required Methods§

Source

fn save(&self, value: &V) -> impl Future<Output = Result<()>>

Source

fn load(&self) -> impl Future<Output = Result<Option<V>>>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<V, S, D, IO, Ser, De> Persistor<V> for CustomPersistor<V, S, D, IO, Ser, De>
where V: VersionControlled + Serialize + DeserializeOwned, D: ?Sized, IO: PersistorIO<S>, Ser: Fn(&V) -> Result<S>, De: Fn(&D) -> Result<V>, S: AsRef<D>,

Source§

impl<V: VersionControlled> Persistor<V> for NoPersistor