Make the unix::net::SocketAddr creation methods public#65255
Make the unix::net::SocketAddr creation methods public#65255kleimkuhler wants to merge 1 commit into
unix::net::SocketAddr creation methods public#65255Conversation
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
These need |
|
Hmm, in their current state I don’t think the It looks like we do have some examples of defining So I think we’ll need to sketch out a more suitable public API for constructing |
|
Why can't mio just use the standard library's UnixListener? https://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html |
|
@sfackler It is mainly because |
|
@KodrAus That is a good point. I found the signatures a little surprising when first looking at them. If exposing |
|
@kleimkuhler that sounds like a good plan me to! Maybe we can also look at whether it’s feasible for |
|
@KodrAus So it's not just This ultimately is because the sockets need this additional flag set as part of the socket creation instead of a separate call to Closing this PR per discussion above and further conversation can take place in #65275. |
Motivation
Recently tokio-rs/mio needed support for creating the
std::os::unix::net::SocketAddrtype. While the type is currently public, it isnot possible to create one as both creation methods are private:
The workaround was creating a
miospecificSocketAddrthat is equivalent tothis type.
A use of needing
SocketAddr::from_partsis shown here.Details
This PR makes the creation methods public so that the already public type can be
created as well. Comments with examples have been added.
I did not feel an RFC process was needed for this; I hope that assumtion is
correct!
Signed-off-by: Kevin Leimkuhler kleimkuhler@icloud.com