pub struct OptimizeClient { /* private fields */ }Expand description
Optimization client — thin facade for LP solving via the inference engine.
Note: the full TypeScript SDK performs LP-to-rule compilation client-side; the Rust port of
that compiler is deferred. For now this client exposes a direct passthrough to the planned
/api/v1/optimize/production endpoint and a solve stub that returns
Error::Validation directing callers to the endpoint-level API. Future versions will
include the full compiler.
Implementations§
Source§impl OptimizeClient
impl OptimizeClient
Sourcepub async fn solve(
&self,
problem: &LinearProgramDefinition,
_opts: &SolveOptions,
options: Option<&RequestOptions>,
) -> Result<OptimizationResult, Error>
pub async fn solve( &self, problem: &LinearProgramDefinition, _opts: &SolveOptions, options: Option<&RequestOptions>, ) -> Result<OptimizationResult, Error>
Solve an LP problem via the backend /optimize/production endpoint.
The backend accepts a JSON representation of the problem; serialization of
LinearProgramDefinition uses the field layout documented in
crate::types::optimize. Call OptimizeClient::solve_raw if you need to pass a
custom JSON shape.
Sourcepub async fn solve_raw(
&self,
payload: &Value,
options: Option<&RequestOptions>,
) -> Result<Value, Error>
pub async fn solve_raw( &self, payload: &Value, options: Option<&RequestOptions>, ) -> Result<Value, Error>
Send a raw JSON payload to /optimize/production and return the raw response.
Use this if the LP structure documented in crate::types::optimize does not match
the current backend contract.
Trait Implementations§
Source§impl Clone for OptimizeClient
impl Clone for OptimizeClient
Source§fn clone(&self) -> OptimizeClient
fn clone(&self) -> OptimizeClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more