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

Function write_lib

crates/compiler-core/src/frozen.rs:117–125  ·  view source on GitHub ↗
(
    buf: &mut Vec<u8>,
    lib: impl ExactSizeIterator<Item = (&'a str, FrozenModule<B>)>,
)

Source from the content-addressed store, hash-verified

115}
116
117fn write_lib<'a, B: AsRef<[u8]>>(
118 buf: &mut Vec<u8>,
119 lib: impl ExactSizeIterator<Item = (&'a str, FrozenModule<B>)>,
120) {
121 marshal::write_len(buf, lib.len());
122 for (name, module) in lib {
123 write_entry(buf, name, module);
124 }
125}
126
127fn write_entry(buf: &mut Vec<u8>, name: &str, module: FrozenModule<impl AsRef<[u8]>>) {
128 marshal::write_vec(buf, name.as_bytes());

Callers 1

encodeMethod · 0.85

Calls 3

write_lenFunction · 0.85
write_entryFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected