pub struct SearchOpts<'a> {
pub ev: Option<Event>,
pub string: String,
pub input_status: InputStatus,
pub cursor_position: u16,
pub search_mode: SearchMode,
pub word_index: Vec<u16>,
pub search_char: char,
pub rows: u16,
pub cols: u16,
pub incremental_search_options: Option<IncrementalSearchOpts<'a>>,
pub smart_case: bool,
/* private fields */
}search only.Expand description
Options controlling the behaviour of search overall
Although it isn’t much important for most use cases but it alongside IncrementalSearchOpts are the key components
when applications want to customize the incremental seaech condition.
Most of the fields have self-explanatory names so it should be very easy to get started using this
Fields§
§ev: Option<Event>A crossterm Event on which to respond
string: StringCurrent string query
input_status: InputStatusStatus of the input prompt. See InputStatus
cursor_position: u16Specifies the terminal column number that the cursor on at the prompt site.
It can range between 1 and string.len() + 1
search_mode: SearchModeDirection of search. See SearchMode.
word_index: Vec<u16>Column numbers where each new word start
search_char: charSearch character, either / or ? depending on SearchMode
rows: u16Number of rows available in the terminal
cols: u16Number of cols available in the terminal
incremental_search_options: Option<IncrementalSearchOpts<'a>>Options specifically controlling incremental search
smart_case: boolWhether smart case search is enabled
Trait Implementations§
Source§impl<'a> From<&'a PagerState> for SearchOpts<'a>
impl<'a> From<&'a PagerState> for SearchOpts<'a>
Source§fn from(ps: &'a PagerState) -> Self
fn from(ps: &'a PagerState) -> Self
Auto Trait Implementations§
impl<'a> Freeze for SearchOpts<'a>
impl<'a> RefUnwindSafe for SearchOpts<'a>
impl<'a> Send for SearchOpts<'a>
impl<'a> Sync for SearchOpts<'a>
impl<'a> Unpin for SearchOpts<'a>
impl<'a> UnsafeUnpin for SearchOpts<'a>
impl<'a> UnwindSafe for SearchOpts<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.