Skip to main content

InsertModel

Trait InsertModel 

Source
pub trait InsertModel:
    Sized
    + Send
    + 'static {
    type Schema: SchemaAccess;
    type Values: InsertValueSet;

    // Required methods
    fn model_name() -> &'static str;
    fn returning_fields() -> &'static [&'static str];
    fn from_row(row: &PgRow, prefix: &str) -> Result<Self, Error>;
}
Expand description

Runtime contract implemented by insert result models.

Required Associated Types§

Required Methods§

Source

fn model_name() -> &'static str

Schema model name being inserted into.

Source

fn returning_fields() -> &'static [&'static str]

Scalar fields returned by the insert statement.

Source

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

Decodes the inserted row returned by RETURNING.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§