-
Notifications
You must be signed in to change notification settings - Fork 185
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
refactor(iroh-router)!: change accept to take an AsRef<[u8]> #2963
Conversation
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2963/docs/iroh/ Last updated: 2024-11-26T09:50:05Z |
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.
Nice, I like this.
I find |
Yeah, I share it. On the other hand compared to some atrocities involving Pin it looks almost simple. Possibly a type alias or even a newtype might be the way to go. |
# Conflicts: # iroh/examples/custom-protocol.rs # iroh/src/node/builder.rs
Description
Change RouterBuilder::accept to take an AsRef<[u8]> instead of a Vec. Also change iroh node accept.
Breaking Changes
Notes & open questions
Question: since we are making the API more pleasant at the expense of a bit of inefficiency, should we also change the second parameter to take a &Arc instead of an Arc?
So
In the various examples I found that you very frequently need the protocol handler again after accept-ing it. So this saves one .clone() in many cases, at the expense of an arc clone, which we basically treat as free anyway.
Change checklist