pub enum Connection {
KeepAlive,
Close,
Upgrade,
None,
}Expand description
客户端和服务器之间的连接状态
Variants§
KeepAlive
客户端希望与服务器保持持久连接,以便在未来的请求中复用同一连接,减少连接的建立和断开开销,提高性能。
Close
客户端希望在完成当前请求之后立即关闭与服务器的连接。这种情况通常发生在客户端只需要单个请求-响应周期的情况下。
Upgrade
None
Implementations§
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
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 moreAuto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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