use super::Storage;
use crate::Result;
use random_access_storage::RandomAccess;
use std::fmt::Debug;
pub trait Persist<T>
where
T: RandomAccess + Debug,
{
fn from_bytes(index: usize, buf: &[u8]) -> Self;
fn to_vec(&self) -> Result<Vec<u8>>;
fn store(&self, index: usize, store: Storage<T>) -> Result<()>;
}