pub struct App {Show 28 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 overlay: OverlayState,
pub should_quit: bool,
pub scroll: ScrollState,
pub history: PatternHistory,
pub selection: MatchSelection,
pub status: StatusMessage,
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 benchmark_results: Vec<BenchmarkResult>,
pub syntax_tokens: Vec<SyntaxToken>,
pub grex_result_tx: UnboundedSender<(u64, String)>,
/* 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>§overlay: OverlayState§should_quit: bool§scroll: ScrollState§history: PatternHistory§selection: MatchSelection§status: StatusMessage§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>§benchmark_results: Vec<BenchmarkResult>§syntax_tokens: Vec<SyntaxToken>§grex_result_tx: UnboundedSender<(u64, String)>Implementations§
Source§impl App
impl App
pub const PANEL_REGEX: u8 = 0
pub const PANEL_TEST: u8 = 1
pub const PANEL_REPLACE: u8 = 2
pub const PANEL_MATCHES: u8 = 3
pub const PANEL_EXPLAIN: u8 = 4
pub const PANEL_COUNT: u8 = 5
Source§impl App
impl App
pub fn new(engine_kind: EngineKind, flags: EngineFlags) -> Self
pub fn set_replacement(&mut self, text: &str)
pub fn scroll_replace_up(&mut self)
pub fn scroll_replace_down(&mut self)
pub fn rereplace(&mut self)
pub fn set_pattern(&mut self, pattern: &str)
pub fn set_test_string(&mut self, text: &str)
pub fn switch_engine(&mut self)
Sourcepub fn switch_engine_to(&mut self, kind: EngineKind)
pub fn switch_engine_to(&mut self, kind: EngineKind)
Low-level engine setter. Does NOT call recompute() — the caller
must trigger recompilation separately if needed.
pub fn scroll_match_up(&mut self)
pub fn scroll_match_down(&mut self)
pub fn scroll_explain_up(&mut self)
pub fn scroll_explain_down(&mut self)
pub fn recompute(&mut self)
pub fn rematch(&mut self)
pub fn commit_pattern_to_history(&mut self)
pub fn history_prev(&mut self)
pub fn history_next(&mut self)
pub fn select_match_next(&mut self)
pub fn select_match_prev(&mut self)
pub fn copy_selected_match(&mut self)
Sourcepub fn print_output(&self, group: Option<&str>, count: bool, color: bool)
pub fn print_output(&self, group: Option<&str>, count: bool, color: bool)
Print match results or replacement output to stdout.
Sourcepub fn print_json_output(&self)
pub fn print_json_output(&self)
Print matches as structured JSON.
Sourcepub fn edit_focused(&mut self, f: impl FnOnce(&mut Editor))
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.
Sourcepub fn move_focused(&mut self, f: impl FnOnce(&mut Editor))
pub fn move_focused(&mut self, f: impl FnOnce(&mut Editor))
Apply a non-mutating cursor movement to the currently focused editor panel.
pub fn run_benchmark(&mut self)
Sourcepub fn regex101_url(&self) -> String
pub fn regex101_url(&self) -> String
Generate a regex101.com URL from the current state.
Sourcepub fn copy_regex101_url(&mut self)
pub fn copy_regex101_url(&mut self)
Copy regex101 URL to clipboard.
Sourcepub fn generate_code(&mut self, lang: &Language)
pub fn generate_code(&mut self, lang: &Language)
Generate code for the current pattern in the given language and copy to clipboard.
pub fn start_debug(&mut self, _max_steps: usize)
pub fn debug_step_forward(&mut self)
pub fn debug_step_back(&mut self)
pub fn debug_jump_start(&mut self)
pub fn debug_jump_end(&mut self)
pub fn debug_next_match(&mut self)
pub fn debug_next_backtrack(&mut self)
pub fn debug_toggle_heatmap(&mut self)
pub fn handle_action(&mut self, action: Action, debug_max_steps: usize)
Sourcepub fn maybe_run_grex_generation(&mut self)
pub fn maybe_run_grex_generation(&mut self)
If the grex overlay has a pending debounce deadline that has passed, spawn a
blocking task to regenerate the pattern with the current options. Results are
delivered via grex_result_tx and claimed later by drain_grex_results.
Sourcepub fn drain_grex_results(&mut self)
pub fn drain_grex_results(&mut self)
Drain any grex generation results that arrived since the last tick, applying only the result that matches the current generation counter.
Sourcepub fn dispatch_grex_overlay_key(&mut self, key: KeyEvent) -> bool
pub fn dispatch_grex_overlay_key(&mut self, key: KeyEvent) -> bool
Dispatch a key event to the grex overlay. Returns true if the key was consumed.
Caller should only invoke this when self.overlay.grex.is_some().
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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