pub struct TreeEntry<'tree> { /* private fields */ }
Expand description
A structure representing an entry inside of a tree. An entry is borrowed from a tree.
Implementations§
source§impl<'tree> TreeEntry<'tree>
impl<'tree> TreeEntry<'tree>
sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Get the filename of a tree entry
Returns None
if the name is not valid utf-8
sourcepub fn name_bytes(&self) -> &[u8] ⓘ
pub fn name_bytes(&self) -> &[u8] ⓘ
Get the filename of a tree entry
sourcepub fn to_object<'a>(&self, repo: &'a Repository) -> Result<Object<'a>, Error>
pub fn to_object<'a>(&self, repo: &'a Repository) -> Result<Object<'a>, Error>
Convert a tree entry to the object it points to.
sourcepub fn kind(&self) -> Option<ObjectType>
pub fn kind(&self) -> Option<ObjectType>
Get the type of the object pointed by the entry
sourcepub fn filemode_raw(&self) -> i32
pub fn filemode_raw(&self) -> i32
Get the raw UNIX file attributes of a tree entry
Trait Implementations§
source§impl<'a> Ord for TreeEntry<'a>
impl<'a> Ord for TreeEntry<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq for TreeEntry<'a>
impl<'a> PartialEq for TreeEntry<'a>
source§impl<'a> PartialOrd for TreeEntry<'a>
impl<'a> PartialOrd for TreeEntry<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for TreeEntry<'a>
Auto Trait Implementations§
impl<'tree> Freeze for TreeEntry<'tree>
impl<'tree> RefUnwindSafe for TreeEntry<'tree>
impl<'tree> !Send for TreeEntry<'tree>
impl<'tree> !Sync for TreeEntry<'tree>
impl<'tree> Unpin for TreeEntry<'tree>
impl<'tree> UnwindSafe for TreeEntry<'tree>
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