pub struct RegexFactory { /* private fields */ }Expand description
Compiles user patterns consistently and binds them to selector targets.
The default factory reads case-sensitive globs. Construct one with RegexFactoryOptions when
a rule family accepts regular expressions or case-insensitive matching.
Implementations§
Source§impl RegexFactory
impl RegexFactory
Sourcepub const fn new(options: RegexFactoryOptions) -> Self
pub const fn new(options: RegexFactoryOptions) -> Self
Creates a factory with explicit compilation options.
Sourcepub const fn options(self) -> RegexFactoryOptions
pub const fn options(self) -> RegexFactoryOptions
Returns this factory’s immutable options.
Sourcepub fn compile(&self, source: impl AsRef<str>) -> Result<Pattern, PatternError>
pub fn compile(&self, source: impl AsRef<str>) -> Result<Pattern, PatternError>
Compiles one pattern according to this factory’s syntax and case behavior.
Sourcepub fn filename_matcher(
&self,
source: impl Into<PatternSpec>,
) -> Result<Filter, PatternError>
pub fn filename_matcher( &self, source: impl Into<PatternSpec>, ) -> Result<Filter, PatternError>
Matches a pattern against the last path segment.
Sourcepub fn folder_matcher(
&self,
source: impl Into<PatternSpec>,
) -> Result<Filter, PatternError>
pub fn folder_matcher( &self, source: impl Into<PatternSpec>, ) -> Result<Filter, PatternError>
Matches a pattern against a file’s containing folder.
Sourcepub fn path_matcher(
&self,
source: impl Into<PatternSpec>,
) -> Result<Filter, PatternError>
pub fn path_matcher( &self, source: impl Into<PatternSpec>, ) -> Result<Filter, PatternError>
Matches a pattern against the complete normalized path.
Sourcepub fn type_name_matcher(
&self,
source: impl Into<PatternSpec>,
) -> Result<Filter, PatternError>
pub fn type_name_matcher( &self, source: impl Into<PatternSpec>, ) -> Result<Filter, PatternError>
Matches a pattern against an unqualified Rust type name.
Sourcepub fn exact_file_matcher(
&self,
path: impl Into<PatternSpec>,
) -> Result<Filter, PatternError>
pub fn exact_file_matcher( &self, path: impl Into<PatternSpec>, ) -> Result<Filter, PatternError>
Matches exactly one normalized file path, treating every character literally.
Trait Implementations§
Source§impl Clone for RegexFactory
impl Clone for RegexFactory
Source§fn clone(&self) -> RegexFactory
fn clone(&self) -> RegexFactory
Returns a copy 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 RegexFactory
impl Debug for RegexFactory
Source§impl Default for RegexFactory
impl Default for RegexFactory
Source§fn default() -> RegexFactory
fn default() -> RegexFactory
Returns the “default value” for a type. Read more
Source§impl Hash for RegexFactory
impl Hash for RegexFactory
Source§impl PartialEq for RegexFactory
impl PartialEq for RegexFactory
impl Copy for RegexFactory
impl Eq for RegexFactory
impl StructuralPartialEq for RegexFactory
Auto Trait Implementations§
impl Freeze for RegexFactory
impl RefUnwindSafe for RegexFactory
impl Send for RegexFactory
impl Sync for RegexFactory
impl Unpin for RegexFactory
impl UnwindSafe for RegexFactory
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.