Crate hubcaps [−] [src]
Hubcaps provides a set of building blocks for interacting with the Github API
Examples
Typical use will require instantiation of a Github client. Which requires
a user agent string, set of hubcaps::Credentials
and a tokio_core Handle
.
extern crate hubcaps; extern crate hyper; extern crate tokio_core; use tokio_core::reactor::Core; use hubcaps::{Credentials, Github}; fn main() { let mut core = Core::new().expect("reactor fail"); let github = Github::new( String::from("user-agent-name"), Some(Credentials::Token( String::from("personal-access-token") )), &core.handle() ); }
Github enterprise users will want to create a client with the Github#host method
Access to various services are provided via methods on instances of the Github
type.
The convention for executing operations typically looks like
github.repo(.., ..).service().operation(OperationOptions)
where operation may be create
,
delete
, etc.
Services and their types are packaged under their own module namespace.
A service interface will provide access to operations and operations may access options types
that define the various parameter options available for the operation. Most operation option
types expose builder()
methods for a builder oriented style of constructing options.
Errors
Operations typically result in a hubcaps::Result
Type which is an alias for Rust's
built-in Result with the Err Type fixed to the
hubcaps::Error type.
Reexports
pub use errors::Error; |
pub use errors::ErrorKind; |
pub use errors::Result; |
Modules
activity |
Activity interface |
branches |
Repo branches interface |
comments |
Comments interface |
deployments |
Deployments interface |
errors |
Client errors |
gists |
Gists interface |
git |
Git interface |
hooks |
Hooks interface |
issues |
Issues interface |
keys |
Deploy keys interface |
labels |
Labels interface |
organizations |
Organizations interface |
pull_commits |
Pull Commits interface |
pulls |
Pull requests interface |
releases |
Releases interface |
repositories |
Repository interface |
review_comments |
Review comments interface |
search |
Search interface |
stars |
Stars interface |
statuses |
Statuses interface |
teams |
Teams interface |
users |
Users interface |
Structs
Github |
Entry point interface for interacting with Github API |
Enums
Credentials |
Various forms of authentication credentials supported by Github |
MediaType |
alias for Result that infers hubcaps::Error as Err Github defined Media types See this doc for more for more information |
SortDirection |
enum representation of Github list sorting options |
Type Definitions
Future |
A type alias for |
Stream |
A type alias for |