[−][src]Struct pathpatterns::MatchEntry
A single entry in a MatchList
.
Implementations
impl MatchEntry
[src]
pub fn new<T: Into<MatchPattern>>(pattern: T, ty: MatchType) -> Self
[src]
Create a new match entry.
pub fn include<T: Into<MatchPattern>>(pattern: T) -> Self
[src]
Create a new include-type match entry with default flags.
pub fn exclude<T: Into<MatchPattern>>(pattern: T) -> Self
[src]
Create a new exclude-type match entry with default flags.
pub fn flags(self, flags: MatchFlag) -> Self
[src]
Builder method to set the match flags to a specific value.
pub fn add_flags(self, flags: MatchFlag) -> Self
[src]
Builder method to add flag bits to the already present ones.
pub fn remove_flags(self, flags: MatchFlag) -> Self
[src]
Builder method to remove match flag bits.
pub fn toggle_flags(self, flags: MatchFlag) -> Self
[src]
Builder method to toggle flag bits.
pub fn match_type(&self) -> MatchType
[src]
pub fn match_type_mut(&mut self) -> &mut MatchType
[src]
Non-Builder method to change the match type.
pub fn pattern(&self) -> &MatchPattern
[src]
Directly access the pattern.
pub fn pattern_mut(&mut self) -> &mut MatchPattern
[src]
Non-Builder method to change the pattern.
pub fn match_flags(&self) -> MatchFlag
[src]
Directly access the match flags.
pub fn match_flags_mut(&mut self) -> &mut MatchFlag
[src]
Non-Builder method to change the flags.
pub fn parse_pattern<T: AsRef<[u8]>>(
pattern: T,
pattern_flags: PatternFlag,
ty: MatchType
) -> Result<Self, ParseError>
[src]
pattern: T,
pattern_flags: PatternFlag,
ty: MatchType
) -> Result<Self, ParseError>
Parse a pattern into a MatchEntry
while interpreting a leading exclamation mark as
inversion and trailing slashes to match only directories.
pub fn matches_mode(&self, file_mode: u32) -> bool
[src]
Test this entry's file type restrictions against a file mode retrieved from stat()
.
pub fn matches_path_suffix<T: AsRef<[u8]>>(&self, path: T) -> bool
[src]
Test whether this entry's pattern matches any complete suffix of a path.
For the path /foo/bar/baz
, this tests whether baz
, bar/baz
or foo/bar/baz
is
matched.
pub fn matches_path_exact<T: AsRef<[u8]>>(&self, path: T) -> bool
[src]
Test whether this entry's pattern matches a path exactly.
pub fn matches<T: AsRef<[u8]>>(&self, path: T, file_mode: Option<u32>) -> bool
[src]
Check whether the path contains a matching suffix and the file mode match the expected file modes.
This is a combination of using .matches_mode()
and .matches_path_suffix()
.
pub fn matches_exact<T: AsRef<[u8]>>(
&self,
path: T,
file_mode: Option<u32>
) -> bool
[src]
&self,
path: T,
file_mode: Option<u32>
) -> bool
Check whether the path contains a matching suffix and the file mode match the expected file modes.
This is a combination of using .matches_mode()
and .matches_path_exact()
.
Trait Implementations
impl Clone for MatchEntry
[src]
fn clone(&self) -> MatchEntry
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MatchEntry
[src]
Auto Trait Implementations
impl RefUnwindSafe for MatchEntry
impl Send for MatchEntry
impl Sync for MatchEntry
impl Unpin for MatchEntry
impl UnwindSafe for MatchEntry
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,