Struct SearchState

Source
pub struct SearchState { /* private fields */ }
Expand description

Search related state, part of the app state

Implementations§

Source§

impl SearchState

Source

pub fn is_up_to_date(&self) -> bool

Source

pub fn touch(&mut self)

tell the search state that it’s not up to date with the app state

Source

pub fn selected_found(&self) -> usize

Source

pub fn has_founds(&self) -> bool

Source

pub fn must_be_drawn(&self) -> bool

Source

pub fn focus_with_mode(&mut self, mode: SearchMode)

Source

pub fn unfocus(&mut self)

Source

pub fn focused(&self) -> bool

Source

pub fn input_has_content(&self) -> bool

Source

pub fn unfocus_and_clear(&mut self)

Source

pub fn clear(&mut self)

Source

pub fn next_match(&mut self)

Source

pub fn previous_match(&mut self)

Source

pub fn apply_key_combination(&mut self, key: KeyCombination) -> bool

handle a raw, uninterpreted key combination (in an input if there’s one focused), return true if the key was consumed (if not, keybindings will be computed)

Source

pub fn search(&self) -> Search

Source

pub fn is_invalid(&self) -> bool

Source

pub fn set_founds(&mut self, founds: Vec<Found>)

Source

pub fn extend_founds(&mut self, new_founds: Vec<Found>)

Source

pub fn selected_found_line(&self) -> Option<usize>

if there are search results, return the line index of the currently selected one

Source

pub fn founds(&self) -> &[Found]

Source

pub fn draw_prefixed_input( &mut self, w: &mut W, x: u16, y: u16, prefix_style: &str, width: u16, ) -> Result<()>

Draw the input with its ‘/’, at the given position, with the specified width

Source

pub fn add_summary_tstring(&self, t_line: &mut TLine, style: &str)

Trait Implementations§

Source§

impl Default for SearchState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ErasedDestructor for T
where T: 'static,