pub struct Request<P> {
pub method: Method,
pub path: Bytes,
pub query: HeaderList,
pub metadata: HeaderList,
pub payload: P,
pub stream: Option<RequestStream>,
pub context: RequestContext,
}Fields§
§method: MethodHTTP method. Standard methods are unit variants (zero-alloc construct +
integer compare); a non-standard method carries its wire bytes. See
Method.
path: BytesURL path bytes. percent-decoded form is in here; the listener boundary is responsible for normalization.
query: HeaderList§metadata: HeaderList§payload: PBuffered request payload. Bytes is the default wire case.
stream: Option<RequestStream>Streamed request body (uploads, WebSocket-inbound relay). None
for the buffered 80% case. Request trailers fold into metadata
at chunked-decode end; cancellation is context.cancel.
context: RequestContextImplementations§
Source§impl Request<Bytes>
impl Request<Bytes>
pub fn builder() -> RequestBuilder
Sourcepub async fn body_bytes(self) -> Result<(Self, Bytes), ProximaError>
pub async fn body_bytes(self) -> Result<(Self, Bytes), ProximaError>
Materialize the payload as Bytes, draining a streamed body if one
is present, and return (self, bytes) with the buffered bytes
installed on self.payload for reuse.
Sourcepub fn into_chunk_stream(self) -> ChunkStream
pub fn into_chunk_stream(self) -> ChunkStream
Uniform chunk-stream view of the request payload: the streamed body if present, else a one-chunk stream of the buffered bytes. Lets a listener pump any request body without matching on the shape.
Trait Implementations§
Source§impl BytePayload for Request<Bytes>
impl BytePayload for Request<Bytes>
Source§impl<P: Clone> Clone for Request<P>
impl<P: Clone> Clone for Request<P>
Source§fn clone(&self) -> Self
fn clone(&self) -> Self
Clone a buffered request so a caller can build once and re-send many
times (a load generator). Every field is a cheap copy — Method/Bytes
are refcount bumps, RequestContext is Arc-backed — so a clone-per-send
avoids the per-send path copy + RequestContext::default() of a fresh
build. A streamed body is not carried: the clone has stream: None
and the buffered payload (a live stream is single-use, not clonable).
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Idempotent for Request<Bytes>
impl Idempotent for Request<Bytes>
fn is_idempotent(&self) -> bool
Source§impl KeyOf<KeyExtractor> for Request<Bytes>
impl KeyOf<KeyExtractor> for Request<Bytes>
Source§fn rate_key<'a>(&'a self, extractor: &'a KeyExtractor) -> Cow<'a, [u8]>
fn rate_key<'a>(&'a self, extractor: &'a KeyExtractor) -> Cow<'a, [u8]>
Source§fn build_rejection(action: &ExceededAction) -> Response<Bytes>
fn build_rejection(action: &ExceededAction) -> Response<Bytes>
Source§impl Replayable for Request<Bytes>
Available on crate feature std only.
impl Replayable for Request<Bytes>
std only.