> For the complete documentation index, see [llms.txt](https://jazz-lang.gitbook.io/jazz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jazz-lang.gitbook.io/jazz/methods.md).

# Methods

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`

Example:

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

}
```
