[−][src]Struct http_types::headers::HeaderValue
A header value.
Implementations
impl HeaderValue
[src]
pub fn from_ascii(bytes: &[u8]) -> Result<Self, Error>
[src]
Create a new HeaderValue
from ASCII bytes.
Error
This function will error if the string is not a valid ASCII.
pub unsafe fn from_ascii_unchecked(bytes: Vec<u8>) -> Self
[src]
Converts a vector of bytes to a HeaderValue
without checking that the string contains
valid ASCII.
Safety
This function is unsafe because it does not check that the bytes passed to it are valid ASCII. If this constraint is violated, it may cause memory unsafety issues with future users of the HeaderValue, as the rest of the library assumes that Strings are valid ASCII.
pub fn as_str(&self) -> &str
[src]
Get the header value as a &str
Trait Implementations
impl Clone for HeaderValue
[src]
fn clone(&self) -> HeaderValue
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HeaderValue
[src]
impl Display for HeaderValue
[src]
impl Eq for HeaderValue
[src]
impl<'_> From<&'_ Mime> for HeaderValue
[src]
impl<'_> From<Cookie<'_>> for HeaderValue
[src]
impl From<Mime> for HeaderValue
[src]
impl FromStr for HeaderValue
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Create a new HeaderValue
.
This checks it's valid ASCII.
impl Hash for HeaderValue
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, '_> PartialEq<&'_ String> for HeaderValue
[src]
impl<'a> PartialEq<&'a str> for HeaderValue
[src]
impl PartialEq<HeaderValue> for HeaderValue
[src]
fn eq(&self, other: &HeaderValue) -> bool
[src]
fn ne(&self, other: &HeaderValue) -> bool
[src]
impl PartialEq<String> for HeaderValue
[src]
impl PartialEq<str> for HeaderValue
[src]
impl StructuralEq for HeaderValue
[src]
impl StructuralPartialEq for HeaderValue
[src]
impl ToHeaderValues for HeaderValue
[src]
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
fn to_header_values(&self) -> Result<Self::Iter>
[src]
impl<'a> TryFrom<&'a str> for HeaderValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for HeaderValue
impl Send for HeaderValue
impl Sync for HeaderValue
impl Unpin for HeaderValue
impl UnwindSafe for HeaderValue
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,