pub struct AttrSet { /* private fields */ }Expand description
A queryable set of .gitattributes patterns.
Implementations§
Source§impl AttrSet
impl AttrSet
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Empty set, seeded only with Git’s built-in [attr]binary macro
(so patterns referencing binary resolve correctly).
Sourcepub fn from_buffer(bytes: &[u8]) -> Self
pub fn from_buffer(bytes: &[u8]) -> Self
Build from a single .gitattributes-format buffer.
Sourcepub fn from_workdir(repo_root: &Path) -> Result<Self>
pub fn from_workdir(repo_root: &Path) -> Result<Self>
Discover every .gitattributes reachable from repo_root (skipping
the .git/ directory) and load them along with .git/info/attributes
if it exists.
Sourcepub fn value(&self, path: &str, attr: &str) -> Option<String>
pub fn value(&self, path: &str, attr: &str) -> Option<String>
Return the resolved value of attr for path (relative to the
repo root, with / separators). None for unspecified or unset.
Set/Value(v) map to Some("true") / Some(v).
Sourcepub fn is_set(&self, path: &str, attr: &str) -> bool
pub fn is_set(&self, path: &str, attr: &str) -> bool
True iff attr is set for path — that is, attr or attr=<v>
where v is anything other than the literal "false".
Sourcepub fn is_lfs_tracked(&self, path: &str) -> bool
pub fn is_lfs_tracked(&self, path: &str) -> bool
True iff path matches a filter=lfs line.
Sourcepub fn is_lockable(&self, path: &str) -> bool
pub fn is_lockable(&self, path: &str) -> bool
True iff path matches a lockable line.
Auto Trait Implementations§
impl Freeze for AttrSet
impl RefUnwindSafe for AttrSet
impl Send for AttrSet
impl Sync for AttrSet
impl Unpin for AttrSet
impl UnsafeUnpin for AttrSet
impl UnwindSafe for AttrSet
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