OxL Reference

method TVar.set

Replaces the value when the transaction commits.

Example:

oxl✓ checked in CI
use std.stm { TVar }

fn main() io {
  let v = TVar<i32>.new(1)
  atomic { v.set(9) }
  print("{atomic { v.get() }}")
}
Output
9
pub(api) fn set(value: T)

Since. 1.0.0-beta

Parameters

NameType
valueT

Effects

none declared (pure unless the body says otherwise)

Defined in: std/stm/stm.oxl:107

See also