[][src]Struct pathpatterns::MatchEntry

pub struct MatchEntry { /* fields omitted */ }

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]

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]

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]

impl Debug for MatchEntry[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.