Trait git_attributes::Pattern
source · pub trait Pattern: Clone + PartialEq + Eq + Debug + Hash + Ord + PartialOrd + Default {
type Value: PartialEq + Eq + Debug + Hash + Ord + PartialOrd + Clone;
// Required methods
fn bytes_to_patterns(bytes: &[u8]) -> Vec<PatternMapping<Self::Value>> ⓘ;
fn may_use_glob_pattern(pattern: &Pattern) -> bool;
}
Expand description
A trait to convert bytes into patterns and their associated value.
This is used for gitattributes
which have a value, and gitignore
which don’t.
Required Associated Types§
Required Methods§
sourcefn bytes_to_patterns(bytes: &[u8]) -> Vec<PatternMapping<Self::Value>> ⓘ
fn bytes_to_patterns(bytes: &[u8]) -> Vec<PatternMapping<Self::Value>> ⓘ
Parse all patterns in bytes
line by line, ignoring lines with errors, and collect them.
sourcefn may_use_glob_pattern(pattern: &Pattern) -> bool
fn may_use_glob_pattern(pattern: &Pattern) -> bool
Returns true if the given pattern may be used for matching.