Statia
Zero-dependency state management for Rust applications. Thread-safe, type-safe, and built entirely on stdlib.
Features
- Thread-safe state containers using RwLock
- Pub/sub system for state changes
- Transaction support for atomic updates
- Type-safe state registry
- Pure stdlib - no external dependencies
Usage
use ;
// Single state
let counter = new;
counter.set;
assert_eq!;
// Subscribe to changes
counter.subscribe;
// Multiple states
let manager = new;
let count_state = manager.register;
let name_state = manager.register;
// Transactions
let mut transaction = new;
transaction.update;
transaction.update;
transaction.commit;
Installation
Add to Cargo.toml:
[]
= "0.1.0"
License
GPL-3.0
Contributing
Pull requests welcome! Please read CONTRIBUTING.md first.