pub struct IncSearch<I: IncSearcher<U>, U: Ui> { /* private fields */ }Expand description
The PromptMode that makes use of IncSearchers
In order to make use of incremental search, you’d do something like this:
use duat_core::prelude::*;
use duat_utils::modes::{IncSearch, Regular, SearchFwd};
fn setup_generic_over_ui<U: Ui>() {
mode::map::<Regular, U>("<C-s>", IncSearch::new(SearchFwd));
}This function returns a Prompt<IncSearch<SearchFwd, U>, U>,
Implementations§
Source§impl<I: IncSearcher<U>, U: Ui> IncSearch<I, U>
impl<I: IncSearcher<U>, U: Ui> IncSearch<I, U>
Sourcepub fn new(inc: I) -> Prompt<Self, U>
pub fn new(inc: I) -> Prompt<Self, U>
Returns a Prompt with IncSearch<I, U> as its
PromptMode
Trait Implementations§
Source§impl<I: IncSearcher<U>, U: Ui> PromptMode<U> for IncSearch<I, U>
impl<I: IncSearcher<U>, U: Ui> PromptMode<U> for IncSearch<I, U>
Source§fn on_switch(&mut self, pa: &mut Pass, text: Text, _: &<U as Ui>::Area) -> Text
fn on_switch(&mut self, pa: &mut Pass, text: Text, _: &<U as Ui>::Area) -> Text
What to do when switchin onto this
PromptMode Read moreSource§fn before_exit(&mut self, _: &mut Pass, text: Text, _: &<U as Ui>::Area)
fn before_exit(&mut self, _: &mut Pass, text: Text, _: &<U as Ui>::Area)
What to do before exiting the
PromptMode Read moreSource§fn once()
fn once()
Things to do when this
PromptMode is first instantiatedSource§type ExitWidget = File<U>
type ExitWidget = File<U>
What
Widget to exit to, upon pressing enter, esc, or
backspace in an empty PromptLineSource§fn return_handle(&self) -> Option<Handle<Self::ExitWidget, U>>
fn return_handle(&self) -> Option<Handle<Self::ExitWidget, U>>
An optional returning
Handle for the ExitWidgetAuto Trait Implementations§
impl<I, U> !Freeze for IncSearch<I, U>
impl<I, U> !RefUnwindSafe for IncSearch<I, U>
impl<I, U> Send for IncSearch<I, U>
impl<I, U> !Sync for IncSearch<I, U>
impl<I, U> Unpin for IncSearch<I, U>
impl<I, U> !UnwindSafe for IncSearch<I, U>
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
Mutably borrows from an owned value. Read more