Struct asserhttp::headers::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 HeaderValues)

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<(), Error>

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

impl Deref for HeaderValues

§

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<(), Error>

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

impl From<HeaderValue> for HeaderValues

source§

fn from(other: HeaderValue) -> HeaderValues

Converts to this type from the input type.
source§

impl From<HeaderValues> for HeaderValue

source§

fn from(other: HeaderValues) -> HeaderValue

Converts to this type from the input type.
source§

impl From<HeaderValues> for HeaderValues

source§

fn from(values: HeaderValues) -> Self

Converts to this type from the input type.
source§

impl From<Vec<HeaderValue>> for HeaderValues

source§

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

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> Index<I> for HeaderValues
where I: SliceIndex<[HeaderValue]>,

§

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

The returned type after indexing.
source§

fn index(&self, index: I) -> &<HeaderValues as Index<I>>::Output

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

impl<'a> IntoIterator for &'a HeaderValues

§

type Item = &'a HeaderValue

The type of the elements being iterated over.
§

type IntoIter = Values<'a>

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

fn into_iter(self) -> <&'a HeaderValues as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for HeaderValues

§

type Item = HeaderValue

The type of the elements being iterated over.
§

type IntoIter = IntoIter<HeaderValue>

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

fn into_iter(self) -> <HeaderValues as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

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

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

§

type Iter = Cloned<Values<'a>>

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

fn to_header_values( &self ) -> Result<<&'a HeaderValues as ToHeaderValues>::Iter, Error>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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