Skip to main content

App

Struct App 

Source
pub struct App {
Show 37 fields pub items: Vec<AnalyzedItem>, pub filtered_items: Vec<usize>, pub crate_info: Option<CrateInfo>, pub dependency_tree: Vec<(String, usize)>, pub filtered_dependency_indices: Vec<usize>, pub crate_registry: CrateRegistry, pub installed_crates_list: Vec<String>, pub selected_installed_crate: Option<InstalledCrate>, pub installed_crate_items: Vec<AnalyzedItem>, pub installed_crate_filtered: Vec<usize>, pub search_input: String, pub current_tab: Tab, pub focus: Focus, pub list_state: ListState, pub completion_selected: usize, pub show_completion: bool, pub show_help: bool, pub show_settings: bool, pub status_message: String, pub candidates: Vec<CompletionCandidate>, pub filtered_candidates: Vec<CompletionCandidate>, pub settings: Settings, pub theme: Theme, pub should_quit: bool, pub project_path: Option<PathBuf>, pub copilot_chat_open: bool, pub copilot_chat_messages: Vec<(String, String)>, pub copilot_chat_input: String, pub copilot_chat_loading: bool, pub copilot_chat_scroll: usize, pub target_size_bytes: Option<u64>, pub crate_docs_cache: HashMap<String, CrateDocInfo>, pub crate_docs_loading: Option<String>, pub crate_docs_failed: HashSet<String>, pub crate_docs_rx: Receiver<(String, Option<CrateDocInfo>)>, pub copilot_tx: Sender<String>, pub copilot_rx: Receiver<String>, /* private fields */
}
Expand description

Main application state

Fields§

§items: Vec<AnalyzedItem>§filtered_items: Vec<usize>§crate_info: Option<CrateInfo>§dependency_tree: Vec<(String, usize)>§filtered_dependency_indices: Vec<usize>

Indices into dependency_tree for Crates tab list (filtered by search). Empty = not computed.

§crate_registry: CrateRegistry§installed_crates_list: Vec<String>§selected_installed_crate: Option<InstalledCrate>§installed_crate_items: Vec<AnalyzedItem>§installed_crate_filtered: Vec<usize>§search_input: String§current_tab: Tab§focus: Focus§list_state: ListState§completion_selected: usize§show_completion: bool§show_help: bool§show_settings: bool§status_message: String§candidates: Vec<CompletionCandidate>§filtered_candidates: Vec<CompletionCandidate>§settings: Settings§theme: Theme§should_quit: bool§project_path: Option<PathBuf>§copilot_chat_open: bool§copilot_chat_messages: Vec<(String, String)>

(role, content) with role “user” or “assistant”

§copilot_chat_input: String§copilot_chat_loading: bool§copilot_chat_scroll: usize§target_size_bytes: Option<u64>

Size of target/ directory in bytes (build artifacts), if computed.

§crate_docs_cache: HashMap<String, CrateDocInfo>§crate_docs_loading: Option<String>§crate_docs_failed: HashSet<String>§crate_docs_rx: Receiver<(String, Option<CrateDocInfo>)>§copilot_tx: Sender<String>§copilot_rx: Receiver<String>

Implementations§

Source§

impl App

Source

pub fn new() -> Self

Source

pub fn load_settings(&mut self) -> Result<()>

Load settings from config file

Source

pub fn cycle_theme(&mut self)

Cycle to the next theme and persist to config

Source

pub fn toggle_settings(&mut self)

Source

pub fn analyze_project(&mut self, path: &Path) -> Result<()>

Analyze a Rust project

Source

pub fn update_candidates(&mut self)

Update completion candidates from analyzed items

Source

pub fn filter_items(&mut self)

Filter items based on search input and current tab

Source

pub fn scan_installed_crates(&mut self) -> Result<()>

Scan for installed crates

Source

pub fn search_qualified_path(&mut self) -> bool

Parse qualified path and navigate to crate + filter items E.g., “serde::de::Deserialize” -> select serde crate, filter for de::Deserialize

Source

pub fn select_installed_crate(&mut self, name: &str) -> Result<()>

Select an installed crate and analyze it

Source

pub fn clear_installed_crate(&mut self)

Clear selected installed crate (go back to list)

Source

pub fn installed_crates_display_list(&self) -> Vec<String>

Crates to show in Crates tab: project dependencies when we have a Cargo project, else all installed.

Source

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

Crate name for “open in browser” (o key): current crate when inside one, or selected dep from list.

Source

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

Selected crate name in Crates tab (root or a dep). None if inside a crate, empty list, or wrong tab.

Source

pub fn dependency_root_name(&self) -> Option<&str>

Root crate name in dependency tree (first entry, depth 0). None if no tree.

Source

pub fn poll_crate_docs_rx(&mut self)

Process any received crate doc fetch results (call each frame).

Source

pub fn maybe_start_crate_doc_fetch(&mut self)

If on Crates tab and selected crate is not root and not cached/loading/failed, start fetch in background.

Source

pub fn get_current_list_len(&self) -> usize

Get current list length based on tab and selection state

Source

pub fn selected_item(&self) -> Option<&AnalyzedItem>

Get the currently selected item

Source

pub fn get_filtered_items(&self) -> Vec<&AnalyzedItem>

Get filtered items as references

Source

pub fn next_item(&mut self)

Source

pub fn prev_item(&mut self)

Source

pub fn next_tab(&mut self)

Source

pub fn prev_tab(&mut self)

Source

pub fn next_focus(&mut self)

Source

pub fn prev_focus(&mut self)

Source

pub fn next_completion(&mut self)

Source

pub fn prev_completion(&mut self)

Source

pub fn select_completion(&mut self)

Source

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

Source

pub fn on_backspace(&mut self)

Source

pub fn toggle_help(&mut self)

Source

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

Build context string for the currently selected item (for Copilot).

Source

pub fn submit_copilot_message(&mut self)

Submit the current chat input to Copilot (spawns thread, sets loading).

Source

pub fn toggle_copilot_chat(&mut self)

Toggle Copilot chat panel; when opening with an item selected, focus chat.

Trait Implementations§

Source§

impl Default for App

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl !Sync for App

§

impl Unpin 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, 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<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