Trait Insert

Source
pub trait Insert<DB>
where Self: Sized + Send + Sync, DB: Database,
{ type Model; // Required method fn insert<'e, A>(self, conn: A) -> BoxFuture<'e, Result<Self::Model>> where A: 'e + Send + Acquire<'e, Database = DB>; }
Expand description

A struct that is Insert is expected to have same fields as the model, excluding fields that have sane defaults at the database level. Concretely, if you have a Person struct: #[derive(ormlite::Model)] struct Person { id: i32, name: String, age: i32, }

Then the Insert struct looks like: struct InsertPerson { name: String, age: i32, }

Required Associated Types§

Required Methods§

Source

fn insert<'e, A>(self, conn: A) -> BoxFuture<'e, Result<Self::Model>>
where A: 'e + Send + Acquire<'e, Database = DB>,

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§