pub enum Version {
Http10,
Http11,
}Expand description
Supported HTTP Versions.
Examples
use dbs_uhttp::Version;
let version = Version::try_from(b"HTTP/1.1");
assert!(version.is_ok());
let version = Version::try_from(b"http/1.1");
assert!(version.is_err());Variants
Http10
HTTP/1.0
Http11
HTTP/1.1
Implementations
sourceimpl Version
impl Version
sourcepub fn raw(self) -> &'static [u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn raw(self) -> &'static [u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
HTTP Version as an u8 slice.
sourcepub fn try_from(bytes: &[u8]) -> Result<Self, RequestError>
pub fn try_from(bytes: &[u8]) -> Result<Self, RequestError>
Creates a new HTTP Version from an u8 slice.
The supported versions are HTTP/1.0 and HTTP/1.1. The version is case sensitive and the accepted input is upper case.
Errors
Returns a InvalidHttpVersion when the HTTP version is not supported.
Trait Implementations
impl Copy for Version
impl StructuralPartialEq for Version
Auto Trait Implementations
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more