tc-transact

Crates.iotc-transact
lib.rstc-transact
created_at2021-02-21 01:46:48.143321
updated_at2024-01-29 12:37:06.842139
descriptionTraits and locking utilities for a TinyChain transaction.
homepage
repositoryhttps://github.com/haydnv/tinychain.git
max_upload_size
id358299
Haydn Vestal

documentation

README

This crate is used internally by TinyChain. It provides traits and data structures to support transactional mutations of in-memory and persistent datatypes. Example: ```rust use tc_transact::{TxnId, TxnLock}; let version = TxnLock::new("version", 0); let txn_one = TxnId::new(1); let txn_two = TxnId::new(2); let txn_three = TxnId::new(3); assert_eq!(version.read(txn_one).await.unwrap(), 0); *(version.write(txn_two).await.unwrap()) = 2; version.commit(txn_two).await; assert_eq!(version.read(txn_three).await.unwrap(), 2); ``` For more information on TinyChain, see [http://github.com/haydnv/tinychain](http://github.com/haydnv/tinychain)
Commit count: 3128

cargo fmt