Skip to content

feat(client): add a TrySendError::message() method #3884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

cratelyn
Copy link
Member

@cratelyn cratelyn commented May 5, 2025

this commit introduces a new inherent method to
hyper::client::conn::TrySendError<T>.

this error type includes a TrySendError::take_message() method today that will return an owned instance of the inbound message, should the underlying dispatch have been closed before serialization of the message ever began.

this commit introduces a new method that allows callers to inspect the message, e.g. to update metrics, without needing to take ownership of the message.

this commit introduces a new inherent method to
`hyper::client::conn::TrySendError<T>`.

this error type includes a `TrySendError::take_message()` method today
that will return an owned instance of the inbound message, should the
underlying dispatch have been closed before serialization of the message
ever began.

this commit introduces a new method that allows callers to inspect the
message, e.g. to update metrics, without needing to take ownership of
the message.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn marked this pull request as ready for review May 5, 2025 15:46
@cratelyn cratelyn merged commit 03fd6af into hyperium:master May 6, 2025
22 checks passed
@cratelyn cratelyn deleted the kate/client-dispatch.try-send-error-message-ref branch May 6, 2025 02:43
cratelyn added a commit to cratelyn/hyper that referenced this pull request May 6, 2025
this commit introduces a new inherent method to
`hyper::client::conn::TrySendError<T>`.

this error type includes a `TrySendError::into_error()` method today
that will consume the `TrySendError<T>`, returning the inner error. this
commit introduces a new method that allows callers to inspect the error,
e.g. to update metrics, without needing to consume the error.

this is akin to hyperium#3884, which added the `TrySendError::message()` method
that returns a reference to the `T`-typed message when applicable.

Signed-off-by: katelyn martin <[email protected]>
cratelyn added a commit that referenced this pull request May 6, 2025
this commit introduces a new inherent method to
`hyper::client::conn::TrySendError<T>`.

this error type includes a `TrySendError::into_error()` method today
that will consume the `TrySendError<T>`, returning the inner error. this
commit introduces a new method that allows callers to inspect the error,
e.g. to update metrics, without needing to consume the error.

this is akin to #3884, which added the `TrySendError::message()` method
that returns a reference to the `T`-typed message when applicable.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn self-assigned this May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants