pub struct ReqBodySender<'conn, S>{ /* private fields */ }Expand description
ReqBodySender handles reading body chunks from the raw payload stream.
This component runs concurrently with request processing to ensure:
- Body chunks are available when the handler needs them
- All body data is properly drained from the connection
- Resources are cleaned up appropriately
The sender maintains an EOF flag to track when the complete body has been read, which is crucial for proper connection handling.
Implementations§
Source§impl<S> ReqBodySender<'_, S>
impl<S> ReqBodySender<'_, S>
Sourcepub async fn send_body(&mut self) -> Result<(), ParseError>
pub async fn send_body(&mut self) -> Result<(), ParseError>
Streams body chunks from payload stream to ReqBody consumer.
This method runs in a loop, responding to chunk requests from the ReqBody until either:
- The complete body is streamed (EOF)
- An error occurs during streaming
Sourcepub async fn skip_body(&mut self)
pub async fn skip_body(&mut self)
Drains any remaining body chunks from the payload stream.
This is critical for maintaining HTTP protocol correctness when:
- The handler doesn’t read the complete body
- The connection will be reused for future requests
It ensures the connection is in a clean state for the next request.
Auto Trait Implementations§
impl<'conn, S> Freeze for ReqBodySender<'conn, S>
impl<'conn, S> !RefUnwindSafe for ReqBodySender<'conn, S>
impl<'conn, S> Send for ReqBodySender<'conn, S>where
S: Send,
impl<'conn, S> Sync for ReqBodySender<'conn, S>where
S: Sync,
impl<'conn, S> Unpin for ReqBodySender<'conn, S>
impl<'conn, S> !UnwindSafe for ReqBodySender<'conn, S>
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