MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / insert

Method insert

src/client/typing/header.rs:85–94  ·  view source on GitHub ↗
(&mut self, py: Python, key: PyBackedStr, value: PyBackedStr)

Source from the content-addressed store, hash-verified

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))]

Callers 12

test_insert_and_getFunction · 0.95
test_append_and_get_allFunction · 0.95
test_remove_and_delitemFunction · 0.95
test_len_and_keys_lenFunction · 0.95
test_clearFunction · 0.95
test_items_and_iterFunction · 0.95
test_get_with_defaultFunction · 0.95
header_map.pyFile · 0.80
newMethod · 0.80
__setitem__Method · 0.80
extract_boundMethod · 0.80
updateMethod · 0.80

Calls

no outgoing calls

Tested by 7

test_insert_and_getFunction · 0.76
test_append_and_get_allFunction · 0.76
test_remove_and_delitemFunction · 0.76
test_len_and_keys_lenFunction · 0.76
test_clearFunction · 0.76
test_items_and_iterFunction · 0.76
test_get_with_defaultFunction · 0.76