pub struct GitHubClientBuilder { /* private fields */ }Expand description
Explicit configuration for authentication, endpoints and HTTP transport.
Custom endpoints receive the configured token. Only use endpoints you trust. An injected HTTP client controls timeouts, proxies and redirects.
Implementations§
Source§impl GitHubClientBuilder
impl GitHubClientBuilder
Sourcepub fn token(self, token: SecretString) -> Self
pub fn token(self, token: SecretString) -> Self
Set the token, for example .token("your-token".into()).
Empty tokens and invalid authorization header values are rejected by build().
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Use this transport’s timeout, proxy and redirect policy instead of the defaults.
Sourcepub fn rest_url(self, url: impl Into<String>) -> Self
pub fn rest_url(self, url: impl Into<String>) -> Self
Set the REST base URL, including any Enterprise API prefix.
Configure graphql_url separately when using a custom installation.
Sourcepub fn graphql_url(self, url: impl Into<String>) -> Self
pub fn graphql_url(self, url: impl Into<String>) -> Self
Set the complete GraphQL endpoint URL. It receives the configured token.
Sourcepub fn build(self) -> Result<GitHubClient>
pub fn build(self) -> Result<GitHubClient>
Validate endpoints and token, then create the client. The default transport uses a 30-second request timeout.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GitHubClientBuilder
impl !UnwindSafe for GitHubClientBuilder
impl Freeze for GitHubClientBuilder
impl Send for GitHubClientBuilder
impl Sync for GitHubClientBuilder
impl Unpin for GitHubClientBuilder
impl UnsafeUnpin for GitHubClientBuilder
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