pub struct Branch<'repo> { /* private fields */ }
Expand description
A structure to represent a git branch
A branch is currently just a wrapper to an underlying Reference
. The
reference can be accessed through the get
and into_reference
methods.
Implementations§
source§impl<'repo> Branch<'repo>
impl<'repo> Branch<'repo>
sourcepub fn get_mut(&mut self) -> &mut Reference<'repo>
pub fn get_mut(&mut self) -> &mut Reference<'repo>
Gain mutable access to the reference that is this branch
sourcepub fn into_reference(self) -> Reference<'repo>
pub fn into_reference(self) -> Reference<'repo>
Take ownership of the underlying reference.
sourcepub fn rename(
&mut self,
new_branch_name: &str,
force: bool,
) -> Result<Branch<'repo>, Error>
pub fn rename( &mut self, new_branch_name: &str, force: bool, ) -> Result<Branch<'repo>, Error>
Move/rename an existing local branch reference.
sourcepub fn name(&self) -> Result<Option<&str>, Error>
pub fn name(&self) -> Result<Option<&str>, Error>
Return the name of the given local or remote branch.
May return Ok(None)
if the name is not valid utf-8.
sourcepub fn name_bytes(&self) -> Result<&[u8], Error>
pub fn name_bytes(&self) -> Result<&[u8], Error>
Return the name of the given local or remote branch.
Auto Trait Implementations§
impl<'repo> Freeze for Branch<'repo>
impl<'repo> RefUnwindSafe for Branch<'repo>
impl<'repo> !Send for Branch<'repo>
impl<'repo> !Sync for Branch<'repo>
impl<'repo> Unpin for Branch<'repo>
impl<'repo> UnwindSafe for Branch<'repo>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more