-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request: Make unix::net::SocketAddr
create methods public
#65275
Comments
|
I like to revive this discussion. For Mio we currently have our own version of |
Unfortunately, we can't just make those Would something like a |
I understand we don't want to expose
That would be a nice start. If we can also have Note that socket2 already has all these methods/ |
So you want to be able to use |
Adding Extending |
Yes, but it would nice to easily convert from OS address storage to a Rust type address. But that can become future work.
👍 Will send a pr. What do you think about
|
|
Should those be folded into |
Implementation pr: #93239. |
Tracking issue for |
…r=m-ou-se Add os::unix::net::SocketAddr::from_path Creates a new SocketAddr from a path, supports both regular paths and abstract namespaces. Note that `SocketAddr::from_abstract_namespace` could be removed after this as `SocketAddr::unix` also supports abstract namespaces. Updates rust-lang#65275 Unblocks tokio-rs/mio#1527 r? `@m-ou-se`
I think this can be closed in favour of #93423? Since the |
Since #93423 is now stabilised (in 1.61) I think this can be closed. |
Motivation
Recently tokio-rs/mio needed support for creating the
std::os::unix::net::SocketAddr
type. While the type is currently public, it isnot possible to create one as both creation methods are private:
The workaround was creating a
mio
specificSocketAddr
that is equivalent tothis type.
A use of needing
SocketAddr::from_parts
is shown here.#65255 was a quick fix at trying to add this, but it will need
#[unstable]
attribute and therefore be tied to an issue I believe. I wanted to open some brief conversation on if this would be okay and I can add the things missing in that PR.The text was updated successfully, but these errors were encountered: