proc_assertions

Attribute Macro mutates

source
#[mutates]
Expand description

Checks if only whitelisted fields of an instance type are mutated by a function. This macro enforces that only the fields listed in the whitelist can be mutated by the function. If any field not in the whitelist is mutated, a compile-time error will be generated.

Usage: #[mutates(MyStructName: "field1", "field2", "field3", ...)]