-
Notifications
You must be signed in to change notification settings - Fork 40
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
use oxnet::{ IpNet, Ipv4Net, Ipv6Net }
#5810
Changes from 22 commits
9a47816
e160e67
5a1f70a
fdd86e2
f3ba1fe
48aa546
ed2e35c
bacc59f
9c9cc97
6566976
acbbb38
0ccf169
2724da8
2bca9ef
3dc4dd1
92f0d51
0541842
22ed4f0
0b8620c
4024b66
98bebdc
0d320e3
c427295
24a455b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -419,33 +419,27 @@ impl TryFrom<types::ProducerEndpoint> | |
} | ||
} | ||
|
||
impl TryFrom<&omicron_common::api::external::Ipv4Net> for types::Ipv4Net { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we planning to get rid of the generated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes; going to be rooting that out here and from other places like dendrite and propolis There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! |
||
impl TryFrom<&oxnet::Ipv4Net> for types::Ipv4Net { | ||
type Error = String; | ||
|
||
fn try_from( | ||
net: &omicron_common::api::external::Ipv4Net, | ||
) -> Result<Self, Self::Error> { | ||
fn try_from(net: &oxnet::Ipv4Net) -> Result<Self, Self::Error> { | ||
types::Ipv4Net::try_from(net.to_string()).map_err(|e| e.to_string()) | ||
} | ||
} | ||
|
||
impl TryFrom<&omicron_common::api::external::Ipv6Net> for types::Ipv6Net { | ||
impl TryFrom<&oxnet::Ipv6Net> for types::Ipv6Net { | ||
type Error = String; | ||
|
||
fn try_from( | ||
net: &omicron_common::api::external::Ipv6Net, | ||
) -> Result<Self, Self::Error> { | ||
fn try_from(net: &oxnet::Ipv6Net) -> Result<Self, Self::Error> { | ||
types::Ipv6Net::try_from(net.to_string()).map_err(|e| e.to_string()) | ||
} | ||
} | ||
|
||
impl TryFrom<&omicron_common::api::external::IpNet> for types::IpNet { | ||
impl TryFrom<&oxnet::IpNet> for types::IpNet { | ||
type Error = String; | ||
|
||
fn try_from( | ||
net: &omicron_common::api::external::IpNet, | ||
) -> Result<Self, Self::Error> { | ||
use omicron_common::api::external::IpNet; | ||
fn try_from(net: &oxnet::IpNet) -> Result<Self, Self::Error> { | ||
use oxnet::IpNet; | ||
match net { | ||
IpNet::V4(v4) => types::Ipv4Net::try_from(v4).map(types::IpNet::V4), | ||
IpNet::V6(v6) => types::Ipv6Net::try_from(v6).map(types::IpNet::V6), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we relying on the lockfile to keep this in sync? I usually don't like relying on a branch directly. Can we give it a 1.0 version tag or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now; I want to get to something resembling stable in oxnet, publish to crates.io and depend on that. We have several other branch = main deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, works for me.