Skip to main content

apply

Function apply 

Source
pub fn apply<T>(ops: impl IntoIterator<Item = Assignment<T>>) -> Assignment<T>
Expand description

Apply multiple operations to a single field.

Takes an array or Vec of Assignment<T> and applies each in order.

§Examples

ⓘ
user.update()
    .todos(stmt::apply([
        stmt::insert(Todo::create().title("Buy groceries")),
        stmt::insert(Todo::create().title("Walk the dog")),
        stmt::remove(&old_todo),
    ]))
    .exec(&mut db)
    .await?;