Skip to main content

elemental_shared/
version.rs

1use crate::error::Result;
2
3pub trait Versioned {
4    fn version(&self) -> usize;
5}
6
7pub trait VersionControlled: Versioned {
8    fn with_version(self, version: usize) -> Self
9    where
10        Self: Sized;
11}
12
13pub trait Persistor<V> {
14    fn save(&self, value: &V) -> impl Future<Output = Result<()>>;
15    fn load(&self) -> impl Future<Output = Result<Option<V>>>
16    where
17        Self: Sized;
18}