You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rsworkspace/crates/AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Prefer domain-specific value objects over primitives (e.g. `AcpPrefix` not `String`). Each type's factory must guarantee correctness at construction—invalid instances should be unrepresentable. Validate per-type, not per-aggregate: avoid validating unrelated fields together in a single constructor.
2
2
3
-
When validating strings for NATS subjects or domain constraints, introduce a value object in its own file (e.g. `ext_method_name.rs`, `session_id.rs`) rather than a standalone `validate_*` function or adding it to `config.rs`. The value object's constructor performs validation; invalid instances are unrepresentable.
3
+
Every value object lives in its own file named after the type (e.g. `acp_prefix.rs`, `ext_method_name.rs`, `session_id.rs`). Never inline a value object into a config, aggregate, or service file.
4
4
5
5
You must use the `test-support` feature to share test helpers between crates.
6
6
Prefer one trait per operation over a single trait with multiple operations.
0 commit comments