feat(util): add InspectErr, InspectFrame combinators#161
Merged
cratelyn merged 1 commit intohyperium:masterfrom Nov 10, 2025
Merged
feat(util): add InspectErr, InspectFrame combinators#161cratelyn merged 1 commit intohyperium:masterfrom
InspectErr, InspectFrame combinators#161cratelyn merged 1 commit intohyperium:masterfrom
Conversation
Member
Author
|
|
Member
Author
|
i opened #162 to address these errors in CI. |
f2ea117 to
1e9c77f
Compare
fixes hyperium#160. the standard library has introduced conventions for combinators that accept callbacks that "inspect" a value, upon being provided a reference to a yielded value. for example, `Result::inspect()` and `Result::inspect_err()` allow callers to e.g. log an `Ok(_)` or `Err(_)` value. `Iterator::inspect()` similarly allows callers to apply a layer of functionality to inspect items as they are yielded by the inner iterator. this commit introduces a pair of combinators to `http_body_util`, called `InspectErr<B, F>` and `InspectFrame<B, F>`. these allow callers to inspect errors and frames yielded by an inner body. these are constructed by calling `BodyExt::inspect_err()` and `BodyExt::inspect_frame()`, respectively. Signed-off-by: katelyn martin <git@katelyn.world>
1e9c77f to
2db6fde
Compare
Member
Author
|
rebased on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #160.
the standard library has introduced conventions for combinators that accept callbacks that "inspect" a value, upon being provided a reference to a yielded value.
for example,
Result::inspect()andResult::inspect_err()allow callers to e.g. log anOk(_)orErr(_)value.Iterator::inspect()similarly allows callers to apply a layer of functionality to inspect items as they are yielded by the inner iterator.this commit introduces a pair of combinators to
http_body_util, calledInspectErr<B, F>andInspectFrame<B, F>. these allow callers to inspect errors and frames yielded by an inner body. these are constructed by callingBodyExt::inspect_err()andBodyExt::inspect_frame(), respectively.