OxL Справочник OxL
РусскийEnglish

kw io

Контекстное слово — список эффектов после возвращаемого типа (§6.2)

Список слов: §1.4

Синтаксис

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

Грамматика: Прил. A

Определяется в

Примеры

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     // метод по умолчанию
}

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                      // статическая проверка

— 4.6 Интерфейсы

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

— 10.2 Атрибуты rpc

Связанные диагностики

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

См. также