rust/library/std/src/net
Yuki Okushi 3b40d2c1f3
Rollup merge of #82487 - CDirkx:const-socketaddr, r=m-ou-se
Constify methods of `std::net::SocketAddr`, `SocketAddrV4` and `SocketAddrV6`

The following methods are made unstable const under the `const_socketaddr` feature (https://github.com/rust-lang/rust/issues/82485):

```rust
// std::net

impl SocketAddr {
    pub const fn ip(&self) -> IpAddr;
    pub const fn port(&self) -> u16;
    pub const fn is_ipv4(&self) -> bool;
    pub const fn is_ipv6(&self) -> bool;
}

impl SocketAddrV4 {
    pub const fn ip(&self) -> IpAddr;
    pub const fn port(&self) -> u16;
}

impl SocketAddrV6 {
    pub const fn ip(&self) -> IpAddr;
    pub const fn port(&self) -> u16;
    pub const fn flowinfo(&self) -> u32;
    pub const fn scope_id(&self) -> u32;
}
```

Note: `SocketAddrV4::ip` and `SocketAddrV6::ip` use pointer casting and depend on the unstable feature `const_raw_ptr_deref`
2021-04-04 00:19:30 +09:00
..
addr Remove redundant 'static from library crates 2020-10-18 17:25:51 +02:00
ip Dont prefix 0x when dbg!(ipv6) 2021-01-20 04:31:34 +00:00
parser Disallow octal format in Ipv4 string 2021-03-30 10:24:23 +08:00
tcp std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
udp Use is_ok() instead of empty Ok(_) 2020-10-13 17:01:50 -04:00
addr.rs Rollup merge of #82487 - CDirkx:const-socketaddr, r=m-ou-se 2021-04-04 00:19:30 +09:00
ip.rs Disallow octal format in Ipv4 string 2021-03-30 10:24:23 +08:00
mod.rs Use io::Error::new_const everywhere to avoid allocations. 2021-03-21 20:22:38 +01:00
parser.rs Disallow octal format in Ipv4 string 2021-03-30 10:24:23 +08:00
tcp.rs Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
test.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
udp.rs Use io::Error::new_const everywhere to avoid allocations. 2021-03-21 20:22:38 +01:00