pub struct MultiEntityBytecode {
pub entities: HashMap<String, EntityBytecode>,
pub event_routing: HashMap<String, Vec<String>>,
pub when_events: HashSet<String>,
pub proto_router: ProtoRouter,
}Fields§
§entities: HashMap<String, EntityBytecode>§event_routing: HashMap<String, Vec<String>>§when_events: HashSet<String>§proto_router: ProtoRouterImplementations§
Source§impl MultiEntityBytecode
impl MultiEntityBytecode
pub fn from_single<S>( entity_name: String, spec: TypedStreamSpec<S>, state_id: u32, ) -> Self
pub fn from_entities(entities_vec: Vec<(String, Box<dyn Any>, u32)>) -> Self
pub fn new() -> MultiEntityBytecodeBuilder
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Deterministic content hash of the compiled bytecode, used to invalidate state snapshots when the stack’s compiled logic changes.
Covers state ids, handler opcode streams, routing, and field metadata. Computed-field evaluators are opaque closures, so only their presence is hashed — their bodies are generated from the same stack source as the opcode streams, which change alongside them in practice.
Opcode streams are hashed via a canonical serde encoding (externally
tagged variants, object keys sorted), NOT via Debug formatting, so the
hash survives cosmetic churn that doesn’t alter the compiled program:
rustc Debug formatting changes, struct field reordering, and inserting
new OpCode variants. Renaming a variant or field DOES change the hash
(names are the tags) — treat renames as snapshot-invalidating. Interpreter
behavior changes that keep the encoding identical are invisible here;
those must bump SNAPSHOT_FORMAT_VERSION instead.