plansolve 0.1.0

Official Rust client library for the PlanSolve optimization API.
Documentation

plansolve

Official Rust client library for the PlanSolve optimization API.

Solve field service routing, professional services task assignment, and shift scheduling problems with a simple, async API. Every optimization type follows the same workflow: construct a request, start the solver, poll for status, get results.

[dependencies]
plansolve = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
serde_json = "1"
use plansolve::Client;

#[tokio::main]
async fn main() -> plansolve::Result<()> {
    let client = Client::from_env()?; // reads PLANSOLVE_API_KEY

    let text = std::fs::read_to_string("request.json").unwrap();
    let request = serde_json::from_str(&text).unwrap();

    let result = client
        .field_service
        .start_and_wait_for_completion(&request, 5000, 10)
        .await?;

    println!("score: {:?}", result.score);
    Ok(())
}

Environments

The base URL is not configurable via environment — there are two fixed environments:

Environment Base URL
Environment::Production (default) https://plansolve.app
Environment::Test https://test.plansolve.app
let client = plansolve::Client::with_environment(api_key, plansolve::Environment::Test);

A plansolve command-line tool built on this library is available in the plansolve-cli crate.

License

MIT