Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork175
[WIP] uefi-raw and uefi: usecore::net
types where possible, remove duplicated types#1645
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
core::net
types where possible, remove duplicated types0b3a947
to8543063
CompareThis simplifies things as we have less types to work with. The overallconvenience is improved and people will be less confused with theautomated imports suggested by their IDE.As the core::Net types are ABI compatible, and it is unlikely that theywill ever change in core, we should go for this simplification.
728dc3b
to6291e95
Comparephip1611 commentedApr 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I personally see this as a major step forward. On the other hand, I'm biased 😁 I'm looking forward to the discussion and other's ideas! |
This tightly integrates the type with the Rust standard IpAddr type.It allows the convenient usage in `uefi` in a later commit.
This does not use core::net::IpAddr in all possible public interfaces.Although there is opportunity for that, this commit only makes `uefi`compatible with the new `uefi-raw` type.
/// An IPv4 internet protocol address. | ||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] | ||
#[repr(transparent)] | ||
pub struct Ipv4Address(pub [u8; 4]); |
nicholasbishopMay 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
I think we should keep the uefi-raw typesIpv4Address
andIp6Address
. Note that thecore::net
types arenotrepr(C)
, so it's not safe to rely on them having the same representation as the UEFI types. Seerust-lang/rust#78802 for some background.
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.
Yeah, I think you are right! Would have been a nice simplification, however!
core::net
types where possible, remove duplicated typescore::net
types where possible, remove duplicated types
Uh oh!
There was an error while loading.Please reload this page.
This is an attempt to bring the discussion of#1575 one step further. It outlines my vision on how we could simplify the interface.
I removed all dedicated types except for
uefi-raw
sIpAddress
.This type is now tightly integrated withcore::net::{IpAddr, Ipv4Addr, Ipv6Addr}
. I think this is a major step forward in convenience and usability.Please review this commit-by-commit.
Steps to Undraft
-> then we can have a better debug impl
Checklist