pub enum HttpVersion {
HTTP0_9,
HTTP1_0,
HTTP1_1,
HTTP2,
HTTP3,
Unknown(String),
}Expand description
Represents the HTTP version used in the request or response.
This enum is used to specify the HTTP version for HTTP requests and responses.
It supports the most common HTTP versions: HTTP/0.9, HTTP/1.0, HTTP/1.1, HTTP/2, HTTP/3, and unknown versions.
The HttpVersion enum allows for easy comparison, cloning, and debugging of the HTTP version.
The variants include:
HTTP0_9: Represents HTTP version 0.9.HTTP1_0: Represents HTTP version 1.0.HTTP1_1: Represents HTTP version 1.1.HTTP2: Represents HTTP version 2.0.HTTP3: Represents HTTP version 3.0.Unknown: Represents an unknown or unsupported HTTP version.
Variants§
HTTP0_9
HTTP version 0.9
HTTP1_0
HTTP version 1.0
HTTP1_1
HTTP version 1.1
HTTP2
HTTP version 2.0
HTTP3
HTTP version 3.0
Unknown(String)
Unknown version
Implementations§
Source§impl HttpVersion
impl HttpVersion
Sourcepub fn is_http0_9(&self) -> bool
pub fn is_http0_9(&self) -> bool
Checks if the current version is HTTP/0.9.
Sourcepub fn is_http1_0(&self) -> bool
pub fn is_http1_0(&self) -> bool
Checks if the current version is HTTP/1.0.
Sourcepub fn is_http1_1(&self) -> bool
pub fn is_http1_1(&self) -> bool
Checks if the current version is HTTP/1.1.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Checks if the current version is unknown.
Sourcepub fn is_http1_1_or_higher(&self) -> bool
pub fn is_http1_1_or_higher(&self) -> bool
Checks if the current version is HTTP/1.1 or higher.
Trait Implementations§
Source§impl Clone for HttpVersion
impl Clone for HttpVersion
Source§fn clone(&self) -> HttpVersion
fn clone(&self) -> HttpVersion
Returns a copy 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 HttpVersion
impl Debug for HttpVersion
Source§impl Default for HttpVersion
impl Default for HttpVersion
Source§impl Display for HttpVersion
impl Display for HttpVersion
Source§impl FromStr for HttpVersion
impl FromStr for HttpVersion
Source§impl PartialEq for HttpVersion
impl PartialEq for HttpVersion
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more