#[non_exhaustive]pub struct GithubClientBuilder<'a> { /* private fields */ }
Available on crate feature
auth
only.Expand description
A GithubClient
builder.
Allows building a GithubClient
while still setting options like the base URL and auth token. Only useful when either the auth
or enterprise
feature enabled.
§Examples
ⓘ
use use_github_api::{GithubClient, GithubClientBuilder};
// If `enterprise` is enabled
let client = GithubClientBuilder::new().auth("adS*lkjha(&W3").base_url("https://gh.enterprise.org/api/v3").build().unwrap();
// If `enterprise` is not enabled
let client = GithubClientBuilder::new().auth("ghp_kajshdkja").build().unwrap();
Implementations§
Source§impl<'a> GithubClientBuilder<'a>
impl<'a> GithubClientBuilder<'a>
Sourcepub fn build(self) -> Result<GithubClient<'a>, Box<dyn StdError>>
pub fn build(self) -> Result<GithubClient<'a>, Box<dyn StdError>>
Builds the builder and returns a client.
§Errors
If either the auth token or the base url is missing, this will error out.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for GithubClientBuilder<'a>
impl<'a> RefUnwindSafe for GithubClientBuilder<'a>
impl<'a> Send for GithubClientBuilder<'a>
impl<'a> Sync for GithubClientBuilder<'a>
impl<'a> Unpin for GithubClientBuilder<'a>
impl<'a> UnwindSafe for GithubClientBuilder<'a>
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