In role Metamodel::AttributeContainer§

See primary documentation in context for method set rw

method set_rw($obj)

Marks a type whose attributes default to having a write accessor. For example in

class Point is rw {
    has $.x;
    has $.y;
}

The is rw trait on the class calls the set_rw method on the metaclass, making all the attributes implicitly writable, so that you can write;

my $p = Point.new(x => 1=> 2);
$p.x = 42;