pub struct Github { /* private fields */ }Expand description
A client for communicating with a Github instance.
Implementations§
Source§impl Github
impl Github
Sourcepub fn new_app<H, P, I, S>(
host: H,
app_id: i64,
private_key: P,
installation_ids: I,
) -> Result<Self, GithubError>
pub fn new_app<H, P, I, S>( host: H, app_id: i64, private_key: P, installation_ids: I, ) -> Result<Self, GithubError>
Create a new Github client as a GitHub App.
The host parameter is the API endpoint. For example github.com uses api.github.com.
The app_id and private_key are provided when registering the application.
The installation_id is an ID associated with a given installation of the application. Its
value is present in webhooks, but does not seem to be available generically.
Sourcepub fn new_action<H>(host: H) -> Result<Self, GithubError>
pub fn new_action<H>(host: H) -> Result<Self, GithubError>
Create a new Github client as a GitHub Action.
The host parameter is the API endpoint. For example github.com uses api.github.com.
The app_id and private_key are provided when registering the application.
The installation_id is an ID associated with a given installation of the application. Its
value is present in webhooks, but does not seem to be available generically.
Sourcepub fn send<Q>(
&self,
owner: &str,
query: &QueryBody<Q::Variables>,
) -> Result<Q::ResponseData, GithubError>
pub fn send<Q>( &self, owner: &str, query: &QueryBody<Q::Variables>, ) -> Result<Q::ResponseData, GithubError>
Send a GraphQL query.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Github
impl !RefUnwindSafe for Github
impl Send for Github
impl Sync for Github
impl Unpin for Github
impl !UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more