pub trait SqlEntity: Structured + Sized {
// Required methods
fn get_projection() -> Projection<Self>;
fn hydrate(row: &Row) -> Result<Self, HydrationError>;
}Expand description
A trait to mark types that are SQL entities. An SQL entity is a type that has a structure, a projection and a hydration function.
Required Methods§
Sourcefn get_projection() -> Projection<Self>
fn get_projection() -> Projection<Self>
Get the projection of the entity.
Sourcefn hydrate(row: &Row) -> Result<Self, HydrationError>
fn hydrate(row: &Row) -> Result<Self, HydrationError>
Hydrate the entity from a row.
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.