Skip to content

Add IpV6Address (net) #49

@vhrcgcom

Description

@vhrcgcom

Description

Implement IpV6Address as a ValueObject in the net module.

Spec: valid IPv6

Implementation checklist

  • Create src/net/ipv6address.rs
  • Implement ValueObject trait
  • Add #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
  • Export from src/net/mod.rs and prelude
  • Unit tests: valid input · empty input · invalid format · normalisation
  • Doc comment with # Example block
  • Update status in ROADMAP.md from ⬜ to ✅

Implementation detail

Input / Output

Type Alias
Input String IpV6AddressInput
Output String — canonical lowercase with :: compression IpV6AddressOutput

Normalization

Parse with std::net::Ipv6Addr, then re-serialise to its Display form (canonical lowercase with :: compression where applicable).

Validation

Must parse successfully via std::net::Ipv6Addr::from_str.

Extra methods

  • segments() -> [u16; 8]
  • is_loopback() -> booltrue for ::1.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions