pub struct TreeEntryRef<'a> {
pub mode: u32,
pub name: &'a [u8],
pub oid: ObjectId,
}Expand description
A borrowed parse-view of a single entry in a raw tree object.
The name slice points into the original tree body. The object id is a
fixed-size value parsed from the raw bytes, so iterating does not allocate
entry names or build an intermediate entry list.
Fields§
§mode: u32§name: &'a [u8]§oid: ObjectIdImplementations§
Source§impl TreeEntryRef<'_>
impl TreeEntryRef<'_>
Sourcepub fn kind(&self) -> Option<EntryKind>
pub fn kind(&self) -> Option<EntryKind>
Classify this entry’s mode, if it is one of Git’s canonical kinds.
pub fn is_tree(&self) -> bool
pub fn is_symlink(&self) -> bool
pub fn is_gitlink(&self) -> bool
pub fn is_executable(&self) -> bool
pub fn to_owned(&self) -> TreeEntry
Trait Implementations§
Source§impl<'a> Clone for TreeEntryRef<'a>
impl<'a> Clone for TreeEntryRef<'a>
Source§fn clone(&self) -> TreeEntryRef<'a>
fn clone(&self) -> TreeEntryRef<'a>
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<'a> Debug for TreeEntryRef<'a>
impl<'a> Debug for TreeEntryRef<'a>
impl<'a> Eq for TreeEntryRef<'a>
Source§impl<'a> From<TreeEntryRef<'a>> for TreeEntry
impl<'a> From<TreeEntryRef<'a>> for TreeEntry
Source§fn from(entry: TreeEntryRef<'a>) -> Self
fn from(entry: TreeEntryRef<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for TreeEntryRef<'a>
impl<'a> PartialEq for TreeEntryRef<'a>
Source§fn eq(&self, other: &TreeEntryRef<'a>) -> bool
fn eq(&self, other: &TreeEntryRef<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for TreeEntryRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for TreeEntryRef<'a>
impl<'a> RefUnwindSafe for TreeEntryRef<'a>
impl<'a> Send for TreeEntryRef<'a>
impl<'a> Sync for TreeEntryRef<'a>
impl<'a> Unpin for TreeEntryRef<'a>
impl<'a> UnsafeUnpin for TreeEntryRef<'a>
impl<'a> UnwindSafe for TreeEntryRef<'a>
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