Skip to main content

Crate use_git_attribute

Crate use_git_attribute 

Source
Expand description

§use-git-attribute

Primitive gitattributes vocabulary for RustUse.

use-git-attribute models attribute names, values, set/unset states, and pattern-plus-attributes rules. It does not read files or evaluate attributes for paths.

§Basic usage

use use_git_attribute::{GitAttributeName, GitAttributeRule, GitAttributeState};

let name = GitAttributeName::new("text").expect("valid attribute name");
let rule = GitAttributeRule::new("*.rs", [(name, GitAttributeState::Set)]).expect("valid rule");

assert_eq!(rule.pattern(), "*.rs");

§Scope

  • Model set, unset, value, and unspecified attribute states.
  • Model pattern plus attributes data.
  • Keep file IO and attribute evaluation out of scope.

Structs§

GitAttributeName
A validated attribute name.
GitAttributeRule
A gitattributes-style rule model.
GitAttributeValue
A plain attribute value.

Enums§

GitAttributeParseError
Error returned while parsing attribute vocabulary.
GitAttributeState
Attribute state vocabulary.