Trait libgitdit::repository::RepositoryExt [] [src]

pub trait RepositoryExt {
    fn find_issue(&self, id: Oid) -> Result<Issue>;
fn issue_by_head_ref(&self, head_ref: &Reference) -> Result<Issue>;
fn issue_with_message<'a>(&'a self, message: &Commit<'a>) -> Result<Issue>;
fn issues_with_prefix(&self, prefix: &str) -> Result<UniqueIssues>;
fn issues(&self) -> Result<UniqueIssues>;
fn create_issue<'a, A, I, J>(
        &self,
        author: &Signature,
        committer: &Signature,
        message: A,
        tree: &Tree,
        parents: I
    ) -> Result<Issue>
    where
        A: AsRef<str>,
        I: IntoIterator<Item = &'a Commit<'a>, IntoIter = J>,
        J: Iterator<Item = &'a Commit<'a>>
;
fn first_parent_messages(&self, id: Oid) -> Result<Messages>;
fn issue_messages_iter<'a>(
        &'a self,
        commit: Commit<'a>
    ) -> Result<IssueMessagesIter<'a>>;
fn collectable_refs<'a>(
        &'a self
    ) -> Result<CollectableRefs<'a, <UniqueIssues<'a> as IntoIterator>::IntoIter>>;
fn empty_tree(&self) -> Result<Tree>; }

Extension trait for Repositories

This trait is intended as an extension for repositories. It introduces utility functions for dealing with issues, e.g. for retrieving references for issues, creating messages and finding the initial message of an issue.

Required Methods

Retrieve an issue

Returns the issue with a given id.

Retrieve an issue by its head ref

Returns the issue associated with a head reference.

Find the issue with a given message in it

Returns the issue containing the message provided

Get issue hashes for a prefix

This function returns all known issues known to the DIT repo under the prefix provided (e.g. all issues for which refs exist under <prefix>/dit/). Provide "refs" as the prefix to get only local issues.

Get all issue hashes

This function returns all known issues known to the DIT repo.

Create a new issue with an initial message

Get an revwalk configured as a first parent iterator

This is a convenience function. It returns an iterator over messages in reverse order, only following first parents.

Get an IssueMessagesIter starting at a given commit

The iterator returned will return messages in reverse order, following the first parent, starting with the commit supplied.

Produce a CollectableRefs for all issues known to the repository

Get an empty tree

This function returns an empty tree.

Implementors