Struct uhttp_version::HttpVersion
[−]
[src]
pub struct HttpVersion { pub major: u8, pub minor: u8, }
HTTP start line version field [RFC7230§2.6].
Fields
major: u8
Major version number.
minor: u8
Minor version number.
Methods
impl HttpVersion
[src]
fn from_parts(major: u8, minor: u8) -> Self
Create a new HttpVersion
from the given major and minor version parts.
fn from_bytes(s: &[u8]) -> Result<Self, ()>
Try to parse an HttpVersion
from the given bytes in the form required by the
request line syntax.
This verifies the syntax is well-formed and extracts the version parts.
Trait Implementations
impl Copy for HttpVersion
[src]
impl Clone for HttpVersion
[src]
fn clone(&self) -> HttpVersion
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for HttpVersion
[src]
impl PartialEq for HttpVersion
[src]
fn eq(&self, __arg_0: &HttpVersion) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HttpVersion) -> bool
This method tests for !=
.
impl Debug for HttpVersion
[src]
impl Hash for HttpVersion
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for HttpVersion
[src]
Writes the version string in the form required by the HTTP status line.