pub struct TerminalRuntimeView { /* private fields */ }Expand description
One terminal attachment to either a local or authenticated remote runtime.
Dropping this value detaches the terminal. It does not own or stop the SDK runtime, continuation loop, scheduler, or persistence.
Implementations§
Source§impl TerminalRuntimeView
impl TerminalRuntimeView
pub async fn attach( runtime: Arc<dyn FrontendRuntime>, history_limit: usize, ) -> Result<Self, FrontendRuntimeError>
pub fn descriptor(&self) -> &FrontendRuntimeDescriptor
Sourcepub fn controller(&self) -> Arc<dyn FrontendRuntime> ⓘ
pub fn controller(&self) -> Arc<dyn FrontendRuntime> ⓘ
Clone the protocol-neutral controller without duplicating the live attachment. Long-running actions can be spawned while this view keeps consuming runtime events.
pub fn history(&self) -> &[ChatMessage]
pub fn history_cursor(&self) -> u64
Sourcepub fn transcript_model(&self) -> TranscriptModel
pub fn transcript_model(&self) -> TranscriptModel
Build the normalized transcript at this attachment’s atomic history/live boundary.
pub async fn next_event( &mut self, ) -> Result<FrontendEvent, FrontendRuntimeError>
Sourcepub fn next_replay_event(&mut self) -> Option<FrontendEvent>
pub fn next_replay_event(&mut self) -> Option<FrontendEvent>
Return the next finite replay item without waiting for live runtime traffic. Full-screen consumers drain this snapshot before enabling input so resolved historical requests are projected atomically.
Sourcepub async fn update_transcript(
&mut self,
transcript: &mut TranscriptModel,
) -> Result<bool, FrontendRuntimeError>
pub async fn update_transcript( &mut self, transcript: &mut TranscriptModel, ) -> Result<bool, FrontendRuntimeError>
Receive and apply the next non-duplicate runtime event.
Sourcepub async fn update_ui(
&mut self,
transcript: &mut TranscriptModel,
composer: &mut ComposerModel,
) -> Result<bool, FrontendRuntimeError>
pub async fn update_ui( &mut self, transcript: &mut TranscriptModel, composer: &mut ComposerModel, ) -> Result<bool, FrontendRuntimeError>
Receive one event and apply it to both terminal projections. The same lossless SDK event drives transcript and composer state.
Sourcepub async fn dispatch_composer_action(
&self,
action: ComposerAction,
composer: &mut ComposerModel,
transcript: &mut TranscriptModel,
) -> Result<(), FrontendRuntimeError>
pub async fn dispatch_composer_action( &self, action: ComposerAction, composer: &mut ComposerModel, transcript: &mut TranscriptModel, ) -> Result<(), FrontendRuntimeError>
Route a pure composer action through the protocol-neutral runtime. Typed responses complete their existing transcript request cell only after the runtime accepts the exactly-once response.
pub async fn submit( &self, prompt: impl Into<String>, ) -> Result<String, FrontendRuntimeError>
pub async fn interrupt(&self) -> Result<bool, FrontendRuntimeError>
pub async fn steer( &self, prompt: impl Into<String>, ) -> Result<(), FrontendRuntimeError>
pub async fn respond( &self, response: FrontendResponse, ) -> Result<(), FrontendRuntimeError>
pub async fn invoke( &self, operation: FrontendOperationInvocation, ) -> Result<FrontendOperationResult, FrontendRuntimeError>
Auto Trait Implementations§
impl !RefUnwindSafe for TerminalRuntimeView
impl !UnwindSafe for TerminalRuntimeView
impl Freeze for TerminalRuntimeView
impl Send for TerminalRuntimeView
impl Sync for TerminalRuntimeView
impl Unpin for TerminalRuntimeView
impl UnsafeUnpin for TerminalRuntimeView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more