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,
sampling: RealtimeSampling,
samplers: Vec<S>,
random_state: Option<R>,
) -> Result<Self, RealtimeGenerationTransactionError<M::Error, C::Error>>
pub fn new( model_state: M, schedule: RealtimeSpeechConfig, sampling: RealtimeSampling, 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,
sampling: RealtimeSampling,
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, sampling: RealtimeSampling, 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 sampling(&self) -> RealtimeSampling
pub const fn sampling(&self) -> RealtimeSampling
Returns the exact portable sampling policy paired with sampler and RNG state.
Sourcepub const fn random_state(&self) -> Option<&R>
pub const fn random_state(&self) -> Option<&R>
Borrows canonical backend random state.
Sourcepub fn replace_sampling(
&mut self,
sampling: RealtimeSampling,
samplers: Vec<S>,
random_state: Option<R>,
) -> Result<(), RealtimeGenerationTransactionError<M::Error, C::Error>>
pub fn replace_sampling( &mut self, sampling: RealtimeSampling, samplers: Vec<S>, random_state: Option<R>, ) -> Result<(), RealtimeGenerationTransactionError<M::Error, C::Error>>
Atomically replaces portable controls, sampler state, and randomness while 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.