rust/library/std/src/net
Matthias Krüger 52016a1005
Rollup merge of #94890 - marmeladema:ip-addr-try-from-bytes, r=joshtriplett
Support parsing IP addresses from a byte string

Fixes #94821

The goal is to be able to parse addresses from a byte string without requiring to do any utf8 validation. Since internally the parser already works on byte strings, this should be possible and I personally already needed this in the past too.

~~I used the proposed approach from the issue by implementing `TryFrom<&'a [u8]>` for all 6 address types (3 ip address types and 3 socket address types). I believe implementing stable traits for stable types is insta-stable so this will probably need an FCP?~~

Switched to an unstable inherent method approach called `parse_ascii` as requested.

cc ``````@jyn514``````
2022-08-29 06:34:41 +02:00
..
addr Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
ip Rollup merge of #99957 - chotchki:ip-globally-reachable_rebase, r=Mark-Simulacrum 2022-08-22 20:34:10 +05:30
parser Disallow octal format in Ipv4 string 2021-03-30 10:24:23 +08:00
tcp Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
udp Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
addr.rs Move SocketAddrCRepr to sys_common 2022-07-17 09:48:56 +02:00
ip.rs Rollup merge of #99957 - chotchki:ip-globally-reachable_rebase, r=Mark-Simulacrum 2022-08-22 20:34:10 +05:30
mod.rs created tcpstream quickack trait 2022-08-13 17:38:01 +02:00
parser.rs Support parsing IP addresses from a byte string 2022-08-26 14:16:53 +02:00
tcp.rs Bump std::net::Incoming FusedIterator impl to Rust 1.64 2022-07-02 11:02:54 -07:00
test.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
udp.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00