Trait Table

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

    const NAME: &'static str;
    const VERSION: u8;
}
Expand description

Types which should be stored.

Required Associated Constants§

Source

const NAME: &'static str

Name of the table. This should be unique within database

Source

const VERSION: u8

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

Required Associated Types§

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§