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 View. The pattern is owned by the engine; 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Search for View

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§