Crates.io | screeps-api |
lib.rs | screeps-api |
version | 0.6.0 |
source | src |
created_at | 2017-12-26 04:28:53.514879 |
updated_at | 2019-07-19 07:03:33.765288 |
description | Fully typed and tested wrapper over the Screeps Game's HTTP API |
homepage | |
repository | https://github.com/daboross/rust-screeps-api |
max_upload_size | |
id | 44418 |
size | 927,748 |
A Rust library for using the Screeps HTTP API.
Screeps is a true programming MMO where users uploading JavaScript code to power their online empires.
rust-screeps-api
can connect to the official server, and any private server instances run by
users.
rust-screeps-api
uses hyper to run http requests and serde to parse json results.
extern crate screeps_api;
use screeps_api::SyncApi;
let mut api = SyncApi::new().unwrap();
api.login("username", "password").unwrap();
let my_info = api.my_info().unwrap();
println!("Logged in with user ID {}!", my_info.user_id);
Documentation is located at https://docs.rs/screeps-api/.
Unofficial API documentation for:
rust-screeps-api
has both unit tests for parsing sample results from each endpoint, and integration tests which make calls to the official server.
Environmental variables used when testing:
.env
file (parsed using the dotenv
crate)Use:
cargo test
to perform all tests, including calls to https://screeps.com with provided login details.cargo test parse
to only perform parsing unit tests. This can be performed offline.cargo test -- --skip auth
to test both parsing and all unauthenticated calls to the official server.