pub struct ConnectionInfo {
pub close: bool,
pub keep_alive: bool,
pub upgrade: bool,
pub hop_by_hop_headers: Vec<String>,
}Expand description
Parsed Connection header information.
Fields§
§close: boolWhether close token was present.
keep_alive: boolWhether keep-alive token was present.
upgrade: boolWhether upgrade token was present.
hop_by_hop_headers: Vec<String>Hop-by-hop header names to strip (lowercased).
These are header field names that appeared in the Connection header and should be removed when forwarding the message.
Implementations§
Source§impl ConnectionInfo
impl ConnectionInfo
Sourcepub fn parse(value: &[u8]) -> Self
pub fn parse(value: &[u8]) -> Self
Parses Connection header value(s).
The value should be a comma-separated list of tokens. Tokens are case-insensitive and whitespace around commas is ignored.
Sourcepub fn should_keep_alive(&self, version: HttpVersion) -> bool
pub fn should_keep_alive(&self, version: HttpVersion) -> bool
Returns whether the connection should be kept alive based on HTTP version.
- HTTP/1.1: defaults to keep-alive unless
closeis present - HTTP/1.0: defaults to close unless
keep-aliveis present
Trait Implementations§
Source§impl Clone for ConnectionInfo
impl Clone for ConnectionInfo
Source§fn clone(&self) -> ConnectionInfo
fn clone(&self) -> ConnectionInfo
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 ConnectionInfo
impl Debug for ConnectionInfo
Source§impl Default for ConnectionInfo
impl Default for ConnectionInfo
Source§fn default() -> ConnectionInfo
fn default() -> ConnectionInfo
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConnectionInfo
impl RefUnwindSafe for ConnectionInfo
impl Send for ConnectionInfo
impl Sync for ConnectionInfo
impl Unpin for ConnectionInfo
impl UnwindSafe for ConnectionInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).