Trait Model

Source
pub trait Model: ModelData + HasActiveModel {
    type Primary: Into<Value>;

    const PRIMARY: &'static str;
    const AUTO_INCREMENT: bool;

    // Required method
    fn primary(&self) -> Self::Primary;

    // Provided methods
    fn active_model() -> <Self as HasActiveModel>::ActiveModel { ... }
    fn update_model(&self) -> UpdateModel<Self> { ... }
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn primary(&self) -> Self::Primary

Provided Methods§

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§