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§
Implementations§
Source§impl Version
impl Version
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 Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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