Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default = []

# Domain modules — opt-in so you only pay for what you use
contact = ["dep:once_cell", "dep:regex", "dep:url"]
primitives = ["dep:rust_decimal", "dep:base64"]

# Cross-cutting concerns can be combined with any module
serde = ["dep:serde"]
Expand All @@ -27,17 +28,19 @@ sql = ["dep:sqlx"]
# Everything at once
full = [
"contact",
"primitives",
]

[dependencies]
thiserror = "2"
once_cell = { version = "1", optional = true }
regex = { version = "1", optional = true }
rust_decimal = { version = "1", optional = true }
rust_decimal = { version = "1.26", optional = true }
chrono = { version = "0.4", optional = true, features = ["serde"] }
uuid = { version = "1", optional = true, features = ["v4"] }
ulid = { version = "1", optional = true }
url = { version = "~2.4", optional = true }
base64 = { version = "0.22", optional = true }
serde = { version = "1", optional = true, features = ["derive"] }
sqlx = { version = "0.8", optional = true, features = ["postgres"] }

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ let parsed: EmailAddress = serde_json::from_str(r#""hello@example.com""#)?;
| `geo` | `Latitude`, `Longitude`, `Coordinate`, `BoundingBox`, `TimeZone` | 6 | 0 / 6 |
| `net` | `Url`, `IpAddress`, `MacAddress`, `ApiKey`, `Port` | 10 | 0 / 10 |
| `measurement` | `Length`, `Weight`, `Temperature`, `Speed` ⚠️ needs unit conversion design | 10 | 0 / 10 |
| `primitives` | `NonEmptyString`, `BoundedString`, `Locale`, `HexColor` | 10 | 0 / 10 |
| `primitives` | `NonEmptyString`, `BoundedString`, `Locale`, `HexColor` | 10 | 10 / 10 |

→ Full details and design rationale in [ROADMAP.md](ROADMAP.md)

Expand Down
24 changes: 12 additions & 12 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@

| Type | Status | Notes |
|---|---|---|
| `NonEmptyString` | | trimmed, at least 1 non-whitespace char |
| `BoundedString` | | `BoundedString<const MIN: usize, const MAX: usize>` via const generics |
| `PositiveInt` | | `i64 > 0` |
| `NonNegativeInt` | | `i64 >= 0` |
| `PositiveDecimal` | | `Decimal > 0` |
| `NonNegativeDecimal` | | `Decimal >= 0` |
| `Probability` | | `f64` in range 0.0..=1.0 |
| `HexColor` | | `#RRGGBB` or `#RGB`, normalised to uppercase |
| `Locale` | | BCP 47 language tag (e.g. `en-US`, `cs-CZ`) |
| `Base64String` | | valid base64-encoded string |
| `NonEmptyString` | | trimmed, at least 1 non-whitespace char |
| `BoundedString` | | `BoundedString<const MIN: usize, const MAX: usize>` via const generics |
| `PositiveInt` | | `i64 > 0` |
| `NonNegativeInt` | | `i64 >= 0` |
| `PositiveDecimal` | | `Decimal > 0` |
| `NonNegativeDecimal` | | `Decimal >= 0` |
| `Probability` | | `f64` in range 0.0..=1.0 |
| `HexColor` | | `#RRGGBB` or `#RGB`, normalised to uppercase |
| `Locale` | | BCP 47 language tag (e.g. `en-US`, `cs-CZ`) |
| `Base64String` | | valid base64-encoded string |

---

Expand All @@ -141,5 +141,5 @@
| `geo` | 6 | 0 | 6 |
| `net` | 10 | 0 | 10 |
| `measurement` | 10 | 0 | 10 |
| `primitives` | 10 | 0 | 10 |
| **Total** | **62** | **5** | **57** |
| `primitives` | 10 | 10 | 0 |
| **Total** | **62** | **15** | **47** |
Loading
Loading