pub enum CloseReason {
ClientConnectionClose,
ServerConnectionClose,
Not100Continue,
CloseDelimitedBody,
}Expand description
Reasons for closing an HTTP connection.
This enum represents the various reasons why an HTTP connection might need to be closed after a request/response cycle is complete.
Variants§
ClientConnectionClose
Client sent connection: close.
ServerConnectionClose
Server sent connection: close.
Not100Continue
When doing expect-100 the server sent some other response.
For expect-100, the only options for a server response are:
- 100 continue, in which case we continue to send the body.
- do nothing, in which case we continue to send the body after a timeout.
- a 4xx or 5xx response indicating the server cannot receive the body.
CloseDelimitedBody
Response body is close delimited.
We do not know how much body data to receive. The socket will be closed when it’s done. This is HTTP/1.0 semantics.
Trait Implementations§
Source§impl Clone for CloseReason
impl Clone for CloseReason
Source§fn clone(&self) -> CloseReason
fn clone(&self) -> CloseReason
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CloseReason
impl Debug for CloseReason
Source§impl PartialEq for CloseReason
impl PartialEq for CloseReason
impl Copy for CloseReason
impl Eq for CloseReason
impl StructuralPartialEq for CloseReason
Auto Trait Implementations§
impl Freeze for CloseReason
impl RefUnwindSafe for CloseReason
impl Send for CloseReason
impl Sync for CloseReason
impl Unpin for CloseReason
impl UnwindSafe for CloseReason
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