Module github_rs::github [] [src]

Docs for code used to access the Github API in Rust

Github Reference Docs

Design

By abstracting away the code underlying the calls into a single struct via Traits, it makes it easy to make API calls without having to import all of the different modules to do it. Merely create a new struct and make the calls from it.

The different traits represent all of the different methods available to access the API and what they do. Since all of them are implemented for this struct all of the methods are available on this page and there is no need to import any of the other files ever. While all the trait implementations and definitions reside in different files within the codebase itself they've all been imported into this module. You'll be able to make any calls you need with the Github struct and not need to worry about trait imports or the like.

Examples

extern crate github_rs;
// Imports trait methods and everything else automatically
use github_rs::github::*;
let github = Client::new("Your API Token Here");
println!("{:#?}", github.get_user());

Structs

Actor
Client

Struct used to make calls to the Github API.

Core
Email
Event
GPGKey
GPGKeyPost
GitIgnore
Markdown
Meta
Org
PatchUser

Used to update an authenticated user.

Plan
Rate
RateLimit
Repo
RepoCreate
Resources
SSHKey
Search
User

Information related to a user on Github is stored in this struct.

Enums

GithubError

Errors related to improper usage of the API

Traits

Activity

Trait used to define access to endpoints grouped under Activity in the Github API specification

Misc

Trait used to specify function hearders for endpoints grouped under Miscellaneous in the Github API specification

Repos

Trait definition for endpoints grouped under Repositories in the Github API specification

Users

Trait used to define access to endpoints grouped under Users in the Github API specification

Type Definitions

AccessToken

Used to represent the access token to authenticate with the Github API

HTML

Type used to explicitly define when we're dealing with HTML and not just JSON or any type of string.

Http2Error

Used to make it more clear that the error has to do with an underlying Http2 library and is not a problem with http itself

RawJSON

Represents a response from the server that has not been deserialized by serde into the appropriate type

Result

Result type used throughout all the endpoints to unify them all under one error type and to make the signature heading easier to read