pub struct HeaderValue { /* private fields */ }
Expand description
A header value.
Implementations§
Source§impl HeaderValue
impl HeaderValue
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<Self, Error>
pub fn from_bytes(bytes: Vec<u8>) -> Result<Self, Error>
Create a new HeaderValue
from a Vec of ASCII bytes.
§Error
This function will error if the bytes is not valid ASCII.
Sourcepub unsafe fn from_bytes_unchecked(bytes: Vec<u8>) -> Self
pub unsafe fn from_bytes_unchecked(bytes: Vec<u8>) -> Self
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.
Trait Implementations§
Source§impl AsMut<HeaderValue> for HeaderValues
impl AsMut<HeaderValue> for HeaderValues
Source§fn as_mut(&mut self) -> &mut HeaderValue
fn as_mut(&mut self) -> &mut HeaderValue
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<HeaderValue> for HeaderValues
impl AsRef<HeaderValue> for HeaderValues
Source§fn as_ref(&self) -> &HeaderValue
fn as_ref(&self) -> &HeaderValue
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for HeaderValue
impl Clone for HeaderValue
Source§fn clone(&self) -> HeaderValue
fn clone(&self) -> HeaderValue
Returns a copy 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<&Mime> for HeaderValue
impl From<&Mime> for HeaderValue
Source§impl From<CacheDirective> for HeaderValue
impl From<CacheDirective> for HeaderValue
Source§fn from(directive: CacheDirective) -> Self
fn from(directive: CacheDirective) -> Self
Converts to this type from the input type.
Source§impl From<Cookie<'_>> for HeaderValue
impl From<Cookie<'_>> for HeaderValue
Source§impl From<Encoding> for HeaderValue
impl From<Encoding> for HeaderValue
Source§impl From<Encoding> for HeaderValue
impl From<Encoding> for HeaderValue
Source§impl From<EncodingProposal> for HeaderValue
impl From<EncodingProposal> for HeaderValue
Source§fn from(entry: EncodingProposal) -> HeaderValue
fn from(entry: EncodingProposal) -> HeaderValue
Converts to this type from the input type.
Source§impl From<EncodingProposal> for HeaderValue
impl From<EncodingProposal> for HeaderValue
Source§fn from(entry: EncodingProposal) -> HeaderValue
fn from(entry: EncodingProposal) -> HeaderValue
Converts to this type from the input type.
Source§impl From<HeaderValue> for HeaderValues
impl From<HeaderValue> for HeaderValues
Source§fn from(other: HeaderValue) -> Self
fn from(other: HeaderValue) -> Self
Converts to this type from the input type.
Source§impl From<HeaderValues> for HeaderValue
impl From<HeaderValues> for HeaderValue
Source§fn from(other: HeaderValues) -> Self
fn from(other: HeaderValues) -> Self
Converts to this type from the input type.
Source§impl From<MediaTypeProposal> for HeaderValue
impl From<MediaTypeProposal> for HeaderValue
Source§fn from(entry: MediaTypeProposal) -> HeaderValue
fn from(entry: MediaTypeProposal) -> HeaderValue
Converts to this type from the input type.
Source§impl From<Metric> for HeaderValue
impl From<Metric> for HeaderValue
Source§fn from(entry: Metric) -> HeaderValue
fn from(entry: Metric) -> HeaderValue
Converts to this type from the input type.
Source§impl From<Mime> for HeaderValue
impl From<Mime> for HeaderValue
Source§impl FromIterator<HeaderValue> for HeaderValues
impl FromIterator<HeaderValue> for HeaderValues
Source§fn from_iter<I>(iter: I) -> HeaderValueswhere
I: IntoIterator<Item = HeaderValue>,
fn from_iter<I>(iter: I) -> HeaderValueswhere
I: IntoIterator<Item = HeaderValue>,
Creates a value from an iterator. Read more
Source§impl FromStr for HeaderValue
impl FromStr for HeaderValue
Source§impl Hash for HeaderValue
impl Hash for HeaderValue
Source§impl<'a> PartialEq<&String> for HeaderValue
impl<'a> PartialEq<&String> for HeaderValue
Source§impl<'a> PartialEq<&'a str> for HeaderValue
impl<'a> PartialEq<&'a str> 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 for HeaderValue
impl PartialEq for HeaderValue
Source§impl ToHeaderValues for HeaderValue
impl ToHeaderValues for HeaderValue
Source§type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Source§fn to_header_values(&self) -> Result<Self::Iter>
fn to_header_values(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
HeaderValues
.Source§impl<'a> TryFrom<&'a str> for HeaderValue
impl<'a> TryFrom<&'a str> 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 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