pub struct Header { /* private fields */ }Implementations§
Source§impl Header
impl Header
pub fn new_res() -> Self
pub fn new_req_h2() -> Self
pub fn new_req_h1() -> Self
pub fn as_raw(&mut self, body_len: usize) -> Result<Vec<String>, HlsError>
pub fn get(&self, name: impl AsRef<str>) -> Option<&HeaderValue>
pub fn get_mut(&mut self, name: impl AsRef<str>) -> Option<&mut HeaderValue>
pub fn remove(&mut self, name: impl AsRef<str>) -> Option<HeaderValue>
pub fn as_h2c(&self) -> Result<Vec<HeaderKey>, HlsError>
Sourcepub fn insert(
&mut self,
k: impl AsRef<str>,
v: impl ToString,
) -> Result<(), HlsError>
pub fn insert( &mut self, k: impl AsRef<str>, v: impl ToString, ) -> Result<(), HlsError>
cookie请使用set_cookie/add_cookie
pub fn set_user_agent( &mut self, user_agent: impl ToString, ) -> Result<(), HlsError>
pub fn set_sec_ch_ua( &mut self, sec_ch_ua: impl ToString, ) -> Result<(), HlsError>
pub fn set_sec_ch_ua_mobile( &mut self, sec_ch_ua_mobile: impl ToString, ) -> Result<(), HlsError>
pub fn set_sec_ch_ua_platform( &mut self, sec_ch_ua_platform: impl ToString, ) -> Result<(), HlsError>
pub fn user_agent(&self) -> Option<&str>
pub fn set_host(&mut self, host: impl ToString) -> Result<(), HlsError>
pub fn host(&self) -> Option<&str>
pub fn set_origin(&mut self, origin: impl ToString) -> Result<(), HlsError>
pub fn set_referer(&mut self, referer: impl ToString) -> Result<(), HlsError>
pub fn set_accept(&mut self, accept: impl ToString) -> Result<(), HlsError>
pub fn set_content_length( &mut self, content_length: usize, ) -> Result<(), HlsError>
pub fn set_content_type(&mut self, content_type: ContentType)
pub fn set_connection( &mut self, connection: impl ToString, ) -> Result<(), HlsError>
pub fn content_length(&self) -> Option<usize>
pub fn content_type(&self) -> Option<&ContentType>
pub fn method(&self) -> &Method
pub fn alpn(&self) -> &ALPN
pub fn uri(&self) -> &Uri
pub fn uri_mut(&mut self) -> &mut Uri
pub fn is_empty(&self) -> bool
pub fn content_encoding(&self) -> Option<&str>
pub fn set_content_encoding( &mut self, encoding: impl ToString, ) -> Result<(), HlsError>
pub fn accept_encoding(&self) -> Option<&str>
pub fn set_method(&mut self, method: Method)
pub fn set_uri(&mut self, uri: Uri)
pub fn location(&self) -> Option<&str>
pub fn parse_h2(packs: Vec<HPack>) -> Result<Header, HlsError>
pub fn status(&self) -> &HttpStatus
pub fn keys(&self) -> &Vec<HeaderKey>
pub fn set_by_json(&mut self, headers: JsonValue) -> Result<(), HlsError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more