MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / filter

Method filter

flow-rs/src/resource/collection.rs:41–51  ·  view source on GitHub ↗
(&self, names: &[&str])

Source from the content-addressed store, hash-verified

39
40impl ResourceCollection {
41 pub(crate) fn filter(&self, names: &[&str]) -> ResourceCollection {
42 ResourceCollection {
43 resources: names
44 .iter()
45 .map(|&name| self.resources.get_key_value(name))
46 .flatten()
47 .map(|(k, v)| (k.clone(), *v))
48 .collect(),
49 storage: self.storage.clone(),
50 }
51 }
52 // Chain two ResourceCollections, and `other` will overwrite `self`
53 pub(crate) async fn chain(self, mut other: UniqueResourceCollection) -> ResourceCollection {
54 let other_storage = other.storage.get_mut();

Callers 11

scan_all_placeholderFunction · 0.80
diffFunction · 0.80
extract_portsFunction · 0.80
parser_expandFunction · 0.80
loadMethod · 0.80
startMethod · 0.80
dump_dotFunction · 0.80
translate_connFunction · 0.80
global_res_implFunction · 0.80
newMethod · 0.80

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected