tokio-uring
tokio-uring copied to clipboard
Refresh: Update `Result<T, B>` to be `Result<(T,B), Error<B>`
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
-
BufError
renamedError
. This follows the more usual convention of using crate prefixes to qualify error types, rather than the type name itself. -
BufResult
renamedResult
. This is the same rational -
map_buf
helper function implrmented with a sealed trait, to give method calling convention, rather than qualified calls
closes #178
@ileixe would you care to review? @Noah-Kennedy / @carllerche / other maintainer? Any opinions?
@ileixe Does this address your comment?
@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.
@ileixe That makes sense - done