Skip to main content

App

Struct App 

Source
pub struct App<'a> {
Show 18 fields pub mode: AppMode, pub quit: bool, pub focused_panel: FocusedPanel, pub log_mode: bool, pub modules_dir: PathBuf, pub theme: Theme, pub theme_locked: bool, pub scripts: StatefulList<ScriptItem>, pub categories: StatefulList<String>, pub all_scripts: HashMap<String, Vec<ScriptItem>>, pub script_panel_area: Rect, pub preview: PreviewState<'a>, pub search: SearchState, pub multi_select: MultiSelectState, pub help: HelpState, pub description: DescriptionState, pub run_script_popup: Option<RunScriptPopup>, pub script_execution_queue: Vec<PathBuf>,
}

Fields§

§mode: AppMode§quit: bool§focused_panel: FocusedPanel§log_mode: bool§modules_dir: PathBuf§theme: Theme§theme_locked: bool§scripts: StatefulList<ScriptItem>§categories: StatefulList<String>§all_scripts: HashMap<String, Vec<ScriptItem>>§script_panel_area: Rect§preview: PreviewState<'a>§search: SearchState§multi_select: MultiSelectState§help: HelpState§description: DescriptionState§run_script_popup: Option<RunScriptPopup>§script_execution_queue: Vec<PathBuf>

Implementations§

Source§

impl<'a> App<'a>

Source

pub fn load_scripts(&mut self, modules_dir: &Path) -> Result<()>

Source

pub fn update_script_list(&mut self)

Source

pub fn update_preview(&mut self)

Source

pub fn toggle_preview_mode(&mut self)

Source

pub fn scroll_preview_up(&mut self)

Source

pub fn scroll_preview_down(&mut self)

Source

pub fn scroll_preview_page_up(&mut self)

Source

pub fn scroll_preview_page_down(&mut self)

Source

pub fn get_script_path(&self) -> Option<PathBuf>

Source

pub fn toggle_search_mode(&mut self)

Source

pub fn next(&mut self)

Source

pub fn previous(&mut self)

Source

pub fn update_autocomplete(&mut self)

Source

pub fn toggle_multi_select_mode(&mut self)

Source

pub fn toggle_script_selection(&mut self)

Source

pub fn is_script_selected(&self, script_path: &Path) -> bool

Source

pub fn toggle_help_mode(&mut self)

Source

pub fn top(&mut self)

Source

pub fn bottom(&mut self)

Source

pub fn handle_key_root_warning_mode(&mut self, key: KeyEvent)

Source§

impl<'a> App<'a>

Source

pub fn new(options: &UiOptions) -> App<'a>

Source

pub fn cycle_theme(&mut self)

Source

pub fn toggle_description_popup(&mut self)

Source

pub fn get_selected_script(&self) -> Option<&ScriptItem>

Source§

impl<'a> App<'a>

Source

pub fn handle_search_input(&mut self, key: KeyEvent)

Source

pub fn handle_key_normal_mode(&mut self, key: KeyEvent)

Source

pub fn handle_key_preview_mode(&mut self, key: KeyEvent)

Source

pub fn handle_mouse(&mut self, event: MouseEvent)

Source

pub fn handle_key_confirmation_mode(&mut self, key: KeyEvent)

Source

pub fn handle_key_help_mode(&mut self, key: KeyEvent)

Source

pub fn handle_key_description_mode(&mut self, key: KeyEvent)

Auto Trait Implementations§

§

impl<'a> !Freeze for App<'a>

§

impl<'a> !RefUnwindSafe for App<'a>

§

impl<'a> Send for App<'a>

§

impl<'a> !Sync for App<'a>

§

impl<'a> Unpin for App<'a>

§

impl<'a> UnsafeUnpin for App<'a>

§

impl<'a> !UnwindSafe for App<'a>

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> Downcast for T
where T: Any,

Source§

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>

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)

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)

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

impl<T> ErasedDestructor for T
where T: 'static,