Expand description
§GitHub Rust - Core Library
A Rust library for GitHub API integration with dual GraphQL/REST support.
§Features
- Dual API: GraphQL primary with REST fallback
- Search: Repository search with filters
- Performance: Connection pooling and async I/O
- Type Safety: Comprehensive error handling
§Quick Start
use github_rust::GitHubService;
let service = GitHubService::new()?;
// Get repository info
let repo = service.get_repository_info("microsoft", "vscode").await?;
println!("{}: {} stars", repo.name_with_owner, repo.stargazer_count);
// Search recent repositories (30 days back, limit 10, Rust language, min 100 stars)
let repos = service.search_repositories(30, 10, Some("rust"), 100).await?;§Authentication
Set GITHUB_TOKEN environment variable for higher rate limits (5000/hour vs 60/hour).
Re-exports§
pub use config::GITHUB_API_URL;pub use config::GITHUB_GRAPHQL_URL;pub use error::GitHubError;pub use error::Result;pub use github::GitHubClient;pub use github::GitHubService;pub use github::RateLimit;pub use github::Repository;pub use github::SearchRepository;pub use github::StargazerWithDate;pub use github::User;pub use github::UserProfile;
Modules§
Functions§
- parse_
github_ node_ id - Parses a GitHub GraphQL node ID to extract the numeric repository ID.
- parse_
repository - Parse a repository string “owner/repo” into components.