Method is a function that declared in some structure and this function got access to this variable. If method need change some field in structure this function should use mut keyword before fun


struct Foo {
var x: int;
mut fun setX(x: int) {
this.x = x;
fun getX(): int {
return x; // implicit `this`