pub struct ResponseWriter<W> { /* private fields */ }Expand description
The response lane. A partially sent or abandoned response permanently
poisons admission. The owner must still await close to retire the backend.
Implementations§
Source§impl<W: WritableStream> ResponseWriter<W>
impl<W: WritableStream> ResponseWriter<W>
pub fn new(writer: W) -> Self
pub fn is_usable(&self) -> bool
pub fn interim(&mut self, version: Version) -> InterimWriter<'_, W>
Sourcepub async fn reject(
&mut self,
status: Status,
cancellation: &Cancellation,
) -> Result<(), Error>
pub async fn reject( &mut self, status: Status, cancellation: &Cancellation, ) -> Result<(), Error>
Best-effort rejection for invalid input, followed by connection closure.
Sourcepub async fn write_response<B: ReadableBody>(
&mut self,
exchange: &Exchange,
response: &mut Response<B>,
cancellation: &Cancellation,
) -> Result<bool, Error>
pub async fn write_response<B: ReadableBody>( &mut self, exchange: &Exchange, response: &mut Response<B>, cancellation: &Cancellation, ) -> Result<bool, Error>
Write one final response. true means output permits persistence; the
connection owner must also finish input and join concurrent work before
admitting another request. Discarded input disables persistence.
pub async fn close(&mut self) -> Result<()>
Auto Trait Implementations§
impl<W> Freeze for ResponseWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for ResponseWriter<W>where
W: RefUnwindSafe,
impl<W> Send for ResponseWriter<W>where
W: Send,
impl<W> Sync for ResponseWriter<W>where
W: Sync,
impl<W> Unpin for ResponseWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for ResponseWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for ResponseWriter<W>where
W: UnwindSafe,
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