pub struct GlobsetFilterer { /* private fields */ }
Expand description
A simple filterer in the style of the watchexec v1.17 filter.
Implementations§
source§impl GlobsetFilterer
impl GlobsetFilterer
sourcepub async fn new(
origin: impl AsRef<Path>,
filters: impl IntoIterator<Item = (String, Option<PathBuf>)>,
ignores: impl IntoIterator<Item = (String, Option<PathBuf>)>,
ignore_files: impl IntoIterator<Item = IgnoreFile>,
extensions: impl IntoIterator<Item = OsString>
) -> Result<Self, Error>
pub async fn new( origin: impl AsRef<Path>, filters: impl IntoIterator<Item = (String, Option<PathBuf>)>, ignores: impl IntoIterator<Item = (String, Option<PathBuf>)>, ignore_files: impl IntoIterator<Item = IgnoreFile>, extensions: impl IntoIterator<Item = OsString> ) -> Result<Self, Error>
Create a new GlobsetFilterer
from a project origin, allowed extensions, and lists of globs.
The first list is used to filter paths (only matching paths will pass the filter), the second is used to ignore paths (matching paths will fail the pattern). If the filter list is empty, only the ignore list will be used. If both lists are empty, the filter always passes.
Ignores and filters are passed as a tuple of the glob pattern as a string and an optional
path of the folder the pattern should apply in (e.g. the folder a gitignore file is in).
A None
to the latter will mark the pattern as being global.
The extensions list is used to filter files by extension.
Non-path events are always passed.
Trait Implementations§
source§impl Debug for GlobsetFilterer
impl Debug for GlobsetFilterer
source§impl Filterer for GlobsetFilterer
impl Filterer for GlobsetFilterer
source§fn check_event(
&self,
event: &Event,
priority: Priority
) -> Result<bool, RuntimeError>
fn check_event( &self, event: &Event, priority: Priority ) -> Result<bool, RuntimeError>
Filter an event.
This implementation never errors.