pub struct HeaderValue(/* private fields */);Expand description
A HeaderValue represents the right hand side of a single name: value pair.
Implementations§
Source§impl HeaderValue
impl HeaderValue
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
determine if this header contains no unsafe characters (\r, \n, \0)
since 0.3.12
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Returns this header value as a &str if it is utf8, None
otherwise. If you need to convert non-utf8 bytes to a string
somehow, match directly on the HeaderValue as an enum and
handle that case. If you need a byte slice regardless of
whether it’s utf8, use the AsRef<[u8]> impl
Trait Implementations§
Source§impl AsRef<[u8]> for HeaderValue
impl AsRef<[u8]> for HeaderValue
Source§impl Clone for HeaderValue
impl Clone for HeaderValue
Source§fn clone(&self) -> HeaderValue
fn clone(&self) -> HeaderValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HeaderValue
impl Debug for HeaderValue
Source§impl Display for HeaderValue
impl Display for HeaderValue
Source§impl From<&'static [u8]> for HeaderValue
impl From<&'static [u8]> for HeaderValue
Source§impl From<&'static str> for HeaderValue
impl From<&'static str> for HeaderValue
Source§impl From<Arguments<'_>> for HeaderValue
impl From<Arguments<'_>> for HeaderValue
Source§impl From<HeaderValue> for HeaderValues
impl From<HeaderValue> for HeaderValues
Source§fn from(v: HeaderValue) -> Self
fn from(v: HeaderValue) -> Self
Converts to this type from the input type.
Source§impl From<String> for HeaderValue
impl From<String> for HeaderValue
Source§impl From<i32> for HeaderValue
impl From<i32> for HeaderValue
Source§impl From<i64> for HeaderValue
impl From<i64> for HeaderValue
Source§impl From<u16> for HeaderValue
impl From<u16> for HeaderValue
Source§impl From<u32> for HeaderValue
impl From<u32> for HeaderValue
Source§impl From<u64> for HeaderValue
impl From<u64> for HeaderValue
Source§impl From<usize> for HeaderValue
impl From<usize> for HeaderValue
Source§impl Ord for HeaderValue
impl Ord for HeaderValue
Source§fn cmp(&self, other: &HeaderValue) -> Ordering
fn cmp(&self, other: &HeaderValue) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<&[u8]> for HeaderValue
impl PartialEq<&[u8]> for HeaderValue
Source§impl PartialEq<&String> for HeaderValue
impl PartialEq<&String> for HeaderValue
Source§impl PartialEq<&str> for HeaderValue
impl PartialEq<&str> for HeaderValue
Source§impl PartialEq<[u8]> for &HeaderValue
impl PartialEq<[u8]> for &HeaderValue
Source§impl PartialEq<[u8]> for HeaderValue
impl PartialEq<[u8]> for HeaderValue
Source§impl PartialEq<HeaderValue> for HeaderValues
impl PartialEq<HeaderValue> for HeaderValues
Source§impl PartialEq<String> for &HeaderValue
impl PartialEq<String> for &HeaderValue
Source§impl PartialEq<String> for HeaderValue
impl PartialEq<String> for HeaderValue
Source§impl PartialEq<str> for &HeaderValue
impl PartialEq<str> for &HeaderValue
Source§impl PartialEq<str> for HeaderValue
impl PartialEq<str> for HeaderValue
Source§impl PartialEq for HeaderValue
impl PartialEq for HeaderValue
Source§impl PartialOrd for HeaderValue
impl PartialOrd for HeaderValue
impl Eq for HeaderValue
impl StructuralPartialEq for HeaderValue
Auto Trait Implementations§
impl Freeze for HeaderValue
impl RefUnwindSafe for HeaderValue
impl Send for HeaderValue
impl Sync for HeaderValue
impl Unpin for HeaderValue
impl UnsafeUnpin for HeaderValue
impl UnwindSafe for HeaderValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.