[][src]Trait bindb::Table

pub trait Table: Serialize + DeserializeOwned {
    type Key: PartialOrd + Serialize + DeserializeOwned;

    const NAME: &'static str;
    const VERSION: u8;

Types which should be stored.

Associated Types

type Key: PartialOrd + Serialize + DeserializeOwned

Primary key of the table. If this type is sane, then it should have same ordering in rust as it does in its bincode serialized form. Simply - Fields sorted in-order numeric values sorted naturally, and strings lexicographically.

Loading content...

Associated Constants

const NAME: &'static str

Name of the table. This should be unique within database

const VERSION: u8

Version of the schema - This is here for future support for migrations of

Loading content...


Loading content...