pub struct ChatApp {Show 30 fields
pub messages: Vec<ChatMessage>,
pub input: String,
pub cursor: usize,
pub message_scroll: ScrollState,
pub sidebar_scroll: ScrollState,
pub should_quit: bool,
pub is_processing: bool,
pub session_id: Option<String>,
pub session_name: String,
pub working_directory: String,
pub git_branch: Option<String>,
pub context_budget: usize,
pub todo_items: Vec<TodoItemView>,
pub subagent_items: Vec<SubagentItemView>,
pub cached_lines: RefCell<Vec<Line<'static>>>,
pub cached_width: RefCell<usize>,
pub needs_rebuild: RefCell<bool>,
pub available_sessions: Vec<SessionMetadata>,
pub is_picking_session: bool,
pub commands: Vec<SlashCommand>,
pub filtered_commands: Vec<SlashCommand>,
pub selected_command_index: usize,
pub pending_attachments: Vec<MessageAttachment>,
pub current_model_ref: String,
pub available_models: Vec<ModelOptionView>,
pub last_context_tokens: Option<usize>,
pub text_selection: TextSelection,
pub clipboard_notice: Option<ClipboardNotice>,
pub current_agent_name: Option<String>,
pub available_agents: Vec<AgentOptionView>,
/* private fields */
}Fields§
§messages: Vec<ChatMessage>§input: String§cursor: usize§message_scroll: ScrollState§should_quit: bool§is_processing: bool§session_id: Option<String>§session_name: String§working_directory: String§git_branch: Option<String>§context_budget: usize§todo_items: Vec<TodoItemView>§subagent_items: Vec<SubagentItemView>§cached_lines: RefCell<Vec<Line<'static>>>§cached_width: RefCell<usize>§needs_rebuild: RefCell<bool>§available_sessions: Vec<SessionMetadata>§is_picking_session: bool§commands: Vec<SlashCommand>§filtered_commands: Vec<SlashCommand>§selected_command_index: usize§pending_attachments: Vec<MessageAttachment>§current_model_ref: String§available_models: Vec<ModelOptionView>§last_context_tokens: Option<usize>§text_selection: TextSelection§clipboard_notice: Option<ClipboardNotice>§current_agent_name: Option<String>§available_agents: Vec<AgentOptionView>Implementations§
Source§impl ChatApp
impl ChatApp
pub fn new(session_name: String, cwd: &Path) -> Self
pub fn set_agents( &mut self, agents: Vec<AgentOptionView>, selected: Option<String>, )
pub fn cycle_agent(&mut self)
pub fn selected_agent(&self) -> Option<&AgentOptionView>
pub fn handle_event(&mut self, event: &TuiEvent)
pub fn has_pending_question(&self) -> bool
pub fn pending_question_view(&self) -> Option<PendingQuestionView>
pub fn handle_question_key(&mut self, key_event: KeyEvent) -> QuestionKeyResult
pub fn submit_input(&mut self) -> SubmittedInput
Sourcepub fn get_lines(&self, width: usize) -> Ref<'_, Vec<Line<'static>>>
pub fn get_lines(&self, width: usize) -> Ref<'_, Vec<Line<'static>>>
Get or rebuild cached lines for the given width (interior mutability)
pub fn progress_panel_height(&self) -> u16
pub fn message_viewport_height(&self, total_height: u16) -> usize
pub fn message_wrap_width(&self, total_width: u16) -> usize
pub fn context_usage(&self) -> (usize, usize)
pub fn processing_step(&self, interval_ms: u128) -> usize
pub fn processing_duration(&self) -> String
pub fn set_processing(&mut self, processing: bool)
pub fn session_epoch(&self) -> u64
pub fn run_epoch(&self) -> u64
pub fn bump_session_epoch(&mut self)
pub fn bump_run_epoch(&mut self)
pub fn start_new_session(&mut self, session_name: String)
Sourcepub fn cancel_agent_task(&mut self)
pub fn cancel_agent_task(&mut self)
Cancel any running agent task
Sourcepub fn set_agent_task(&mut self, handle: JoinHandle<()>)
pub fn set_agent_task(&mut self, handle: JoinHandle<()>)
Set the agent task handle
pub fn arm_esc_interrupt(&mut self)
pub fn clear_pending_esc_interrupt(&mut self)
pub fn should_interrupt_on_esc(&self) -> bool
pub fn processing_interrupt_hint(&self) -> &'static str
pub fn update_command_filtering(&mut self)
pub fn mark_dirty(&self)
pub fn configure_models( &mut self, current_model_ref: String, available_models: Vec<ModelOptionView>, )
pub fn selected_model_ref(&self) -> &str
pub fn set_selected_model(&mut self, model_ref: &str)
pub fn insert_char(&mut self, ch: char)
pub fn insert_str(&mut self, text: &str)
pub fn backspace(&mut self)
pub fn clear_input(&mut self)
pub fn set_input(&mut self, value: String)
pub fn add_pending_attachment(&mut self, attachment: MessageAttachment)
pub fn move_to_line_start(&mut self)
pub fn move_to_line_end(&mut self)
pub fn move_cursor_up(&mut self)
pub fn move_cursor_down(&mut self)
pub fn move_cursor_left(&mut self)
pub fn move_cursor_right(&mut self)
pub fn start_selection(&mut self, line: usize, column: usize)
pub fn update_selection(&mut self, line: usize, column: usize)
pub fn end_selection(&mut self)
pub fn clear_selection(&mut self)
pub fn show_clipboard_notice(&mut self, x: u16, y: u16)
pub fn active_clipboard_notice(&self) -> Option<ClipboardNotice>
Sourcepub fn get_selected_text(&self, lines: &[Line<'static>]) -> String
pub fn get_selected_text(&self, lines: &[Line<'static>]) -> String
Get selected text from the lines
Sourcepub fn is_point_selected(&self, line: usize, column: usize) -> bool
pub fn is_point_selected(&self, line: usize, column: usize) -> bool
Check if a point (line, column) is within the selection
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChatApp
impl !RefUnwindSafe for ChatApp
impl Send for ChatApp
impl !Sync for ChatApp
impl Unpin for ChatApp
impl UnsafeUnpin for ChatApp
impl UnwindSafe for ChatApp
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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 more