Struct git_repository::easy::TreeRef [−][src]
pub struct TreeRef<'repo, A> {
pub id: ObjectId,
pub data: Ref<'repo, [u8]>,
// some fields omitted
}
Expand description
A decoded tree object with access to its owning repository.
Please note that the limitations described in ObjectRef apply here as well.
Fields
id: ObjectId
The id of the tree
data: Ref<'repo, [u8]>
The fully decoded tree data
Implementations
Obtain a tree instance by handing in all components that it is made up of.
pub fn lookup_path<I, P>(self, path: I) -> Result<Option<Entry>, Error> where
I: IntoIterator<Item = P>,
P: PartialEq<BStr>,
pub fn lookup_path<I, P>(self, path: I) -> Result<Option<Entry>, Error> where
I: IntoIterator<Item = P>,
P: PartialEq<BStr>,
Follow a sequence of path
components starting from this instance, and look them up one by one until the last component
is looked up and its tree entry is returned.
Performance Notes
Searching tree entries is currently done in sequence, which allows to the search to be allocation free. It would be possible to re-use a vector and use a binary search instead, which might be able to improve performance over all. However, a benchmark should be created first to have some data and see which trade-off to choose here.