Skip to main content

QueryModel

Trait QueryModel 

Source
pub trait QueryModel:
    Sized
    + Send
    + 'static {
    type Schema: SchemaAccess;
    type Variables: QueryVariableSet;

    // Required methods
    fn model_name() -> &'static str;
    fn selection() -> QuerySelection;
    fn from_row(row: &PgRow, prefix: &str) -> Result<Self, Error>;

    // Provided method
    fn selection_with_variables(_variables: &QueryVariables) -> QuerySelection { ... }
}

Required Associated Types§

Required Methods§

Source

fn model_name() -> &'static str

Source

fn selection() -> QuerySelection

Source

fn from_row(row: &PgRow, prefix: &str) -> Result<Self, Error>

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§