Repository navigation
refactor(netwatch)!: improve platform feature-gating and don't reexport netdev types - #163
Merged
Merged
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/net-tools/pr/163/docs/net_tools/ Last updated: 2026-07-14T14:56:07Z |
Frando
force-pushed
the
Frando/refactor-platform-impls
branch
from
June 15, 2026 10:16
ac13c84 to
86ded18
Compare
The `derive_more` dependency was declared for three targets but used in only one. Fold it into a single base dependency and use its `Display` derive for `Interface` in place of the hand-written impl.
Frando
force-pushed
the
Frando/refactor-platform-impls
branch
from
July 13, 2026 21:59
86ded18 to
2c3b6c7
Compare
The external-types job inherited the workflow-wide `RUSTDOCFLAGS=-Dwarnings`, so unrelated rustdoc lints from the analyzer's internal rustdoc run turned into hard failures. Clear `RUSTDOCFLAGS` for that job. Install cargo-make, cargo-check-external-types, and wasm-bindgen-cli through `taiki-e/install-action` rather than `cargo-binstall`, which pulled its own latest build on every run. Bump `cargo-check-external-types` to 0.5.0 with the matching nightly, kept in sync with `Makefile.toml`.
Frando
marked this pull request as ready for review
July 13, 2026 22:17
Frando
force-pushed
the
Frando/refactor-platform-impls
branch
from
July 13, 2026 22:20
13a3499 to
053eabb
Compare
flub
reviewed
Jul 14, 2026
Member
|
I think this needs a breaking changes section of some sort, even if it is not listing individual things. |
Tighten the check-external-types allowlist from star imports to the specific `noq_udp` and `n0_watcher` types that appear in the public API. Document every `Interface` and `Ipv6AddrFlags` field, tracing each flag to its OS source, and give module and item docs proper summary lines.
flub
approved these changes
Jul 14, 2026
Closed
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We currently reexport items from
netdevon platforms supported bynetdev, and recreate identical types on other platforms. This is brittle and easy to break.We also relied on module-path-rewriting, which is hard to follow and easy to miss.
This PR fixes both by restructuring the platform impl. It now defines shared types in one place, and then delegates to platform impls in a very normal way. The platforms using netdev still share code, but we no longer re-export any types from netdev.
Also adds a
check-external-typesCI check to validate this.Breaking Changes
netwatch::interfaces::Ipv6AddrFlagsis now netwatch's own type on every platform, instead of a re-export ofnetdev'sIpv6AddrFlags. The field names are unchanged; code that relied on thenetdevtype identity must usenetwatch::interfaces::Ipv6AddrFlags.netwatch::interfaces::Interfaceno longer wraps or exposesnetdev::Interface; it is self-owned.Interface::is_up,Interface::name, andInterface::addrsare unchanged. Nonetdevtypes remain in the public API.<Interface as Display>now prints"{index}. {name} up={is_up} addrs={addrs:?}"instead of"{index}. {name} {if_type:?} ipv4={..} ipv6={..}".interfaces::Statenow has the same public fields on every platform. On wasm this adds the publiclocal_addressesfield and makesis_expensiveanddefault_route_interfacepublic; the never-populatedhttp_proxyandpacfields are gone.Notes & open questions
Change checklist