Trait Model

Source
pub trait Model:
    Clone
    + Serialize
    + for<'de> Deserialize<'de> {
    type Id: Debug + Clone + Eq;

    // Required methods
    fn id(&self) -> &Self::Id;
    fn model_name() -> &'static str;
}
Expand description

An identifiable model that can be stored in a database.

Required Associated Types§

Required Methods§

Source

fn id(&self) -> &Self::Id

Source

fn model_name() -> &'static str

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§