Skip to main content

RealtimeGenerationState

Struct RealtimeGenerationState 

Source
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>
where M: SemanticStateTransaction, M::Error: 'static, C: Completion,

Source

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.

Source

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.

Source

pub const fn model_state(&self) -> &M

Borrows canonical model/cache state.

Source

pub const fn schedule_state(&self) -> &RealtimeFrameScheduleState

Borrows canonical delayed-frame state.

Source

pub const fn sampling(&self) -> RealtimeSampling

Returns the exact portable sampling policy paired with sampler and RNG state.

Source

pub fn samplers(&self) -> &[S]

Borrows canonical sampler states in text-plus-depth order.

Source

pub const fn random_state(&self) -> Option<&R>

Borrows canonical backend random state.

Source

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.

Source

pub fn execute_frame_transition<T>( &mut self, frame: &RealtimeInputFrame, transition: &mut T, ) -> Result<T::Output, RealtimeFrameExecutionError<T::Error, RealtimeGenerationTransactionError<M::Error, C::Error>>>
where S: Clone, R: Clone, T: RealtimeFrameTransition<M::Branch, S, R, C>,

Executes one ingress-dependent transition and publishes every mutable component only after its exact completion succeeds.

Source

pub fn commit_submission_branch<B>( &mut self, branch: RealtimeGenerationBranch<M::Branch, S, R, C>, ) -> Result<(), RealtimeGenerationTransactionError<M::Error, C::Error>>
where B: SubmissionBackend<Completion = C>, S: Clone, R: Clone,

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.

Trait Implementations§

Source§

impl<M: Debug, S: Debug, R: Debug, C: Debug> Debug for RealtimeGenerationState<M, S, R, C>

Source§

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

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

impl<M, S, R, C> SemanticStateTransaction for RealtimeGenerationState<M, S, R, C>
where M: SemanticStateTransaction, M::Error: 'static, S: Clone, R: Clone, C: Completion,

Source§

type Branch = RealtimeGenerationBranch<<M as SemanticStateTransaction>::Branch, S, R, C>

Transition-local branch.
Source§

type Error = RealtimeGenerationTransactionError<<M as SemanticStateTransaction>::Error, <C as Completion>::Error>

State error.
Source§

fn branch(&self) -> Result<Self::Branch, Self::Error>

Creates an unpublished branch.
Source§

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>

Discards an unpublished branch.
Source§

fn permits_parallel_branches(&self) -> bool

Whether independent branches may share the current canonical base.

Auto Trait Implementations§

§

impl<M, S, R, C> Freeze for RealtimeGenerationState<M, S, R, C>
where M: Freeze, Vec<S>: Freeze, Option<R>: Freeze, PhantomData<fn() -> C>: Freeze,

§

impl<M, S, R, C> RefUnwindSafe for RealtimeGenerationState<M, S, R, C>

§

impl<M, S, R, C> Send for RealtimeGenerationState<M, S, R, C>
where M: Send, Vec<S>: Send, Option<R>: Send, PhantomData<fn() -> C>: Send,

§

impl<M, S, R, C> Sync for RealtimeGenerationState<M, S, R, C>
where M: Sync, Vec<S>: Sync, Option<R>: Sync, PhantomData<fn() -> C>: Sync,

§

impl<M, S, R, C> Unpin for RealtimeGenerationState<M, S, R, C>
where M: Unpin, Vec<S>: Unpin, Option<R>: Unpin, PhantomData<fn() -> C>: Unpin,

§

impl<M, S, R, C> UnsafeUnpin for RealtimeGenerationState<M, S, R, C>

§

impl<M, S, R, C> UnwindSafe for RealtimeGenerationState<M, S, R, C>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.