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<Projector>,
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<Projector>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) -> Self
pub fn new(request: Request<Body>, framing: Framing) -> Self
One request whose provider reports no transport request id.
Sourcepub fn with_request_id_header(self, header: Option<&'static str>) -> Self
pub fn with_request_id_header(self, header: Option<&'static str>) -> Self
Name the reply header carrying the provider’s transport request id.
Sourcepub fn with_relaxed_content_type(self) -> Self
pub fn with_relaxed_content_type(self) -> Self
Accept a streamed reply that names no content type.
Sourcepub fn with_route(self, route: Option<&'static str>) -> Self
pub fn with_route(self, route: Option<&'static str>) -> Self
Name the endpoint template observation groups attempts under.
Sourcepub fn with_projection(self, project: Projector) -> Self
pub fn with_projection(self, project: Projector) -> Self
Read observation facts off each reply payload through project.
Sourcepub fn with_analysis_only(self, analysis_only: fn(&WireFrame) -> bool) -> Self
pub fn with_analysis_only(self, analysis_only: fn(&WireFrame) -> bool) -> Self
Exempt frames analysis_only accepts from observation’s frame
positions.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Encoded
impl !RefUnwindSafe for Encoded
impl !UnwindSafe for Encoded
impl Send for Encoded
impl Sync for Encoded
impl Unpin for Encoded
impl UnsafeUnpin for Encoded
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more