Crate modio[−][src]
Modio provides a set of building blocks for interacting with the mod.io API.
The client uses asynchronous I/O, backed by the futures
and tokio
crates, and requires both
to be used alongside.
Authentication
To access the API authentication is required and can be done via 3 ways:
- Request an API key (Read-only)
- Manually create an OAuth 2 Access Token (Read + Write)
- Email Authentication Flow to create an OAuth 2 Access Token (Read + Write)
Rate Limiting
For API requests using API key authentication are unlimited and for OAuth 2 authentication requests are limited to 120 requests per hour.
A special error Error::RateLimit will be return from api operations when the rate limit associated with credentials has been exhausted.
Examples
extern crate modio; extern crate tokio; use modio::{Credentials, Error, Modio}; use tokio::runtime::Runtime; fn main() -> Result<(), Error> { let mut rt = Runtime::new()?; let modio = Modio::new( "user-agent-name/1.0", Credentials::ApiKey(String::from("user-or-game-api-key")), ); // create some tasks and execute them // let result = rt.block_on(task)?; Ok(()) }
For testing purposes use Modio::host
to create a client for the
mod.io test environment.
Re-exports
pub use auth::Credentials; |
pub use error::Error; |
Modules
auth |
Authentication Flow interface |
comments |
Mod comments interface |
error |
Client errors |
files |
Modfile interface |
filter | |
games |
Games interface |
me |
Me interface |
metadata |
Mod metadata KVP interface |
mods |
Mods Interface |
reports |
Reports interface |
teams |
Team members interface |
users |
Users interface |
Structs
Endpoint |
Generic endpoint for sub-resources |
Event |
See the Event Object docs for more informations. |
EventListOptions |
Options used to filter event listings. |
Modio |
Endpoint interface to interacting with the mod.io API. |
ModioErrorResponse |
See the Error Object docs for more informations. |
ModioListResponse |
See the Multiple Item Response docs for more informations. |
ModioMessage |
See the Message Object docs for more informations. |
Enums
EventType |
Traits
AddOptions | |
DeleteOptions | |
QueryParams |
Type Definitions
Future | |
Stream |