pub trait InsertRecord: Sized + Clone {
type Record: TableRecord;
type Schema: TableSchema<Record = Self::Record>;
// Required methods
fn from_values(values: &[(ColumnDef, Value)]) -> Result<Self, DbmsError>;
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§
Sourcetype Record: TableRecord
type Record: TableRecord
The TableRecord type associated with this table schema.
Sourcetype Schema: TableSchema<Record = Self::Record>
type Schema: TableSchema<Record = Self::Record>
The table schema associated with this record.
Required Methods§
Sourcefn from_values(values: &[(ColumnDef, Value)]) -> Result<Self, DbmsError>
fn from_values(values: &[(ColumnDef, Value)]) -> Result<Self, DbmsError>
Creates an insert record from a list of column Values.
Sourcefn into_values(self) -> Vec<(ColumnDef, Value)>
fn into_values(self) -> Vec<(ColumnDef, Value)>
Converts the record into a list of column Values for insertion.
Sourcefn into_record(self) -> Self::Schema
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".