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 default_branch(
&self,
repository: &str,
) -> impl Future<Output = Result<String, 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;
}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 run.sh --jitconfig 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 default_branch(
&self,
repository: &str,
) -> impl Future<Output = Result<String, Error>> + Send
fn default_branch( &self, repository: &str, ) -> impl Future<Output = Result<String, Error>> + Send
The repository’s default branch.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".