pub struct GrepPredicate { /* private fields */ }Expand description
AND-combined regex predicate applied to raw line bytes. Lines that fail
UTF-8 decoding never match (mirrors what the interactive / search does).
Implementations§
Source§impl GrepPredicate
impl GrepPredicate
Sourcepub fn compile(patterns: &[String], case_mode: CaseMode) -> Result<Self, String>
pub fn compile(patterns: &[String], case_mode: CaseMode) -> Result<Self, String>
Compile each pattern under the given case policy. Returns the first
invalid pattern’s error, prefixed so the user can tell which
--grep argument was bad. The case policy is applied via
CaseMode::apply_to_pattern, so the (?i) flag is prepended when
insensitivity is wanted.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GrepPredicate
impl RefUnwindSafe for GrepPredicate
impl Send for GrepPredicate
impl Sync for GrepPredicate
impl Unpin for GrepPredicate
impl UnsafeUnpin for GrepPredicate
impl UnwindSafe for GrepPredicate
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