Module validated_types

Source
Expand description

Wrapper types that encode validation constraints in the type system.

These types make invalid config states unrepresentable at parse time:

  • PositiveI64 / PositiveI32 / PositiveF64 — value must be > 0
  • NonZeroU64 — u64 that must be != 0
  • WeightMultiplier — f64 that must be >= 1.0
  • NonEmptyVec<T> — Vec that must contain at least one element

Structs§

NonEmptyVec
NonZeroU64
PositiveF64
PositiveI32
PositiveI64
WeightMultiplier