Skip to main content

SchemaSendTracker

Struct SchemaSendTracker 

Source
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

Source

pub fn new() -> Self

Source

pub fn reset(&mut self)

Reset connection-scoped state — call on reconnection. The registry is preserved (schemas don’t change across connections).

Source

pub fn registry(&self) -> &SchemaRegistry

Borrow the schema registry. Used by the operation store to pull schemas it hasn’t stored yet.

Source

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.

Source

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.

Source

pub fn extract_schemas( &mut self, shape: &'static Shape, ) -> Result<ExtractedSchemas, SchemaExtractError>

Compatibility shim: schema extraction is now independent from connection-scoped send tracking.

Trait Implementations§

Source§

impl Debug for SchemaSendTracker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SchemaSendTracker

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ChannelLiveness for T
where T: MaybeSend + MaybeSync + 'static,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,