pub struct Encoded {
pub request: Request<Body>,
pub framing: Framing,
pub request_id_header: Option<&'static str>,
pub relaxed_content_type: bool,
pub route: Option<&'static str>,
pub project: Option<fn(&[u8], &mut ObservationSink<'_>)>,
pub analysis_only: Option<fn(&WireFrame) -> bool>,
}Expand description
The request a wire sends, and how its reply is framed.
Data only: built by Wire::encode from the wire and the request, and
read by the driver. A wire never touches a socket or a request extension.
Debug shows request methods and URI paths, not schemes, authorities,
queries, header values or bodies. Paths are not scrubbed: callers must
still avoid placing sensitive data in them.
Fields§
§request: Request<Body>The HTTP request.
framing: FramingHow the reply’s bytes split into frames.
request_id_header: Option<&'static str>The reply header carrying the provider’s transport request id
(Anthropic request-id, OpenAI x-request-id), when the provider
reports one. None is “does not report one”, never an error.
relaxed_content_type: boolWhether a streamed reply may omit Content-Type (one gateway
replays Responses bodies without it). A wrong content type is
still rejected.
route: Option<&'static str>Stable endpoint template for observation grouping, without base-URL
prefixes or interpolated values. None uses the concrete request path.
project: Option<fn(&[u8], &mut ObservationSink<'_>)>Reads observation facts off each raw reply payload before
normalization discards them. None projects nothing.
analysis_only: Option<fn(&WireFrame) -> bool>Whether a frame carries only analysis metadata: it still decodes, but does not advance observation’s EOF and corruption positions.
Implementations§
Source§impl Encoded
impl Encoded
Sourcepub fn new(request: Request<Body>, framing: Framing) -> Encoded
pub fn new(request: Request<Body>, framing: Framing) -> Encoded
One request whose provider reports no transport request id.
Sourcepub fn with_request_id_header(self, header: Option<&'static str>) -> Encoded
pub fn with_request_id_header(self, header: Option<&'static str>) -> Encoded
Name the reply header carrying the provider’s transport request id.
Sourcepub fn with_relaxed_content_type(self) -> Encoded
pub fn with_relaxed_content_type(self) -> Encoded
Accept a streamed reply that names no content type.
Sourcepub fn with_route(self, route: Option<&'static str>) -> Encoded
pub fn with_route(self, route: Option<&'static str>) -> Encoded
Name the endpoint template observation groups attempts under.
Sourcepub fn with_projection(
self,
project: fn(&[u8], &mut ObservationSink<'_>),
) -> Encoded
pub fn with_projection( self, project: fn(&[u8], &mut ObservationSink<'_>), ) -> Encoded
Read observation facts off each reply payload through project.