pub struct GitHubClient { /* private fields */ }Implementations§
Source§impl GitHubClient
impl GitHubClient
pub fn new(base_url: impl Into<String>, token: Option<String>) -> Result<Self>
pub fn with_options(options: GitHubClientOptions) -> Result<Self>
pub fn latest_reference( &self, owner: &str, repository: &str, ) -> Result<LatestReference>
pub fn resolve_reference( &self, owner: &str, repository: &str, reference: &str, ) -> Result<String>
pub fn validate_token_scopes(&self) -> Result<()>
pub fn default_branch(&self, owner: &str, repository: &str) -> Result<String>
pub fn branch_head_sha( &self, owner: &str, repository: &str, branch: &str, ) -> Result<String>
pub fn commit_tree_sha( &self, owner: &str, repository: &str, commit_sha: &str, ) -> Result<String>
pub fn create_branch( &self, owner: &str, repository: &str, branch: &str, base_sha: &str, ) -> Result<()>
pub fn create_ref( &self, owner: &str, repository: &str, ref_path: &str, sha: &str, ) -> Result<()>
Sourcepub fn create_annotated_tag(
&self,
owner: &str,
repository: &str,
tag: &str,
message: &str,
commit_sha: &str,
) -> Result<String>
pub fn create_annotated_tag( &self, owner: &str, repository: &str, tag: &str, message: &str, commit_sha: &str, ) -> Result<String>
Create an annotated tag object pointing at commit_sha and return the
tag object’s SHA. The tagger identity derives from the token. A ref
must still be created separately to make the tag reachable.
pub fn reference_sha( &self, owner: &str, repository: &str, ref_path: &str, ) -> Result<Option<String>>
pub fn create_blob( &self, owner: &str, repository: &str, content: &str, ) -> Result<String>
pub fn create_tree( &self, owner: &str, repository: &str, base_tree_sha: &str, entries: &[TreeEntry], ) -> Result<String>
pub fn create_commit( &self, owner: &str, repository: &str, message: &str, tree_sha: &str, parent_sha: &str, ) -> Result<String>
pub fn update_branch( &self, owner: &str, repository: &str, branch: &str, commit_sha: &str, ) -> Result<()>
pub fn update_ref( &self, owner: &str, repository: &str, ref_path: &str, sha: &str, force: bool, ) -> Result<()>
Sourcepub fn update_ref_fast_forward(
&self,
owner: &str,
repository: &str,
ref_path: &str,
sha: &str,
) -> Result<bool>
pub fn update_ref_fast_forward( &self, owner: &str, repository: &str, ref_path: &str, sha: &str, ) -> Result<bool>
Fast-forward ref_path to sha; returns Ok(false) when GitHub rejects
the update because it is not a fast forward (HTTP 422).
Sourcepub fn latest_semver_tag(
&self,
owner: &str,
repository: &str,
prefix: &str,
) -> Result<Option<TagInfo>>
pub fn latest_semver_tag( &self, owner: &str, repository: &str, prefix: &str, ) -> Result<Option<TagInfo>>
Latest tag whose name is prefix followed by a semver version,
scanning up to 1000 tags.
pub fn compare_commits( &self, owner: &str, repository: &str, base: &str, head: &str, max_pages: u32, ) -> Result<CommitRange>
pub fn list_commits( &self, owner: &str, repository: &str, head_sha: &str, max_pages: u32, ) -> Result<CommitRange>
pub fn create_release( &self, owner: &str, repository: &str, tag_name: &str, name: &str, body: &str, target_commitish: &str, ) -> Result<ReleaseInfo>
pub fn ensure_token(&self) -> Result<()>
pub fn create_pull_request( &self, owner: &str, repository: &str, title: &str, body: &str, head: &str, base: &str, ) -> Result<PullRequestInfo>
pub fn find_open_pull_request( &self, owner: &str, repository: &str, head: &str, base: &str, ) -> Result<Option<PullRequestInfo>>
pub fn update_pull_request( &self, owner: &str, repository: &str, number: u64, title: &str, body: &str, ) -> Result<PullRequestInfo>
pub fn add_labels( &self, owner: &str, repository: &str, issue_number: u64, labels: &[String], ) -> Result<()>
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