Expand description
Canonical plugin-state wire format.
Lives in truce-utils (rather than truce-core) so build-time
tools - cargo-truce emits factory-preset files containing this
envelope at install time - can produce byte-identical blobs
without inheriting truce-core’s runtime dependency chain.
truce-core::state re-exports everything here and layers the
plugin-coupled helpers (apply_state, snapshot_plugin, …)
on top.
Structs§
- Deserialized
State - Deserialized state.
Enums§
- State
Parse - Outcome of
parse_state: what the bytes turned out to be. Splits the causesdeserialize_statecollapses into oneNoneso callers can route each one differently (fail the load, offer the bytes to the plugin’smigrate_statehook, …).
Functions§
- deserialize_
state - Deserialize plugin state. Thin wrapper over
parse_statefor callers that only care about the strict-success case (preset codecs, tests). - hash_
plugin_ id - Compute a simple hash of the plugin ID string for state identification.
- parse_
state - Parse a state blob, distinguishing every failure cause. See
StateParsefor the routing each variant is meant for. - serialize_
state - Serialize plugin state: parameter values + extra state. Empty
extraslice serializes as the same0u64length-prefix that an absent extra block would, so callers don’t need anOptionwrapper to express “no extra state”. - vst3_
cid - The 16-byte VST3 class ID for a plugin ID string.