Struct asserhttp::headers::HeaderValue
source · [−]pub struct HeaderValue { /* private fields */ }
Expand description
A header value.
Implementations
sourceimpl HeaderValue
impl HeaderValue
sourcepub fn from_bytes(bytes: Vec<u8, Global>) -> Result<HeaderValue, Error>
pub fn from_bytes(bytes: Vec<u8, Global>) -> Result<HeaderValue, 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, Global>) -> HeaderValue
pub unsafe fn from_bytes_unchecked(bytes: Vec<u8, Global>) -> HeaderValue
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
sourceimpl AsMut<HeaderValue> for HeaderValues
impl AsMut<HeaderValue> for HeaderValues
sourcefn 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.
sourceimpl AsRef<HeaderValue> for HeaderValues
impl AsRef<HeaderValue> for HeaderValues
sourcefn as_ref(&self) -> &HeaderValue
fn as_ref(&self) -> &HeaderValue
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Clone for HeaderValue
impl Clone for HeaderValue
sourcefn clone(&self) -> HeaderValue
fn clone(&self) -> HeaderValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for HeaderValue
impl Debug for HeaderValue
sourceimpl Display for HeaderValue
impl Display for HeaderValue
sourceimpl<'_> From<&'_ Mime> for HeaderValue
impl<'_> From<&'_ Mime> for HeaderValue
sourcefn from(mime: &Mime) -> HeaderValue
fn from(mime: &Mime) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<CacheDirective> for HeaderValue
impl From<CacheDirective> for HeaderValue
sourcefn from(directive: CacheDirective) -> HeaderValue
fn from(directive: CacheDirective) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<Encoding> for HeaderValue
impl From<Encoding> for HeaderValue
sourcefn from(directive: Encoding) -> HeaderValue
fn from(directive: Encoding) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<Encoding> for HeaderValue
impl From<Encoding> for HeaderValue
sourcefn from(directive: Encoding) -> HeaderValue
fn from(directive: Encoding) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<EncodingProposal> for HeaderValue
impl From<EncodingProposal> for HeaderValue
sourcefn from(entry: EncodingProposal) -> HeaderValue
fn from(entry: EncodingProposal) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<EncodingProposal> for HeaderValue
impl From<EncodingProposal> for HeaderValue
sourcefn from(entry: EncodingProposal) -> HeaderValue
fn from(entry: EncodingProposal) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<HeaderValue> for HeaderValues
impl From<HeaderValue> for HeaderValues
sourcefn from(other: HeaderValue) -> HeaderValues
fn from(other: HeaderValue) -> HeaderValues
Converts to this type from the input type.
sourceimpl From<HeaderValues> for HeaderValue
impl From<HeaderValues> for HeaderValue
sourcefn from(other: HeaderValues) -> HeaderValue
fn from(other: HeaderValues) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<MediaTypeProposal> for HeaderValue
impl From<MediaTypeProposal> for HeaderValue
sourcefn from(entry: MediaTypeProposal) -> HeaderValue
fn from(entry: MediaTypeProposal) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<Metric> for HeaderValue
impl From<Metric> for HeaderValue
sourcefn from(entry: Metric) -> HeaderValue
fn from(entry: Metric) -> HeaderValue
Converts to this type from the input type.
sourceimpl From<Mime> for HeaderValue
impl From<Mime> for HeaderValue
sourcefn from(mime: Mime) -> HeaderValue
fn from(mime: Mime) -> HeaderValue
Converts to this type from the input type.
sourceimpl FromIterator<HeaderValue> for HeaderValues
impl FromIterator<HeaderValue> for HeaderValues
sourcefn from_iter<I>(iter: I) -> HeaderValues where
I: IntoIterator<Item = HeaderValue>,
fn from_iter<I>(iter: I) -> HeaderValues where
I: IntoIterator<Item = HeaderValue>,
Creates a value from an iterator. Read more
sourceimpl FromStr for HeaderValue
impl FromStr for HeaderValue
sourcefn from_str(s: &str) -> Result<HeaderValue, <HeaderValue as FromStr>::Err>
fn from_str(s: &str) -> Result<HeaderValue, <HeaderValue as FromStr>::Err>
Create a new HeaderValue
.
This checks it’s valid ASCII.
sourceimpl Hash for HeaderValue
impl Hash for HeaderValue
sourceimpl<'a, '_> PartialEq<&'_ String> for HeaderValue
impl<'a, '_> PartialEq<&'_ String> for HeaderValue
sourceimpl<'a> PartialEq<&'a str> for HeaderValue
impl<'a> PartialEq<&'a str> for HeaderValue
sourceimpl PartialEq<HeaderValue> for HeaderValue
impl PartialEq<HeaderValue> for HeaderValue
sourcefn eq(&self, other: &HeaderValue) -> bool
fn eq(&self, other: &HeaderValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &HeaderValue) -> bool
fn ne(&self, other: &HeaderValue) -> bool
This method tests for !=
.
sourceimpl PartialEq<String> for HeaderValue
impl PartialEq<String> for HeaderValue
sourceimpl PartialEq<str> for HeaderValue
impl PartialEq<str> for HeaderValue
sourceimpl ToHeaderValues for HeaderValue
impl ToHeaderValues for HeaderValue
type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
sourcefn to_header_values(
&self
) -> Result<<HeaderValue as ToHeaderValues>::Iter, Error>
fn to_header_values(
&self
) -> Result<<HeaderValue as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved HeaderValues
.
sourceimpl<'a> TryFrom<&'a str> for HeaderValue
impl<'a> TryFrom<&'a str> for HeaderValue
impl Eq for HeaderValue
impl StructuralEq for HeaderValue
impl StructuralPartialEq for HeaderValue
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
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