Skip to content

Add primitives module (v0.3.0)#84

Merged
codegresscom merged 4 commits intomainfrom
feat/66-77-primitives
Apr 20, 2026
Merged

Add primitives module (v0.3.0)#84
codegresscom merged 4 commits intomainfrom
feat/66-77-primitives

Conversation

@vhrcgcom
Copy link
Copy Markdown
Collaborator

@vhrcgcom vhrcgcom commented Apr 20, 2026

Summary

Implements the full primitives module (v0.3.0) — 10 value objects with validation, normalisation, and serde support.

Type Spec
NonEmptyString trimmed, at least 1 non-whitespace char
BoundedString<MIN, MAX> const-generic length bounds, Unicode char count
PositiveInt i64 > 0
NonNegativeInt i64 >= 0
PositiveDecimal Decimal > 0
NonNegativeDecimal Decimal >= 0
Probability f64 in [0.0, 1.0], NaN/inf rejected
HexColor #RRGGBB / #RGB, expanded + uppercased; .r()/.g()/.b()
Locale BCP 47 lang tag, _-, lang lowercase, region uppercase
Base64String standard Base64; .decode() -> Vec<u8>

New optional dependency: base64 = "0.22" (MSRV 1.65, within our 1.85 requirement).
rust_decimal (already optional dep) pinned to 1.26 and added to primitives feature.

Closes #66
Closes #67
Closes #68
Closes #69
Closes #70
Closes #71
Closes #72
Closes #73
Closes #75
Closes #77

Type of change

  • Bug fix
  • New value object / feature
  • Documentation
  • Refactor / internal improvement
  • CI / tooling

Checklist

  • cargo fmt — code is formatted
  • cargo clippy --features full,serde -- -Dclippy::all — no warnings
  • cargo test --features full,serde — all tests pass (108/108)
  • New public API has doc comments with an # Example block
  • New value objects have tests for: valid input, empty input, invalid format, normalisation
  • README feature table updated (if a new feature was added)

Václav Hrach and others added 4 commits April 20, 2026 20:50
10 value objects: NonEmptyString, BoundedString, PositiveInt,
NonNegativeInt, PositiveDecimal, NonNegativeDecimal, Probability,
HexColor, Locale, Base64String.

Closes #66, #67, #68, #69, #70, #71, #72, #73, #75, #77

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rust convention: words in file names separated by underscores.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- rust_decimal = "1" resolved to 1.0.0 under minimal-versions (Decimal::ZERO
  absent); pinned to 1.26 where all used constants exist
- non_empty_string was misplaced in mod.rs causing cargo fmt failure;
  reordered lexicographically

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codegresscom codegresscom merged commit bbb7090 into main Apr 20, 2026
14 checks passed
@codegresscom codegresscom deleted the feat/66-77-primitives branch April 20, 2026 19:04
vhrcgcom pushed a commit that referenced this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants