-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Implement conversion traits for IpAddr #1816
Comments
These seem pretty straightforward - feel free to open a PR adding them! |
I know I've often times wanted an easy way to create an I've wanted to reach for something like this, since it only requires the single let addr = SocketAddr::new((127, 0, 0, 1), 8080); But it would require changing |
A related (?) conversion which I think would be too confusing as a |
@mattico Interesting idea. It might be worth opening a separate issue for that so it can have its own separate discussion |
@mattico FYI, these methods already exist (I didn't know they existed until now):
Considering there are multiple ways to convert, adding a single |
Impl From<Ipv4Addr, Ipv6Addr> for IpAddr. Fixes rust-lang/rfcs#1816.
Cool! |
I'm thinking
From<Ipv4Addr>
andFrom<Ipv6Addr>
at least.The text was updated successfully, but these errors were encountered: