(headers: http::HeaderMap)
| 185 | } |
| 186 | |
| 187 | pub fn from_headers(headers: http::HeaderMap) -> Self { |
| 188 | let mut h: HashMap<String, String> = HashMap::new(); |
| 189 | for (k, v) in headers.into_iter() { |
| 190 | if let Some(name) = k { |
| 191 | h.insert(name.to_string(), v.to_str().unwrap().to_string()); |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | Metadata { inner: h } |
| 196 | } |
| 197 | |
| 198 | pub fn into_headers(&self) -> http::HeaderMap { |
| 199 | let mut header = http::HeaderMap::new(); |