pub struct HeaderMut<'a> { /* private fields */ }Available on crate feature
api only.Implementations§
Source§impl<'a> HeaderMut<'a>
impl<'a> HeaderMut<'a>
pub fn new(header: &'a mut HeaderMap) -> Self
pub fn header(&mut self, key: HeaderName, value: HeaderValue) -> &mut Self
pub fn header_static( &mut self, key: HeaderName, value: &'static str, ) -> &mut Self
pub fn header_static_sensitive( &mut self, key: HeaderName, value: &'static str, ) -> &mut Self
pub fn header_str( &mut self, key: HeaderName, value: &str, ) -> Result<&mut Self, Error>
pub fn header_str_sensitive( &mut self, key: HeaderName, value: &str, ) -> Result<&mut Self, Error>
pub fn append(&mut self, key: HeaderName, value: HeaderValue) -> &mut Self
pub fn extend(&mut self, headers: HeaderMap) -> &mut Self
pub fn is_empty(&self) -> bool
Sourcepub fn user_agent(&mut self, agent: &str) -> Result<&mut Self, Error>
pub fn user_agent(&mut self, agent: &str) -> Result<&mut Self, Error>
User-Agent: agent
Sourcepub fn cache_control_no_cache(&mut self) -> &mut Self
pub fn cache_control_no_cache(&mut self) -> &mut Self
Cache-Control: no-cache
Sourcepub fn cache_control(&mut self, value: &str) -> Result<&mut Self, Error>
pub fn cache_control(&mut self, value: &str) -> Result<&mut Self, Error>
Cache-Control: value
Sourcepub fn request_id(&mut self, id: &str) -> Result<&mut Self, Error>
pub fn request_id(&mut self, id: &str) -> Result<&mut Self, Error>
X-Request-ID: id
Sourcepub fn cors_allow_all(&mut self) -> &mut Self
pub fn cors_allow_all(&mut self) -> &mut Self
Access-Control-Allow-Origin: *
Sourcepub fn cors_allow_origin(&mut self, origin: &str) -> Result<&mut Self, Error>
pub fn cors_allow_origin(&mut self, origin: &str) -> Result<&mut Self, Error>
Access-Control-Allow-Origin: origin
Sourcepub fn cors_allow_methods_standard(&mut self) -> &mut Self
pub fn cors_allow_methods_standard(&mut self) -> &mut Self
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Sourcepub fn cors_allow_headers_standard(&mut self) -> &mut Self
pub fn cors_allow_headers_standard(&mut self) -> &mut Self
Access-Control-Allow-Headers: Content-Type, Authorization
Sourcepub fn connection_keep_alive(&mut self) -> &mut Self
pub fn connection_keep_alive(&mut self) -> &mut Self
Connection: keep-alive
Sourcepub fn connection_close(&mut self) -> &mut Self
pub fn connection_close(&mut self) -> &mut Self
Connection: close
Sourcepub fn content_length(&mut self, length: u64) -> &mut Self
pub fn content_length(&mut self, length: u64) -> &mut Self
Content-Length: length
Source§impl<'a> HeaderMut<'a>
impl<'a> HeaderMut<'a>
Sourcepub fn accept_json(&mut self) -> &mut Self
pub fn accept_json(&mut self) -> &mut Self
ACCEPT: application/json
Sourcepub fn accept_html(&mut self) -> &mut Self
pub fn accept_html(&mut self) -> &mut Self
ACCEPT: text/html
Sourcepub fn accept_text(&mut self) -> &mut Self
pub fn accept_text(&mut self) -> &mut Self
ACCEPT: text/plain
Sourcepub fn accept_any(&mut self) -> &mut Self
pub fn accept_any(&mut self) -> &mut Self
ACCEPT: /
Sourcepub fn accept_mulity(&mut self, items: &[&str]) -> Result<&mut Self, Error>
pub fn accept_mulity(&mut self, items: &[&str]) -> Result<&mut Self, Error>
ACCEPT: multi items
Sourcepub fn accept_encoding_standard(&mut self) -> &mut Self
pub fn accept_encoding_standard(&mut self) -> &mut Self
Accept-Encoding: gzip, deflate, br
Sourcepub fn accept_language_en(&mut self) -> &mut Self
pub fn accept_language_en(&mut self) -> &mut Self
Accept-Language: en-US, en;q=0.9
Sourcepub fn accept_language(&mut self, lang: &str) -> Result<&mut Self, Error>
pub fn accept_language(&mut self, lang: &str) -> Result<&mut Self, Error>
Accept-Language: lang
Source§impl<'a> HeaderMut<'a>
impl<'a> HeaderMut<'a>
Sourcepub fn content_type_formencoded(&mut self) -> &mut Self
pub fn content_type_formencoded(&mut self) -> &mut Self
CONTENT-TYPE: application/x-www-form-urlencoded
Sourcepub fn content_type_json(&mut self) -> &mut Self
pub fn content_type_json(&mut self) -> &mut Self
CONTENT-TYPE: application/json
Sourcepub fn content_type_text(&mut self) -> &mut Self
pub fn content_type_text(&mut self) -> &mut Self
CONTENT-TYPE: text/plain
Sourcepub fn content_type_html(&mut self) -> &mut Self
pub fn content_type_html(&mut self) -> &mut Self
CONTENT-TYPE: text/html
Sourcepub fn content_type_multipart(&mut self) -> &mut Self
pub fn content_type_multipart(&mut self) -> &mut Self
CONTENT-TYPE: multipart/form-data
Source§impl<'a> HeaderMut<'a>
impl<'a> HeaderMut<'a>
Authorization: type credentials
pub fn basic_auth(&mut self, username: &str, password: &str) -> &mut Self
pub fn bearer_token(&mut self, token: &str) -> &mut Self
Auto Trait Implementations§
impl<'a> Freeze for HeaderMut<'a>
impl<'a> RefUnwindSafe for HeaderMut<'a>
impl<'a> Send for HeaderMut<'a>
impl<'a> Sync for HeaderMut<'a>
impl<'a> Unpin for HeaderMut<'a>
impl<'a> !UnwindSafe for HeaderMut<'a>
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