Enum front_line::HttpVersion
source · pub enum HttpVersion {
OneZero,
OneOne,
}
Expand description
Represents versions of the HTTP protocol.
Currently supports only HTTP/1.0 and HTTP/1.1.
Variants§
OneZero
Represents the HTTP/1.0 version.
OneOne
Represents the HTTP/1.1 version.
This version includes features like persistent connections and chunked transfer-coding.
Implementations§
source§impl HttpVersion
impl HttpVersion
sourcepub fn parse(remaining_request_line: &[u8]) -> Option<HttpVersion>
pub fn parse(remaining_request_line: &[u8]) -> Option<HttpVersion>
Parse an HTTP version from the given request line slice.
This function will attempt to parse the provided slice and return the identified HTTP version if recognized.
Arguments
remaining_request_line
- A byte slice containing the part of the request line representing the HTTP version.
Returns
Returns Some(HttpVersion)
if a valid HTTP version is identified. Otherwise,
returns None
.
Trait Implementations§
source§impl Debug for HttpVersion
impl Debug for HttpVersion
source§impl PartialEq for HttpVersion
impl PartialEq for HttpVersion
source§fn eq(&self, other: &HttpVersion) -> bool
fn eq(&self, other: &HttpVersion) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for HttpVersion
impl StructuralEq for HttpVersion
impl StructuralPartialEq for HttpVersion
Auto Trait Implementations§
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