bearcove / loona

HTTP 1+2 in Rust, with io_uring & ktls
https://docs.rs/loona
Apache License 2.0
361 stars 13 forks source link

Drop `BufOrSlice`, just use `Piece` for everything. #153

Closed fasterthanlime closed 8 months ago

fasterthanlime commented 8 months ago

That involves changing the WriteOwned trait, which is fine, whatever.

This is blocked on #150


context: writev might write an arbitrary number of bytes, you might give it ["hello", "world"] and it may write until the second "o", so then you need your buffer list to be ["rld"]: hence the BufOrSlice enum to be able to give io_uring the address of "rld".

but for http/2 framing reasons, I recently had to do the same thing: splitting Piece, an enum of &'static [u8], HeaderName, Vec<u8>, etc. into PieceCore (that enum), and Piece, an enum with Full and Slice variants.

I'd be fine if writev_all only accepted PieceList actually.

fasterthanlime commented 8 months ago

Closed by https://github.com/bearcove/fluke/pull/166