Skip to content

Add convenience methods to IpAddr #1554

@canndrew

Description

@canndrew

IpAddr should have at least the following methods:

/// Returns `true` if `self` is one of the two unspecified addresses
fn is_unspecified(&self) -> bool;

/// Returns `true` if `self` is a loopback address such as `127.0.0.1` or `::1`
fn is_loopback(&self) -> bool;

Edit: is_multicast and to_ipv6_{compatible,mapped} would make sense aswell although I have no need for them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions