Generated API client for SpaceTraders.
cargo add space-traders-apiBy default reqwest/default-tls is included (feature default-tls).
use space_traders_api::apis::{configuration::Configuration, global_api};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut config = Configuration::new();
if let Ok(token) = std::env::var("SPACE_TRADERS_AGENT_TOKEN") {
config.bearer_access_token = Some(token);
}
let status = global_api::get_status(&config).await?;
println!("Status: {}", status.status);
}See examples/main.rs for an example to get started.
cargo run --example mainTo provide an agent token to the example, set SPACE_TRADERS_AGENT_TOKEN:
export SPACE_TRADERS_AGENT_TOKEN=...
cargo run --example mainThis project uses just to run commands the same way as the CI:
cargo just checkto check formatting and lints.cargo just docto generate and preview docs.
For a full list of commands, see the Justfile.