AUDIO
Source snapshot · 12 October 2026

API reference / ravet_state

Crate ravet_state 

Expand description

Owned observable trees and transactional undo on control threads.

This crate allocates and clones bounded snapshots; never use it in an audio callback. Publish validated processor-specific snapshots through the portable control/audio bridge. Stable node IDs are product-owned and never renumbered.

use ravet_state::{Limits, Mutation, Node, NodeId, Store, Value};
let mut state = Store::new(Node::new(NodeId(1), "session"), Limits::default())?;
state.commit(&[Mutation::Set {
    node: NodeId(1), key: "gain".into(), value: Value::Real(0.5),
}])?;
let preset = state.encode(*b"PRODUCT1");
state.undo()?;
state.restore(&preset, *b"PRODUCT1")?;

Structs§

ChangeBatch
One revision, representing a complete committed transaction or restoration.
Limits
Validated caps. Maximums: 4096 nodes, depth 64, 16 MiB encoded bytes, 128 undo snapshots and 128 journal batches. Journal must be nonempty.
Node
Owned tree node. Builders are validated when admitted to a store.
NodeId
Product-owned stable node identity; zero has no special meaning.
Store
Single-owner control-thread store, with atomic transactions and bounded history.
Subscription
Poll cursor associated with one store. Construct through subscribe. Do not transfer cursors to a different store.

Enums§

Change
Mutation
Complete transaction operations; order is significant.
Notifications
Bounded notifications. A lagging cursor receives the complete current tree.
StateError
Value
Persistable property values. Floating values must be finite.