10 releases (4 breaking)
Uses new Rust 2024
new 0.4.0 | Apr 27, 2025 |
---|---|
0.3.4 | Dec 28, 2024 |
0.3.3 | Oct 6, 2024 |
0.3.0 | Jul 28, 2024 |
0.0.0-alpha.0 | Sep 23, 2023 |
#161 in Game dev
145KB
3.5K
SLoC
Resonite API in rust

Rust models of Resonite's API.
Any official documentation of Resonite' API is lacking, and the API is still changing too. So this crate can't guarantee correctness.
There's serde
support for communicating with the API.
There's also support to (de)serialize data to a binary with borsh
.
This has the upsides of it include:
- using less space
- (de)serializing faster
- not so directly tied to API implementation like serde, so trouble with field renames & such can be avoided
This crate provides an example API client with the optional http_client
& signalr_client
features.
For programming style, beyond the clippy lints & rustfmt's automatic formatting: Doc comments should come before attributes. I'm hoping that someday rustfmt will gain the ability to automate that.
Testing
The integration tests will contact the live API. That's why they are ignored by default.
Some of them also will require authentication.
Sadly not all the things can even be reliably tested without creating a mock API. Which in turn defeats the purpose of the tests in the first place.
Generating auth token
To dogfed the API crate, the auth getting is implemented with a simple rust script using this crate itself. You can run the binary with:
cargo run --bin auth-helper --all-features
Running ignored tests
Make sure that you've got:
- an internet connection
- a valid authentication file
Then just run the tests;
# A specific test with output logging
cargo test --all-features get_user -- --exact --ignored --nocapture
# All tests
cargo test --all-features -- --ignored
License
Note that the license is MPL-2.0
instead of the more common MIT OR Apache-2.0
.
A license change however can be negotiated if the Resonite team wants to use this crate or adopt this crate into a more official one with a different license.
Dependencies
~2–16MB
~225K SLoC