MCPcopy Index your code
hub / github.com/RustPython/RustPython / register_manual

Method register_manual

crates/vm/src/codecs.rs:235–242  ·  view source on GitHub ↗
(&self, name: &str, codec: PyCodec)

Source from the content-addressed store, hash-verified

233 }
234
235 pub(crate) fn register_manual(&self, name: &str, codec: PyCodec) -> PyResult<()> {
236 let name = normalize_encoding_name(name);
237 self.inner
238 .write()
239 .search_cache
240 .insert(name.into_owned(), codec);
241 Ok(())
242 }
243
244 pub fn lookup(&self, encoding: &str, vm: &VirtualMachine) -> PyResult<PyCodec> {
245 let encoding = normalize_encoding_name(encoding);

Callers 1

Calls 4

normalize_encoding_nameFunction · 0.85
into_ownedMethod · 0.80
insertMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected