Struct wiremock::http::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
sourcepub fn as_mut(&mut self) -> &mut HeaderValue
pub fn as_mut(&mut self) -> &mut HeaderValue
Performs the conversion.
sourceimpl AsRef<HeaderValue> for HeaderValues
impl AsRef<HeaderValue> for HeaderValues
sourcepub fn as_ref(&self) -> &HeaderValue
pub fn as_ref(&self) -> &HeaderValue
Performs the conversion.
sourceimpl Clone for HeaderValue
impl Clone for HeaderValue
sourcepub fn clone(&self) -> HeaderValue
pub 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
sourcepub fn from(mime: &Mime) -> HeaderValue
pub fn from(mime: &Mime) -> HeaderValue
Performs the conversion.
sourceimpl From<CacheDirective> for HeaderValue
impl From<CacheDirective> for HeaderValue
sourcepub fn from(directive: CacheDirective) -> HeaderValue
pub fn from(directive: CacheDirective) -> HeaderValue
Performs the conversion.
sourceimpl<'_> From<Cookie<'_>> for HeaderValue
impl<'_> From<Cookie<'_>> for HeaderValue
sourcepub fn from(cookie: Cookie<'_>) -> HeaderValue
pub fn from(cookie: Cookie<'_>) -> HeaderValue
Performs the conversion.
sourceimpl From<Encoding> for HeaderValue
impl From<Encoding> for HeaderValue
sourcepub fn from(directive: Encoding) -> HeaderValue
pub fn from(directive: Encoding) -> HeaderValue
Performs the conversion.
sourceimpl From<Encoding> for HeaderValue
impl From<Encoding> for HeaderValue
sourcepub fn from(directive: Encoding) -> HeaderValue
pub fn from(directive: Encoding) -> HeaderValue
Performs the conversion.
sourceimpl From<EncodingProposal> for HeaderValue
impl From<EncodingProposal> for HeaderValue
sourcepub fn from(entry: EncodingProposal) -> HeaderValue
pub fn from(entry: EncodingProposal) -> HeaderValue
Performs the conversion.
sourceimpl From<EncodingProposal> for HeaderValue
impl From<EncodingProposal> for HeaderValue
sourcepub fn from(entry: EncodingProposal) -> HeaderValue
pub fn from(entry: EncodingProposal) -> HeaderValue
Performs the conversion.
sourceimpl From<HeaderValue> for HeaderValues
impl From<HeaderValue> for HeaderValues
sourcepub fn from(other: HeaderValue) -> HeaderValues
pub fn from(other: HeaderValue) -> HeaderValues
Performs the conversion.
sourceimpl From<HeaderValues> for HeaderValue
impl From<HeaderValues> for HeaderValue
sourcepub fn from(other: HeaderValues) -> HeaderValue
pub fn from(other: HeaderValues) -> HeaderValue
Performs the conversion.
sourceimpl From<MediaTypeProposal> for HeaderValue
impl From<MediaTypeProposal> for HeaderValue
sourcepub fn from(entry: MediaTypeProposal) -> HeaderValue
pub fn from(entry: MediaTypeProposal) -> HeaderValue
Performs the conversion.
sourceimpl From<Metric> for HeaderValue
impl From<Metric> for HeaderValue
sourcepub fn from(entry: Metric) -> HeaderValue
pub fn from(entry: Metric) -> HeaderValue
Performs the conversion.
sourceimpl From<Mime> for HeaderValue
impl From<Mime> for HeaderValue
sourcepub fn from(mime: Mime) -> HeaderValue
pub fn from(mime: Mime) -> HeaderValue
Performs the conversion.
sourceimpl FromIterator<HeaderValue> for HeaderValues
impl FromIterator<HeaderValue> for HeaderValues
sourcepub fn from_iter<I>(iter: I) -> HeaderValues where
I: IntoIterator<Item = HeaderValue>,
pub 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
sourcepub fn from_str(s: &str) -> Result<HeaderValue, <HeaderValue as FromStr>::Err>
pub 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
sourcepub fn eq(&self, other: &HeaderValue) -> bool
pub fn eq(&self, other: &HeaderValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &HeaderValue) -> bool
pub 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.
sourcepub fn to_header_values(
&self
) -> Result<<HeaderValue as ToHeaderValues>::Iter, Error>
pub 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
sourceimpl TryFrom<HeaderValue> for HeaderValue
impl TryFrom<HeaderValue> for HeaderValue
sourcepub fn try_from(
value: HeaderValue
) -> Result<HeaderValue, <HeaderValue as TryFrom<HeaderValue>>::Error>
pub fn try_from(
value: HeaderValue
) -> Result<HeaderValue, <HeaderValue as TryFrom<HeaderValue>>::Error>
Performs the conversion.
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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more