pub struct RealtimeGenerationState<M, S, R, C> { /* private fields */ }Expand description
Canonical composite state for realtime model generation.
C is the exact completion type returned by a concrete
SubmissionBackend. It is carried at the type level so a branch cannot
be published using an unrelated completion kind.
Implementations§
Source§impl<M, S, R, C> RealtimeGenerationState<M, S, R, C>
impl<M, S, R, C> RealtimeGenerationState<M, S, R, C>
Sourcepub fn new(
model_state: M,
schedule: RealtimeSpeechConfig,
samplers: Vec<S>,
random_state: Option<R>,
) -> Result<Self, RealtimeGenerationTransactionError<M::Error, C::Error>>
pub fn new( model_state: M, schedule: RealtimeSpeechConfig, samplers: Vec<S>, random_state: Option<R>, ) -> Result<Self, RealtimeGenerationTransactionError<M::Error, C::Error>>
Creates canonical state bound to one exact normalized schedule.
Sourcepub fn from_parts(
model_state: M,
schedule: &RealtimeSpeechConfig,
schedule_state: RealtimeFrameScheduleState,
samplers: Vec<S>,
random_state: Option<R>,
) -> Result<Self, RealtimeGenerationTransactionError<M::Error, C::Error>>
pub fn from_parts( model_state: M, schedule: &RealtimeSpeechConfig, schedule_state: RealtimeFrameScheduleState, samplers: Vec<S>, random_state: Option<R>, ) -> Result<Self, RealtimeGenerationTransactionError<M::Error, C::Error>>
Validates and adopts an existing portable schedule state.
This constructor is useful when resuming in-memory state: the state must carry the same complete schedule identity, not merely equal dimensions.
Sourcepub const fn model_state(&self) -> &M
pub const fn model_state(&self) -> &M
Borrows canonical model/cache state.
Sourcepub const fn schedule_state(&self) -> &RealtimeFrameScheduleState
pub const fn schedule_state(&self) -> &RealtimeFrameScheduleState
Borrows canonical delayed-frame state.
Sourcepub const fn random_state(&self) -> Option<&R>
pub const fn random_state(&self) -> Option<&R>
Borrows canonical backend random state.
Sourcepub fn set_random_state(&mut self, random_state: Option<R>)
pub fn set_random_state(&mut self, random_state: Option<R>)
Replaces backend randomness while the canonical request is idle.
Sourcepub fn set_samplers(
&mut self,
samplers: Vec<S>,
) -> Result<(), RealtimeGenerationTransactionError<M::Error, C::Error>>
pub fn set_samplers( &mut self, samplers: Vec<S>, ) -> Result<(), RealtimeGenerationTransactionError<M::Error, C::Error>>
Replaces sampler state while the canonical request is idle.
Sourcepub fn execute_frame_transition<T>(
&mut self,
frame: &RealtimeInputFrame,
transition: &mut T,
) -> Result<T::Output, RealtimeFrameExecutionError<T::Error, RealtimeGenerationTransactionError<M::Error, C::Error>>>
pub fn execute_frame_transition<T>( &mut self, frame: &RealtimeInputFrame, transition: &mut T, ) -> Result<T::Output, RealtimeFrameExecutionError<T::Error, RealtimeGenerationTransactionError<M::Error, C::Error>>>
Executes one ingress-dependent transition and publishes every mutable component only after its exact completion succeeds.
Sourcepub fn commit_submission_branch<B>(
&mut self,
branch: RealtimeGenerationBranch<M::Branch, S, R, C>,
) -> Result<(), RealtimeGenerationTransactionError<M::Error, C::Error>>
pub fn commit_submission_branch<B>( &mut self, branch: RealtimeGenerationBranch<M::Branch, S, R, C>, ) -> Result<(), RealtimeGenerationTransactionError<M::Error, C::Error>>
Publishes a branch only after the concrete backend’s exact completion has reported completion and successful waiting.
The backend bound proves that C is a SubmissionBackend::Completion
rather than architecture-owned or family-specific completion metadata.