mithril_persistence::sqlite

Trait SqLiteEntity

source
pub trait SqLiteEntity {
    // Required methods
    fn hydrate(row: Row) -> Result<Self, HydrationError>
       where Self: Sized;
    fn get_projection() -> Projection;
}
Expand description

How to hydrate an entity from a SQLite result row

Required Methods§

source

fn hydrate(row: Row) -> Result<Self, HydrationError>
where Self: Sized,

This method is intended to be used when creating new instances from SQL result rows. This is the place to grab data, check consistency and types and return the entity if possible.

source

fn get_projection() -> Projection

Construct a Projection that will allow to hydrate this SqLiteEntity.

Object Safety§

This trait is not object safe.

Implementors§