pub enum HttpVersion {
Http10,
Http11,
}Expand description
An HTTP version.
Supports HTTP/1.0 and HTTP/1.1, which are the versions the runtime actually handles. Keep-alive semantics are a runtime concern, not a property of this value type.
§Serialization
Display produces the wire format: HTTP/1.0 or HTTP/1.1.
§Comparison
Two versions are equal if and only if they represent the same HTTP
version. HTTP/1.0 != HTTP/1.1.
Variants§
Implementations§
Source§impl HttpVersion
impl HttpVersion
Sourcepub fn parse(version_str: &str) -> Result<Self, HttpVersionError>
pub fn parse(version_str: &str) -> Result<Self, HttpVersionError>
Parse an HTTP version from the version string in a request line
(e.g., HTTP/1.1).
§Errors
Returns HttpVersionError::Unsupported if the version is not
HTTP/1.0 or HTTP/1.1.
Trait Implementations§
Source§impl AsRef<str> for HttpVersion
impl AsRef<str> for HttpVersion
Source§impl Clone for HttpVersion
impl Clone for HttpVersion
Source§fn clone(&self) -> HttpVersion
fn clone(&self) -> HttpVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HttpVersion
Source§impl Debug for HttpVersion
impl Debug for HttpVersion
Source§impl Display for HttpVersion
impl Display for HttpVersion
impl Eq for HttpVersion
Source§impl From<&Version> for HttpVersion
impl From<&Version> for HttpVersion
Source§impl Hash for HttpVersion
impl Hash for HttpVersion
Source§impl PartialEq for HttpVersion
impl PartialEq for HttpVersion
impl StructuralPartialEq for HttpVersion
Auto Trait Implementations§
impl Freeze for HttpVersion
impl RefUnwindSafe for HttpVersion
impl Send for HttpVersion
impl Sync for HttpVersion
impl Unpin for HttpVersion
impl UnsafeUnpin for HttpVersion
impl UnwindSafe for HttpVersion
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