1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/// A four-octet IPv4 address in wire order. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct Ipv4Address([u8; 4]); impl Ipv4Address { /// Constructs an address from wire-order octets. #[inline] pub const fn new(octets: [u8; 4]) -> Self { Self(octets) } /// Returns wire-order octets. #[inline] pub const fn octets(self) -> [u8; 4] { self.0 } }