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§
- GitAttribute
Name - A validated attribute name.
- GitAttribute
Rule - A
gitattributes-style rule model. - GitAttribute
Value - A plain attribute value.
Enums§
- GitAttribute
Parse Error - Error returned while parsing attribute vocabulary.
- GitAttribute
State - Attribute state vocabulary.