pub struct RequestBodyWriter<'scope> { /* private fields */ }Expand description
Direct request output. Vectors move into the encoder; slices are copied by
Into<Vec<u8>>. One boxed sink retains in-flight state, without allocating
a future or crossing a producer queue for each frame.
Implementations§
Source§impl RequestBodyWriter<'_>
impl RequestBodyWriter<'_>
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>
Sourcepub async fn flush(&mut self, cancellation: &Cancellation) -> Result<(), Error>
pub async fn flush(&mut self, cancellation: &Cancellation) -> Result<(), Error>
Every accepted frame is already flushed to the transport. After normal
close_write, also wait for final framing. This does not promise that
the peer has received or processed the bytes.
pub async fn finish(self, cancellation: &Cancellation) -> Result<(), Error>
Sourcepub fn close_write(&mut self, error: Option<Error>)
pub fn close_write(&mut self, error: Option<Error>)
Signal normal closure. The connection supervisor sends final framing;
use asynchronous finish when completion must be observed.
pub fn abort(&mut self)
Trait Implementations§
Source§impl WritableBody for RequestBodyWriter<'_>
impl WritableBody for RequestBodyWriter<'_>
type Data = Vec<u8>
type Error = Error
Source§async fn write_frame(
&mut self,
frame: BodyFrame<Vec<u8>>,
cancellation: &Cancellation,
) -> Result<(), Error>
async fn write_frame( &mut self, frame: BodyFrame<Vec<u8>>, cancellation: &Cancellation, ) -> Result<(), Error>
Accept one whole frame. Headers follow all data; a terminal frame closes
output atomically with acceptance. Later writes fail. Queue capacity
becoming available does not mean the transport has released its buffers.
async fn flush(&mut self, cancellation: &Cancellation) -> Result<(), Error>
fn close_write(&mut self, error: Option<Error>)
fn abort(&mut self)
Auto Trait Implementations§
impl<'scope> !RefUnwindSafe for RequestBodyWriter<'scope>
impl<'scope> !Sync for RequestBodyWriter<'scope>
impl<'scope> !UnwindSafe for RequestBodyWriter<'scope>
impl<'scope> Freeze for RequestBodyWriter<'scope>
impl<'scope> Send for RequestBodyWriter<'scope>
impl<'scope> Unpin for RequestBodyWriter<'scope>
impl<'scope> UnsafeUnpin for RequestBodyWriter<'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