Skip to main content

Search

Trait Search 

Source
pub trait Search: Send {
    // Required methods
    fn find_next(&self, from: Pos, pat: &Regex) -> Option<Range<Pos>>;
    fn find_prev(&self, from: Pos, pat: &Regex) -> Option<Range<Pos>>;
}
Expand description

Search sub-trait of Buffer. The pattern is owned by the engine (see SPEC.md “Open issues”); buffers do not cache compiled regexes.

Required Methods§

Source

fn find_next(&self, from: Pos, pat: &Regex) -> Option<Range<Pos>>

First match at-or-after from. None when no match remains.

Source

fn find_prev(&self, from: Pos, pat: &Regex) -> Option<Range<Pos>>

Last match at-or-before from.

Implementations on Foreign Types§

Source§

impl Search for Buffer

Source§

fn find_next(&self, from: Pos, pat: &Regex) -> Option<Range<Pos>>

Source§

fn find_prev(&self, from: Pos, pat: &Regex) -> Option<Range<Pos>>

Implementors§