pub struct ContentRegexPattern { /* private fields */ }Expand description
A regex for searching in file content
Implementations§
Source§impl ContentRegexPattern
impl ContentRegexPattern
pub fn new( pat: &str, flags: &str, max_file_size: usize, ) -> Result<Self, PatternError>
pub fn is_empty(&self) -> bool
pub fn to_regex_parts(&self) -> (String, String)
pub fn score_of(&self, candidate: Candidate<'_>) -> Option<i32>
pub fn try_get_content_match( &self, path: &Path, desired_len: usize, ) -> Result<Option<ContentMatch>>
Sourcepub fn try_get_match_line_count(&self, path: &Path) -> Result<Option<usize>>
pub fn try_get_match_line_count(&self, path: &Path) -> Result<Option<usize>>
get the line of the first match, if any
Sourcepub fn get_match_line_count(&self, path: &Path) -> Option<usize>
pub fn get_match_line_count(&self, path: &Path) -> Option<usize>
get the line of the first match, if any
pub fn get_content_match( &self, path: &Path, desired_len: usize, ) -> Option<ContentMatch>
Trait Implementations§
Source§impl Clone for ContentRegexPattern
impl Clone for ContentRegexPattern
Source§fn clone(&self) -> ContentRegexPattern
fn clone(&self) -> ContentRegexPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentRegexPattern
impl Debug for ContentRegexPattern
Auto Trait Implementations§
impl Freeze for ContentRegexPattern
impl RefUnwindSafe for ContentRegexPattern
impl Send for ContentRegexPattern
impl Sync for ContentRegexPattern
impl Unpin for ContentRegexPattern
impl UnwindSafe for ContentRegexPattern
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more