Skip to main content

App

Struct App 

Source
pub struct App {
Show 34 fields pub regex_editor: Editor, pub test_editor: Editor, pub replace_editor: Editor, pub focused_panel: u8, pub engine_kind: EngineKind, pub flags: EngineFlags, pub matches: Vec<Match>, pub replace_result: Option<ReplaceResult>, pub explanation: Vec<ExplainNode>, pub error: Option<String>, pub show_help: bool, pub help_page: usize, pub should_quit: bool, pub match_scroll: u16, pub replace_scroll: u16, pub explain_scroll: u16, pub pattern_history: VecDeque<String>, pub history_index: Option<usize>, pub selected_match: usize, pub selected_capture: Option<usize>, pub clipboard_status: Option<String>, pub show_whitespace: bool, pub rounded_borders: bool, pub vim_mode: bool, pub vim_state: VimState, pub compile_time: Option<Duration>, pub match_time: Option<Duration>, pub error_offset: Option<usize>, pub output_on_quit: bool, pub workspace_path: Option<String>, pub show_recipes: bool, pub recipe_index: usize, pub show_benchmark: bool, pub benchmark_results: Vec<BenchmarkResult>, /* private fields */
}

Fields§

§regex_editor: Editor§test_editor: Editor§replace_editor: Editor§focused_panel: u8§engine_kind: EngineKind§flags: EngineFlags§matches: Vec<Match>§replace_result: Option<ReplaceResult>§explanation: Vec<ExplainNode>§error: Option<String>§show_help: bool§help_page: usize§should_quit: bool§match_scroll: u16§replace_scroll: u16§explain_scroll: u16§pattern_history: VecDeque<String>§history_index: Option<usize>§selected_match: usize§selected_capture: Option<usize>§clipboard_status: Option<String>§show_whitespace: bool§rounded_borders: bool§vim_mode: bool§vim_state: VimState§compile_time: Option<Duration>§match_time: Option<Duration>§error_offset: Option<usize>§output_on_quit: bool§workspace_path: Option<String>§show_recipes: bool§recipe_index: usize§show_benchmark: bool§benchmark_results: Vec<BenchmarkResult>

Implementations§

Source§

impl App

Source

pub const PANEL_REGEX: u8 = 0

Source

pub const PANEL_TEST: u8 = 1

Source

pub const PANEL_REPLACE: u8 = 2

Source

pub const PANEL_MATCHES: u8 = 3

Source

pub const PANEL_EXPLAIN: u8 = 4

Source

pub const PANEL_COUNT: u8 = 5

Source§

impl App

Source

pub fn new(engine_kind: EngineKind, flags: EngineFlags) -> Self

Source

pub fn set_replacement(&mut self, text: &str)

Source

pub fn scroll_replace_up(&mut self)

Source

pub fn scroll_replace_down(&mut self)

Source

pub fn rereplace(&mut self)

Source

pub fn set_pattern(&mut self, pattern: &str)

Source

pub fn set_test_string(&mut self, text: &str)

Source

pub fn switch_engine(&mut self)

Source

pub fn switch_engine_to(&mut self, kind: EngineKind)

Source

pub fn scroll_match_up(&mut self)

Source

pub fn scroll_match_down(&mut self)

Source

pub fn scroll_explain_up(&mut self)

Source

pub fn scroll_explain_down(&mut self)

Source

pub fn recompute(&mut self)

Source

pub fn rematch(&mut self)

Source

pub fn commit_pattern_to_history(&mut self)

Source

pub fn history_prev(&mut self)

Source

pub fn history_next(&mut self)

Source

pub fn select_match_next(&mut self)

Source

pub fn select_match_prev(&mut self)

Source

pub fn copy_selected_match(&mut self)

Source

pub fn set_status_message(&mut self, message: String)

Source

pub fn tick_clipboard_status(&mut self) -> bool

Tick down the clipboard status timer. Returns true if status was cleared.

Source

pub fn print_output(&self, group: Option<&str>, count: bool, color: bool)

Print match results or replacement output to stdout.

Source

pub fn print_json_output(&self)

Print matches as structured JSON.

Source

pub fn edit_focused(&mut self, f: impl FnOnce(&mut Editor))

Apply a mutating editor operation to the currently focused editor panel, then trigger the appropriate recompute/rematch/rereplace.

Source

pub fn move_focused(&mut self, f: impl FnOnce(&mut Editor))

Apply a non-mutating cursor movement to the currently focused editor panel.

Source

pub fn run_benchmark(&mut self)

Source

pub fn regex101_url(&self) -> String

Generate a regex101.com URL from the current state.

Source

pub fn copy_regex101_url(&mut self)

Copy regex101 URL to clipboard.

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