Skip to main content

Module constraint

Module constraint 

Source
Expand description

Typed VersionConstraint — what versions a dependency accepts.

Adapters parse their native constraint syntax (cargo ^1.2.3, npm >=1.2.3 <2.0.0, Bundler ~> 1.2.3, pip >=1.2,<2.0, Composer ^1.2 || ^2.0, …) into this canonical typed shape. The resolver in gen-engine reads this once + does its version-selection math against it; per-adapter constraint logic lives only at the parse boundary.

Structs§

CompoundConstraint
Compound constraint container — disjunction / conjunction of atomic ConstraintSpecs. Kept separate from ConstraintSpec to avoid serde recursion-overflow on the derive macros (Vec inside a derived Serialize/Deserialize enum triggers a monomorphization storm). Most adapters never need this — the Range + Caret + Tilde variants cover ≥95% of real-world constraints.
VersionConstraint
Wrapper carrying both the typed ConstraintSpec and the original native syntax — handy for diagnostics + round-tripping back to the source manifest.

Enums§

Combinator
ConstraintSpec
One typed variant per constraint kind every package manager surfaces. Adapter is responsible for converting ~> 1.2.3 etc. into the matching shape.