pub trait GithubApi: Send + Sync {
// Required methods
fn queued_jobs(
&self,
repository: &str,
) -> impl Future<Output = Result<Vec<QueuedJob>, Error>> + Send;
fn runners(
&self,
repository: &str,
) -> impl Future<Output = Result<Vec<Runner>, Error>> + Send;
fn jit_config(
&self,
repository: &str,
name: &str,
labels: &[String],
) -> impl Future<Output = Result<(Runner, JitConfig), Error>> + Send;
fn delete_runner(
&self,
repository: &str,
id: u64,
) -> impl Future<Output = Result<Deleted, Error>> + Send;
fn job(
&self,
repository: &str,
id: u64,
) -> impl Future<Output = Result<JobDetails, Error>> + Send;
fn run_trigger(
&self,
repository: &str,
run: u64,
) -> impl Future<Output = Result<RunTrigger, Error>> + Send;
fn pull_request(
&self,
repository: &str,
number: u64,
) -> impl Future<Output = Result<PullRequest, Error>> + Send;
fn repository(
&self,
repository: &str,
) -> impl Future<Output = Result<RepositoryDetails, Error>> + Send;
fn on_branch(
&self,
repository: &str,
branch: &str,
sha: &str,
) -> impl Future<Output = Result<bool, Error>> + Send;
fn cancel_run(
&self,
repository: &str,
run: u64,
) -> impl Future<Output = Result<(), Error>> + Send;
fn spend(&self) -> Spend;
}Expand description
The GitHub calls the scheduler makes. Github is the real client; the engine’s tests use a fake.
Required Methods§
Sourcefn queued_jobs(
&self,
repository: &str,
) -> impl Future<Output = Result<Vec<QueuedJob>, Error>> + Send
fn queued_jobs( &self, repository: &str, ) -> impl Future<Output = Result<Vec<QueuedJob>, Error>> + Send
The repository’s jobs waiting for a runner, in queued runs and in runs that started some of their jobs.
Sourcefn runners(
&self,
repository: &str,
) -> impl Future<Output = Result<Vec<Runner>, Error>> + Send
fn runners( &self, repository: &str, ) -> impl Future<Output = Result<Vec<Runner>, Error>> + Send
The repository’s self-hosted runners.
Sourcefn jit_config(
&self,
repository: &str,
name: &str,
labels: &[String],
) -> impl Future<Output = Result<(Runner, JitConfig), Error>> + Send
fn jit_config( &self, repository: &str, name: &str, labels: &[String], ) -> impl Future<Output = Result<(Runner, JitConfig), Error>> + Send
Registers a runner for one job and returns it with the config the runner’s listener takes.
Sourcefn delete_runner(
&self,
repository: &str,
id: u64,
) -> impl Future<Output = Result<Deleted, Error>> + Send
fn delete_runner( &self, repository: &str, id: u64, ) -> impl Future<Output = Result<Deleted, Error>> + Send
Removes a runner from the repository.
Sourcefn job(
&self,
repository: &str,
id: u64,
) -> impl Future<Output = Result<JobDetails, Error>> + Send
fn job( &self, repository: &str, id: u64, ) -> impl Future<Output = Result<JobDetails, Error>> + Send
One job’s progress and steps.
Sourcefn run_trigger(
&self,
repository: &str,
run: u64,
) -> impl Future<Output = Result<RunTrigger, Error>> + Send
fn run_trigger( &self, repository: &str, run: u64, ) -> impl Future<Output = Result<RunTrigger, Error>> + Send
What started a workflow run.
Sourcefn pull_request(
&self,
repository: &str,
number: u64,
) -> impl Future<Output = Result<PullRequest, Error>> + Send
fn pull_request( &self, repository: &str, number: u64, ) -> impl Future<Output = Result<PullRequest, Error>> + Send
One pull request: who opened it and where its head branch is.
Sourcefn repository(
&self,
repository: &str,
) -> impl Future<Output = Result<RepositoryDetails, Error>> + Send
fn repository( &self, repository: &str, ) -> impl Future<Output = Result<RepositoryDetails, Error>> + Send
The repository’s default branch and visibility.
Sourcefn on_branch(
&self,
repository: &str,
branch: &str,
sha: &str,
) -> impl Future<Output = Result<bool, Error>> + Send
fn on_branch( &self, repository: &str, branch: &str, sha: &str, ) -> impl Future<Output = Result<bool, Error>> + Send
Whether branch of the repository has the commit sha: its head or an ancestor of it. A tag of the same
name, which git would take for it, does not count.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".