Open icidasset opened 1 year ago
Yes, that would be nice!
Ideally an equivalent on the public side should also exist.
Agreed, for us that's going to be more akin to integrating iroh-unixfs
(now beetle-unixfs
?). Or in webnative, we could do that today if we integrated with unixfs-exporter
nicely.
I started on some implementation recently, but ended up refocusing my efforts. Here's some useful resources:
ReadableStream
s on the JS side, and ReadableStreamBYOBReader
to minimize copying.ByobReader
-> AsyncRead
is the way to go), but I also found this useful in general, just in case there needs to be some stream-to-asyncread conversion somewhere: https://docs.rs/futures/latest/futures/stream/trait.TryStreamExt.html#method.into_async_readJsStream
and JsFuture
A wasm-bindgen interface for a private file's
stream_content
method. Ideally an equivalent on the public side should also exist.Use case I had in mind: Ability to use the HTTP range header to get a part of a file.