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

fn isErr

Whether a value of a union type is one of its error alternatives. The code generated for sagas and pipelines uses it to decide between "go on" and "compensate".

Example:

oxl✓ проверяется в CI
use std.saga

fn main() io {
  let v: i64 = 1
  print("{saga.isErr(&v)}")
}
Вывод
false
@intrinsic("saga.isErr") pub(api) fn isErr<T>(v: &T) -> bool  pure

Сложность. O(1).

С версии. 1.0.0-beta

Параметры

ИмяТип
v&T

Возвращает

bool

Эффекты

pure

Определено в: std/saga/saga.oxl:78

См. также