pub struct Encoding {}Expand description
Wrapper over supported AcceptEncoding.
Implementations
sourceimpl Encoding
impl Encoding
sourcepub fn try_from(bytes: &[u8]) -> Result<(), RequestError>
pub fn try_from(bytes: &[u8]) -> Result<(), RequestError>
Parses a byte slice and checks if identity encoding is invalidated. Encoding must be ASCII, so also UTF-8 valid.
Errors
InvalidRequest is returned when the byte stream is empty.
InvalidValue is returned when the identity encoding is invalidated.
InvalidUtf8String is returned when the byte stream contains invalid characters.
Examples
use dbs_uhttp::Encoding;
assert!(Encoding::try_from(b"deflate").is_ok());
assert!(Encoding::try_from(b"identity;q=0").is_err());Trait Implementations
impl Copy for Encoding
impl StructuralPartialEq for Encoding
Auto Trait Implementations
impl RefUnwindSafe for Encoding
impl Send for Encoding
impl Sync for Encoding
impl Unpin for Encoding
impl UnwindSafe for Encoding
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