Skip to content

Commit f890c79

Browse files
rklaehnFrando
andauthored
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

16 files changed

+1505
-813
lines changed

Cargo.lock

Lines changed: 66 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@ tracing-test = "0.2.5"
6060
walkdir = "2.5.0"
6161
atomic_refcell = "0.1.13"
6262
iroh = { version = "0.92", features = ["discovery-local-network"]}
63+
async-compression = { version = "0.4.30", features = ["lz4", "tokio"] }
64+
concat_const = "0.2.0"
6365

6466
[features]
6567
hide-proto-docs = []
6668
metrics = []
6769
default = ["hide-proto-docs", "fs-store"]
6870
fs-store = ["dep:redb", "dep:reflink-copy"]
71+
72+
[patch.crates-io]
73+
iroh = { git = "https://github.com/n0-computer/iroh", branch = "main" }
74+
iroh-base = { git = "https://github.com/n0-computer/iroh", branch = "main" }

0 commit comments

Comments
 (0)