OxL Reference

kw io

Contextual keyword — the effect list after the return type (§6.2)

The list of words: §1.4

Syntax

ebnf
Effect      = "io" | "net" | "db" | "time" | "rand" | Ident ;

Grammar: App. A

Defined in

Examples

oxl
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

— 4.6 Interfaces

oxl
@explicit interface Middleware { fn around(ctx: &var Ctx, next: Next) -> Response  net, io, time, db }

— 10.2 rpc attributes

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

See also