pub struct SerializableStreamSpec {Show 13 fields
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>,
pub views: Vec<ViewDef>,
}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
views: Vec<ViewDef>View definitions for derived/projected views
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) -> SerializableStreamSpec
pub fn with_content_hash(self) -> SerializableStreamSpec
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 moreSource§impl Debug for SerializableStreamSpec
impl Debug for SerializableStreamSpec
Source§impl<'de> Deserialize<'de> for SerializableStreamSpec
impl<'de> Deserialize<'de> for SerializableStreamSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerializableStreamSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerializableStreamSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SerializableStreamSpec
impl Serialize for SerializableStreamSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for SerializableStreamSpec
impl RefUnwindSafe for SerializableStreamSpec
impl Send for SerializableStreamSpec
impl Sync for SerializableStreamSpec
impl Unpin for SerializableStreamSpec
impl UnwindSafe for SerializableStreamSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request