rust-elm 0.6.0
Elm Architecture for Rust, evolving toward The Composable Architecture (UDF).
Install
[]
= { = "../rust-elm" }
= "0.6.0"
= "3.4.0"
= "3.3.0"
= { = "1.38", = ["rt-multi-thread", "macros"] }
Feature flags
| Feature | Default | Purpose |
|---|---|---|
runtime |
yes | Tokio interpreter, Runtime, RwRuntime, Store, subscriptions |
websocket |
yes | Real Sub::websocket via tokio-tungstenite (interval stub without it) |
serde |
no | FileStorage, replay snapshots |
Build without Tokio (pure descriptions only):
Quick start
use ;
Release notes
0.6.0
RwRuntime—Arc<RwLock<S>>reducer loop for read-heavy workloads.RwStore/ReadStore— dispatch +read_store()for concurrent readers;ScopedRwStore.- Rw bindings —
ReadStateBinding,RwStateBinding, projected variants. StoreHub+StoreWork— shared bus/listeners between mutex and Rw backends.
0.5.0
safe_reducermodule —safe_reduce_update,safe_reduce_rollback,SafeReduceError(replacesreduce_panic/catch_reduce_panic/ReducePanic).StateBinding/subscribe_changes— zero-copy store reads and field-level change signals; see binding.md.- Example renamed:
safe_reducer(wascatch_reduce).
0.3.0
RuntimeConfig—bus_capacity,worker_threads,thread_nameforRuntime::from_program.RefKpTrait— scope/store/optics use core traits directly;StateLens/StateKeypathremoved.StoreTask::finish_with_timeout— configurable wait for store work.painexample — ISO 20022-style validation with fail-fastValidator.
0.2.0
- WebSocket subscriptions, runtime feature flags, ecommerce example.
Modules
| Module | Purpose |
|---|---|
cmd |
Commands returned from update |
effect |
Pure async effect descriptions (debounce, throttle, from_run, cancel) |
sub |
Subscription descriptions (runtime-agnostic data) |
safe_reducer |
safe_reduce_update, safe_reduce_rollback, SafeReduceError |
runtime |
Bus-driven update loop + Tokio interpreter (runtime feature) |
subscription |
Sub interpreter — tick/stream/websocket (runtime feature) |
store |
Store, RwStore, ReadStore, StoreTask, ScopedStore (runtime feature) |
test_store |
ExhaustiveTestStore for synchronous effect/action testing |
test_runtime |
Sync testing without Tokio |
shared |
Shared<T>, Storage, InMemoryStorage, FileStorage (serde) |
dependencies |
Re-exports rust_dependencies |
env |
Environment (live/test), FakeClock, MockHttp |
optics |
State/action focusing via rust-key-paths |
reducer |
Reducer trait, CombineReducers, CatchReducer, RollbackCatchReducer |
scope |
ScopeReducer, IfLetReducer, ForEachReducer, lift_cmd |
identified |
Re-exports rust_identified_vec |
replay |
Action log + replay harness |
Examples (one per feature area)
| Example | Command | Shows |
|---|---|---|
safe_reducer |
cargo run -p rust-elm --example safe_reducer |
Safe update: default vs rollback |
subscriptions |
cargo run -p rust-elm --example subscriptions |
Tick + map_msg subs |
scope_for_each |
cargo run -p rust-elm --example scope_for_each |
Scope + ForEach without Runtime |
dependencies |
cargo run -p rust-elm --example dependencies |
Environment live vs test |
shared_state |
cargo run -p rust-elm --example shared_state |
Shared<T> observers |
ecommerce |
cargo run -p rust-elm --example ecommerce |
Full shop (mutex Runtime) |
rw_ecommerce |
cargo run -p rust-elm --example rw_ecommerce |
Same shop on RwRuntime |
Quality tooling
# Clippy (crate only)
# Miri (identified, shared, scope — no runtime)
# Scope / ForEach benchmarks
Key paths prelude
use ;
use Kp;
See ROADMAP.md, book/architecture.md, book/safe_reducer.md, book/ecommerce.md, book/rw_ecommerce.md.