Skip to main content

ActixAdminPrimaryKey

Trait ActixAdminPrimaryKey 

Source
pub trait ActixAdminPrimaryKey:
    DeserializeOwned
    + FromStr
    + Display
    + Clone
    + 'static { }
Expand description

Blanket bound for anything usable as an entity primary key in the admin.

This is what powers the ActixAdminViewModelTrait::Id associated type, letting an entity be keyed by i32, i64, String, uuid::Uuid, … as long as the type satisfies the four ubiquitous requirements:

  • DeserializeOwned — needed by actix_web::web::Path<Id>.
  • FromStr — needed to parse ids out of form bodies (bulk delete).
  • Display — needed to render ids into URLs and templates.
  • Clone + 'static — needed by the generated Sea-ORM queries.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> ActixAdminPrimaryKey for T
where T: DeserializeOwned + FromStr + Display + Clone + 'static,