https://github.com/rust-lang/rust/issues/101035

Tracking Issue for addr_parse_ascii feature · Issue #101035 · rust-lang/rust

Skip to content

Navigation Menu

Use saved searches to filter your results more quickly

Sign up

@marmeladema

Description

@marmeladema

Feature gate: #![feature(addr_parse_ascii)]

This is a tracking issue for parsing network addresses (IP, Socket, etc) from a slice of bytes.

Internally the parser already works on bytes, this feature exposes publicly the ability to parse network address from a slice of bytes and therefor avoid the need to do utf8 validation in case one has only bytes.

Public API

impl IpAddr {
    pub fn parse_ascii(b: &[u8]) -> Result<Self, AddrParseError> {
}
impl Ipv4Addr {
    pub fn parse_ascii(b: &[u8]) -> Result<Self, AddrParseError> {
}
impl Ipv6Addr {
    pub fn parse_ascii(b: &[u8]) -> Result<Self, AddrParseError> {
}
impl SocketAddrV4 {
    pub fn parse_ascii(b: &[u8]) -> Result<Self, AddrParseError> {
}
impl SocketAddrV6 {
    pub fn parse_ascii(b: &[u8]) -> Result<Self, AddrParseError> {
}
impl SocketAddr {
    pub fn parse_ascii(b: &[u8]) -> Result<Self, AddrParseError> {
}

Steps / History

Unresolved Questions

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