OxL Reference

method DynHandle.rollback

Undoes the latest change (of layer when given) or, with to, goes back to the state after that version (layer: only that layer; none: every layer). A rollback is a new version.

Example:

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

fn main() io {
  let l = Limits.get()
  l.rps.set(500)!
  l.rps.set(700)!
  l.rps.rollback()!
  print("{l.rps.get()}")
}
Output
500
pub(api) fn rollback(to: u64 = 0, layer: DynScope? = none) -> () | DynError

Since. 1.0.0-beta

Parameters

NameType
tou64 = 0
layerDynScope? = none

Returns

()

Errors

  • DynError @error
  • `DynError` when the policy of the config refuses the caller, or there is nothing to roll back.

Effects

none declared (pure unless the body says otherwise)

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

See also