pub trait Entity: TeaqlEntity + Sized {
// Required methods
fn from_record(record: Record) -> Result<Self, EntityError>;
fn into_record(self) -> Record;
// Provided methods
fn on_loaded(&mut self, context: &dyn Any) { ... }
fn into_json(self) -> Value { ... }
}Required Methods§
fn from_record(record: Record) -> Result<Self, EntityError>
fn into_record(self) -> Record
Provided Methods§
Sourcefn on_loaded(&mut self, context: &dyn Any)
fn on_loaded(&mut self, context: &dyn Any)
Invoked immediately after the entity is loaded from the repository. Used by implementations to attach runtime contexts or initialize internal states.
fn into_json(self) -> Value
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".