pub struct WritableRequest<'scope> { /* private fields */ }Expand description
An active request, distinct from the semantic Request<B> message value.
Writes drive HTTP output. finish consumes this handle and returns the
response. split permits independent upload and response consumption.
Sequential upload can deadlock against a peer which blocks on response
output before consuming the request; proxies must drive both directions.
Implementations§
Source§impl<'scope> WritableRequest<'scope>
impl<'scope> WritableRequest<'scope>
pub async fn write( &mut self, data: impl Into<Vec<u8>>, cancellation: &Cancellation, ) -> Result<(), Error>
pub async fn write_frame( &mut self, frame: BodyFrame<Vec<u8>>, cancellation: &Cancellation, ) -> Result<(), Error>
pub async fn flush(&mut self, cancellation: &Cancellation) -> Result<(), Error>
pub fn split(self) -> (RequestBodyWriter<'scope>, PendingResponse<'scope>)
Sourcepub async fn finish(
self,
cancellation: &Cancellation,
) -> Result<Response<StreamingResponseBody<'scope>>, Error>
pub async fn finish( self, cancellation: &Cancellation, ) -> Result<Response<StreamingResponseBody<'scope>>, Error>
Complete output, then read final response metadata. For early responses or simultaneous streaming, split and poll both directions concurrently.
Auto Trait Implementations§
impl<'scope> !RefUnwindSafe for WritableRequest<'scope>
impl<'scope> !Sync for WritableRequest<'scope>
impl<'scope> !UnwindSafe for WritableRequest<'scope>
impl<'scope> Freeze for WritableRequest<'scope>
impl<'scope> Send for WritableRequest<'scope>
impl<'scope> Unpin for WritableRequest<'scope>
impl<'scope> UnsafeUnpin for WritableRequest<'scope>
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