Trait Create

Source
pub trait Create<E> {
    // Required method
    fn create<'life0, 'async_trait>(
        &'life0 self,
        entity: E,
    ) -> Pin<Box<dyn Future<Output = Result<WithId<E>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

[C]reate CRUD operation

Required Methods§

Source

fn create<'life0, 'async_trait>( &'life0 self, entity: E, ) -> Pin<Box<dyn Future<Output = Result<WithId<E>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an object in the database and returns its id.

Implementors§

Source§

impl<DB, E> Create<E> for Store<DB, E>
where DB: Database + SupportsReturning, E: for<'r> FromRow<'r, <DB as Database>::Row> + Schema<DB> + BindColumn<DB> + Sync + Send, for<'c> &'c mut <DB as Database>::Connection: Executor<'c, Database = DB>, for<'c> <DB as HasArguments<'c>>::Arguments: IntoArguments<'c, DB>, for<'c> i64: Type<DB> + Decode<'c, DB> + Encode<'c, DB>, usize: ColumnIndex<<DB as Database>::Row>,

Create