OxL Reference

method DynHandle.open

Declares the field (once per process) and returns the handle; called by the generated Config.get().

Example:

oxl✓ checked in CI
dynamic Limits {
  rps: u32 = 100
  title: str = "shop"
}

fn main() io {
  let a = Limits.get()
  let b = Limits.get()
  a.rps.set(5)!
  print("{b.rps.get()}")
}
Output
5
pub(api) static fn open(cfg: str, key: str, default: T, gate: DynGate) -> DynHandle<T> where T: Serializable

Complexity. O(1) after the first call.

Since. 1.0.0-beta

Parameters

NameType
cfgstr
keystr
defaultT
gateDynGate

Returns

DynHandle<T> where T: Serializable

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/dynconf.oxl:432

See also