tokio-rs / tokio-uring

An io_uring backed runtime for Rust
MIT License
1.11k stars 117 forks source link

Update `BufResult<T, B>` to be `Result<(T,B), BufError<B>>` #267

Closed Maaarcocr closed 7 months ago

Maaarcocr commented 1 year ago

Why?

Solves https://github.com/tokio-rs/tokio-uring/issues/178

How?

I've changed the type to be what was proposed in the issue and then followed the compiler warnings to make rustc happy.

I've also added a free function map_buf which allows to map a function over the buffer on BufResult. Let me know if that's okay, but it made writing some code easier.

ollie-etl commented 7 months ago

Updated in #295