pub trait BaseEntity: Send + Sync {
type LoaderType;
// Required methods
fn load() -> Self::LoaderType;
fn id(&self) -> i64;
fn uid(&self) -> Uuid;
fn created_at(&self) -> DateTimeWithTimeZone;
fn updated_at(&self) -> DateTimeWithTimeZone;
}Expand description
Uniform identity view over a model.
Implement for each SeaORM entity model so generic query and repository code
can read id, uid, and timestamps without knowing the concrete type.
Required Associated Types§
Sourcetype LoaderType
type LoaderType
The loader type used to load relations for this entity.
Required Methods§
Sourcefn load() -> Self::LoaderType
fn load() -> Self::LoaderType
Returns a loader for this entity type.
Sourcefn created_at(&self) -> DateTimeWithTimeZone
fn created_at(&self) -> DateTimeWithTimeZone
Returns the creation timestamp.
Sourcefn updated_at(&self) -> DateTimeWithTimeZone
fn updated_at(&self) -> DateTimeWithTimeZone
Returns the last-update timestamp.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".