use super::Storage;
use random_access_storage::RandomAccessMethods;
use std::fmt::Debug;
use Result;
pub trait Persist<T>
where
T: RandomAccessMethods + 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<()>;
}