pub struct TextContinuationBoundary<'d, 's, B, C>where
B: TextGenerationBackend,
C: TokenFilterController,{ /* private fields */ }Expand description
Exclusive access for composing native mechanisms at an already settled continuation boundary. This is a backend/runtime-author surface, not a full snapshot API. Operations must validate before mutation and preserve or fence state on failure. Catching an unwind fences this continuation automatically.
Implementations§
Source§impl<B: TextGenerationBackend, C: TokenFilterController> TextContinuationBoundary<'_, '_, B, C>
impl<B: TextGenerationBackend, C: TokenFilterController> TextContinuationBoundary<'_, '_, B, C>
Sourcepub fn identity(&self) -> TextContinuationIdentity
pub fn identity(&self) -> TextContinuationIdentity
Same-run identity used before restoring any state component.
Sourcepub fn driver_identity(&self) -> TextDriverIdentity
pub fn driver_identity(&self) -> TextDriverIdentity
Exclusive source driver, common to this run and its isolated descendants.
Sourcepub fn controller(&self) -> &C
pub fn controller(&self) -> &C
Constraint state for an independently staged host checkpoint.
Sourcepub fn remaining_tokens(&self) -> Option<usize>
pub fn remaining_tokens(&self) -> Option<usize>
Remaining model-prediction allowance, including any pending input.
Sourcepub fn parts(
&self,
) -> (&ModelRuntime<B>, &B::TextGenerationState, Option<PendingTextInput<&B::Prompt, &B::Token>>)
pub fn parts( &self, ) -> (&ModelRuntime<B>, &B::TextGenerationState, Option<PendingTextInput<&B::Prompt, &B::Token>>)
Read-only mechanism inputs. No host or native state advances here.
Sourcepub fn mechanism_parts(
&mut self,
) -> (&mut ModelRuntime<B>, &mut B::TextGenerationState, Option<PendingTextInput<&B::Prompt, &B::Token>>)
pub fn mechanism_parts( &mut self, ) -> (&mut ModelRuntime<B>, &mut B::TextGenerationState, Option<PendingTextInput<&B::Prompt, &B::Token>>)
Native mechanism access while the pending input remains read-only. Callers retain the existing completion owner and must not submit ordinary model predictions through this snapshot-composition borrow.
Sourcepub fn install_host_state(
&mut self,
controller: C,
pending: Option<PendingTextInput<B::Prompt, B::Token>>,
remaining_tokens: Option<usize>,
)
pub fn install_host_state( &mut self, controller: C, pending: Option<PendingTextInput<B::Prompt, B::Token>>, remaining_tokens: Option<usize>, )
Installs independently prepared host state after all fallible validation, copying and native installation have succeeded. This performs no work.
Sourcepub fn fork_host_state(
&self,
backend_state: B::TextGenerationState,
controller: C,
pending: Option<PendingTextInput<B::Prompt, B::Token>>,
remaining_tokens: Option<usize>,
) -> TextGenerationContinuation<B, C>
pub fn fork_host_state( &self, backend_state: B::TextGenerationState, controller: C, pending: Option<PendingTextInput<B::Prompt, B::Token>>, remaining_tokens: Option<usize>, ) -> TextGenerationContinuation<B, C>
Constructs a child continuation from independently prepared components. Its native model state must be installed before advancing it. A child has a fresh run identity and shares only this driver’s execution authority.
Source§impl<B: NativeTextStateBackend, C: TokenFilterController> TextContinuationBoundary<'_, '_, B, C>
impl<B: NativeTextStateBackend, C: TokenFilterController> TextContinuationBoundary<'_, '_, B, C>
Sourcepub fn exchange_branch(
&mut self,
other: &mut TextGenerationContinuation<B, C>,
native: &mut B::NativeTextState,
) -> Result<(), TextContinuationError<B::Error, C::Error>>
pub fn exchange_branch( &mut self, other: &mut TextGenerationContinuation<B, C>, native: &mut B::NativeTextState, ) -> Result<(), TextContinuationError<B::Error, C::Error>>
Exchanges a quiescent child and its model-state slot with the installed continuation. All host checks precede native exchange; after its success the complete ordinary machine is moved infallibly. The facade then moves the matching semantic/lifecycle state before another prediction.