pub struct SerializableStreamSpec {
pub state_name: String,
pub program_id: Option<String>,
pub idl: Option<IdlSnapshot>,
pub identity: IdentitySpec,
pub handlers: Vec<SerializableHandlerSpec>,
pub sections: Vec<EntitySection>,
pub field_mappings: BTreeMap<String, FieldTypeInfo>,
pub resolver_hooks: Vec<ResolverHook>,
pub instruction_hooks: Vec<InstructionHook>,
pub computed_fields: Vec<String>,
pub computed_field_specs: Vec<ComputedFieldSpec>,
pub content_hash: Option<String>,
}Expand description
Serializable version of StreamSpec without phantom types
Fields§
§state_name: String§program_id: Option<String>Program ID (Solana address) - extracted from IDL
idl: Option<IdlSnapshot>Embedded IDL for AST-only compilation
identity: IdentitySpec§handlers: Vec<SerializableHandlerSpec>§sections: Vec<EntitySection>§field_mappings: BTreeMap<String, FieldTypeInfo>§resolver_hooks: Vec<ResolverHook>§instruction_hooks: Vec<InstructionHook>§computed_fields: Vec<String>Computed field paths (legacy, for backward compatibility)
computed_field_specs: Vec<ComputedFieldSpec>Computed field specifications with full expression AST
content_hash: Option<String>Deterministic content hash (SHA256 of canonical JSON, excluding this field) Used for deduplication and version tracking
Implementations§
Source§impl SerializableStreamSpec
impl SerializableStreamSpec
Sourcepub fn compute_content_hash(&self) -> String
pub fn compute_content_hash(&self) -> String
Compute deterministic content hash (SHA256 of canonical JSON).
The hash is computed over the entire spec except the content_hash field itself, ensuring the same AST always produces the same hash regardless of when it was generated or by whom.
Sourcepub fn verify_content_hash(&self) -> bool
pub fn verify_content_hash(&self) -> bool
Verify that the content_hash matches the computed hash. Returns true if hash is valid or not set.
Sourcepub fn with_content_hash(self) -> Self
pub fn with_content_hash(self) -> Self
Set the content_hash field to the computed hash.
Trait Implementations§
Source§impl Clone for SerializableStreamSpec
impl Clone for SerializableStreamSpec
Source§fn clone(&self) -> SerializableStreamSpec
fn clone(&self) -> SerializableStreamSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more