refactor!: mark public types as non_exhaustive#4107
Merged
Conversation
dignifiedquire
approved these changes
Apr 13, 2026
c8e4d2a to
d40a9ba
Compare
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4107/docs/iroh/ Last updated: 2026-04-13T12:15:59Z |
d40a9ba to
e46136a
Compare
Add `#[non_exhaustive]` to public structs and enums that external code should not construct or match exhaustively: - `RelayConfig`, `RelayQuicConfig` (relay_map): add constructors - `DirectAddrType`, `DiscoveryEvent`: enums - `RelayToClientMsg`, `ClientToRelayMsg`, `FrameType`: protocol enums - Update call sites to use `From`/`new()` instead of struct literals
aa22447 to
60a01b9
Compare
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
Add
#[non_exhaustive]to various public structs and enums that we might want to extend during 1.0:relay_map::RelayConfig,relay_map::RelayQuicConfigDirectAddrType,DiscoveryEvent: enumsRelayToClientMsg,ClientToRelayMsg,FrameTypeThere's more items in the server-side of iroh-relay, will do those separately.
Breaking Changes
iroh_relay::RelayConfigis now#[non_exhaustive]. UseRelayConfig::from(relay_url)for the common case, orRelayConfig::new(url, quic)to specify a custom QUIC config.iroh_relay::RelayQuicConfigis now#[non_exhaustive]. UseRelayQuicConfig::new(port)orRelayQuicConfig::default()instead of struct literals.iroh_relay::protos::relay::RelayToClientMsgis now#[non_exhaustive].iroh_relay::protos::relay::ClientToRelayMsgis now#[non_exhaustive].iroh_relay::protos::common::FrameTypeis now#[non_exhaustive].iroh::DirectAddrTypeis now#[non_exhaustive].iroh::address_lookup::mdns::DiscoveryEventis now#[non_exhaustive].iroh_relay::server::Metricsis now#[non_exhaustive]. UseMetrics::default()instead of struct literals.iroh_relay::server::RelayMetricsis now#[non_exhaustive]. UseRelayMetrics::default()instead of struct literals.Notes & open questions
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme