Skip to main content

TextContinuationBoundary

Struct TextContinuationBoundary 

Source
pub struct TextContinuationBoundary<'d, 's, B, C>{ /* 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>

Source

pub fn identity(&self) -> TextContinuationIdentity

Same-run identity used before restoring any state component.

Source

pub fn driver_identity(&self) -> TextDriverIdentity

Exclusive source driver, common to this run and its isolated descendants.

Source

pub fn controller(&self) -> &C

Constraint state for an independently staged host checkpoint.

Source

pub fn remaining_tokens(&self) -> Option<usize>

Remaining model-prediction allowance, including any pending input.

Source

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.

Source

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.

Source

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.

Source

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

pub fn fail(&mut self)

Fences a continuation when a composed operation cannot preserve it.

Source§

impl<B: NativeTextStateBackend, C: TokenFilterController> TextContinuationBoundary<'_, '_, B, C>

Source

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.

Trait Implementations§

Source§

impl<B: TextGenerationBackend, C: TokenFilterController> Drop for TextContinuationBoundary<'_, '_, B, C>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'d, 's, B, C> !UnwindSafe for TextContinuationBoundary<'d, 's, B, C>

§

impl<'d, 's, B, C> Freeze for TextContinuationBoundary<'d, 's, B, C>
where &'d mut ModelRuntime<B>: Freeze, &'s mut TextGenerationContinuation<B, C>: Freeze,

§

impl<'d, 's, B, C> RefUnwindSafe for TextContinuationBoundary<'d, 's, B, C>

§

impl<'d, 's, B, C> Send for TextContinuationBoundary<'d, 's, B, C>
where &'d mut ModelRuntime<B>: Send, &'s mut TextGenerationContinuation<B, C>: Send,

§

impl<'d, 's, B, C> Sync for TextContinuationBoundary<'d, 's, B, C>
where &'d mut ModelRuntime<B>: Sync, &'s mut TextGenerationContinuation<B, C>: Sync,

§

impl<'d, 's, B, C> Unpin for TextContinuationBoundary<'d, 's, B, C>
where &'d mut ModelRuntime<B>: Unpin, &'s mut TextGenerationContinuation<B, C>: Unpin,

§

impl<'d, 's, B, C> UnsafeUnpin for TextContinuationBoundary<'d, 's, B, 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.