8 releases
0.2.1 | Feb 8, 2024 |
---|---|
0.2.0 | Oct 19, 2023 |
0.1.0-beta.3 | Jul 3, 2023 |
0.1.0-alpha.2 | Jun 21, 2023 |
#2 in #nation
170KB
3K
SLoC
A NationStates API in Rust.
Proud to be 100% safe. Takes full advantage of Rust's type system.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.
lib.rs
:
A NationStates API wrapper that takes full advantage of Rust's type system.
Works with the current API (v12) as of 4 October 2023.
Using the library usually takes three steps:
- Creating a request
(e.g.
PublicNationRequest
) with the relevant shards. - Sending the request as a URL through a
Client
. - Parsing the response using a parser in
parsers
.
Currently, the following requests can be formed and sent:
- Nation (public shards only):
PublicNationRequest::new
, fromPublicNationShards
; also,StandardPublicNationRequest
- Region:
RegionRequest::new
, fromRegionShards
; also,StandardRegionRequest
- World (except for
regionsfromtag
):WorldRequest::new
, fromWorldShards
- WA (World Assembly):
WAShard
, fromWAShards
The following requests can be parsed:
Nation
(some fields still being finalized)
The following functionality is planned, but is not implemented:
- parsers for Region, World, and WA request responses
- private shards
- lighter-weight client using
hyper
- breaking crate into features
Examples
For a list of examples, see the examples folder on GitHub.
Dependencies
~9–21MB
~303K SLoC