[][src]Struct git2::Tree

pub struct Tree<'repo> { /* fields omitted */ }

A structure to represent a git tree


impl<'repo> Tree<'repo>

Get the id (SHA1) of a repository object

Get the number of entries listed in this tree.

Return true if there is not entry

Important traits for TreeIter<'tree>

Returns an iterator over the entries in this tree.

Traverse the entries in a tree and its subtrees in post or pre order. The callback function will be run on each node of the tree that's walked. The return code of this function will determine how the walk continues.

libgit requires that the callback be an integer, where 0 indicates a successful visit, 1 skips the node, and -1 aborts the traversal completely. You may opt to use the enum TreeWalkResult instead.

This example is not tested
let mut ct = 0;
tree.walk(TreeWalkMode::PreOrder, |_, entry| {
    assert_eq!(entry.name(), Some("foo"));
    ct += 1;
assert_eq!(ct, 1);

See libgit documentation for more information.

Lookup a tree entry by SHA value.

Lookup a tree entry by its position in the tree

Lookup a tree entry by its filename

Retrieve a tree entry contained in a tree or in any of its subtrees, given its relative path.

Casts this Tree to be usable as an Object

Consumes Commit to be returned as an Object

Trait Implementations

impl<'repo> Clone for Tree<'repo>

Performs copy-assignment from source. Read more

impl<'repo> Drop for Tree<'repo>

impl<'repo, 'iter> IntoIterator for &'iter Tree<'repo>

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

impl<'repo> Debug for Tree<'repo>

Auto Trait Implementations

impl<'repo> !Send for Tree<'repo>

impl<'repo> !Sync for Tree<'repo>

Blanket Implementations

impl<T> From for T

impl<T, U> Into for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

impl<T, U> TryFrom for T where
    T: From<U>, 

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized