pub trait HeaderMapExt {
// Required methods
fn typed_get<H>(&self) -> Result<Option<H>, Error>
where H: Header;
fn typed_insert<H>(&mut self, header: &H)
where H: Header;
fn typed_remove<H>(&mut self) -> Result<Option<H>, Error>
where H: Header;
}
Expand description
An extension trait adding typed getters and setters to HeaderMap
.
Required Methods§
Sourcefn typed_get<H>(&self) -> Result<Option<H>, Error>where
H: Header,
fn typed_get<H>(&self) -> Result<Option<H>, Error>where
H: Header,
Retrieves the specified header from the map, if present.
Sourcefn typed_insert<H>(&mut self, header: &H)where
H: Header,
fn typed_insert<H>(&mut self, header: &H)where
H: Header,
Inserts the provided header into the map.
This overwrites any existing entries for that header.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.