Skip to main content

RuntimeRealtimeProductTurnHandle

Struct RuntimeRealtimeProductTurnHandle 

Source
pub struct RuntimeRealtimeProductTurnHandle { /* private fields */ }
Expand description

Runtime-backed RealtimeProductTurnHandle impl.

Implementations§

Source§

impl RuntimeRealtimeProductTurnHandle

Source

pub fn new(dsl: Arc<HandleDslAuthority>) -> Self

Construct a handle backed by the session’s shared DSL authority.

Source

pub fn ephemeral() -> Self

Construct a handle backed by an ephemeral DSL authority (tests / legacy recovery paths).

Trait Implementations§

Source§

impl Debug for RuntimeRealtimeProductTurnHandle

Source§

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

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

impl RealtimeProductTurnHandle for RuntimeRealtimeProductTurnHandle

Source§

fn turn_in_flight(&self) -> Result<bool, DslTransitionError>

Fire ProductTurnInFlight. Returns Ok(true) when the turn advanced from Idle; Ok(false) when already in-flight.
Source§

fn turn_committed(&self) -> Result<bool, DslTransitionError>

Fire ProductTurnCommitted. Returns Ok(true) when the phase advanced (AwaitingProgressCommitted, or OutputStartedPreemptible); Ok(false) otherwise.
Source§

fn output_started(&self) -> Result<bool, DslTransitionError>

Fire ProductOutputStarted. Returns Ok(true) when the phase advanced (AwaitingProgressOutputStarted, or CommittedPreemptible); Ok(false) otherwise.
Source§

fn turn_interrupted(&self) -> Result<bool, DslTransitionError>

Fire ProductTurnInterrupted. Returns Ok(true) when the output-started milestone was cleared (PreemptibleCommitted, or OutputStartedAwaitingProgress); Ok(false) otherwise.
Source§

fn turn_terminal(&self) -> Result<bool, DslTransitionError>

Fire ProductTurnTerminal. Returns Ok(true) when the phase advanced back to Idle from any non-Idle phase; Ok(false) when already Idle.
Source§

fn current_phase(&self) -> RealtimeProductTurnPhase

Read the current typed phase from the DSL.
Source§

fn projection_advance_observed( &self, advanced_at_ms: u64, ) -> Result<bool, DslTransitionError>

Fire RealtimeProjectionAdvanceObserved { advanced_at_ms } — the shell received a SessionContextAdvanced observer tick. The DSL decides the resulting freshness based on the current product-turn phase (live → StaleDeferred; idle → StaleImmediate). Read more
Source§

fn projection_refreshed( &self, observed_ms: u64, ) -> Result<bool, DslTransitionError>

Fire RealtimeProjectionRefreshed { observed_ms } — the shell completed a provider-session refresh drain. Returns to Clean.
Source§

fn projection_baseline_observed( &self, observed_ms: u64, ) -> Result<bool, DslTransitionError>

Fire RealtimeProjectionBaselineObserved { observed_ms } — the shell observed a provider-owned session-context mutation that the currently open provider session already contains. This may advance a clean frontier, but it must not clear StaleDeferred / StaleImmediate; only a real refresh drain may make stale state clean.
Source§

fn projection_reset(&self, baseline_ms: u64) -> Result<bool, DslTransitionError>

Fire RealtimeProjectionReset { baseline_ms } — the shell closed or reconnected the product session and wants to re-seed the Clean baseline at the current DSL session-context watermark.
Source§

fn projection_freshness(&self) -> RealtimeProjectionFreshness

Read the current typed projection-freshness discriminant from the DSL. The shell reads this at the canonical drain sites (observer tick arrival, input-chunk refresh gate, turn-end drain) to decide whether to rebuild the provider session’s projection.
Source§

fn projection_frontier_ms(&self) -> u64

Read the current monotonic frontier watermark from the DSL.
Source§

fn install_projection_freshness_observer( &self, observer: Arc<dyn RealtimeProjectionFreshnessObserver>, )

Install a typed observer for RealtimeProjectionFreshnessChanged effect emission. Implementations without an installed observer drop the effect (standalone / WASM paths).
Source§

fn install_projection_freshness_observer_with_snapshot( &self, observer: Arc<dyn RealtimeProjectionFreshnessObserver>, ) -> (RealtimeProjectionFreshness, u64)

Atomically install a typed observer and return the current freshness snapshot as a single authority read. Implementations MUST hold the same authority lock that projection transitions use for both observer installation and the (freshness, frontier) sample, so no RealtimeProjectionFreshnessChanged effect can slip between “observer visible” and “socket seeded from the DSL”. Read more
Source§

fn classify_client_input_submitted(&self) -> Result<bool, DslTransitionError>

Fire ClassifyRealtimeClientInputSubmitted — the client’s input chunk was accepted by the provider session. Returns Ok(false) when already ReattachAndRecover.
Source§

fn classify_mid_turn_activity(&self) -> Result<bool, DslTransitionError>

Fire ClassifyRealtimeMidTurnActivity — the provider session emitted a non-terminal activity (e.g. a tool call) inside a live turn. Returns Ok(false) when already ReattachAndRecover.
Source§

fn classify_turn_terminated(&self) -> Result<bool, DslTransitionError>

Fire ClassifyRealtimeTurnTerminated — the current turn reached a logical terminal stop reason. Also folds in the pending StaleDeferred → StaleImmediate promotion so the turn-end drain site picks up any pending advance.
Source§

fn reconnect_policy_on_clean_close(&self) -> RealtimeReconnectPolicy

Read the typed reconnect-policy classification. The shell reads this at the clean-close branch to decide whether a clean provider- session close should trigger a proactive reattach (ReattachAndRecover) or close the channel cleanly (CleanExit).
Source§

fn is_in_flight(&self) -> bool

True iff the provider session has an active turn (any non-Idle phase). Used by the realtime-WS projection-refresh gate.
Source§

fn should_preempt_on_input(&self) -> bool

True iff an input chunk arriving now should preempt the current provider-managed turn — i.e. the turn has reached Preemptible. Read more
Source§

fn is_projection_stale_immediate(&self) -> bool

Convenience accessor: true iff the current freshness is StaleImmediate — the shell uses this at drain sites.

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,