Trait elephantry::entity::Entity
source · pub trait Entity {
// Required methods
fn from(tuple: &Tuple<'_>) -> Self;
fn get(&self, field: &str) -> Option<&dyn ToSql>;
}
Expand description
Trait to translate SQL row to struct and vice versa.
You probably should use the Entity
derive macro instead of writing the
impl by yourself.
Required Methods§
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
Implementors§
impl Entity for Constraint
Available on crate feature
inspect
only.impl Entity for Index
Available on crate feature
inspect
only.impl Entity for Column
Available on crate feature
inspect
only.impl Entity for Composite
Available on crate feature
inspect
only.impl Entity for Domain
Available on crate feature
inspect
only.impl Entity for Enum
Available on crate feature
inspect
only.impl Entity for Extension
Available on crate feature
inspect
only.impl Entity for Function
Available on crate feature
inspect
only.impl Entity for Relation
Available on crate feature
inspect
only.impl Entity for Schema
Available on crate feature
inspect
only.impl Entity for Trigger
Available on crate feature
inspect
only.