http_types::headers

Struct HeaderValues

Source
pub struct HeaderValues { /* private fields */ }
Expand description

A list of HeaderValues.

This always contains at least one header value.

Implementations§

Source§

impl HeaderValues

Source

pub fn append(&mut self, other: &mut Self)

Move all values from other into self, leaving other empty.

Source

pub fn get(&self, index: usize) -> Option<&HeaderValue>

Returns a reference or a value depending on the type of index.

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut HeaderValue>

Returns a mutable reference or a value depending on the type of index.

Source

pub fn contains(&self, value: &HeaderValue) -> bool

Returns true if there is a value corresponding to the specified HeaderValue in the list, false otherwise.

Source

pub fn last(&self) -> &HeaderValue

Returns the last HeaderValue.

Source

pub fn iter(&self) -> Values<'_>

An iterator visiting all header values in arbitrary order.

Methods from Deref<Target = HeaderValue>§

Source

pub fn as_str(&self) -> &str

Get the header value as a &str

Trait Implementations§

Source§

impl AsMut<HeaderValue> for HeaderValues

Source§

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

Source§

fn as_ref(&self) -> &HeaderValue

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for HeaderValues

Source§

fn clone(&self) -> HeaderValues

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HeaderValues

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for HeaderValues

Source§

type Target = HeaderValue

The resulting type after dereferencing.
Source§

fn deref(&self) -> &HeaderValue

Dereferences the value.
Source§

impl DerefMut for HeaderValues

Source§

fn deref_mut(&mut self) -> &mut HeaderValue

Mutably dereferences the value.
Source§

impl Display for HeaderValues

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<HeaderValue> for HeaderValues

Source§

fn from(other: HeaderValue) -> Self

Converts to this type from the input type.
Source§

impl From<HeaderValues> for HeaderValue

Source§

fn from(other: HeaderValues) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<HeaderValue>> for HeaderValues

Source§

fn from(headers: Vec<HeaderValue>) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<HeaderValue> for HeaderValues

Source§

fn from_iter<I>(iter: I) -> HeaderValues
where I: IntoIterator<Item = HeaderValue>,

Creates a value from an iterator. Read more
Source§

impl<I: SliceIndex<[HeaderValue]>> Index<I> for HeaderValues

Source§

type Output = <I as SliceIndex<[HeaderValue]>>::Output

The returned type after indexing.
Source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a> IntoIterator for &'a HeaderValues

Source§

type Item = &'a HeaderValue

The type of the elements being iterated over.
Source§

type IntoIter = Values<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl IntoIterator for HeaderValues

Source§

type Item = HeaderValue

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<HeaderValue>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> PartialEq<&String> for HeaderValues

Source§

fn eq(&self, other: &&String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<&'a str> for HeaderValues

Source§

fn eq(&self, other: &&'a str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[&'a str]> for HeaderValues

Source§

fn eq(&self, other: &[&'a str]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<String> for HeaderValues

Source§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<str> for HeaderValues

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> ToHeaderValues for &'a HeaderValues

Source§

type Iter = Cloned<Values<'a>>

Returned iterator over header values which this type may correspond to.
Source§

fn to_header_values(&self) -> Result<Self::Iter>

Converts this object to an iterator of resolved HeaderValues.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T