(&mut self, py: Python, key: PyBackedStr, value: PyBackedStr)
| 96 | /// Append a key-value pair to the header map. |
| 97 | #[pyo3(signature = (key, value))] |
| 98 | fn append(&mut self, py: Python, key: PyBackedStr, value: PyBackedStr) { |
| 99 | py.allow_threads(|| { |
| 100 | if let (Ok(name), Ok(value)) = ( |
| 101 | HeaderName::from_bytes(key.as_bytes()), |
| 102 | HeaderValue::from_maybe_shared(value), |
| 103 | ) { |
| 104 | self.0.append(name, value); |
| 105 | } |
| 106 | }) |
| 107 | } |
| 108 | |
| 109 | /// Remove a key-value pair from the header map. |
| 110 | #[pyo3(signature = (key))] |
no outgoing calls