[][src]Crate github_stats

Gets the stats of a Github repository.

Examples

Get Stats of Repository

use github_stats::Repo;

let repo = Repo::new("rust-lang", "rust", "<my user agent>").await;

match repo {
    Ok(repo) => {/* Do some stuff */},
    Err(e) => eprintln!(":("),
}

Search Latest Merged PR and Get Total Merged PR Count

use github_stats::{Query, Search};

// Gets latest merged PR
let search = Search::issues(
    &Query::new().repo("rust-lang", "rust").is("pr").is("merged"),
)
.per_page(1)
.search("<my user agent>")
.await;

match search {
    Ok(results) => println!("# of merged PRs: {}", results.total_count()),
    Err(e) => eprintln!(":("),
}

Re-exports

pub use search::Search;

Modules

search

Structs

Query
Repo

Represents that stats of a Github repository.

User

Represents that stats of a Github user.

Type Definitions

Error

This crate's standard error type.

Result

This crate's standard Result type.