Skip to main content

plansolve/
lib.rs

1//! Official Rust client library for the [PlanSolve](https://getplansolve.com) optimization API.
2//!
3//! Solve field service routing, professional services task assignment, and shift
4//! scheduling problems with a simple, async API. All optimization types follow the
5//! same workflow: construct a request, start the solver, poll for status, get results.
6//!
7//! ```no_run
8//! # async fn run() -> plansolve::Result<()> {
9//! use plansolve::Client;
10//!
11//! let client = Client::from_env()?;
12//! let request = serde_json::from_str(&std::fs::read_to_string("request.json").unwrap()).unwrap();
13//! let result = client
14//!     .field_service
15//!     .start_and_wait_for_completion(&request, 5000, 10)
16//!     .await?;
17//! println!("score: {:?}", result.score);
18//! # Ok(())
19//! # }
20//! ```
21
22mod client;
23mod error;
24mod score;
25mod solver_status;
26mod transport;
27
28pub mod field_service;
29pub mod jobs;
30pub mod professional_services;
31pub mod shift;
32
33pub use client::{Client, Environment};
34pub use error::{Error, Result};
35pub use score::Score;
36pub use solver_status::{SolverStatus, SolverStatusResponse};