Description
Implement Port as a ValueObject in the net module.
Spec: u16 in range 1–65535
Implementation checklist
Implementation detail
Input / Output
|
Type |
Alias |
| Input |
u16 |
PortInput |
| Output |
u16 |
PortOutput |
Normalization
None.
Validation
- Must be in the range
1..=65535. Port 0 is reserved and rejected.
Extra methods
is_well_known() -> bool — true for ports 1–1023 (system / well-known ports).
is_registered() -> bool — true for ports 1024–49151.
is_dynamic() -> bool — true for ports 49152–65535 (ephemeral range).
References
Description
Implement
Portas aValueObjectin thenetmodule.Spec:
u16in range 1–65535Implementation checklist
src/net/port.rsValueObjecttrait#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]src/net/mod.rsandprelude# ExampleblockROADMAP.mdfrom ⬜ to ✅Implementation detail
Input / Output
u16PortInputu16PortOutputNormalization
None.
Validation
1..=65535. Port 0 is reserved and rejected.Extra methods
is_well_known() -> bool—truefor ports 1–1023 (system / well-known ports).is_registered() -> bool—truefor ports 1024–49151.is_dynamic() -> bool—truefor ports 49152–65535 (ephemeral range).References