method TVar.set
Replaces the value when the transaction commits.
Example:
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
| Name | Type |
|---|---|
value | T |
Effects
none declared (pure unless the body says otherwise)
Defined in: std/stm/stm.oxl:107