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
sourceimpl<'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]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
pub fn name_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [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
sourceimpl<'a> Ord for TreeEntry<'a>
impl<'a> Ord for TreeEntry<'a>
sourceimpl<'a> PartialOrd<TreeEntry<'a>> for TreeEntry<'a>
impl<'a> PartialOrd<TreeEntry<'a>> for TreeEntry<'a>
sourcefn partial_cmp(&self, other: &TreeEntry<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &TreeEntry<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<'a> Eq for TreeEntry<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more