kw io
Contextual keyword — the effect list after the return type (§6.2)
The list of words: §1.4
Syntax
Effect = "io" | "net" | "db" | "time" | "rand" | Ident ;Grammar: App. A
Defined in
- 6.2 Effects — The set of effects is written after the return type, comma-separated
- 11.2 Database transaction — The body is executed in a transaction of the database db.
- 1.4 Keywords — Reserved (cannot be used as names)
- 15.1 comptime — A comptime fn is executed only at compile time; comptime { …
- 4.6 Interfaces — Interfaces are structural
- 0.3 Editions and versions — The edition (edition = "2027" in oxl.toml) fixes the syntax and semantics.
- 10.2 rpc attributes — Defaults for all rpcs are set in cluster { defaults { …
- 8.1 Execution model — The unit of execution is the task
Examples
pub(api) interface Storage {
fn get(k: str) -> bytes? io
var fn put(k: str, v: bytes) io
fn has(k: str) -> bool io => get(k) != none // a default method
}
interface ReadWrite { embed Reader; embed Writer }
interface Container<T> { type Item = T; fn items() -> iter<T> }
@explicit interface Persistent { fn key() -> str }
assert FileStorage: Storage // static check@explicit interface Middleware { fn around(ctx: &var Ctx, next: Next) -> Response net, io, time, db }Related diagnostics
effects, atomic-db-effects, cross-shard-tx, comptime-error, not-comptime, explicit-interface, interface-not-satisfied, not-implemented, attribute-not-applicable, cache-not-readonly, invalid-window, retry-not-idempotent, rpc-attr, blocking-in-task