Struct MatchOptions

struct MatchOptions { ... }

Configuration options to modify the behaviour of Pattern::matches_with(..).

Fields

case_sensitive: bool

Whether or not patterns should be matched in a case-sensitive manner. This currently only considers upper/lower case relationships between ASCII characters, but in future this might be extended to work with Unicode.

require_literal_separator: bool

Whether or not path-component separator characters (e.g. / on Posix) must be matched by a literal /, rather than by * or ? or [...].

require_literal_leading_dot: bool

Whether or not paths that contain components that start with a . will require that . appears literally in the pattern; *, ?, **, or [...] will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.

Implementations

impl MatchOptions

fn new() -> Self

Constructs a new MatchOptions with default field values. This is used when calling functions that do not take an explicit MatchOptions parameter.

This function always returns this value:

MatchOptions {
    case_sensitive: true,
    require_literal_separator: false,
    require_literal_leading_dot: false
}

Note

The behavior of this method doesn't match default()'s. This returns case_sensitive as true while default() does it as false.

impl Clone for MatchOptions

fn clone(self: &Self) -> MatchOptions

impl Copy for MatchOptions

impl Debug for MatchOptions

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Default for MatchOptions

fn default() -> MatchOptions

impl Eq for MatchOptions

impl Freeze for MatchOptions

impl Hash for MatchOptions

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl Ord for MatchOptions

fn cmp(self: &Self, other: &MatchOptions) -> $crate::cmp::Ordering

impl PartialEq for MatchOptions

fn eq(self: &Self, other: &MatchOptions) -> bool

impl PartialOrd for MatchOptions

fn partial_cmp(self: &Self, other: &MatchOptions) -> $crate::option::Option<$crate::cmp::Ordering>

impl RefUnwindSafe for MatchOptions

impl Send for MatchOptions

impl StructuralPartialEq for MatchOptions

impl Sync for MatchOptions

impl Unpin for MatchOptions

impl UnwindSafe for MatchOptions

impl<T> Any for MatchOptions

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for MatchOptions

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for MatchOptions

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for MatchOptions

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for MatchOptions

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for MatchOptions

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for MatchOptions

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for MatchOptions

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for MatchOptions

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>