Skip to content

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

Merged
cratelyn merged 1 commit into
hyperium:masterfrom
cratelyn:kate/client-dispatch.try-send-error-message-ref
May 6, 2025
Merged

feat(client): add a TrySendError::message() method#3884
cratelyn merged 1 commit into
hyperium:masterfrom
cratelyn:kate/client-dispatch.try-send-error-message-ref

Conversation

@cratelyn

@cratelyn cratelyn commented May 5, 2025

Copy link
Copy Markdown
Member

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 <git@katelyn.world>
@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
@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 <git@katelyn.world>
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 <git@katelyn.world>
@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

2 participants