Skip to main content

App

Struct App 

Source
pub struct App {
Show 81 fields pub messages: Vec<ChatMessage>, pub input: String, pub cursor_pos: usize, pub input_selection: Option<(usize, usize)>, pub scroll_offset: u32, pub max_scroll: u32, pub is_streaming: bool, pub current_response: String, pub current_thinking: String, pub should_quit: bool, pub mode: AppMode, pub usage: TokenUsage, pub model_name: String, pub provider_name: String, pub agent_name: String, pub theme: Theme, pub tick_count: u64, pub layout: LayoutRects, pub pending_tool_name: Option<String>, pub pending_tool_input: String, pub current_tool_calls: Vec<ToolCallDisplay>, pub streaming_segments: Vec<StreamSegment>, pub status_message: Option<StatusMessage>, pub model_selector: ModelSelector, pub agent_selector: AgentSelector, pub command_palette: CommandPalette, pub thinking_selector: ThinkingSelector, pub session_selector: SessionSelector, pub help_popup: HelpPopup, pub streaming_started: Option<Instant>, pub thinking_expanded: bool, pub thinking_budget: u32, pub auto_opened_thinking: bool, pub thinking_collapse_at: Option<Instant>, pub last_escape_time: Option<Instant>, pub follow_bottom: bool, pub paste_blocks: Vec<PasteBlock>, pub attachments: Vec<ImageAttachment>, pub conversation_title: Option<String>, pub vim_mode: bool, pub selection: TextSelection, pub content_width: u16, pub context_window: u32, pub last_input_tokens: u32, pub esc_hint_until: Option<Instant>, pub todos: Vec<TodoItem>, pub message_line_map: Vec<usize>, pub tool_line_map: Vec<Option<(usize, usize)>>, pub expanded_tool_calls: HashSet<(usize, usize)>, pub context_menu: MessageContextMenu, pub pending_question: Option<PendingQuestion>, pub pending_permission: Option<PendingPermission>, pub message_queue: VecDeque<QueuedMessage>, pub history: Vec<String>, pub history_index: Option<usize>, pub history_draft: String, pub skill_entries: Vec<(String, String)>, pub custom_command_names: Vec<String>, pub rename_input: String, pub rename_visible: bool, pub favorite_models: Vec<String>, pub file_picker: FilePicker, pub login_popup: LoginPopup, pub welcome_screen: WelcomeScreen, pub aside_popup: AsidePopup, pub chips: Vec<InputChip>, pub active_subagent: Option<SubagentState>, pub background_subagents: Vec<BackgroundSubagentInfo>, pub subagent_panel_expanded: bool, pub render_dirty: bool, pub render_cache: Option<RenderCache>, pub message_cache: Option<MessageCache>, pub segment_cache: Option<SegmentCache>, pub tool_call_complete_ticks: HashMap<(usize, usize), u64>, pub input_at_top: bool, pub cached_model_groups: Option<Vec<(String, Vec<String>)>>, pub model_fetch_rx: Option<Receiver<(Vec<(String, Vec<String>)>, String, String)>>, pub cursor_shape: CursorShape, pub cursor_blink: bool, pub cursor_shape_normal: Option<CursorShape>, pub cursor_blink_normal: Option<bool>,
}

Fields§

§messages: Vec<ChatMessage>§input: String§cursor_pos: usize§input_selection: Option<(usize, usize)>§scroll_offset: u32§max_scroll: u32§is_streaming: bool§current_response: String§current_thinking: String§should_quit: bool§mode: AppMode§usage: TokenUsage§model_name: String§provider_name: String§agent_name: String§theme: Theme§tick_count: u64§layout: LayoutRects§pending_tool_name: Option<String>§pending_tool_input: String§current_tool_calls: Vec<ToolCallDisplay>§streaming_segments: Vec<StreamSegment>§status_message: Option<StatusMessage>§model_selector: ModelSelector§agent_selector: AgentSelector§command_palette: CommandPalette§thinking_selector: ThinkingSelector§session_selector: SessionSelector§help_popup: HelpPopup§streaming_started: Option<Instant>§thinking_expanded: bool§thinking_budget: u32§auto_opened_thinking: bool§thinking_collapse_at: Option<Instant>§last_escape_time: Option<Instant>§follow_bottom: bool§paste_blocks: Vec<PasteBlock>§attachments: Vec<ImageAttachment>§conversation_title: Option<String>§vim_mode: bool§selection: TextSelection§content_width: u16§context_window: u32§last_input_tokens: u32§esc_hint_until: Option<Instant>§todos: Vec<TodoItem>§message_line_map: Vec<usize>§tool_line_map: Vec<Option<(usize, usize)>>§expanded_tool_calls: HashSet<(usize, usize)>§context_menu: MessageContextMenu§pending_question: Option<PendingQuestion>§pending_permission: Option<PendingPermission>§message_queue: VecDeque<QueuedMessage>§history: Vec<String>§history_index: Option<usize>§history_draft: String§skill_entries: Vec<(String, String)>§custom_command_names: Vec<String>§rename_input: String§rename_visible: bool§favorite_models: Vec<String>§file_picker: FilePicker§login_popup: LoginPopup§welcome_screen: WelcomeScreen§aside_popup: AsidePopup§chips: Vec<InputChip>§active_subagent: Option<SubagentState>§background_subagents: Vec<BackgroundSubagentInfo>§subagent_panel_expanded: bool§render_dirty: bool§render_cache: Option<RenderCache>§message_cache: Option<MessageCache>§segment_cache: Option<SegmentCache>§tool_call_complete_ticks: HashMap<(usize, usize), u64>§input_at_top: bool§cached_model_groups: Option<Vec<(String, Vec<String>)>>§model_fetch_rx: Option<Receiver<(Vec<(String, Vec<String>)>, String, String)>>§cursor_shape: CursorShape§cursor_blink: bool§cursor_shape_normal: Option<CursorShape>§cursor_blink_normal: Option<bool>

Implementations§

Source§

impl App

Source

pub fn new( model_name: String, provider_name: String, agent_name: String, theme_name: &str, vim_mode: bool, cursor_shape: CursorShape, cursor_blink: bool, cursor_shape_normal: Option<CursorShape>, cursor_blink_normal: Option<bool>, ) -> Self

Source

pub fn mark_dirty(&mut self)

Source

pub fn streaming_elapsed_secs(&self) -> Option<f64>

Source

pub fn thinking_level(&self) -> ThinkingLevel

Source

pub fn handle_agent_event(&mut self, event: AgentEvent)

Source

pub fn take_input(&mut self) -> Option<String>

Source

pub fn take_attachments(&mut self) -> Vec<ImageAttachment>

Source

pub fn queue_input(&mut self) -> bool

Source

pub fn input_height(&self, width: u16) -> u16

Source

pub fn handle_paste(&mut self, text: String)

Source

pub fn paste_block_at_cursor(&self) -> Option<usize>

Source

pub fn delete_paste_block(&mut self, idx: usize)

Source

pub fn chip_at_cursor(&self) -> Option<usize>

Source

pub fn delete_chip(&mut self, idx: usize)

Source

pub fn adjust_chips( &mut self, edit_start: usize, old_len: usize, new_len: usize, )

Source

pub fn add_image_attachment(&mut self, path: &str) -> Result<(), String>

Source

pub fn insert_file_reference(&mut self, path: &str)

Source

pub fn display_cursor_pos(&self) -> usize

Source

pub fn display_input(&self) -> String

Source

pub fn scroll_up(&mut self, n: u32)

Source

pub fn scroll_down(&mut self, n: u32)

Source

pub fn scroll_to_top(&mut self)

Source

pub fn scroll_to_bottom(&mut self)

Source

pub fn clear_conversation(&mut self)

Source

pub fn insert_char(&mut self, c: char)

Source

pub fn delete_char_before(&mut self)

Source

pub fn clear_input_selection(&mut self)

Source

pub fn input_selection_range(&self) -> Option<(usize, usize)>

Source

pub fn copy_input_selection(&self) -> Option<String>

Source

pub fn delete_input_selection(&mut self) -> bool

Source

pub fn select_left(&mut self)

Source

pub fn select_right(&mut self)

Source

pub fn select_home(&mut self)

Source

pub fn select_end(&mut self)

Source

pub fn select_all_input(&mut self)

Source

pub fn move_cursor_left(&mut self)

Source

pub fn move_cursor_right(&mut self)

Source

pub fn move_cursor_home(&mut self)

Source

pub fn move_cursor_end(&mut self)

Source

pub fn delete_word_before(&mut self)

Source

pub fn delete_to_end(&mut self)

Source

pub fn delete_to_start(&mut self)

Source

pub fn extract_selected_text(&self) -> Option<String>

Source

pub fn move_cursor_up(&mut self) -> bool

Source

pub fn move_cursor_down(&mut self) -> bool

Source

pub fn history_prev(&mut self)

Source

pub fn history_next(&mut self)

Auto Trait Implementations§

§

impl Freeze for App

§

impl !RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl !UnwindSafe for App

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

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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