Crate assign

source ·
Expand description

This module provides the assign! macro to allow mutating a struct value in a declarative style.

It is an alternative to struct update syntax that works with non-exhaustive structs.

It is used as

let foo = assign!(init_expression, {
    field: new_field_value,
    // other_field: new_other_field_value,
    // ...
});

For details and examples, see the documentation for the macro itself.

Macros§

  • Mutate a struct value in a declarative style.