pub struct FilePattern {
pub pattern: String,
pub pattern_type: PatternType,
pub case_sensitive: bool,
}Expand description
File pattern for matching files
Fields§
§pattern: StringPattern string (glob pattern)
pattern_type: PatternTypePattern type
case_sensitive: boolWhether pattern is case sensitive
Implementations§
Source§impl FilePattern
impl FilePattern
Sourcepub fn new(pattern: &str, pattern_type: PatternType) -> Self
pub fn new(pattern: &str, pattern_type: PatternType) -> Self
Create a new file pattern
Sourcepub fn new_case_sensitive(pattern: &str, pattern_type: PatternType) -> Self
pub fn new_case_sensitive(pattern: &str, pattern_type: PatternType) -> Self
Create a case-sensitive file pattern
Sourcepub fn matches_file(&self, file_path: &Path) -> bool
pub fn matches_file(&self, file_path: &Path) -> bool
Check if pattern matches a file path
Trait Implementations§
Source§impl Clone for FilePattern
impl Clone for FilePattern
Source§fn clone(&self) -> FilePattern
fn clone(&self) -> FilePattern
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 moreSource§impl Debug for FilePattern
impl Debug for FilePattern
Source§impl<'de> Deserialize<'de> for FilePattern
impl<'de> Deserialize<'de> for FilePattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FilePattern
impl RefUnwindSafe for FilePattern
impl Send for FilePattern
impl Sync for FilePattern
impl Unpin for FilePattern
impl UnsafeUnpin for FilePattern
impl UnwindSafe for FilePattern
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