Struct sig_proxy::middleware::proxy::prelude::headers::HeaderValue [−]
pub struct HeaderValue { /* fields omitted */ }
A header value.
Implementations
impl HeaderValue
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.
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.
pub fn as_str(&self) -> &str
Get the header value as a &str
Trait Implementations
impl AsMut<HeaderValue> for HeaderValues
pub fn as_mut(&mut self) -> &mut HeaderValue
impl AsRef<HeaderValue> for HeaderValues
pub fn as_ref(&self) -> &HeaderValue
impl Clone for HeaderValue
pub fn clone(&self) -> HeaderValue
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HeaderValue
impl Display for HeaderValue
impl Eq for HeaderValue
impl<'_> From<&'_ Mime> for HeaderValue
pub fn from(mime: &Mime) -> HeaderValue
impl From<CacheDirective> for HeaderValue
pub fn from(directive: CacheDirective) -> HeaderValue
impl<'_> From<Cookie<'_>> for HeaderValue
pub fn from(cookie: Cookie<'_>) -> HeaderValue
impl From<Encoding> for HeaderValue
pub fn from(directive: Encoding) -> HeaderValue
impl From<Encoding> for HeaderValue
pub fn from(directive: Encoding) -> HeaderValue
impl From<EncodingProposal> for HeaderValue
pub fn from(entry: EncodingProposal) -> HeaderValue
impl From<EncodingProposal> for HeaderValue
pub fn from(entry: EncodingProposal) -> HeaderValue
impl From<HeaderValue> for HeaderValues
pub fn from(other: HeaderValue) -> HeaderValues
impl From<HeaderValues> for HeaderValue
pub fn from(other: HeaderValues) -> HeaderValue
impl From<MediaTypeProposal> for HeaderValue
pub fn from(entry: MediaTypeProposal) -> HeaderValue
impl From<Metric> for HeaderValue
pub fn from(entry: Metric) -> HeaderValue
impl From<Mime> for HeaderValue
pub fn from(mime: Mime) -> HeaderValue
impl FromIterator<HeaderValue> for HeaderValues
pub fn from_iter<I>(iter: I) -> HeaderValues where
I: IntoIterator<Item = HeaderValue>,
I: IntoIterator<Item = HeaderValue>,
impl FromStr for HeaderValue
type Err = Error
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<HeaderValue, <HeaderValue as FromStr>::Err>
Create a new HeaderValue
.
This checks it’s valid ASCII.
impl Hash for HeaderValue
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, '_> PartialEq<&'_ String> for HeaderValue
impl<'a> PartialEq<&'a str> for HeaderValue
impl PartialEq<HeaderValue> for HeaderValue
pub fn eq(&self, other: &HeaderValue) -> bool
pub fn ne(&self, other: &HeaderValue) -> bool
impl PartialEq<String> for HeaderValue
impl PartialEq<str> for HeaderValue
impl StructuralEq for HeaderValue
impl StructuralPartialEq for HeaderValue
impl ToHeaderValues for HeaderValue
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
pub fn to_header_values(
&self
) -> Result<<HeaderValue as ToHeaderValues>::Iter, Error>
&self
) -> Result<<HeaderValue as ToHeaderValues>::Iter, Error>
impl<'a> TryFrom<&'a str> for HeaderValue
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(
value: &'a str
) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a str>>::Error>
value: &'a str
) -> Result<HeaderValue, <HeaderValue as TryFrom<&'a str>>::Error>
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,