MCPcopy Create free account
hub / github.com/Keats/jsonwebtoken / insert

Method insert

src/header.rs:133–140  ·  view source on GitHub ↗

Add the given (key, value) pair to the header

(&mut self, key: impl Into<String>, value: T)

Source from the content-addressed store, hash-verified

131
132 /// Add the given (key, value) pair to the header
133 pub fn insert<T>(&mut self, key: impl Into<String>, value: T)
134 where
135 T: Serialize,
136 {
137 let value =
138 serde_json::to_value(value).expect("serializing extra header value must not fail");
139 self.inner.insert(key.into(), value);
140 }
141
142 /// Get the raw extra values specified in the header
143 pub fn inner(&self) -> &BTreeMap<String, serde_json::Value> {

Callers 10

new_implMethod · 0.80
test_header_extras_hashFunction · 0.80
test_header_hashFunction · 0.80
deserialize_unknown_ktyFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 3

test_header_extras_hashFunction · 0.64
test_header_hashFunction · 0.64
deserialize_unknown_ktyFunction · 0.64