This is a Rust wrapper for jpdb.io's API.
It uses ureq and offers syncronous api calls by design, mainly because no client would make enough calls at the same time for it to reasonably matter. This also simplifies use, reduces compile time/executable size, and massively simplifies the dependency tree. If you need to make calls in an async function, you can turn to your executor's function of choice (eg. tokio's spawn_blocking
) instead.
```rust use jpdb::client::Client;
fn main() { // First, we create a client let client = Client::new("myjpdbtoken"); //token is stored in the settings page
// Next, we can call upon the api easily
let response = client.ping();
//Every function returns a result, with any error type jpdb can return
if let Err(jpdb::error::Error::BadKey(__)) = response {
println!("your error handling here, because the token was bad");
}
// That's about it! Read the docs for all available endpoints, and the error they'd return.
} ```
Like all good rust crates, jpdb
uses semantic versioning. The rationale is the following, for X.Y.Z: