pub struct Filter {
pub in_path: Option<PathBuf>,
pub on: Matcher,
pub op: Op,
pub pat: Pattern,
pub negate: bool,
}
Expand description
A tagged filter.
Fields
in_path: Option<PathBuf>
Path the filter applies from.
on: Matcher
Which tag the filter applies to.
op: Op
The operation to perform on the tag’s value.
pat: Pattern
The pattern to match against the tag’s value.
negate: bool
If true, a positive match with this filter will override negative matches from previous filters on the same tag, and negative matches will be ignored.
Implementations
Matches the filter against a subject.
This is really an internal method to the tagged filterer machinery, exposed so you can build your own filterer using the same types or the textual syntax. As such its behaviour is not guaranteed to be stable (its signature is, though).
Create a filter from a gitignore-style glob pattern.
The optional path is for the in_path
field of the filter. When parsing gitignore files, it
should be set to the path of the directory the ignore file is in.
The resulting filter matches on Path
, with the NotGlob
op, and a Glob
pattern. If it starts with a !
, it is negated.
Returns the filter with its in_path
canonicalised.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Filter
impl UnwindSafe for Filter
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more