II.3 Summary of built-in attributes
| Attribute | Applies to | Section |
|---|---|---|
@derive(I, …) | data, enum, distinct | §4.6 |
@sealed | data | §4.3 |
@explicit | interface | §4.6 |
@open | enum | §4.4 |
@error | data, enum | §6.5 |
@reflect | type | §15.2 |
@v(n), @since(n), @removed(n), @tag(n), @renamed(from) | type, field | §9.2 |
@repr(W), @codec(…), @zigzag, @preserve_unknown | type, field | §9.3–9.5 |
@grpc_status(code) | error type | §10.1 |
@table, @pk, @auto, @index, @shard | data, field | §12.8 |
@isolation(level) | function with atomic(db) | §11.2 |
@owner, @visible, @encrypted, @audit | table, field, rpc | §13 |
@public, @allow(…) | rpc | §13.4 |
@timeout, @retry, @idempotent, @readonly, @cache, @ratelimit, @resumable, @window, @trace | rpc | §10.2 |
@retain | topic | §10.5 |
@parallel(n) | pipeline | §10.6 |
@idle(d), @transient | actor, actor field | §12.5 |
@near(expr), @pinned, @nonblocking | function, actor, extern function | §8.1, §12.6 |
@tag(…), @skip, @flaky, @test_only | test, declaration | §18 |
@deprecated(msg), @inline, @cold | any declaration | II.3 |
@tag(n) with an integer argument on a field is the field number; @tag(labels…) on a test is selection labels.
Also: @internal (rpc, inaccessible to external principals, §13.4), @c_layout (data for FFI, §16.1), @flaky(retries: n) and @skip(reason) (test, §18.1), @must_close(by: method?) (type, §4.3).
Implementation-defined. Optimiser hints (D-8063; D-7690, D-7691).
@inlineand@coldon afnand the functionsstd.opt.likely(c),unlikely(c)are hints: they do not change the results of a program, and an implementation MAY ignore them. This implementation:@inlinesets the LLVM attributealwaysinline,@coldsetscold(attribute arguments are ignored without a diagnostic);likely(c)andunlikely(c)returncand pass the expectation to the code generator (llvm.expect).@arena(a request arena, §7.4) is not implemented: placement in an arena remains an optimisation that must not be relied upon.
Source: docs/spec/oxl-standard.en.md