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;
fn bytes_to_patterns(bytes: &[u8]) -> Vec<PatternMapping<Self::Value>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
;
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>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn bytes_to_patterns(bytes: &[u8]) -> Vec<PatternMapping<Self::Value>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
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.