InsertRecord

Trait InsertRecord 

Source
pub trait InsertRecord:
    Sized
    + Clone
    + CandidType {
    type Record: TableRecord;
    type Schema: TableSchema<Record = Self::Record>;

    // Required methods
    fn from_values(values: &[(ColumnDef, Value)]) -> IcDbmsResult<Self>;
    fn into_values(self) -> Vec<(ColumnDef, Value)>;
    fn into_record(self) -> Self::Schema;
}
Expand description

This trait represents a record for inserting into a table.

Required Associated Types§

Source

type Record: TableRecord

The TableRecord type associated with this table schema.

Source

type Schema: TableSchema<Record = Self::Record>

The table schema associated with this record.

Required Methods§

Source

fn from_values(values: &[(ColumnDef, Value)]) -> IcDbmsResult<Self>

Creates an insert record from a list of column Values.

Source

fn into_values(self) -> Vec<(ColumnDef, Value)>

Converts the record into a list of column Values for insertion.

Source

fn into_record(self) -> Self::Schema

Converts the insert record into the corresponding table record.

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.

Implementors§