> For the complete Mojo documentation index, see [llms.txt](/llms.txt).
> Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

# @staticmethod

You can add the `@staticmethod` decorator on a struct method to declare a static
method.

For example:

```mojo
from std.pathlib import Path

struct MyStruct(Movable):
    var data: List[UInt8]

    def __init__(out self):
        self.data = List[UInt8]()

    @staticmethod
    def load_from_file(file_path: Path) raises -> Self:
        var new_struct = MyStruct()
        new_struct.data = file_path.read_bytes()
        return new_struct ^
```

Unlike an instance method, a static method doesn't take an implicit `self`
argument. It's not attached to a specific instance of a struct, so it can't
access instance data.

For more information see the documentation on
[static methods](/docs/manual/structs/#static-methods).
