pub struct SchemaSendTracker { /* private fields */ }Expand description
Tracks which schemas have been sent on the current connection.
Plain struct — owned by SessionCore behind the same Mutex as the
conduit tx. Reset on reconnection.
Implementations§
Source§impl SchemaSendTracker
impl SchemaSendTracker
pub fn new() -> Self
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset connection-scoped state — call on reconnection. The registry is preserved (schemas don’t change across connections).
Sourcepub fn registry(&self) -> &SchemaRegistry
pub fn registry(&self) -> &SchemaRegistry
Borrow the schema registry. Used by the operation store to pull schemas it hasn’t stored yet.
Sourcepub fn has_sent_binding(
&self,
method_id: MethodId,
direction: BindingDirection,
) -> bool
pub fn has_sent_binding( &self, method_id: MethodId, direction: BindingDirection, ) -> bool
Whether this method+direction binding has already been sent on the wire.
Sourcepub fn plan_for_shape(
shape: &'static Shape,
) -> Result<PreparedSchemaPlan, SchemaExtractError>
pub fn plan_for_shape( shape: &'static Shape, ) -> Result<PreparedSchemaPlan, SchemaExtractError>
Compute the full schema payload for a shaped value without mutating any per-connection send tracking.
Sourcepub fn plan_from_source(
root_type: &TypeRef,
source: &dyn SchemaSource,
) -> PreparedSchemaPlan
pub fn plan_from_source( root_type: &TypeRef, source: &dyn SchemaSource, ) -> PreparedSchemaPlan
Compute the full schema payload for a canonical root type and schema source without mutating any per-connection send tracking.
Sourcepub fn preview_prepared_plan(
&mut self,
method_id: MethodId,
direction: BindingDirection,
prepared: &PreparedSchemaPlan,
) -> CborPayload
pub fn preview_prepared_plan( &mut self, method_id: MethodId, direction: BindingDirection, prepared: &PreparedSchemaPlan, ) -> CborPayload
Compute the schema payload that would be sent for a binding without mutating connection-scoped send tracking.
Sourcepub fn mark_prepared_plan_sent(
&mut self,
method_id: MethodId,
direction: BindingDirection,
prepared: &PreparedSchemaPlan,
)
pub fn mark_prepared_plan_sent( &mut self, method_id: MethodId, direction: BindingDirection, prepared: &PreparedSchemaPlan, )
Mark a previously previewed schema payload as successfully sent.
Sourcepub fn commit_prepared_plan(
&mut self,
method_id: MethodId,
direction: BindingDirection,
prepared: PreparedSchemaPlan,
) -> CborPayload
pub fn commit_prepared_plan( &mut self, method_id: MethodId, direction: BindingDirection, prepared: PreparedSchemaPlan, ) -> CborPayload
Commit a previously prepared schema payload against the live per-connection tracking state, returning only the schemas that still need to be sent on the wire for this binding.
Sourcepub fn attach_schemas_for_shape_if_needed(
&mut self,
method_id: MethodId,
shape: &'static Shape,
schematic: &mut impl Schematic,
) -> Result<CborPayload, SchemaExtractError>
pub fn attach_schemas_for_shape_if_needed( &mut self, method_id: MethodId, shape: &'static Shape, schematic: &mut impl Schematic, ) -> Result<CborPayload, SchemaExtractError>
Prepare schemas for a method call/response, returning a CBOR payload to inline in the request/response. Returns empty payload if schemas were already sent for this shape.
Sourcepub fn prepare_send(
&mut self,
method_id: MethodId,
direction: BindingDirection,
root_type: &TypeRef,
source: &dyn SchemaSource,
) -> CborPayload
pub fn prepare_send( &mut self, method_id: MethodId, direction: BindingDirection, root_type: &TypeRef, source: &dyn SchemaSource, ) -> CborPayload
Prepare schemas for sending, sourcing them from a SchemaSource.
Used for replay paths where we don’t have a live value shape but do
have the bound root TypeRef and a schema source.
pub fn commit_prepared_send( &mut self, method_id: MethodId, direction: BindingDirection, prepared: &CborPayload, ) -> CborPayload
Sourcepub fn extract_schemas(
&mut self,
shape: &'static Shape,
) -> Result<Arc<ExtractedSchemas>, SchemaExtractError>
pub fn extract_schemas( &mut self, shape: &'static Shape, ) -> Result<Arc<ExtractedSchemas>, SchemaExtractError>
Compatibility shim: schema extraction is now independent from connection-scoped send tracking.