(&mut self, py: Python, key: PyBackedStr, value: PyBackedStr)
| 83 | /// Insert a key-value pair into the header map. |
| 84 | #[pyo3(signature = (key, value))] |
| 85 | fn insert(&mut self, py: Python, key: PyBackedStr, value: PyBackedStr) { |
| 86 | py.allow_threads(|| { |
| 87 | if let (Ok(name), Ok(value)) = ( |
| 88 | HeaderName::from_bytes(key.as_bytes()), |
| 89 | HeaderValue::from_maybe_shared(value), |
| 90 | ) { |
| 91 | self.0.insert(name, value); |
| 92 | } |
| 93 | }) |
| 94 | } |
| 95 | |
| 96 | /// Append a key-value pair to the header map. |
| 97 | #[pyo3(signature = (key, value))] |
no outgoing calls