pub struct ProgressState {
pub input_tokens: AtomicU64,
pub output_tokens: AtomicU64,
pub is_running: AtomicBool,
pub is_paused: AtomicBool,
pub interrupt_requested: AtomicBool,
pub action: RwLock<String>,
pub focus: RwLock<Option<String>>,
pub start_time: Instant,
pub layout_state: RwLock<Option<Arc<LayoutState>>>,
}Expand description
Shared state for progress tracking
Fields§
§input_tokens: AtomicU64§output_tokens: AtomicU64§is_running: AtomicBool§is_paused: AtomicBoolWhether the indicator is paused (for coordinating with other output)
interrupt_requested: AtomicBoolWhether an interrupt has been requested (ESC pressed)
action: RwLock<String>Current action being performed (e.g., “Generating response”)
focus: RwLock<Option<String>>Current focus/detail (e.g., “Reading config.yaml”)
start_time: InstantStart time for elapsed tracking
layout_state: RwLock<Option<Arc<LayoutState>>>Optional layout state for fixed status line rendering
Implementations§
Source§impl ProgressState
impl ProgressState
pub fn new() -> Arc<Self>
pub fn update_tokens(&self, input: u64, output: u64)
pub fn get_tokens(&self) -> (u64, u64)
pub fn set_action(&self, action: &str)
pub fn get_action(&self) -> String
pub fn set_focus(&self, focus: &str)
pub fn clear_focus(&self)
pub fn get_focus(&self) -> Option<String>
pub fn stop(&self)
pub fn is_running(&self) -> bool
pub fn is_paused(&self) -> bool
Sourcepub fn set_layout(&self, layout: Arc<LayoutState>)
pub fn set_layout(&self, layout: Arc<LayoutState>)
Set the layout state for fixed status line rendering
Sourcepub fn has_layout(&self) -> bool
pub fn has_layout(&self) -> bool
Check if layout is active (for choosing render mode)
Sourcepub fn get_layout(&self) -> Option<Arc<LayoutState>>
pub fn get_layout(&self) -> Option<Arc<LayoutState>>
Get layout state if available
Sourcepub fn request_interrupt(&self)
pub fn request_interrupt(&self)
Request an interrupt (called when ESC is pressed)
Sourcepub fn is_interrupted(&self) -> bool
pub fn is_interrupted(&self) -> bool
Check if an interrupt has been requested
Sourcepub fn clear_interrupt(&self)
pub fn clear_interrupt(&self)
Clear the interrupt flag
Trait Implementations§
Source§impl Debug for ProgressState
impl Debug for ProgressState
Auto Trait Implementations§
impl !Freeze for ProgressState
impl !RefUnwindSafe for ProgressState
impl Send for ProgressState
impl Sync for ProgressState
impl Unpin for ProgressState
impl UnwindSafe for ProgressState
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
Mutably borrows from an owned value. Read more
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> 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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.