Struct git2::TreeBuilder
source · [−]pub struct TreeBuilder<'repo> { /* private fields */ }
Expand description
Constructor for in-memory trees
Implementations
sourceimpl<'repo> TreeBuilder<'repo>
impl<'repo> TreeBuilder<'repo>
sourcepub fn get<P>(&self, filename: P) -> Result<Option<TreeEntry<'_>>, Error> where
P: IntoCString,
pub fn get<P>(&self, filename: P) -> Result<Option<TreeEntry<'_>>, Error> where
P: IntoCString,
Get en entry from the builder from its filename
sourcepub fn insert<P: IntoCString>(
&mut self,
filename: P,
oid: Oid,
filemode: i32
) -> Result<TreeEntry<'_>, Error>
pub fn insert<P: IntoCString>(
&mut self,
filename: P,
oid: Oid,
filemode: i32
) -> Result<TreeEntry<'_>, Error>
Add or update an entry in the builder
No attempt is made to ensure that the provided Oid points to an object of a reasonable type (or any object at all).
The mode given must be one of 0o040000, 0o100644, 0o100755, 0o120000 or 0o160000 currently.
sourcepub fn remove<P: IntoCString>(&mut self, filename: P) -> Result<(), Error>
pub fn remove<P: IntoCString>(&mut self, filename: P) -> Result<(), Error>
Remove an entry from the builder by its filename
Trait Implementations
Auto Trait Implementations
impl<'repo> RefUnwindSafe for TreeBuilder<'repo>
impl<'repo> !Send for TreeBuilder<'repo>
impl<'repo> !Sync for TreeBuilder<'repo>
impl<'repo> Unpin for TreeBuilder<'repo>
impl<'repo> UnwindSafe for TreeBuilder<'repo>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more