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

method Flag.open

Declares the flag (once per process) and returns it bound to the cluster value; called by the generated Config.get().

Example:

oxl✓ проверяется в CI
dynamic Features {
  beta: Flag = Flag.on
}

fn main() io {
  let ann = Principal.User("ann", [], Map.new(), false, none)
  print("{Features.get().beta.on(r#for: ann)}")
}
Вывод
true
pub(api) static fn open(cfg: str, key: str, default: Flag, gate: DynGate) -> Flag

Сложность. O(1) after the first call.

С версии. 1.0.0-beta

Параметры

ИмяТип
cfgstr
keystr
defaultFlag
gateDynGate

Возвращает

Flag

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/dynconf.oxl:781

См. также