Skip to main content

Header

Struct Header 

Source
pub struct Header { /* private fields */ }

Implementations§

Source§

impl Header

Source

pub fn new_res() -> Self

Source

pub fn new_req_h2() -> Self

Source

pub fn new_req_h1() -> Self

Source

pub fn as_raw(&mut self, body_len: usize) -> Result<Vec<String>, HlsError>

Source

pub fn get(&self, name: impl AsRef<str>) -> Option<&HeaderValue>

Source

pub fn get_mut(&mut self, name: impl AsRef<str>) -> Option<&mut HeaderValue>

Source

pub fn remove(&mut self, name: impl AsRef<str>) -> Option<HeaderValue>

Source

pub fn as_h2c(&self) -> Result<Vec<HeaderKey>, HlsError>

Source

pub fn set_cookies(&mut self, ck: Vec<Cookie>)

Source

pub fn insert( &mut self, k: impl AsRef<str>, v: impl ToString, ) -> Result<(), HlsError>

cookie请使用set_cookie/add_cookie

Source

pub fn set_user_agent( &mut self, user_agent: impl ToString, ) -> Result<(), HlsError>

Source

pub fn set_sec_ch_ua( &mut self, sec_ch_ua: impl ToString, ) -> Result<(), HlsError>

Source

pub fn set_sec_ch_ua_mobile( &mut self, sec_ch_ua_mobile: impl ToString, ) -> Result<(), HlsError>

Source

pub fn set_sec_ch_ua_platform( &mut self, sec_ch_ua_platform: impl ToString, ) -> Result<(), HlsError>

Source

pub fn user_agent(&self) -> Option<&str>

Source

pub fn set_host(&mut self, host: impl ToString) -> Result<(), HlsError>

Source

pub fn host(&self) -> Option<&str>

Source

pub fn set_origin(&mut self, origin: impl ToString) -> Result<(), HlsError>

Source

pub fn set_referer(&mut self, referer: impl ToString) -> Result<(), HlsError>

Source

pub fn set_accept(&mut self, accept: impl ToString) -> Result<(), HlsError>

Source

pub fn set_content_length( &mut self, content_length: usize, ) -> Result<(), HlsError>

Source

pub fn set_content_type(&mut self, content_type: ContentType)

Source

pub fn set_connection( &mut self, connection: impl ToString, ) -> Result<(), HlsError>

Source

pub fn content_length(&self) -> Option<usize>

Source

pub fn content_type(&self) -> Option<&ContentType>

Source

pub fn cookies(&self) -> Option<&Vec<Cookie>>

Source

pub fn method(&self) -> &Method

Source

pub fn alpn(&self) -> &ALPN

Source

pub fn uri(&self) -> &Uri

Source

pub fn uri_mut(&mut self) -> &mut Uri

Source

pub fn is_empty(&self) -> bool

Source

pub fn content_encoding(&self) -> Option<&str>

Source

pub fn set_content_encoding( &mut self, encoding: impl ToString, ) -> Result<(), HlsError>

Source

pub fn accept_encoding(&self) -> Option<&str>

Source

pub fn set_method(&mut self, method: Method)

Source

pub fn set_uri(&mut self, uri: Uri)

Source

pub fn location(&self) -> Option<&str>

Source

pub fn authorization(&self) -> Option<&str>

Source

pub fn set_authorization( &mut self, authorization: impl ToString, ) -> Result<(), HlsError>

Source

pub fn parse_h2(packs: Vec<HPack>) -> Result<Header, HlsError>

Source

pub fn status(&self) -> &HttpStatus

Source

pub fn keys(&self) -> &Vec<HeaderKey>

Source

pub fn set_by_json(&mut self, headers: JsonValue) -> Result<(), HlsError>

Trait Implementations§

Source§

impl Clone for Header

Source§

fn clone(&self) -> Header

Returns a duplicate 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 Display for Header

Source§

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

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

impl TryFrom<&str> for Header

Source§

type Error = HlsError

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

fn try_from(value: &str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<String> for Header

Source§

type Error = HlsError

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

fn try_from(value: String) -> 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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

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§

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.