Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Draft
phip1611 wants to merge4 commits intomain
base:main
Choose a base branch
Loading
fromcore-net

Conversation

phip1611
Copy link
Member

@phip1611phip1611 commentedApr 21, 2025
edited
Loading

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 foruefi-rawsIpAddress.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

  • Ensure that always all bytes are initialized in the constructors
    -> then we can have a better debug impl

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See theRewriting History guide for help.
  • Update the changelog (if necessary)

@phip1611phip1611 marked this pull request as draftApril 21, 2025 08:44
@phip1611phip1611 changed the titleXXX WIP Core netuefi-raw and uefi: usecore::net types where possible, remove duplicated typesApr 21, 2025
@phip1611phip1611 marked this pull request as ready for reviewApril 21, 2025 09:13
@phip1611phip1611force-pushed thecore-net branch 2 times, most recently from0b3a947 to8543063CompareApril 21, 2025 10:53
This 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.
@phip1611phip1611force-pushed thecore-net branch 2 times, most recently from728dc3b to6291e95CompareApril 21, 2025 10:57
@phip1611
Copy link
MemberAuthor

phip1611 commentedApr 21, 2025
edited
Loading

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]);
Copy link
Member

@nicholasbishopnicholasbishopMay 7, 2025
edited
Loading

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.

Copy link
MemberAuthor

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!

@phip1611phip1611 marked this pull request as draftMay 19, 2025 19:59
@phip1611phip1611 self-assigned thisMay 19, 2025
@phip1611phip1611 changed the titleuefi-raw and uefi: usecore::net types where possible, remove duplicated types[WIP] uefi-raw and uefi: usecore::net types where possible, remove duplicated typesMay 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicholasbishopnicholasbishopnicholasbishop left review comments

Assignees

@phip1611phip1611

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@phip1611@nicholasbishop

[8]ページ先頭

©2009-2025 Movatter.jp