pub struct RealtimePayloadState<M, P> { /* private fields */ }Expand description
Canonical semantic model state paired with its delayed realtime payloads.
Implementations§
Source§impl<M, P> RealtimePayloadState<M, P>
impl<M, P> RealtimePayloadState<M, P>
Sourcepub fn fresh(model_state: M, schedule: RealtimeSpeechConfig) -> Self
pub fn fresh(model_state: M, schedule: RealtimeSpeechConfig) -> Self
Creates fresh model state with empty delayed-payload history for one schedule.
This is the canonical request-local initialization path. Architecture and facade composition can assemble neutral realtime state without asking a concrete backend to understand delayed-frame semantics.
Sourcepub fn new(
model_state: M,
payload_history: RealtimePayloadHistory<P>,
schedule: &RealtimeSpeechConfig,
) -> Result<Self, RealtimePayloadHistoryError>
pub fn new( model_state: M, payload_history: RealtimePayloadHistory<P>, schedule: &RealtimeSpeechConfig, ) -> Result<Self, RealtimePayloadHistoryError>
Pairs model state with history only when both use the exact selected schedule.
Sourcepub const fn model_state(&self) -> &M
pub const fn model_state(&self) -> &M
Returns canonical model/cache state.
Sourcepub fn model_state_mut(&mut self) -> &mut M
pub fn model_state_mut(&mut self) -> &mut M
Mutably returns canonical model/cache state.
Sourcepub const fn payload_history(&self) -> &RealtimePayloadHistory<P>
pub const fn payload_history(&self) -> &RealtimePayloadHistory<P>
Returns canonical delayed payload history.
Sourcepub fn payload_history_mut(&mut self) -> &mut RealtimePayloadHistory<P>
pub fn payload_history_mut(&mut self) -> &mut RealtimePayloadHistory<P>
Mutably returns canonical delayed payload history.
Sourcepub fn parts_mut(&mut self) -> (&mut M, &mut RealtimePayloadHistory<P>)
pub fn parts_mut(&mut self) -> (&mut M, &mut RealtimePayloadHistory<P>)
Mutably borrows model/cache state and payload history together.
Sourcepub fn into_parts(self) -> (M, RealtimePayloadHistory<P>)
pub fn into_parts(self) -> (M, RealtimePayloadHistory<P>)
Consumes canonical model state and payload history.
Trait Implementations§
Source§impl<M: Clone, P: Clone> Clone for RealtimePayloadState<M, P>
impl<M: Clone, P: Clone> Clone for RealtimePayloadState<M, P>
Source§fn clone(&self) -> RealtimePayloadState<M, P>
fn clone(&self) -> RealtimePayloadState<M, P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<M: Eq, P: Eq> Eq for RealtimePayloadState<M, P>
Source§impl<M, P> SemanticStateTransaction for RealtimePayloadState<M, P>
impl<M, P> SemanticStateTransaction for RealtimePayloadState<M, P>
Source§type Branch = RealtimePayloadBranch<<M as SemanticStateTransaction>::Branch, P>
type Branch = RealtimePayloadBranch<<M as SemanticStateTransaction>::Branch, P>
Transition-local branch.
Source§type Error = RealtimePayloadStateTransactionError<<M as SemanticStateTransaction>::Error>
type Error = RealtimePayloadStateTransactionError<<M as SemanticStateTransaction>::Error>
State error.
Source§fn commit_branch(&mut self, branch: Self::Branch) -> Result<(), Self::Error>
fn commit_branch(&mut self, branch: Self::Branch) -> Result<(), Self::Error>
Publishes a completed branch.
Source§fn discard_branch(branch: Self::Branch) -> Result<(), Self::Error>
fn discard_branch(branch: Self::Branch) -> Result<(), Self::Error>
Discards an unpublished branch.
Source§fn permits_parallel_branches(&self) -> bool
fn permits_parallel_branches(&self) -> bool
Whether independent branches may share the current canonical base.
impl<M: PartialEq, P: PartialEq> StructuralPartialEq for RealtimePayloadState<M, P>
Auto Trait Implementations§
impl<M, P> Freeze for RealtimePayloadState<M, P>
impl<M, P> RefUnwindSafe for RealtimePayloadState<M, P>
impl<M, P> Send for RealtimePayloadState<M, P>
impl<M, P> Sync for RealtimePayloadState<M, P>
impl<M, P> Unpin for RealtimePayloadState<M, P>
impl<M, P> UnsafeUnpin for RealtimePayloadState<M, P>
impl<M, P> UnwindSafe for RealtimePayloadState<M, P>
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
Mutably borrows from an owned value. Read more