You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments