Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for IP address prefixes #86991

Closed
1 task
CDirkx opened this issue Jul 9, 2021 · 1 comment
Closed
1 task

Tracking Issue for IP address prefixes #86991

CDirkx opened this issue Jul 9, 2021 · 1 comment
Labels
A-io Area: std::io, std::fs, std::net and std::path C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@CDirkx
Copy link
Contributor

CDirkx commented Jul 9, 2021

This is the tracking issue for IP address prefixes such as 192.0.2.0/24.
The feature gate for the issue is #![feature(ip_prefix)].

Overview

Ipv4AddrPrefix

#[derive(Copy, PartialEq, Eq, Clone, Hash)]
pub struct Ipv4AddrPrefix {
    address: Ipv4Addr,
    len: u8,
}

impl Ipv4AddrPrefix {
    pub const fn new(address: Ipv4AddrPrefix, len: u32) -> Result<Ipv4AddrPrefix, InvalidPrefixError>;
    pub const fn address(&self) -> Ipv4Addr;
    pub const fn len(&self) -> u32;
    pub const fn contains(&self, address: &Ipv4Addr) -> bool;
}

impl Debug for Ipv4AddrPrefix  {}
impl Display for Ipv4AddrPrefix  {}
impl From<Ipv4Addr> for Ipv4AddrPrefix  {}
impl FromStr for Ipv4AddrPrefix  {}

Ipv6AddrPrefix

#[derive(Copy, PartialEq, Eq, Clone, Hash)]
pub struct Ipv6AddrPrefix {
    address: Ipv6Addr,
    len: u8,
}

impl Ipv6AddrPrefix {
    pub const fn new(address: Ipv6AddrPrefix, len: u32) -> Result<Ipv6AddrPrefix, InvalidPrefixError>;
    pub const fn address(&self) -> Ipv6Addr;
    pub const fn len(&self) -> u32;
    pub const fn contains(&self, address: &Ipv6Addr) -> bool;
}

impl Debug for Ipv6AddrPrefix  {}
impl Display for Ipv6AddrPrefix  {}
impl From<Ipv6Addr> for Ipv6AddrPrefix  {}
impl FromStr for Ipv6AddrPrefix  {}

Unresolved Questions

Implementation history

@CDirkx CDirkx added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Jul 9, 2021
@rustbot rustbot added A-io Area: std::io, std::fs, std::net and std::path T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 9, 2021
@dtolnay
Copy link
Member

dtolnay commented Jun 25, 2024

The feature tracked by this issue never got merged. I'll close the tracking issue since this is not tracking any work at the moment, but we can reopen (or create a new one) if someone picks this back up in the future.

@dtolnay dtolnay closed this as completed Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io Area: std::io, std::fs, std::net and std::path C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants