pub struct TuiState { /* private fields */ }Expand description
Pure terminal projection of canonical durable state and bounded ephemeral observations.
Implementations§
Source§impl TuiState
impl TuiState
Sourcepub fn from_snapshot(
snapshot: &SessionSnapshot,
startup: StartupContext,
) -> Self
pub fn from_snapshot( snapshot: &SessionSnapshot, startup: StartupContext, ) -> Self
Rebuilds a projection from one immutable canonical snapshot.
Sourcepub const fn session_id(&self) -> SessionId
pub const fn session_id(&self) -> SessionId
Returns session identity.
Sourcepub const fn model_ref(&self) -> Option<&ModelRef>
pub const fn model_ref(&self) -> Option<&ModelRef>
Returns the active durable provider-qualified model selection.
Sourcepub const fn reasoning_effort(&self) -> Option<ReasoningEffort>
pub const fn reasoning_effort(&self) -> Option<ReasoningEffort>
Returns the durable session reasoning selection, when explicit.
Sourcepub const fn pending_reasoning_effort(&self) -> Option<ReasoningEffort>
pub const fn pending_reasoning_effort(&self) -> Option<ReasoningEffort>
Returns a queued next-turn reasoning selection, when present.
Sourcepub fn displayed_reasoning_effort(&self) -> &'static str
pub fn displayed_reasoning_effort(&self) -> &'static str
Returns the effective durable or pending effort shown by the TUI.
Sourcepub fn messages(&self) -> &[CanonicalMessage]
pub fn messages(&self) -> &[CanonicalMessage]
Returns the current durable transcript.
Sourcepub const fn usage(&self) -> Option<&Usage>
pub const fn usage(&self) -> Option<&Usage>
Returns provider-neutral usage from the latest observed terminal run event.
Sourcepub const fn event_cursor(&self) -> SessionSequence
pub const fn event_cursor(&self) -> SessionSequence
Returns the current event cursor.
Sourcepub const fn is_resyncing(&self) -> bool
pub const fn is_resyncing(&self) -> bool
Returns whether a snapshot reload is pending after reconnect or a gap.
Sourcepub const fn generation(&self) -> u64
pub const fn generation(&self) -> u64
Returns current render generation.
Sourcepub const fn preferences(&self) -> &ViewPreferences
pub const fn preferences(&self) -> &ViewPreferences
Returns local view preferences.
Sourcepub const fn transcript_viewport(&self) -> &TranscriptViewport
pub const fn transcript_viewport(&self) -> &TranscriptViewport
Returns local transcript navigation state.
Sourcepub const fn approval(&self) -> Option<&ApprovalView>
pub const fn approval(&self) -> Option<&ApprovalView>
Returns the persisted approval projection, when pending.
Sourcepub const fn approval_choice(&self) -> ApprovalChoice
pub const fn approval_choice(&self) -> ApprovalChoice
Returns the selected approval choice.
Sourcepub const fn approval_submitting(&self) -> bool
pub const fn approval_submitting(&self) -> bool
Returns whether the approval command is already owned by the service.
Sourcepub const fn streaming(&self) -> &BTreeMap<MessageId, StreamingMessage>
pub const fn streaming(&self) -> &BTreeMap<MessageId, StreamingMessage>
Returns streamed incomplete messages.
Sourcepub const fn tools(&self) -> &BTreeMap<ToolCallId, ToolView>
pub const fn tools(&self) -> &BTreeMap<ToolCallId, ToolView>
Returns durable/transient tool projections.
Sourcepub const fn hosted_tools(&self) -> &BTreeMap<ToolCallId, HostedToolView>
pub const fn hosted_tools(&self) -> &BTreeMap<ToolCallId, HostedToolView>
Returns ephemeral provider-hosted activity projections.
Sourcepub const fn model_retry(&self) -> Option<&ModelRetryView>
pub const fn model_retry(&self) -> Option<&ModelRetryView>
Returns the currently scheduled model retry, when waiting in backoff.
Sourcepub const fn is_running(&self) -> bool
pub const fn is_running(&self) -> bool
Returns whether a model/tool run is currently active.
Sourcepub const fn run_elapsed_seconds(&self) -> u64
pub const fn run_elapsed_seconds(&self) -> u64
Returns elapsed whole seconds for the active request.
Sourcepub fn queued_message_count(&self) -> usize
pub fn queued_message_count(&self) -> usize
Returns the number of session-scoped ephemeral queued inputs shown.
Sourcepub fn attachments(&self) -> &[ComposerAttachment]
pub fn attachments(&self) -> &[ComposerAttachment]
Returns validated images retained for the next idle prompt submission.
Sourcepub fn attachment_blocks(&self) -> Vec<ContentBlock>
pub fn attachment_blocks(&self) -> Vec<ContentBlock>
Clones the canonical image blocks in submission order.
Sourcepub fn attachment_encoded_bytes(&self) -> usize
pub fn attachment_encoded_bytes(&self) -> usize
Returns aggregate encoded image bytes retained by the composer.
Trait Implementations§
impl StructuralPartialEq for TuiState
Auto Trait Implementations§
impl Freeze for TuiState
impl RefUnwindSafe for TuiState
impl Send for TuiState
impl Sync for TuiState
impl Unpin for TuiState
impl UnsafeUnpin for TuiState
impl UnwindSafe for TuiState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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