Struct git2::Tree [−][src]
pub struct Tree<'repo> { /* fields omitted */ }
Expand description
A structure to represent a git tree
Implementations
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.
let mut ct = 0;
tree.walk(TreeWalkMode::PreOrder, |_, entry| {
assert_eq!(entry.name(), Some("foo"));
ct += 1;
TreeWalkResult::Ok
}).unwrap();
assert_eq!(ct, 1);
See libgit documentation for more information.
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.
Consumes Commit to be returned as an Object
Trait Implementations
Auto Trait Implementations
impl<'repo> RefUnwindSafe for Tree<'repo>
impl<'repo> UnwindSafe for Tree<'repo>
Blanket Implementations
Mutably borrows from an owned value. Read more