Skip to main content

Crate plansolve

Crate plansolve 

Source
Expand description

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. All optimization types follow the same workflow: construct a request, start the solver, poll for status, get results.

use plansolve::Client;

let client = Client::from_env()?;
let request = serde_json::from_str(&std::fs::read_to_string("request.json").unwrap()).unwrap();
let result = client
    .field_service
    .start_and_wait_for_completion(&request, 5000, 10)
    .await?;
println!("score: {:?}", result.score);

Modules§

field_service
Field service optimization — vehicle routing with geographic constraints, travel time, visit sequencing, and time windows.
professional_services
Professional services optimization — assigns tasks to employees based on skills, availability, priorities, and deadlines. No geographic constraints.
shift
Shift assignment optimization — assigns shifts/tasks to employees based on skills and availability, focused on shift coverage and scheduling.

Structs§

Client
The main PlanSolve API client. Exposes one sub-client per optimization type.
Score
An optimization score in the format Xhard/Ymedium/Zsoft.
SolverStatusResponse
The status of a solver job, returned by the /status endpoints.

Enums§

Environment
A PlanSolve API environment. Each has a single fixed base URL.
Error
Errors that can occur when using the PlanSolve client.
SolverStatus
The state of the solver for a given job.

Type Aliases§

Result
Convenience alias for results returned by this crate.