pub struct ProblemSpec {
pub problem_id: String,
pub tenant_scope: String,
pub objective: ObjectiveSpec,
pub constraints: Vec<ConstraintSpec>,
pub inputs: Value,
pub budgets: SolveBudgets,
pub determinism: DeterminismSpec,
pub provenance: ProvenanceEnvelope,
}Expand description
Complete problem specification for the solver gate
This is the contract surface for optimization problems - pure, serializable, and deterministic input that can be traced, replayed, and audited.
Fields§
§problem_id: StringStable identifier for trace joins and audit
tenant_scope: StringTenant scope for multi-tenant flows
objective: ObjectiveSpecObjective to optimize (minimize/maximize)
constraints: Vec<ConstraintSpec>Constraints that must be satisfied
inputs: ValueTyped payload per pack (schema-validated by the pack)
budgets: SolveBudgetsResource budgets for solving
determinism: DeterminismSpecDeterminism requirements
provenance: ProvenanceEnvelopeProvenance for audit trail
Implementations§
Source§impl ProblemSpec
impl ProblemSpec
Sourcepub fn builder(
problem_id: impl Into<String>,
tenant_scope: impl Into<String>,
) -> ProblemSpecBuilder
pub fn builder( problem_id: impl Into<String>, tenant_scope: impl Into<String>, ) -> ProblemSpecBuilder
Create a new problem spec builder
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the problem spec (schema validation happens in pack)
Sourcepub fn inputs_as<T: for<'de> Deserialize<'de>>(&self) -> Result<T>
pub fn inputs_as<T: for<'de> Deserialize<'de>>(&self) -> Result<T>
Parse inputs as a specific type
Trait Implementations§
Source§impl Clone for ProblemSpec
impl Clone for ProblemSpec
Source§fn clone(&self) -> ProblemSpec
fn clone(&self) -> ProblemSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProblemSpec
impl Debug for ProblemSpec
Source§impl<'de> Deserialize<'de> for ProblemSpec
impl<'de> Deserialize<'de> for ProblemSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProblemSpec
impl RefUnwindSafe for ProblemSpec
impl Send for ProblemSpec
impl Sync for ProblemSpec
impl Unpin for ProblemSpec
impl UnsafeUnpin for ProblemSpec
impl UnwindSafe for ProblemSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more