pub struct Repo { /* private fields */ }Implementations§
Source§impl Repo
impl Repo
pub const fn inner(&self) -> &Repository
Sourcepub fn local_path(&self) -> PathBuf
pub fn local_path(&self) -> PathBuf
Sourcepub fn local_path_str(&self) -> String
pub fn local_path_str(&self) -> String
Sourcepub fn sha(&self) -> Result<Option<String>, Error>
pub fn sha(&self) -> Result<Option<String>, Error>
Returns the SHA of the currently checked-out commit, if any.
§Errors
If some git-related magic goes south, or there is no commit.
Sourcepub fn branch(&self) -> Result<Option<String>, Error>
pub fn branch(&self) -> Result<Option<String>, Error>
Returns the local name of the currently checked-out branch, if any.
§Errors
If some git-related magic goes south, or the branch name is not valid UTF-8.
Sourcepub fn tag(&self) -> Result<Option<String>, Error>
pub fn tag(&self) -> Result<Option<String>, Error>
Returns the name of the currently checked-out tag, if any tag points to the current HEAD.
§Errors
If some git-related magic goes south, or the tag name is not valid UTF-8.
Sourcepub fn remote_tracking_branch(&self) -> Result<Option<String>, Error>
pub fn remote_tracking_branch(&self) -> Result<Option<String>, Error>
The local name of the remote tracking branch.
§Errors
If some git-related magic goes south, or the remote name is not valid UTF-8.
Sourcepub fn remote_name(&self) -> Result<Option<String>, Error>
pub fn remote_name(&self) -> Result<Option<String>, Error>
Local name of the main remote.
§Errors
If some git-related magic goes south, or the reomte name is not valid UTF-8.
Sourcepub fn remote_clone_url(&self) -> Result<Option<String>, Error>
pub fn remote_clone_url(&self) -> Result<Option<String>, Error>
Returns the clone URL of the main remote, if there is any.
§Errors
If some git-related magic goes south.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Repo
impl RefUnwindSafe for Repo
impl Send for Repo
impl !Sync for Repo
impl Unpin for Repo
impl UnwindSafe for 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
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