MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / push

Method push

crates/core/src/source.rs:12–21  ·  view source on GitHub ↗
(&mut self, name: &str, contents: &[u8])

Source from the content-addressed store, hash-verified

10
11impl Files {
12 pub fn push(&mut self, name: &str, contents: &[u8]) {
13 match self.files.entry(name.to_owned()) {
14 Entry::Vacant(entry) => {
15 entry.insert(contents.to_owned());
16 }
17 Entry::Occupied(ref mut entry) => {
18 entry.get_mut().extend_from_slice(contents);
19 }
20 }
21 }
22
23 pub fn get_size(&mut self, name: &str) -> Option<usize> {
24 self.files.get(name).map(|data| data.len())

Callers 15

gen_worldFunction · 0.45
mainFunction · 0.45
find_cratesFunction · 0.45
finishMethod · 0.45
includeMethod · 0.45
finish_fileMethod · 0.45
import_interfaceMethod · 0.45
finishMethod · 0.45
namespaceFunction · 0.45
func_namespace_nameMethod · 0.45

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected