pub struct GitHubClient { /* private fields */ }
Expand description
Client for GitHub’s REST API
The GitHub client can be used to send HTTP requests to GitHub’s REST API. The client handles authentication, serialization, and pagination.
Implementations§
Source§impl GitHubClient
impl GitHubClient
Sourcepub fn new(
github_host: GitHubHost,
app_id: AppId,
private_key: PrivateKey,
installation_id: InstallationId,
) -> Self
pub fn new( github_host: GitHubHost, app_id: AppId, private_key: PrivateKey, installation_id: InstallationId, ) -> Self
Initializes a new instance of the GitHub client
Sourcepub async fn get<T>(&self, endpoint: &str) -> Result<T, Error>where
T: DeserializeOwned,
pub async fn get<T>(&self, endpoint: &str) -> Result<T, Error>where
T: DeserializeOwned,
Send a GET request to GitHub
Sourcepub async fn post<T>(
&self,
endpoint: &str,
body: Option<impl Serialize>,
) -> Result<T, Error>where
T: DeserializeOwned,
pub async fn post<T>(
&self,
endpoint: &str,
body: Option<impl Serialize>,
) -> Result<T, Error>where
T: DeserializeOwned,
Send a POST request to 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 · 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 Freeze for GitHubClient
impl !RefUnwindSafe for GitHubClient
impl Send for GitHubClient
impl Sync for GitHubClient
impl Unpin for GitHubClient
impl !UnwindSafe 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