Skip to main content

EntityKind

Trait EntityKind 

Source
pub trait EntityKind:
    Kind
    + TypeKind
    + FieldValues {
    type PrimaryKey: Copy + Into<Key>;
    type Store: StoreKind;
    type Canister: CanisterKind;

    const ENTITY_NAME: &'static str;
    const PRIMARY_KEY: &'static str;
    const FIELDS: &'static [&'static str];
    const INDEXES: &'static [&'static IndexModel];
    const MODEL: &'static EntityModel;

    // Required methods
    fn key(&self) -> Key;
    fn primary_key(&self) -> Self::PrimaryKey;
    fn set_primary_key(&mut self, key: Self::PrimaryKey);
}
Expand description

EntityKind

Required Associated Constants§

Source

const ENTITY_NAME: &'static str

Source

const PRIMARY_KEY: &'static str

Source

const FIELDS: &'static [&'static str]

Source

const INDEXES: &'static [&'static IndexModel]

Source

const MODEL: &'static EntityModel

Required Associated Types§

Required Methods§

Source

fn key(&self) -> Key

Source

fn primary_key(&self) -> Self::PrimaryKey

Source

fn set_primary_key(&mut self, key: Self::PrimaryKey)

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§