pub struct GitHubClient { /* private fields */ }Expand description
GitHub API client
Implementations§
Source§impl GitHubClient
impl GitHubClient
Sourcepub fn new(config: GitHubConfig) -> Result<Self>
pub fn new(config: GitHubConfig) -> Result<Self>
Create a new GitHub client
Sourcepub async fn get_repository(
&self,
owner: &str,
repo: &str,
) -> Result<Repository>
pub async fn get_repository( &self, owner: &str, repo: &str, ) -> Result<Repository>
Get repository information
Sourcepub async fn get_file_contents(
&self,
owner: &str,
repo: &str,
path: &str,
ref_name: Option<&str>,
) -> Result<FileContents>
pub async fn get_file_contents( &self, owner: &str, repo: &str, path: &str, ref_name: Option<&str>, ) -> Result<FileContents>
Get file contents from a repository
Sourcepub async fn get_commit(
&self,
owner: &str,
repo: &str,
sha: &str,
) -> Result<Commit>
pub async fn get_commit( &self, owner: &str, repo: &str, sha: &str, ) -> Result<Commit>
Get a specific commit
Sourcepub async fn get_commit_diff(
&self,
owner: &str,
repo: &str,
sha: &str,
) -> Result<String>
pub async fn get_commit_diff( &self, owner: &str, repo: &str, sha: &str, ) -> Result<String>
Get commit diff
Sourcepub async fn get_pull_request(
&self,
owner: &str,
repo: &str,
pr_number: u64,
) -> Result<PullRequest>
pub async fn get_pull_request( &self, owner: &str, repo: &str, pr_number: u64, ) -> Result<PullRequest>
Get pull request details
Sourcepub async fn get_pull_request_diff(
&self,
owner: &str,
repo: &str,
pr_number: u64,
) -> Result<String>
pub async fn get_pull_request_diff( &self, owner: &str, repo: &str, pr_number: u64, ) -> Result<String>
Get pull request diff
Sourcepub async fn get_pull_request_files(
&self,
owner: &str,
repo: &str,
pr_number: u64,
) -> Result<Vec<PullRequestFile>>
pub async fn get_pull_request_files( &self, owner: &str, repo: &str, pr_number: u64, ) -> Result<Vec<PullRequestFile>>
Get pull request files
Sourcepub async fn get_release_by_tag(
&self,
owner: &str,
repo: &str,
tag: &str,
) -> Result<Release>
pub async fn get_release_by_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result<Release>
Get a release by tag
Sourcepub async fn get_latest_release(
&self,
owner: &str,
repo: &str,
) -> Result<Release>
pub async fn get_latest_release( &self, owner: &str, repo: &str, ) -> Result<Release>
Get latest release
Sourcepub async fn get_issue(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Issue>
pub async fn get_issue( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Issue>
Get issue details
Sourcepub async fn list_commits(
&self,
owner: &str,
repo: &str,
since: Option<&str>,
per_page: Option<u32>,
) -> Result<Vec<CommitSummary>>
pub async fn list_commits( &self, owner: &str, repo: &str, since: Option<&str>, per_page: Option<u32>, ) -> Result<Vec<CommitSummary>>
List recent commits
Sourcepub async fn search_code(
&self,
query: &str,
per_page: Option<u32>,
) -> Result<CodeSearchResult>
pub async fn search_code( &self, query: &str, per_page: Option<u32>, ) -> Result<CodeSearchResult>
Search code in repositories
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more