Skip to main content

SpeculativeOutputRuntime

Struct SpeculativeOutputRuntime 

Source
pub struct SpeculativeOutputRuntime<S, C, P> { /* private fields */ }
Expand description

Canonical speculative sampler, sequence, constraint, and output sink.

Implementations§

Source§

impl<S, C, P> SpeculativeOutputRuntime<S, C, P>

Source

pub fn new( sampler: S, sequence: GenerationSequence, constraint: C, publisher: P, cancellation: GenerationCancellationToken, ) -> Self

Creates one canonical output runtime.

Source

pub fn with_lifecycle_observer( self, observer: Arc<dyn SpeculativeLifecycleObserver>, ) -> Self

Installs explicit production lifecycle observation for this lane.

Source

pub fn observe_lifecycle( &self, stage: SpeculativeLifecycleStage, ) -> Result<(), SpeculativeOutputError>

Observes one lifecycle boundary before its associated work.

Source

pub const fn sampler(&self) -> &S

Canonical sampling state.

Source

pub const fn sampler_mut(&mut self) -> &mut S

Mutable canonical sampling state.

Source

pub const fn sequence(&self) -> &GenerationSequence

Canonical committed sequence.

Source

pub const fn sequence_mut(&mut self) -> &mut GenerationSequence

Mutable canonical committed sequence.

Source

pub const fn constraint(&self) -> &C

Transactional semantic constraint.

Source

pub const fn constraint_mut(&mut self) -> &mut C

Mutable transactional semantic constraint.

Source

pub const fn cancellation(&self) -> &GenerationCancellationToken

Cooperative cancellation token.

Source

pub fn cancel(&mut self) -> Result<(), SpeculativeOutputError>

Applies cancellation and publishes its terminal semantic state.

Source

pub fn install_committed_state( &mut self, sampler: S, constraint: C, sequence: GenerationSequence, )

Installs logical state only after its matching backend boundary committed.

Source

pub fn publish_committed( &mut self, tokens: &[u32], ) -> Result<bool, SpeculativeOutputError>

Publishes tokens only after their backend cache transaction committed.

Auto Trait Implementations§

§

impl<S, C, P> !RefUnwindSafe for SpeculativeOutputRuntime<S, C, P>

§

impl<S, C, P> !UnwindSafe for SpeculativeOutputRuntime<S, C, P>

§

impl<S, C, P> Freeze for SpeculativeOutputRuntime<S, C, P>
where S: Freeze, C: Freeze, P: Freeze,

§

impl<S, C, P> Send for SpeculativeOutputRuntime<S, C, P>
where S: Send, C: Send, P: Send,

§

impl<S, C, P> Sync for SpeculativeOutputRuntime<S, C, P>
where S: Sync, C: Sync, P: Sync,

§

impl<S, C, P> Unpin for SpeculativeOutputRuntime<S, C, P>
where S: Unpin, C: Unpin, P: Unpin,

§

impl<S, C, P> UnsafeUnpin for SpeculativeOutputRuntime<S, C, P>

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.