[][src]Trait ormx::Patch

pub trait Patch where
    Self: Sized + Send + Sync + 'static, 
{ type Table: Table; fn apply_to(self, entity: &mut Self::Table);
fn patch_row<'a, 'c: 'a>(
        &'a self,
        db: impl Executor<'c, Database = Db> + 'a,
        id: <Self::Table as Table>::Id
    ) -> BoxFuture<'a, Result<()>>; }

A type which can be used to "patch" a row, updating multiple fields at once.

Associated Types

type Table: Table

Loading content...

Required methods

fn apply_to(self, entity: &mut Self::Table)

Applies the data of this patch to the given entity. This does not persist the change in the database.

fn patch_row<'a, 'c: 'a>(
    &'a self,
    db: impl Executor<'c, Database = Db> + 'a,
    id: <Self::Table as Table>::Id
) -> BoxFuture<'a, Result<()>>

Applies this patch to a row in the database.

Loading content...

Implementors

Loading content...