pub struct Github { /* private fields */ }Expand description
A GitHub API client for one token. Requests on one URL are conditional on its last ETag, so an unchanged
answer costs no rate limit.
Implementations§
Source§impl Github
impl Github
Sourcepub fn new(base: &str, token_source: TokenSource) -> Result<Github, Error>
pub fn new(base: &str, token_source: TokenSource) -> Result<Github, Error>
A client for base (API_URL, or a test server) that takes its token from token_source.
Sourcepub fn blocked_until(&self) -> Option<SystemTime>
pub fn blocked_until(&self) -> Option<SystemTime>
When the next request may be sent: None now, otherwise when the rate limit resets.
Trait Implementations§
Source§impl GithubApi for Github
impl GithubApi for Github
Source§async fn queued_jobs(&self, repository: &str) -> Result<Vec<QueuedJob>, Error>
async fn queued_jobs(&self, repository: &str) -> Result<Vec<QueuedJob>, Error>
The repository’s jobs waiting for a runner, in queued runs and in runs that started some of their jobs.
Source§async fn runners(&self, repository: &str) -> Result<Vec<Runner>, Error>
async fn runners(&self, repository: &str) -> Result<Vec<Runner>, Error>
The repository’s self-hosted runners.
Source§async fn jit_config(
&self,
repository: &str,
name: &str,
labels: &[String],
) -> Result<(Runner, JitConfig), Error>
async fn jit_config( &self, repository: &str, name: &str, labels: &[String], ) -> Result<(Runner, JitConfig), Error>
Registers a runner for one job and returns it with the config
run.sh --jitconfig takes.Source§async fn delete_runner(
&self,
repository: &str,
id: u64,
) -> Result<Deleted, Error>
async fn delete_runner( &self, repository: &str, id: u64, ) -> Result<Deleted, Error>
Removes a runner from the repository.
Source§async fn job(&self, repository: &str, id: u64) -> Result<JobDetails, Error>
async fn job(&self, repository: &str, id: u64) -> Result<JobDetails, Error>
One job’s progress and steps.
Source§async fn run_trigger(
&self,
repository: &str,
run: u64,
) -> Result<RunTrigger, Error>
async fn run_trigger( &self, repository: &str, run: u64, ) -> Result<RunTrigger, Error>
What started a workflow run.
Source§async fn pull_request(
&self,
repository: &str,
number: u64,
) -> Result<PullRequest, Error>
async fn pull_request( &self, repository: &str, number: u64, ) -> Result<PullRequest, Error>
One pull request: who opened it and where its head branch is.
Source§async fn default_branch(&self, repository: &str) -> Result<String, Error>
async fn default_branch(&self, repository: &str) -> Result<String, Error>
The repository’s default branch.
Auto Trait Implementations§
impl !Freeze for Github
impl !RefUnwindSafe for Github
impl !UnwindSafe for Github
impl Send for Github
impl Sync for Github
impl Unpin for Github
impl UnsafeUnpin for Github
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