Skip to content

Tracking Issue for addr_parse_ascii feature #101035

Open

Description

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.

Footnotes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions