refactor(iroh): Split RemoteStateActor struct into connections and state#4268
Open
Frando wants to merge 5 commits into
Open
refactor(iroh): Split RemoteStateActor struct into connections and state#4268Frando wants to merge 5 commits into
Frando wants to merge 5 commits into
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4268/docs/iroh/ Last updated: 2026-05-15T14:37:43Z |
flub
approved these changes
May 16, 2026
| fn select_best_path<'a>( | ||
| all_paths: FxHashMap<&'a transports::Addr, PathSelectionData>, | ||
| current_path: Option<&'a transports::Addr>, | ||
| ) -> Option<(transports::Addr, Duration)> { |
Contributor
There was a problem hiding this comment.
Can you not return Option<(&'a transports::Addr, Duration)> here? Or would that not really have any impact on the use anyway?
Member
Author
There was a problem hiding this comment.
I tried, but it then gets into parallel mutable borrow errors again unfortunately.
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
By splitting the
RemoteStateActorstruct intoconnectionsandstate, we can write and use util methods onstatewhile also mutably borrowing intoconnections. This e.g. allows us to haveopen_path_on_connto repeat less code.Breaking Changes
Notes & open questions
The PR is best reviewed commit-by-commit. Only the last commit moves code around so that there is a single impl block for
StateandRemoteStateActoreach.Change checklist