Patch

Trait Patch 

Source
pub trait Patch
where Self: Sized + Send + Sync + 'static,
{ type Table: Table; // Required methods 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, ) -> impl Future<Output = Result<()>> + Send + 'a; }
Expand description

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

Required Associated Types§

Required Methods§

Source

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.

Source

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

Applies this patch to a row in the database.

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§