-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh)!: Wrap the Connection struct so we own the type (#3110)
## Description This makes iroh own the Connection type. This is desirable because: - Some: upstream APIs don't work well for us, e.g. Connection::remote_address is not that meaningful. This allows us to remove those and replace them with more appropriate APIs. This has not yet been done in this PR however. - The connection type and changes are currently on the Endpoint, they also belong on the Connection. - Connection information, like which pats are used, the latencies of those paths etc, also belong on the Connection. - It is generally not great to expose types which you have no control over in your public API. For the 1.0 we do not want to have any such structs. This takes an important step in that direction. As part of this change Connection::remote_node_id replaces the get_remote_node_id function. Also Connection::alpn now exists. ## Breaking Changes ### iroh - `iroh::endpoint::get_remote_node_id` has been removed. Use `iroh::endpoint::Connection::remote_node_id` instead. ## Notes & open questions This does not yet clean up the existing methods in the Connection, preserving most of them as-is. It is easier to handle those separately as each one involves careful decisions about the API. Replaces #2768 ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
- Loading branch information
Showing
7 changed files
with
360 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.