Skip to main content

Module model

Module model 

Source

Enums§

UnsupportedPk
Model::Pk of a model whose primary key is none of the types above (a text key, say). Nothing can build one, so ForeignKey<Model> is unusable for it. Set by the derive.

Traits§

Model
Core trait implemented by #[derive(Model)]. Every model must be able to describe its own schema. ModelHooks is a supertrait: the derive emits an empty impl unless #[model(hooks)] is set.
ModelMixin
Marker trait for abstract model mixins (#[derive(ModelMixin)]). A mixin is never a real table — its fields get flattened into models that use it.
PrimaryKey
A primary key value type that a ForeignKey<M> column can hold: Uuid (the default), i32 (FieldAutoInt / FieldInt) or i64 (FieldAutoBigInt / FieldBigInt).
PrimaryKeyField
The key type of a primary key field type: FieldUuid -> Uuid, FieldAutoInt and FieldInt -> i32, FieldAutoBigInt and FieldBigInt -> i64. Used by #[derive(Model)] to set Model::Pk.