pub struct Git2Context { /* private fields */ }Expand description
Git context provider backed by git2.
Implementations§
Source§impl Git2Context
impl Git2Context
Trait Implementations§
Source§impl Debug for Git2Context
impl Debug for Git2Context
Source§impl GitContextProvider for Git2Context
impl GitContextProvider for Git2Context
Source§fn get_branch(&self) -> Result<String, AstDocError>
fn get_branch(&self) -> Result<String, AstDocError>
Get the current branch name. Read more
Source§fn get_latest_commit(&self) -> Result<String, AstDocError>
fn get_latest_commit(&self) -> Result<String, AstDocError>
Get the latest commit summary (short hash + subject). Read more
Source§fn get_diff(&self) -> Result<Option<String>, AstDocError>
fn get_diff(&self) -> Result<Option<String>, AstDocError>
Get the uncommitted diff as a string, or
None if clean. Read moreSource§fn extract(&self) -> Result<GitContext, AstDocError>
fn extract(&self) -> Result<GitContext, AstDocError>
Extract all git context into a
GitContext struct. Read moreAuto Trait Implementations§
impl Freeze for Git2Context
impl RefUnwindSafe for Git2Context
impl Send for Git2Context
impl Sync for Git2Context
impl Unpin for Git2Context
impl UnsafeUnpin for Git2Context
impl UnwindSafe for Git2Context
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more