Struct Find

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

Contains logic to search text

Implementations§

Source§

impl Find

Source

pub fn new(id: usize) -> Find

Source

pub fn id(&self) -> usize

Source

pub fn occurrences(&self) -> &Selection

Source

pub fn hls_dirty(&self) -> bool

Source

pub fn find_status( &self, view: &View, text: &Rope, matches_only: bool, ) -> FindStatus

Source

pub fn set_hls_dirty(&mut self, is_dirty: bool)

Source

pub fn update_highlights(&mut self, text: &Rope, delta: &RopeDelta)

Source

pub fn unset(&mut self)

Unsets the search and removes all highlights from the view.

Source

pub fn update_find( &mut self, text: &Rope, start: usize, end: usize, include_slop: bool, )

Execute the search on the provided text in the range provided by start and end.

Source

pub fn next_occurrence( &self, text: &Rope, reverse: bool, wrapped: bool, sel: &Selection, ) -> Option<SelRegion>

Return the occurrence closest to the provided selection sel. If searched is reversed then the occurrence closest to the start of the selection is returned. wrapped indicates that if the end of the text is reached the search continues from the start.

Trait Implementations§

Source§

impl ToAnnotation for Find

Implementing the ToAnnotation trait allows to convert finds to annotations.

Source§

fn get_annotations( &self, interval: Interval, view: &View, text: &Rope, ) -> AnnotationSlice

Returns annotations that overlap the provided interval.

Auto Trait Implementations§

§

impl Freeze for Find

§

impl RefUnwindSafe for Find

§

impl Send for Find

§

impl Sync for Find

§

impl Unpin for Find

§

impl UnwindSafe for Find

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