pub enum CloseReason<'a> {
Ended,
Stale,
Failed(&'a Error),
}Expand description
Why a connection ended.
Three, because three is what the code can tell apart. It deliberately
does not include “the caller dropped it”: that would have to be
reported from a Drop impl, and the module doc says why no hook is
ever called from one.
Variants§
Ended
The exchange finished it: the peer closed the connection after the
response, or the response said Connection: close. Nothing went
wrong — there is simply no second request to be had on it.
Stale
It was taken from the pool for a new request and turned out to have been closed by the peer while it sat idle.
The reason a request that did nothing wrong sometimes pays for a
connect: this is the event that explains the Connected
following it.
Failed(&'a Error)
It failed, and here is the failure.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CloseReason<'a>
impl<'a> !UnwindSafe for CloseReason<'a>
impl<'a> Freeze for CloseReason<'a>
impl<'a> Send for CloseReason<'a>
impl<'a> Sync for CloseReason<'a>
impl<'a> Unpin for CloseReason<'a>
impl<'a> UnsafeUnpin for CloseReason<'a>
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