[][src]Struct git_anger_library::repo::Repo

pub struct Repo {
    pub name: String,
    pub total_commits: usize,
    pub total_curses: usize,
    pub curses: HashMap<String, usize>,
    pub authors: HashMap<String, Author>,
}

A simple representation of a git repository.

Fields

name: String

Name of the repository.

total_commits: usize

Count of the total amount of commits in the repository.

total_curses: usize

Count of the total amount of curses used in the commits.

curses: HashMap<String, usize>

HashMap of all the naughty words used by the authors.

authors: HashMap<String, Author>

HashMap of all the authors that have been committed.

Implementations

impl Repo[src]

pub fn new(path: &Path) -> Result<Self, Box<dyn Error>>[src]

Creates a new and empty repository.

pub fn author(&mut self, author_name: &str) -> &mut Author[src]

Checks if an author exists and creates a new author if she/he doesn't exist.

pub fn count_curses(&mut self)[src]

Counts all the naughty words used by authors.

pub fn print_json(&self) -> Result<(), Box<dyn Error>>[src]

Serialize the Repo struct into a JSON-object and print it.

pub fn print_list(&self) -> Result<(), Box<dyn Error>>[src]

Build a table to display naughty authors and their words.

pub fn commits(repo: &Repository) -> Result<Vec<Commit>, Box<dyn Error>>[src]

Build a list of commits by walking the history of a repository.

pub fn build(&mut self, commits: Vec<Commit>)[src]

Iterate over all commits, finding authors who have been naughty and keep track of them.

Trait Implementations

impl Debug for Repo[src]

impl Serialize for Repo[src]

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.