Skip to main content

App

Struct App 

Source
pub struct App {
Show 53 fields pub messages: Vec<ChatMessage>, pub input: String, pub cursor_pos: usize, pub scroll_offset: u16, pub max_scroll: u16, pub scroll_position: f64, pub scroll_velocity: f64, 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 error_message: Option<String>, 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 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 visual_lines: Vec<String>, 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 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,
}

Fields§

§messages: Vec<ChatMessage>§input: String§cursor_pos: usize§scroll_offset: u16§max_scroll: u16§scroll_position: f64§scroll_velocity: f64§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>§error_message: Option<String>§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§last_escape_time: Option<Instant>§follow_bottom: bool§paste_blocks: Vec<PasteBlock>§attachments: Vec<ImageAttachment>§conversation_title: Option<String>§vim_mode: bool§selection: TextSelection§visual_lines: Vec<String>§content_width: u16§context_window: u32§last_input_tokens: u32§esc_hint_until: Option<Instant>§todos: Vec<TodoItem>§message_line_map: Vec<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

Implementations§

Source§

impl App

Source

pub fn new( model_name: String, provider_name: String, agent_name: String, theme_name: &str, vim_mode: bool, context_window: u32, ) -> 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) -> 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 add_image_attachment(&mut self, path: &str) -> Result<(), String>

Source

pub fn display_input(&self) -> String

Source

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

Source

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

Source

pub fn scroll_to_top(&mut self)

Source

pub fn scroll_to_bottom(&mut self)

Source

pub fn scroll_frac(&self) -> f64

Source

pub fn animate_scroll(&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 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