pub struct GitIgnoreRule { /* private fields */ }Expand description
A classified ignore rule.
Implementations§
Source§impl GitIgnoreRule
impl GitIgnoreRule
Sourcepub fn parse(
value: impl AsRef<str>,
) -> Result<GitIgnoreRule, GitIgnoreParseError>
pub fn parse( value: impl AsRef<str>, ) -> Result<GitIgnoreRule, GitIgnoreParseError>
Parses a gitignore-style line.
§Errors
Returns GitIgnoreParseError::EmptyPattern when a negated line has no pattern.
Sourcepub const fn pattern(&self) -> Option<&GitIgnorePattern>
pub const fn pattern(&self) -> Option<&GitIgnorePattern>
Returns the pattern when this is a pattern-bearing rule.
Sourcepub const fn negation(&self) -> GitIgnoreNegation
pub const fn negation(&self) -> GitIgnoreNegation
Returns the negation marker.
Sourcepub const fn scope(&self) -> GitIgnoreScope
pub const fn scope(&self) -> GitIgnoreScope
Returns the rule scope.
Sourcepub const fn is_comment(&self) -> bool
pub const fn is_comment(&self) -> bool
Returns true when this is a comment line.
Sourcepub const fn is_directory_only(&self) -> bool
pub const fn is_directory_only(&self) -> bool
Returns true when this rule is directory-only vocabulary.
Trait Implementations§
Source§impl Clone for GitIgnoreRule
impl Clone for GitIgnoreRule
Source§fn clone(&self) -> GitIgnoreRule
fn clone(&self) -> GitIgnoreRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GitIgnoreRule
impl Debug for GitIgnoreRule
Source§impl FromStr for GitIgnoreRule
impl FromStr for GitIgnoreRule
Source§type Err = GitIgnoreParseError
type Err = GitIgnoreParseError
The associated error which can be returned from parsing.
Source§fn from_str(
value: &str,
) -> Result<GitIgnoreRule, <GitIgnoreRule as FromStr>::Err>
fn from_str( value: &str, ) -> Result<GitIgnoreRule, <GitIgnoreRule as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl PartialEq for GitIgnoreRule
impl PartialEq for GitIgnoreRule
Source§fn eq(&self, other: &GitIgnoreRule) -> bool
fn eq(&self, other: &GitIgnoreRule) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for GitIgnoreRule
impl StructuralPartialEq for GitIgnoreRule
Auto Trait Implementations§
impl Freeze for GitIgnoreRule
impl RefUnwindSafe for GitIgnoreRule
impl Send for GitIgnoreRule
impl Sync for GitIgnoreRule
impl Unpin for GitIgnoreRule
impl UnsafeUnpin for GitIgnoreRule
impl UnwindSafe for GitIgnoreRule
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