pub struct GitignorePattern {
pub original: String,
pub pattern: String,
pub negated: bool,
pub directory_only: bool,
pub anchored: bool,
pub rule_type: GitignoreRule,
}
Expand description
Individual gitignore pattern with parsing and matching
Fields§
§original: String
§pattern: String
§negated: bool
§directory_only: bool
§anchored: bool
§rule_type: GitignoreRule
Implementations§
Source§impl GitignorePattern
impl GitignorePattern
Sourcepub fn matches<P: AsRef<Path>>(
&self,
path: P,
is_directory: bool,
case_sensitive: bool,
) -> bool
pub fn matches<P: AsRef<Path>>( &self, path: P, is_directory: bool, case_sensitive: bool, ) -> bool
Check if this pattern matches a path
Sourcepub fn is_comment(&self) -> bool
pub fn is_comment(&self) -> bool
Check if this pattern is a comment
Sourcepub fn effective_pattern(&self) -> &str
pub fn effective_pattern(&self) -> &str
Get the effective pattern (without gitignore syntax)
Trait Implementations§
Source§impl Clone for GitignorePattern
impl Clone for GitignorePattern
Source§fn clone(&self) -> GitignorePattern
fn clone(&self) -> GitignorePattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GitignorePattern
impl Debug for GitignorePattern
Source§impl<'de> Deserialize<'de> for GitignorePattern
impl<'de> Deserialize<'de> for GitignorePattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GitignorePattern
impl RefUnwindSafe for GitignorePattern
impl Send for GitignorePattern
impl Sync for GitignorePattern
impl Unpin for GitignorePattern
impl UnwindSafe for GitignorePattern
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more