oml-storage 0.1.4-alpha

A very simple wrapper to handle locked storage of items.
Documentation
1
2
3
4
5
6
7
8
9
10
use async_trait::async_trait;
use color_eyre::eyre::Result;

#[async_trait]
pub trait StorageItem: core::fmt::Debug + std::default::Default + std::marker::Sync {
    fn serialize(&self) -> Result<Vec<u8>>;
    fn deserialize(data: &[u8]) -> Result<Self>
    where
        Self: Sized;
}