Skip to main content

Module crud_update_macro

Module crud_update_macro 

Source

Functions§

update_macro_embedded_patch_and_mixed_shapes
Embedded partial update via brace block: meta: { version: 2 } lowers to meta: stmt::apply([stmt::patch(<Metadata>::fields().version(), 2)]).
update_macro_has_many_insert
Has-many insert via bracket-of-braces: todos: [{ title: "x" }] lowers to todos: stmt::apply([stmt::insert(Todo::create().title("x"))]).
update_macro_has_many_mixed_list
Has-many list with mixed builders and plain expressions — the macro passes plain entries through and wraps inline builders in stmt::insert.
update_macro_method_shorthand_clear
Method shorthand on a Vec<scalar> field: tags.clear() lowers to tags: stmt::clear(), replacing the field with an empty list.
update_macro_method_shorthand_extend
Method shorthand on a Vec<scalar> field: tags.extend([..]) lowers to tags: stmt::extend([..]) for an atomic batch append.
update_macro_method_shorthand_pop
Method shorthand on a Vec<scalar> field: tags.pop() lowers to tags: stmt::pop() for an atomic trailing-element drop.
update_macro_method_shorthand_push
Method shorthand on a Vec<scalar> field: tags.push("rust") lowers to tags: stmt::push("rust") for an atomic append.
update_macro_method_shorthand_reads_target_field
Method-shorthand arguments may also read the target instance’s own fields inline (issue #1073).
update_macro_method_shorthand_set
Method shorthand: field.set(value) lowers to field: stmt::set(value).
update_macro_multiple_fields
Multiple fields in one update call.
update_macro_query_target
Update through a query builder target — no instance required.
update_macro_shorthand
Field shorthand — name as a bare ident expands to name: name.
update_macro_simple
Basic single-field update through an instance target.
update_macro_value_reads_target_field
Value expressions may read the target instance’s own fields inline (issue #1073). The macro evaluates values before .update() borrows the target, so active: !user.active compiles.