feat(domain): implement RelayId newtype with validation
Implement smart constructor that validates relay IDs are within valid range (1-8 for 8-channel relay controller). Add accessor method as_u8() for safe access to inner value. Add comprehensive documentation to satisfy clippy requirements. TDD green phase: Tests from T017 now pass. Ref: T018 (specs/001-modbus-relay-control/tasks.md)
This commit is contained in:
@@ -211,7 +211,7 @@
|
||||
- **File**: src/domain/relay.rs
|
||||
- **Complexity**: Low | **Uncertainty**: Low
|
||||
|
||||
- [ ] **T018** [US1] [TDD] Implement RelayId newtype with validation
|
||||
- [x] **T018** [US1] [TDD] Implement RelayId newtype with validation
|
||||
- #[repr(transparent)] newtype wrapping u8
|
||||
- Constructor validates 1..=8 range
|
||||
- Implement Display, Debug, Clone, Copy, PartialEq, Eq
|
||||
|
||||
Reference in New Issue
Block a user