pub struct FileConditionBuilder { /* private fields */ }Expand description
Immutable scope builder selecting the files to which a rule applies.
Selector methods consume and return the builder, so a reusable scope can be cloned and branched.
Patterns compile immediately. The first invalid pattern is retained in Self::selector_error
and will become a user error when a terminal rule is checked; this keeps the fluent sentence
free of intermediate Result handling.
Implementations§
Source§impl FileConditionBuilder
impl FileConditionBuilder
Sourcepub fn with_name(self, pattern: impl Into<PatternSpec>) -> Self
pub fn with_name(self, pattern: impl Into<PatternSpec>) -> Self
Selects files whose final path segment matches pattern.
Sourcepub fn in_folder(self, pattern: impl Into<PatternSpec>) -> Self
pub fn in_folder(self, pattern: impl Into<PatternSpec>) -> Self
Selects files whose containing directory matches pattern.
Sourcepub fn in_path(self, pattern: impl Into<PatternSpec>) -> Self
pub fn in_path(self, pattern: impl Into<PatternSpec>) -> Self
Selects files whose complete normalized path matches pattern.
Sourcepub fn in_file(self, path: impl Into<PatternSpec>) -> Self
pub fn in_file(self, path: impl Into<PatternSpec>) -> Self
Selects exactly one normalized file path, treating metacharacters literally.
Sourcepub fn should(self) -> PositiveMatchPatternFileConditionBuilder
pub fn should(self) -> PositiveMatchPatternFileConditionBuilder
Enters the positive mood for a file predicate.
Sourcepub fn should_not(self) -> NegatedMatchPatternFileConditionBuilder
pub fn should_not(self) -> NegatedMatchPatternFileConditionBuilder
Enters the negated mood for a file predicate.
Sourcepub const fn project_locator(&self) -> &ProjectLocator
pub const fn project_locator(&self) -> &ProjectLocator
Returns where Cargo project discovery will begin.
Sourcepub fn filters(&self) -> &[Filter]
pub fn filters(&self) -> &[Filter]
Returns every successfully compiled selector in chain order.
All filters combine with AND semantics.
Sourcepub const fn selector_error(&self) -> Option<&PatternError>
pub const fn selector_error(&self) -> Option<&PatternError>
Returns the first selector compilation error retained by this builder.
Trait Implementations§
Source§impl Clone for FileConditionBuilder
impl Clone for FileConditionBuilder
Source§fn clone(&self) -> FileConditionBuilder
fn clone(&self) -> FileConditionBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more