pub struct Headers(/* private fields */);Expand description
HTTP headers, matched case-insensitively and kept in order.
Debug output redacts the values of credential headers (see
is_sensitive_header), so requests and responses can be logged.
Implementations§
Source§impl Headers
impl Headers
Sourcepub fn insert_sensitive(
&mut self,
name: impl Into<String>,
value: impl Into<String>,
)
pub fn insert_sensitive( &mut self, name: impl Into<String>, value: impl Into<String>, )
Append a header whose value is a secret, which Debug output
redacts whatever the header’s name.
Sourcepub fn retry_after(&self, name: &str) -> Option<Duration>
pub fn retry_after(&self, name: &str) -> Option<Duration>
How long the server asks the client to wait before retrying: the
name header (usually retry-after) or retry-after-ms, parsed
with parse_retry_after relative to the current time.
Unlike passing SystemTime::now() yourself, this also works on
wasm32-unknown-unknown.
Trait Implementations§
impl Eq for Headers
impl StructuralPartialEq for Headers
Auto Trait Implementations§
impl Freeze for Headers
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnsafeUnpin for Headers
impl UnwindSafe for Headers
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