struct Foo {
bar: i32,
}
let foo_var = Foo { bar: 16 };
// I want to do something like this
foo_var.new_field: u8 = "new field".to_string();
// which lets me then call
println!("{}", foo_var.new_field);
// which would print "new field"
I know I could:
implement it as a function, but I want to have a consistent "style", so I want to avoid parenthesis for
foo_var.new_field()
.implement it as a default, but it would be cool if I could implement this in another script (like you can do with impl for functions) without always adding a field to the struct and the default.