doc.rust-lang.org
const BITS: u32
The size of an IPv6 address in bits.
associated_constant
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Ipv6Addr
An IPv6 address.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_ipv6_mapped(&self) -> Ipv6Addr
Converts this address to an IPv4-mapped IPv6 address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_ipv6_compatible(&self) -> Ipv6Addr
Converts this address to an IPv4-compatible IPv6 address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_bits(self) -> u32
Converts an IPv4 address into a u32 representation using native byte order.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn octets(&self) -> [u8; 4]
Returns the four eight-bit integers that make up this address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr
Creates a new IPv4 address from four eight-bit octets.
associated_function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_unspecified(&self) -> bool
Returns true for the special 'unspecified' address (0.0.0.0).
method
core
Stable since 1.12.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_private(&self) -> bool
Returns true if this is a private address.
method
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_multicast(&self) -> bool
Returns true if this is a multicast address (224.0.0.0/4).
method
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_loopback(&self) -> bool
Returns true if this is a loopback address (127.0.0.0/8).
method
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_link_local(&self) -> bool
Returns true if the address is link-local (169.254.0.0/16).
method
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_documentation(&self) -> bool
Returns true if this address is in a range designated for documentation.
method
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_broadcast(&self) -> bool
Returns true if this is a broadcast address (255.255.255.255).
method
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_octets(octets: [u8; 4]) -> Ipv4Addr
Creates an Ipv4Addr from a four element byte array.
associated_function
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_bits(bits: u32) -> Ipv4Addr
Converts a native byte order u32 into an IPv4 address.
associated_function
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
const UNSPECIFIED: Self
An IPv4 address representing an unspecified address: 0.0.0.0
associated_constant
core
Stable since 1.30.0
Version 1.100.0-nightly
doc.rust-lang.org
const LOCALHOST: Self
An IPv4 address with the address pointing to localhost: 127.0.0.1
associated_constant
core
Stable since 1.30.0
Version 1.100.0-nightly
doc.rust-lang.org
const BROADCAST: Self
An IPv4 address representing the broadcast address: 255.255.255.255.
associated_constant
core
Stable since 1.30.0
Version 1.100.0-nightly
doc.rust-lang.org
const BITS: u32
The size of an IPv4 address in bits.
associated_constant
core
Stable since 1.80.0
Version 1.100.0-nightly