linkerd2-proxy icon indicating copy to clipboard operation
linkerd2-proxy copied to clipboard

feat(http/body-eos): `EosRef<'a, E>: Clone + Copy`

Open cratelyn opened this issue 3 months ago • 2 comments

this commit introduces clone and copy implementations for the EosRef<'a, E> type used to inspect and classify the outcome of a request or response body.

as the documentation comment notes in the commit below, this enum only contains immutable references to other values: a header map or an error. other variants are empty tags.

pub enum EosRef<'a, E = Error> {
    None,
    Trailers(&'a HeaderMap),
    Error(&'a E),
    Cancelled,
}

this commit makes this type implicitly clonable.

Signed-off-by: katelyn martin [email protected]

cratelyn avatar Nov 19 '25 18:11 cratelyn

see https://github.com/linkerd/linkerd2-proxy/pull/4246, where this "end of stream" middleware was previously introduced.

cratelyn avatar Nov 19 '25 19:11 cratelyn

see https://github.com/linkerd/linkerd2-proxy/pull/4306, which builds upon this change to make further use of our EosRef<'a, E> model in our stream labeling facilities.

cratelyn avatar Nov 19 '25 19:11 cratelyn