OxL Reference

method TVar.get

The value (a copy) as seen by the running transaction.

Example:

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

fn main() io {
  let v = TVar<i32>.new(1)
  print("{atomic { v.get() + 1 }}")
}
Output
2
pub(api) fn get() -> T

Since. 1.0.0-beta

Returns

T

Effects

none declared (pure unless the body says otherwise)

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

See also