pub struct RequestStream { /* private fields */ }Expand description
A streamed request body (uploads, WebSocket-inbound relay). Symmetric
to ResponseStream: carries an optional trailers slot a chunked
decoder populates at body-end (HTTP/1.1 request trailers, RFC 7230
§4.1.2). Request::body_bytes folds those into Request.headers
after draining — “request trailers fold into headers at chunked-decode
end”.
Implementations§
Source§impl RequestStream
impl RequestStream
pub fn new<S>(stream: S) -> Self
pub fn from_chunk_stream(stream: ChunkStream) -> Self
Sourcepub fn with_trailers_slot(self, slot: TrailersSlot) -> Self
pub fn with_trailers_slot(self, slot: TrailersSlot) -> Self
Attach a trailers slot a chunked decoder populates at body-end.
Sourcepub fn trailers(&self) -> Option<HeaderList>
pub fn trailers(&self) -> Option<HeaderList>
Read captured trailers, if any. None until a stream-end producer
populates the slot.
Sourcepub fn trailers_slot(&self) -> Option<&TrailersSlot>
pub fn trailers_slot(&self) -> Option<&TrailersSlot>
Borrow the trailers slot — handed to a producer (the chunked decoder pump) before the stream completes.
pub fn into_chunk_stream(self) -> ChunkStream
pub fn chunk_stream_mut(&mut self) -> &mut ChunkStream
Sourcepub async fn collect(self) -> Result<Bytes, ProximaError>
pub async fn collect(self) -> Result<Bytes, ProximaError>
Drain to a single Bytes.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RequestStream
impl !Sync for RequestStream
impl !UnwindSafe for RequestStream
impl Freeze for RequestStream
impl Send for RequestStream
impl Unpin for RequestStream
impl UnsafeUnpin for RequestStream
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
Mutably borrows from an owned value. Read more