plansolve 0.25.2

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(())
}

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

License

MIT