pub type IPv4 = U32<NetworkEndian>;Expand description
The underlying value (u32) and trait impl for AFI 1. Exactly fitting IPv4 bytes (4 octets).
Aliased Type§
pub struct IPv4(/* private fields */);Trait Implementations§
Source§impl AddressFamily for IPv4
impl AddressFamily for IPv4
Source§type InnerIpAddr = Ipv4Addr
type InnerIpAddr = Ipv4Addr
The std::net that the value of self belongs to. So,
std::net::Ipv4Addr, and std::net::Ipv6Addr for IPv4, and IPv6
respectively.
fn zero() -> Self
fn from_u8(value: u8) -> Self
fn from_u32(value: u32) -> Self
fn from_ipaddr(ip_addr: Self::InnerIpAddr) -> Self
fn into_bit_span(net: Self, start_bit: u8, len: u8) -> BitSpan
Source§fn add_bit_span(self, len: u8, bs: BitSpan) -> (U32<NetworkEndian>, u8)
fn add_bit_span(self, len: u8, bs: BitSpan) -> (U32<NetworkEndian>, u8)
Treat self as a prefix and append the given bitspan to it.
Source§fn into_ipaddr(self) -> IpAddr
fn into_ipaddr(self) -> IpAddr
Turn self in to a std::net::IpAddr.
Source§fn dangerously_truncate_to_u32(self) -> u32
fn dangerously_truncate_to_u32(self) -> u32
Truncate self to a u32. For IPv4 this is a NOP. For IPv6 this
truncates to 32 bits.
Source§fn truncate_to_len(self, len: u8) -> Self
fn truncate_to_len(self, len: u8) -> Self
fill the bits after the specified len with zeros. Interpreted as an IP
Prefix, this means that self will be truncated to the specified len.