[][src]Trait mhdb::Datum

pub trait Datum: Sized {
    fn to_datum(&self) -> Result<Vec<u8>, Box<dyn StdError + Sync + Send>>;
fn from_datum(b: Vec<u8>) -> Result<Self, Box<dyn StdError + Sync + Send>>; }

A datum represents a single item in the database. Any type used as key or value needs to implement Datum.

Any type implementing Serialize and Deserialize also implements Datum.

Required methods

fn to_datum(&self) -> Result<Vec<u8>, Box<dyn StdError + Sync + Send>>

fn from_datum(b: Vec<u8>) -> Result<Self, Box<dyn StdError + Sync + Send>>

Loading content...

Implementors

impl<T: Serialize + DeserializeOwned> Datum for T[src]

Loading content...