#[derive(IndexMut)]
{
// Attributes available to this derive:
#[index_mut]
}
Expand description
Implement IndexMut for a structure.
ยงSample.
use derive_tools::IndexMut;
#[ derive( IndexMut ) ]
struct MyStruct( i32 );
let mut my_struct = MyStruct( 13 );
my_struct[ 0 ] += 1;
dbg!( my_struct.0 );To learn more about the feature, study the module derive_tools::IndexMut.