Add convenience method for handling ipv4-mapped addresses by canonicalizing them by the8472 · Pull Request #87708 · rust-lang/rust (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation4 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

the8472

This simplifies checking common properties in an address-family-agnostic
way since #86335 commits to not checking IPv4 semantics
of IPv4-mapped addresses in the Ipv6Addr property methods.

@the8472

…them

This simplifies checking common properties in an address-family-agnostic way since since rust-lang#86335 commits to not checking IPv4 semantics of IPv4-mapped addresses in the Ipv6Addr property methods.

@rust-highfive

r? @dtolnay

(rust-highfive has picked a reviewer for you, use r? to override)

@the8472 the8472 added the T-libs-api

Relevant to the library API team, which will review and decide on the PR/issue.

label

Aug 2, 2021

@the8472 the8472 changed the titleAdd convenience for handling ipv4-mapped addresses by canonicalizing them Add convenience method for handling ipv4-mapped addresses by canonicalizing them

Aug 2, 2021

dtolnay

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dtolnay

@bors

📌 Commit a5cdff3 has been approved by dtolnay

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Aug 2, 2021

JohnTitor added a commit to JohnTitor/rust that referenced this pull request

Aug 3, 2021

@JohnTitor

Add convenience method for handling ipv4-mapped addresses by canonicalizing them

This simplifies checking common properties in an address-family-agnostic way since rust-lang#86335 commits to not checking IPv4 semantics of IPv4-mapped addresses in the Ipv6Addr property methods.

JohnTitor added a commit to JohnTitor/rust that referenced this pull request

Aug 3, 2021

@JohnTitor

Add convenience method for handling ipv4-mapped addresses by canonicalizing them

This simplifies checking common properties in an address-family-agnostic way since rust-lang#86335 commits to not checking IPv4 semantics of IPv4-mapped addresses in the Ipv6Addr property methods.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 3, 2021

@bors

Rollup of 8 pull requests

Successful merges:

Failed merges:

r? @ghost @rustbot modify labels: rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Oct 15, 2023

@matthiaskrgr

Stabilize {IpAddr, Ipv6Addr}::to_canonical

Make IpAddr::to_canonical and IpV6Addr::to_canonical stable (+const), as well as const stabilize Ipv6Addr::to_ipv4_mapped.

Newly stable API:

impl IpAddr {
    // Newly stable under `ip_to_canonical`
    const fn to_canonical(&self) -> IpAddr;
}

impl Ipv6Addr {
    // Newly stable under `ip_to_canonical`
    const fn to_canonical(&self) -> IpAddr;

    // Already stable, this makes it const stable under
    // `const_ipv6_to_ipv4_mapped`
    const fn to_ipv4_mapped(&self) -> Option<Ipv4Addr>
}

These stabilize a subset of the following tracking issues:

Stabilization of all methods under the ip gate was attempted once at rust-lang#66584 then again at rust-lang#76098. These were not successful because there are still unknowns about is_documentation is_benchmarking and similar; to_canonical is much more straightforward.

I have looked and could not find any known issues with to_canonical. These were added in 2021 in rust-lang#87708

cc implementor @the8472

r? libs-api @rustbot label +T-libs-api +needs-fcp

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Oct 16, 2023

@matthiaskrgr

Stabilize {IpAddr, Ipv6Addr}::to_canonical

Make IpAddr::to_canonical and IpV6Addr::to_canonical stable (+const), as well as const stabilize Ipv6Addr::to_ipv4_mapped.

Newly stable API:

impl IpAddr {
    // Newly stable under `ip_to_canonical`
    const fn to_canonical(&self) -> IpAddr;
}

impl Ipv6Addr {
    // Newly stable under `ip_to_canonical`
    const fn to_canonical(&self) -> IpAddr;

    // Already stable, this makes it const stable under
    // `const_ipv6_to_ipv4_mapped`
    const fn to_ipv4_mapped(&self) -> Option<Ipv4Addr>
}

These stabilize a subset of the following tracking issues:

Stabilization of all methods under the ip gate was attempted once at rust-lang#66584 then again at rust-lang#76098. These were not successful because there are still unknowns about is_documentation is_benchmarking and similar; to_canonical is much more straightforward.

I have looked and could not find any known issues with to_canonical. These were added in 2021 in rust-lang#87708

cc implementor @the8472

r? libs-api @rustbot label +T-libs-api +needs-fcp

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Oct 16, 2023

@rust-timer

Rollup merge of rust-lang#115955 - tgross35:ip-to-canonical, r=dtolnay

Stabilize {IpAddr, Ipv6Addr}::to_canonical

Make IpAddr::to_canonical and IpV6Addr::to_canonical stable (+const), as well as const stabilize Ipv6Addr::to_ipv4_mapped.

Newly stable API:

impl IpAddr {
    // Newly stable under `ip_to_canonical`
    const fn to_canonical(&self) -> IpAddr;
}

impl Ipv6Addr {
    // Newly stable under `ip_to_canonical`
    const fn to_canonical(&self) -> IpAddr;

    // Already stable, this makes it const stable under
    // `const_ipv6_to_ipv4_mapped`
    const fn to_ipv4_mapped(&self) -> Option<Ipv4Addr>
}

These stabilize a subset of the following tracking issues:

Stabilization of all methods under the ip gate was attempted once at rust-lang#66584 then again at rust-lang#76098. These were not successful because there are still unknowns about is_documentation is_benchmarking and similar; to_canonical is much more straightforward.

I have looked and could not find any known issues with to_canonical. These were added in 2021 in rust-lang#87708

cc implementor @the8472

r? libs-api @rustbot label +T-libs-api +needs-fcp

jstasiak added a commit to netaddr/netaddr that referenced this pull request

Dec 15, 2023

@jstasiak

jstasiak added a commit to netaddr/netaddr that referenced this pull request

Dec 15, 2023

@jstasiak

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-libs-api

Relevant to the library API team, which will review and decide on the PR/issue.