pub trait Pack: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn version(&self) -> &'static str;
fn validate_inputs(&self, inputs: &Value) -> Result<(), GateError>;
fn invariants(&self) -> &[InvariantDef];
fn solve(&self, spec: &ProblemSpec) -> Result<PackSolveResult, GateError>;
fn check_invariants(
&self,
plan: &ProposedPlan,
) -> Result<Vec<InvariantResult>, GateError>;
fn evaluate_gate(
&self,
plan: &ProposedPlan,
invariant_results: &[InvariantResult],
) -> PromotionGate;
}Expand description
A domain pack for the solver gate
Packs define the contract for a specific optimization domain, including input validation, solving, invariant checking, and gate evaluation.
Required Methods§
Sourcefn validate_inputs(&self, inputs: &Value) -> Result<(), GateError>
fn validate_inputs(&self, inputs: &Value) -> Result<(), GateError>
Validate and deserialize the input payload
Sourcefn invariants(&self) -> &[InvariantDef]
fn invariants(&self) -> &[InvariantDef]
Get invariant definitions for this pack
Sourcefn solve(&self, spec: &ProblemSpec) -> Result<PackSolveResult, GateError>
fn solve(&self, spec: &ProblemSpec) -> Result<PackSolveResult, GateError>
Solve the problem and return a proposed plan
Sourcefn check_invariants(
&self,
plan: &ProposedPlan,
) -> Result<Vec<InvariantResult>, GateError>
fn check_invariants( &self, plan: &ProposedPlan, ) -> Result<Vec<InvariantResult>, GateError>
Check invariants against a proposed plan
Sourcefn evaluate_gate(
&self,
plan: &ProposedPlan,
invariant_results: &[InvariantResult],
) -> PromotionGate
fn evaluate_gate( &self, plan: &ProposedPlan, invariant_results: &[InvariantResult], ) -> PromotionGate
Evaluate promotion gate based on plan and invariant results
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".