pub struct GitHubClient { /* private fields */ }Expand description
Low-level GitHub API client with connection pooling.
Handles HTTP requests, authentication, and rate limiting.
For most use cases, prefer using GitHubService instead.
Implementations§
Source§impl GitHubClient
impl GitHubClient
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new GitHub API client with connection pooling and optional token authentication.
Automatically detects GITHUB_TOKEN from environment variables.
The token is stored securely using SecretString and is automatically
zeroized when the client is dropped.
Sourcepub fn builder() -> GitHubClientBuilder
pub fn builder() -> GitHubClientBuilder
Creates a builder with no token; environment variables are not read.
pub fn has_token(&self) -> bool
Sourcepub fn client(&self) -> &Client
pub fn client(&self) -> &Client
Raw HTTP transport. Library authentication headers are added only by API methods.
Sourcepub async fn check_rate_limit(&self) -> Result<RateLimit>
pub async fn check_rate_limit(&self) -> Result<RateLimit>
Returns the REST core quota. Use check_rate_limits for GraphQL and search quotas.
Sourcepub async fn check_rate_limits(&self) -> Result<RateLimits>
pub async fn check_rate_limits(&self) -> Result<RateLimits>
Retrieves separate quotas for every resource returned by GitHub.
Trait Implementations§
Source§impl Clone for GitHubClient
impl Clone for GitHubClient
Source§fn clone(&self) -> GitHubClient
fn clone(&self) -> GitHubClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for GitHubClient
impl !UnwindSafe for GitHubClient
impl Freeze for GitHubClient
impl Send for GitHubClient
impl Sync for GitHubClient
impl Unpin for GitHubClient
impl UnsafeUnpin for GitHubClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more