Skip to content

Add PositiveInt (primitives) #68

@vhrcgcom

Description

@vhrcgcom

Description

Implement PositiveInt as a ValueObject in the primitives module.

Spec: i64 > 0

Implementation checklist

  • Create src/primitives/positiveint.rs
  • Implement ValueObject trait
  • Add #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
  • Export from src/primitives/mod.rs and prelude
  • Unit tests: valid input · empty input · invalid format · normalisation
  • Doc comment with # Example block
  • Update status in ROADMAP.md from ⬜ to ✅

Implementation detail

Input / Output

Type Alias
Input i64 PositiveIntInput
Output i64 PositiveIntOutput

Normalization

None.

Validation

  • Must be strictly positive: value > 0. Zero is rejected.

Extra methods

None beyond the trait.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions