pub fn from_ascii(bytes: &[u8]) -> Result<Self, Error> {
        crate::ensure!(bytes.is_ascii(), "Bytes should be valid ASCII");

        // This is permitted because ASCII is valid UTF-8, and we just checked that.
        let string = unsafe { String::from_utf8_unchecked(bytes.to_vec()) };
        Ok(Self { inner: string })
    }
/// Create a new `HeaderValue` from ASCII bytes.
///
/// # Error
///
/// This function will error if the string is not a valid ASCII.
Create a new `HeaderValue` from ASCII bytes.
Create a new ` HeaderValue ` from ASCII bytes .
pub fn from_ascii(bytes: &[u8]) -> Result<Self, Error> {
        crate::ensure!(bytes.is_ascii(), "Bytes should be valid ASCII");
        // This is permitted because ASCII is valid UTF-8, and we just checked that.
        let string = unsafe { String::from_utf8_unchecked(bytes.to_vec()) };
        Ok(Self { inner: string })
    }
pub fn from_ascii ( bytes : & [ u8 ] ) -> Result < Self , Error > { crate :: ensure ! ( bytes is_ascii ( ) " " ) ; // This is permitted because ASCII is valid UTF-8, and we just checked that. let string = unsafe { String :: from_utf8_unchecked ( bytes . to_vec ( ) ) } ; Ok ( Self { inner : string } ) }
Create a new `HeaderValue` from ASCII bytes.
Create a new ` HeaderValue ` from ASCII bytes .
bytes
&[u8]
bytes
&[u8]
error
This function will error if the string is not a valid ASCII.
This function will error if the string is not a valid ASCII .