pub enum Branch {
Local {
name: String,
committer_email: String,
committer_date_time: DateTime<Utc>,
},
Remote {
name: String,
committer_email: String,
committer_date_time: DateTime<Utc>,
},
}Expand description
Local or remote branch with metadata about the last commit.
Variants§
Implementations§
Source§impl Branch
impl Branch
Sourcepub fn name_no_origin(&self) -> &str
pub fn name_no_origin(&self) -> &str
Returns the branch name with the “origin/” prefix removed if present.
Sourcepub fn committer_email(&self) -> &str
pub fn committer_email(&self) -> &str
Returns the email address of the last committer on this branch.
Sourcepub const fn committer_date_time(&self) -> &DateTime<Utc>
pub const fn committer_date_time(&self) -> &DateTime<Utc>
Returns the timestamp of the last commit on this branch.
Trait Implementations§
Source§impl<'a> TryFrom<(Branch<'a>, BranchType)> for Branch
Attempts to convert a libgit2 branch and its type into our Branch enum.
impl<'a> TryFrom<(Branch<'a>, BranchType)> for Branch
Attempts to convert a libgit2 branch and its type into our Branch enum.
Auto Trait Implementations§
impl Freeze for Branch
impl RefUnwindSafe for Branch
impl Send for Branch
impl Sync for Branch
impl Unpin for Branch
impl UnsafeUnpin for Branch
impl UnwindSafe for Branch
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