Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub const fn ip(&self) -> IpAddr
Returns the IP address associated with this socket address.
method core Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub enum SocketAddr
An internet socket address, either IPv4 or IPv6.
enum core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct AddrParseError
An error which can be returned when parsing an IP address or a socket address.
struct core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_ipv4_mapped(&self) -> Option<Ipv4Addr>
Converts this address to an IPv4 address if it's an IPv4-mapped address, as defined in IETF RFC 4291 section 2.5.5.2, otherwise returns None.
method core Stable since 1.63.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_ipv4(&self) -> Option<Ipv4Addr>
Converts this address to an IPv4 address if it is either an IPv4-compatible address as defined in IETF RFC 4291 section 2.5.5.1, or an IPv4-mapped address as defined in IETF RFC 4291 section 2.5.5.2, otherwise returns None.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_canonical(&self) -> IpAddr
Converts this address to an IpAddr::V4 if it is an IPv4-mapped address, otherwise returns self wrapped in an IpAddr::V6.
method core Stable since 1.75.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn to_bits(self) -> u128
Converts an IPv6 address into a u128 representation using native byte order.
method core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn segments(&self) -> [u16; 8]
Returns the eight 16-bit segments that make up this address.
method core Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn octets(&self) -> [u8; 16]
Returns the sixteen eight-bit integers the IPv6 address consists of.
method core Stable since 1.12.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr
Creates a new IPv6 address from eight 16-bit segments.
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 (::).
method core Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_unique_local(&self) -> bool
Returns true if this is a unique local address (fc00::/7).
method core Stable since 1.84.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_unicast_link_local(&self) -> bool
Returns true if the address is a unicast address with link-local scope, as defined in RFC 4291.
method core Stable since 1.84.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 (ff00::/8).
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 the loopback address (::1), as defined in IETF RFC 4291 section 2.5.3.
method core Stable since 1.7.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_segments(segments: [u16; 8]) -> Ipv6Addr
Creates an Ipv6Addr from an eight element 16-bit array.
associated_function core Stable since 1.91.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_octets(octets: [u8; 16]) -> Ipv6Addr
Creates an Ipv6Addr from a sixteen 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: u128) -> Ipv6Addr
Converts a native byte order u128 into an IPv6 address.
associated_function core Stable since 1.80.0 Version 1.100.0-nightly
doc.rust-lang.org
const UNSPECIFIED: Self
An IPv6 address representing the unspecified address: ::.
associated_constant core Stable since 1.30.0 Version 1.100.0-nightly
doc.rust-lang.org
const LOCALHOST: Self
An IPv6 address representing localhost: ::1.
associated_constant core Stable since 1.30.0 Version 1.100.0-nightly
"Panic is “pulling over to the side of the road” whereas crash is “running into a telephone pole”."

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.