method KvTx.put
Stores value under key when the transaction commits.
Example:
use std.kv { Kv }
fn main() io, db {
let kv = Kv.open("docs-kvtxput")!
let _ = kv.txn(tx => {
tx.put("k", b"v")
})
print("{kv.get("k")!.len()}")
kv.close()
}Output
1
pub(api) fn put(key: str, value: bytes)Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
key | str |
value | bytes |
Effects
none declared (pure unless the body says otherwise)
Defined in: std/kv/kv.oxl:701