[][src]Trait reef::Format

pub trait Format {
    fn to_bytes<T: Sized + Serialize>(value: T) -> Result<Vec<u8>>;
fn from_bytes<T: DeserializeOwned>(bytes: Vec<u8>) -> Result<T>; fn save_as<T: Sized + Serialize>(value: T, path: &Path) -> Result<()> { ... }
fn open<T: DeserializeOwned>(path: &Path) -> Result<T> { ... } }

A trait to provide conversion to and from bytes for a generic type

Required methods

fn to_bytes<T: Sized + Serialize>(value: T) -> Result<Vec<u8>>

fn from_bytes<T: DeserializeOwned>(bytes: Vec<u8>) -> Result<T>

Loading content...

Provided methods

fn save_as<T: Sized + Serialize>(value: T, path: &Path) -> Result<()>

fn open<T: DeserializeOwned>(path: &Path) -> Result<T>

Loading content...

Implementors

impl Format for Json[src]

Loading content...