Mojo decorators
A Mojo decorator is a higher-order
function that modifies or
extends the behavior of a struct, a function, or some other code. Instead of
actually calling the higher-order function, you simply add the decorator (such
as the @fieldwise_init
decorator) above your code (such as a struct). The Mojo
compiler then uses the decorator function to modify your code at compile time.
The following pages describe each built-in decorator with examples.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!