pub trait AdminModel: Model {
const ADMIN_NAME: &'static str;
const DISPLAY_NAME: &'static str;
const FIELDS: &'static [AdminField];
// Required methods
fn field_display(&self, name: &str) -> Option<String>;
fn from_form(form: &FormData, id: Option<i64>) -> Result<Self, Error>;
// Provided method
fn singular_name() -> &'static str { ... }
}Required Associated Constants§
const ADMIN_NAME: &'static str
const DISPLAY_NAME: &'static str
const FIELDS: &'static [AdminField]
Required Methods§
fn field_display(&self, name: &str) -> Option<String>
fn from_form(form: &FormData, id: Option<i64>) -> Result<Self, Error>
Provided Methods§
Sourcefn singular_name() -> &'static str
fn singular_name() -> &'static str
Singular form of the display name. Used for labels like “New X” and
“Edit X”. Defaults to [DISPLAY_NAME]; the #[derive(RustioAdmin)]
macro generates a proper singular form.
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.