Struct gitbrowse::Repo[][src]

pub struct Repo { /* fields omitted */ }

A reference to an opened repository.

Implementations

impl Repo[src]

pub fn open(path: impl AsRef<Path>) -> Result<Repo, Error>[src]

Open the repository at the given path

pub fn browse_branch<'a>(&'a self, branch: &str) -> Result<Branch<'a>, Error>[src]

Browse a branch with the given name. Will return an error if the branch is not found.

pub fn current_branch(&self) -> Result<Option<Branch<'_>>, Error>[src]

Attempt to get the current branch. This will return None if the current git HEAD is detached.

pub fn list_branches_with_newest_commit_id(
    &self
) -> Result<Vec<NameWithId>, Error>
[src]

List all branches and the ID of the last commit of that branch.

pub fn list_branches(&self) -> Result<Vec<String>, Error>[src]

List all branches.

pub fn list_tags_with_commit_id(&self) -> Result<Vec<NameWithId>, Error>[src]

List all tags and the commit ID of that tag.

pub fn list_tags(&self) -> Result<Vec<String>, Error>[src]

List all tags.

Auto Trait Implementations

impl RefUnwindSafe for Repo

impl Send for Repo

impl !Sync for Repo

impl Unpin for Repo

impl UnwindSafe for Repo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.