kw time
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
- 1.4 Keywords — Reserved (cannot be used as names)
- 11.2 Database transaction — The body is executed in a transaction of the database db.
- 15.1 comptime — A comptime fn is executed only at compile time; comptime { …
- 17.3 Clocks — now() -> Time and Instant.now() have the effect time.
- 10.2 rpc attributes — Defaults for all rpcs are set in cluster { defaults { …
- 2.2 Import — The first segment of the path MUST be std, self, super or the name of a dependency from oxl.toml.
- 10.5 Topics — cluster-wide fan-out — A topic is a distributed broadcast with storage in the built-in storage.
Examples
@explicit interface Middleware { fn around(ctx: &var Ctx, next: Next) -> Response net, io, time, db }use std.time { Duration, now }
use std.http.{Client as Http}
use self.billing { charge } // a module of one's own package
use super.common { Money } // the parent module
use auth.tokens { verify } // a dependency from oxl.toml
use parsers { <|> } // importing an operator
use std.coll.* // all pub names (a warning in libraries)Related diagnostics
effects, atomic-db-effects, cross-shard-tx, comptime-error, not-comptime, attribute-not-applicable, cache-not-readonly, invalid-window, retry-not-idempotent, rpc-attr, bad-import-root, glob-import, import-conflict, unresolved-import