Crate github_stats

Source
Expand description

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§

Modules§

Structs§

Type Aliases§

  • This crate’s standard error type.
  • This crate’s standard Result type.