-
Notifications
You must be signed in to change notification settings - Fork 235
feat(iroh-relay)!: adjust APIs to make it easier to create RelayMap
s from lists of RelayUrls
#3292
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
Conversation
… from lists of `RelayUrls` In our examples and tests, it is enough to build `RelayMap`s from a single `RelayUrl`, but our users will more likely be in the situation where they have multiple relays. This changes the APIs to make adding multiple relays the most prominant use case.
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3292/docs/iroh/ Last updated: 2025-05-07T16:18:39Z |
RelayMap
s from lists of RelayUrls
RelayMap
s from lists of RelayUrls
I think it is great to be sleuthing at these APIs! They are indeed not very ergonomic. Would they not be more rusty by leveraging traits more?
I'm kind of curious why they grew into what they currently are, so might be missing the mark. Edit: The doc comments on all the functions are also fairly over the place and need fixing. |
Did everything suggested in @flub your comment, but adjusted the code to remove the need for the |
Co-authored-by: Floris Bruynooghe <[email protected]>
Co-authored-by: Floris Bruynooghe <[email protected]>
Co-authored-by: Floris Bruynooghe <[email protected]>
Co-authored-by: Floris Bruynooghe <[email protected]>
…t we also have a QUIC port to configure, having an impl that only looks at the STUN port does not make sense
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.
The "Breaking Changes" section in the PR description needs updating, but otherwise looks good!
Description
In our examples and tests, it is enough to build
RelayMap
s from a singleRelayUrl
, but our users will more likely be in the situation where they have multiple relays.Now we have
From<RelayUrl>
,From<(RelayUrl, u16)>
,FromIterator<RelayUrl>
FromIterator<(RelayUrl, u16)>
impls to create aRelayMap
.Also,
From<RelayUrl>
andFrom<(RelayUrl, u16)>
to create aRelayNode
.Breaking Changes
pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
pub fn from_url(url: RelayUrl) -> RelayMap
, useFrom<RelayUrl>
insteadChange checklist