pub struct ProblemSpecBuilder { /* private fields */ }Expand description
Builder for ProblemSpec
Implementations§
Source§impl ProblemSpecBuilder
impl ProblemSpecBuilder
Sourcepub fn new(problem_id: String, tenant_scope: String) -> Self
pub fn new(problem_id: String, tenant_scope: String) -> Self
Create a new builder with required fields
Sourcepub fn objective(self, obj: ObjectiveSpec) -> Self
pub fn objective(self, obj: ObjectiveSpec) -> Self
Set the objective
Sourcepub fn constraint(self, c: ConstraintSpec) -> Self
pub fn constraint(self, c: ConstraintSpec) -> Self
Add a constraint
Sourcepub fn constraints(self, cs: impl IntoIterator<Item = ConstraintSpec>) -> Self
pub fn constraints(self, cs: impl IntoIterator<Item = ConstraintSpec>) -> Self
Add multiple constraints
Sourcepub fn inputs<T: Serialize>(self, inputs: &T) -> Result<Self>
pub fn inputs<T: Serialize>(self, inputs: &T) -> Result<Self>
Set inputs from a serializable type
Sourcepub fn inputs_raw(self, inputs: Value) -> Self
pub fn inputs_raw(self, inputs: Value) -> Self
Set inputs from raw JSON value
Sourcepub fn budgets(self, budgets: SolveBudgets) -> Self
pub fn budgets(self, budgets: SolveBudgets) -> Self
Set solve budgets
Sourcepub fn determinism(self, det: DeterminismSpec) -> Self
pub fn determinism(self, det: DeterminismSpec) -> Self
Set determinism spec
Sourcepub fn provenance(self, prov: ProvenanceEnvelope) -> Self
pub fn provenance(self, prov: ProvenanceEnvelope) -> Self
Set provenance
Sourcepub fn build(self) -> Result<ProblemSpec>
pub fn build(self) -> Result<ProblemSpec>
Build the problem spec
Auto Trait Implementations§
impl Freeze for ProblemSpecBuilder
impl RefUnwindSafe for ProblemSpecBuilder
impl Send for ProblemSpecBuilder
impl Sync for ProblemSpecBuilder
impl Unpin for ProblemSpecBuilder
impl UnsafeUnpin for ProblemSpecBuilder
impl UnwindSafe for ProblemSpecBuilder
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