Skip to main content

Crate gix_glob

Crate gix_glob 

Source
Expand description

Provide glob Patterns for matching against paths or anything else.

§Examples

use bstr::ByteSlice;
use gix_glob::{pattern::Case, wildmatch, Pattern};

let pattern = Pattern::from_bytes(b"src/**/*.rs").unwrap();
assert!(pattern.matches_repo_relative_path(
    b"src/lib.rs".as_bstr(),
    Some(4),
    Some(false),
    Case::Sensitive,
    wildmatch::Mode::NO_MATCH_SLASH_LITERAL,
));

assert!(gix_glob::wildmatch(
    b"*.rs".as_bstr(),
    b"lib.rs".as_bstr(),
    wildmatch::Mode::empty(),
));

§Feature Flags

  • serde — Data structures implement serde::Serialize and serde::Deserialize.

Modules§

pattern
search
Utilities for searching matches of paths to patterns.
wildmatch

Structs§

Pattern
A glob pattern optimized for matching paths relative to a root directory.

Functions§

parse
Create a Pattern by parsing text or return None if text is empty.
wildmatch
Employ pattern matching to see if value matches pattern.