Commit f890c79
feat: abstract over stream types on provide and get side (#147)
## Description
This PR introduces abstract versions of iroh::endpoint::{SendStream,
RecvStream} and modifies the provide side and get side implementation to
use these abstract streams instead of directly using iroh::endpoint
streams.
This is necessary for wrapping the streams into a transformation such as
compression, see the discussion in
n0-computer/sendme#93 .
The compression example shows how streams can be wrapped into
compression/decompression to create a derived protocol with a different
ALPN that is identical to the blobs protocol except for compression.
## Breaking Changes
iroh::endpoint::SendStream and iroh::endpoint::RecvStream are replaced
with the traits iroh_blobs::util::SendStream and
iroh_blobs::util::RecvStream in the get FSM and in the provider side
API.
## Notes & open questions
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## Change checklist
- [ ] Self-review.
- [ ] 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.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
---------
Co-authored-by: Frando <frando@unbiskant.org>1 parent 3b4f595 commit f890c79
File tree
16 files changed
+1505
-813
lines changed- examples
- src
- api
- get
- provider
- store/fs/util
- util
16 files changed
+1505
-813
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments