pub trait GithubApi: Send + Sync {
// Required methods
fn get_ref(
&self,
owner: &str,
repo: &str,
tag: &str,
) -> impl Future<Output = Result<RefTarget, GithubError>> + Send;
fn get_tag(
&self,
owner: &str,
repo: &str,
sha: &str,
) -> impl Future<Output = Result<TagObject, GithubError>> + Send;
fn list_releases(
&self,
owner: &str,
repo: &str,
page: u32,
) -> impl Future<Output = Result<Vec<RemoteRelease>, GithubError>> + Send;
fn create_release(
&self,
owner: &str,
repo: &str,
tag: &str,
title: &str,
body: &str,
prerelease: bool,
) -> impl Future<Output = Result<RemoteRelease, GithubError>> + Send;
fn list_assets(
&self,
owner: &str,
repo: &str,
release_id: u64,
page: u32,
) -> impl Future<Output = Result<Vec<RemoteAsset>, GithubError>> + Send;
fn upload_asset(
&self,
owner: &str,
repo: &str,
release_id: u64,
name: &str,
file: Box<dyn Read + Send>,
length: u64,
content_type: &str,
) -> impl Future<Output = Result<RemoteAsset, GithubError>> + Send;
fn delete_asset(
&self,
owner: &str,
repo: &str,
asset_id: u64,
) -> impl Future<Output = Result<(), GithubError>> + Send;
}Expand description
Provider transport seam for GitHub staging.
Production uses fixed https://api.github.com plus upload host
https://uploads.github.com through eggfetch-core with a lean profile
(no retries, no redirects). Tests inject a deterministic fixture.
Required Methods§
Sourcefn get_ref(
&self,
owner: &str,
repo: &str,
tag: &str,
) -> impl Future<Output = Result<RefTarget, GithubError>> + Send
fn get_ref( &self, owner: &str, repo: &str, tag: &str, ) -> impl Future<Output = Result<RefTarget, GithubError>> + Send
Fetch exact refs/tags/<tag> reference.
Sourcefn get_tag(
&self,
owner: &str,
repo: &str,
sha: &str,
) -> impl Future<Output = Result<TagObject, GithubError>> + Send
fn get_tag( &self, owner: &str, repo: &str, sha: &str, ) -> impl Future<Output = Result<TagObject, GithubError>> + Send
Fetch one annotated tag object by SHA.
Sourcefn list_releases(
&self,
owner: &str,
repo: &str,
page: u32,
) -> impl Future<Output = Result<Vec<RemoteRelease>, GithubError>> + Send
fn list_releases( &self, owner: &str, repo: &str, page: u32, ) -> impl Future<Output = Result<Vec<RemoteRelease>, GithubError>> + Send
List releases for one page (1-indexed, per_page=100).
Sourcefn create_release(
&self,
owner: &str,
repo: &str,
tag: &str,
title: &str,
body: &str,
prerelease: bool,
) -> impl Future<Output = Result<RemoteRelease, GithubError>> + Send
fn create_release( &self, owner: &str, repo: &str, tag: &str, title: &str, body: &str, prerelease: bool, ) -> impl Future<Output = Result<RemoteRelease, GithubError>> + Send
Create a new draft release for an exact existing tag.
Sourcefn list_assets(
&self,
owner: &str,
repo: &str,
release_id: u64,
page: u32,
) -> impl Future<Output = Result<Vec<RemoteAsset>, GithubError>> + Send
fn list_assets( &self, owner: &str, repo: &str, release_id: u64, page: u32, ) -> impl Future<Output = Result<Vec<RemoteAsset>, GithubError>> + Send
List all assets for one release.
Sourcefn upload_asset(
&self,
owner: &str,
repo: &str,
release_id: u64,
name: &str,
file: Box<dyn Read + Send>,
length: u64,
content_type: &str,
) -> impl Future<Output = Result<RemoteAsset, GithubError>> + Send
fn upload_asset( &self, owner: &str, repo: &str, release_id: u64, name: &str, file: Box<dyn Read + Send>, length: u64, content_type: &str, ) -> impl Future<Output = Result<RemoteAsset, GithubError>> + Send
Upload one asset; 502/422 are reported as errors with http_502 /
http_422_duplicate prefixes so the caller can apply narrow recovery.
Sourcefn delete_asset(
&self,
owner: &str,
repo: &str,
asset_id: u64,
) -> impl Future<Output = Result<(), GithubError>> + Send
fn delete_asset( &self, owner: &str, repo: &str, asset_id: u64, ) -> impl Future<Output = Result<(), GithubError>> + Send
Delete one asset by id (only the narrow starter recovery may call this).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".