tokio-rs / tokio-uring

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

Refresh: Update `Result<T, B>` to be `Result<(T,B), Error<B>` #295

Open ollie-etl opened 7 months ago

ollie-etl commented 7 months ago

This PR is a update of #267, which seems to have gone stale, due to inactivity on in this repo.

Changes the return type to be a Result of tuples, instead of a tuple containing a result and a buffer. This allows this crate to work in a more ergenomic fashion with ? operator

In addition to updating the original PR, the following changes are made in this one, not in the original

closes #178

ollie-etl commented 7 months ago

@ileixe would you care to review? @Noah-Kennedy / @carllerche / other maintainer? Any opinions?

ollie-etl commented 7 months ago

@ileixe Does this address your comment?

ileixe commented 7 months ago

@ollie-etl Exactly, thanks! Ah I did not aware it's not callable outside crate. Can you provide such traits callable (via sealed supertrait)? I think it's common to call it from compatibility layer (to abstract read via uring / non-uring). We ourselves are using it outside the crate.

ollie-etl commented 7 months ago

@ileixe That makes sense - done