Headers

Struct Headers 

Source
pub struct Headers(/* private fields */);
Expand description

HTTP3 headers from the request or response.

Implementations§

Source§

impl Headers

Source

pub fn with_frame(frame: &Frame<'_>) -> Result<Self, ErrorCode>

Constructs the headers from a HTTP3 Frame.

§Panics

Panics if frame is not type FrameKind::Headers.

Source

pub fn generate_frame(&self) -> Frame<'static>

Generates a Frame with these headers.

Source

pub fn get<K>(&self, key: K) -> Option<&str>
where K: AsRef<str>,

Returns a reference to the value associated with the key.

Source

pub fn insert<K, V>(&mut self, key: K, value: V)
where K: ToString, V: ToString,

Inserts a field (key, value) in the headers.

If the headers did have this key present, the value is updated.

Trait Implementations§

Source§

impl AsRef<HashMap<String, String>> for Headers

Source§

fn as_ref(&self) -> &HashMap<String, String>

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

impl Debug for Headers

Source§

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

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

impl<K, V> FromIterator<(K, V)> for Headers
where K: ToString, V: ToString,

Source§

fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl TryFrom<Headers> for SessionRequest

Source§

type Error = HeadersParseError

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

fn try_from(headers: Headers) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Headers> for SessionResponse

Source§

type Error = HeadersParseError

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

fn try_from(headers: Headers) -> Result<Self, Self::Error>

Performs the conversion.

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