pub struct PatternCompiler { /* private fields */ }Implementations§
Source§impl PatternCompiler
impl PatternCompiler
pub const fn new() -> Self
pub fn fixed_strings(self, on: bool) -> Self
pub fn word_regexp(self, on: bool) -> Self
pub fn line_regexp(self, on: bool) -> Self
pub const fn case_insensitive(self, on: bool) -> Self
pub fn shape(&self, pattern: &str) -> String
Sourcepub fn compile(&self, patterns: &[&str]) -> Result<Regex, SearchError>
pub fn compile(&self, patterns: &[&str]) -> Result<Regex, SearchError>
Compiles multiple patterns into a single regex.
§Errors
Returns SearchError::RegexBuild if the combined pattern is invalid.
Sourcepub fn compile_one(&self, pattern: &str) -> Result<Regex, SearchError>
pub fn compile_one(&self, pattern: &str) -> Result<Regex, SearchError>
Compiles a single pattern into a regex.
§Errors
Returns SearchError::RegexBuild if the pattern is invalid.
Trait Implementations§
Source§impl Clone for PatternCompiler
impl Clone for PatternCompiler
Source§fn clone(&self) -> PatternCompiler
fn clone(&self) -> PatternCompiler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PatternCompiler
Source§impl Debug for PatternCompiler
impl Debug for PatternCompiler
Source§impl Default for PatternCompiler
impl Default for PatternCompiler
Source§fn default() -> PatternCompiler
fn default() -> PatternCompiler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PatternCompiler
impl RefUnwindSafe for PatternCompiler
impl Send for PatternCompiler
impl Sync for PatternCompiler
impl Unpin for PatternCompiler
impl UnsafeUnpin for PatternCompiler
impl UnwindSafe for PatternCompiler
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> 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