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 const_sockaddr_setters #131714

Open
3 tasks
tgross35 opened this issue Oct 14, 2024 · 0 comments
Open
3 tasks

Tracking Issue for const_sockaddr_setters #131714

tgross35 opened this issue Oct 14, 2024 · 0 comments
Labels
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

@tgross35
Copy link
Contributor

tgross35 commented Oct 14, 2024

Feature gate: #![feature(const_sockaddr_setters)]

This is a tracking issue using the set_ip and set_port methods on SocketAddr types in const contexts.

Public API

// core::net

impl SocketAddr {
    pub const fn set_ip(&mut self, new_ip: IpAddr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV4 {
    pub const fn set_ip(&mut self, new_ip: Ipv4Addr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV6 {
    pub const fn set_ip(&mut self, new_ip: Ipv6Addr);
    pub const fn set_port(&mut self, new_port: u16);
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@tgross35 tgross35 added 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. labels Oct 14, 2024
tgross35 added a commit to tgross35/rust that referenced this issue Oct 14, 2024
Unstably add `const` to the `sockaddr_setters` methods. Included API:

    // core::net

    impl SocketAddr {
        pub const fn set_ip(&mut self, new_ip: IpAddr);
        pub const fn set_port(&mut self, new_port: u16);
    }

    impl SocketAddrV4 {
        pub const fn set_ip(&mut self, new_ip: Ipv4Addr);
        pub const fn set_port(&mut self, new_port: u16);
    }

    impl SocketAddrV6 {
        pub const fn set_ip(&mut self, new_ip: Ipv6Addr);
        pub const fn set_port(&mut self, new_port: u16);
    }

Tracking issue: <rust-lang#131714>
bors added a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2024
… r=Amanieu

Add an unstable `const_sockaddr_setters` feature

Unstably add `const` to the `sockaddr_setters` methods. Included API:

```rust
// core::net

impl SocketAddr {
    pub const fn set_ip(&mut self, new_ip: IpAddr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV4 {
    pub const fn set_ip(&mut self, new_ip: Ipv4Addr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV6 {
    pub const fn set_ip(&mut self, new_ip: Ipv6Addr);
    pub const fn set_port(&mut self, new_port: u16);
}
```

Tracking issue: <rust-lang#131714>
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Oct 29, 2024
Add an unstable `const_sockaddr_setters` feature

Unstably add `const` to the `sockaddr_setters` methods. Included API:

```rust
// core::net

impl SocketAddr {
    pub const fn set_ip(&mut self, new_ip: IpAddr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV4 {
    pub const fn set_ip(&mut self, new_ip: Ipv4Addr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV6 {
    pub const fn set_ip(&mut self, new_ip: Ipv6Addr);
    pub const fn set_port(&mut self, new_port: u16);
}
```

Tracking issue: <rust-lang/rust#131714>
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Oct 30, 2024
Add an unstable `const_sockaddr_setters` feature

Unstably add `const` to the `sockaddr_setters` methods. Included API:

```rust
// core::net

impl SocketAddr {
    pub const fn set_ip(&mut self, new_ip: IpAddr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV4 {
    pub const fn set_ip(&mut self, new_ip: Ipv4Addr);
    pub const fn set_port(&mut self, new_port: u16);
}

impl SocketAddrV6 {
    pub const fn set_ip(&mut self, new_ip: Ipv6Addr);
    pub const fn set_port(&mut self, new_port: u16);
}
```

Tracking issue: <rust-lang/rust#131714>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

1 participant