Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for IpAddr #27801
Comments
alexcrichton
added
A-io
T-libs
B-unstable
labels
Aug 13, 2015
Ms2ger
referenced this issue
Aug 16, 2015
Open
Tracking: Unstable Rust feature gates used by Servo #5286
This comment has been minimized.
This comment has been minimized.
|
Nominating for discussion for 1.6. If it isn't consumed or produced by any libstd APIs, I'd vote for its removal. |
sfackler
added
the
I-nominated
label
Nov 4, 2015
This comment has been minimized.
This comment has been minimized.
dimbleby
commented
Nov 4, 2015
|
It's certainly a useful thing to have:
I expect there are others. Perhaps it would be feasible to search It would surely be better if there were a single canonical implementation of |
This comment has been minimized.
This comment has been minimized.
|
I think It is common, in my experience, for a userspace program to accept a hostname, resolve the hostname to either an IPv4 or IPv6 address and pass that address to one of the aforementioned I also think that it doesn't particularly make sense to have DNS facilities in |
This comment has been minimized.
This comment has been minimized.
|
The libs team is a little up in the air about whether to stabilize or deprecate this type, so some thoughts would be welcome! On a personal opinion side of things, I'm a little wary to stabilize this as there's no corresponding type in C (as opposed to a |
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Nov 5, 2015
This comment has been minimized.
This comment has been minimized.
|
I think I agree with @murarth that Also, I wonder if including |
This comment has been minimized.
This comment has been minimized.
|
Figured I'd chime in and mention that libpnet uses |
This comment has been minimized.
This comment has been minimized.
|
I'd like to mirror @mrmonday 's sentiment about keeping IpAddr around. There are times when you need to represent an ip address without the port. |
This comment has been minimized.
This comment has been minimized.
daschl
commented
Nov 27, 2015
This comment has been minimized.
This comment has been minimized.
abaumhauer
commented
Dec 1, 2015
|
+1 on stabilizing this type. Many times we (as network programmers) don't care if it's an IPv4 or v6 address. In Postgres, there's an Inet type that holds either format. This would be helpful for rust-postgres crate, too. |
This comment has been minimized.
This comment has been minimized.
|
rust-postgres would need a bit more than just |
This comment has been minimized.
This comment has been minimized.
abaumhauer
commented
Dec 2, 2015
|
@sfackler, are you implying that IpvXAddr types should add netmask bits to better represent IP addresses? It's a good point that an IP address is more valuable when you know the netmask. |
This comment has been minimized.
This comment has been minimized.
|
Uh, no I am not saying we should add a netmask field to this type. |
This comment has been minimized.
This comment has been minimized.
|
I feel like this enum should either be beefed up and used elsewhere in std, or deprecated. I don't care much which route we take. |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this during triage today and the conclusion was to deprecate. This type can be added back to the standard library if need be and otherwise without many concrete users in-tree itself this sort of type seems suitable for an external crate or definition locally. |
This comment has been minimized.
This comment has been minimized.
|
FWIW: I considered using this in rust-url but went with a custom enum instead for hosts since I need another variant anyway, for DNS domain names. |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 3, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 3, 2015
alexcrichton
referenced this issue
Dec 3, 2015
Merged
std: Stabilize APIs for the 1.6 release #30187
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 3, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 3, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 3, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 3, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 4, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 4, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 4, 2015
bors
added a commit
that referenced
this issue
Dec 5, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 5, 2015
bors
added a commit
that referenced
this issue
Dec 5, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Dec 5, 2015
bors
added a commit
that referenced
this issue
Dec 6, 2015
bors
added a commit
that referenced
this issue
Dec 6, 2015
bors
closed this
in
#30187
Dec 6, 2015
This comment has been minimized.
This comment has been minimized.
johnzachary
commented
Dec 13, 2015
|
Even though this is closed and done, it's a shame you guys removed |
This comment has been minimized.
This comment has been minimized.
|
I reimplemented it myself in libpnet[1] - based on all the references to this issue, so has everyone else! It's a shame none of these networking libraries are going to be able to work together now, without deconstructing/reconstructing the IpAddr. |
This comment has been minimized.
This comment has been minimized.
johnzachary
commented
Dec 13, 2015
|
Thanks @mrmonday. That was the answer I expected but hoped for something better. And I agree with your second comment. If people use a feature in a code base, why isn't that "pulling it's own weight"? |
This comment has been minimized.
This comment has been minimized.
|
@johnzachary To rephrase that, do you believe that the standard library should include every feature that someone at some point has used in a code base? |
This comment has been minimized.
This comment has been minimized.
dimbleby
commented
Dec 14, 2015
|
I released my re-implementation as its own tiny crate. Feel free to use. |
This comment has been minimized.
This comment has been minimized.
|
@sfackler No, but I do think it's a bit weird that the IpAddr enum was removed but both std::net::Ipv4Addr and std::net::Ipv6Addr were kept. IpAddr was a nice way to represent those in a single binding. Why not keep what (I think) is a logical relationship between those two structs? |
This comment has been minimized.
This comment has been minimized.
|
Ipv6Addr and Ipv4Addr were used in SocketAddrV6 and SocketAddrV4 respectively, which were in turn parts of SocketAddr, which is a fundamental component of the TcpStream and UdpSocket APIs. IpAddr was neither produced nor consumed by anything in the standard library. |
This comment has been minimized.
This comment has been minimized.
|
Well, |
This comment has been minimized.
This comment has been minimized.
|
If DNS lookup functions are overhauled to return |
This comment has been minimized.
This comment has been minimized.
johnzachary
commented
Dec 16, 2015
|
We implemented our own version of
@sfackler No and this isn't that case. This is a case of many people finding a feature in the standard library useful and voicing their disapproval when it was removed. I understand it was marked |
This comment has been minimized.
This comment has been minimized.
|
The libs team took up this issue again at our meeting this week, and have agreed that deprecation was the wrong call. There's a clear community consensus to ship this, and the rationale for deprecation essentially boiled down to a concern about minimalism in I've opened a PR to revert, which actually stabilizes the enum as of 1.7 (currently in beta). That will require a backport. |
This comment has been minimized.
This comment has been minimized.
johnzachary
commented
Feb 9, 2016
|
Awesome. Thank you! |
alexcrichton commentedAug 13, 2015
This is a tracking issue for the unstable
ip_addrfeature of the standard library. Some thoughts: