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

Method print_map

crates/rust/src/interface.rs:1967–1985  ·  view source on GitHub ↗
(&mut self, key: &Type, value: &Type, mode: TypeMode)

Source from the content-addressed store, hash-verified

1965 }
1966
1967 fn print_map(&mut self, key: &Type, value: &Type, mode: TypeMode) {
1968 let key_mode = self.filter_mode(key, mode);
1969 let value_mode = self.filter_mode(value, mode);
1970 if mode.lists_borrowed {
1971 let lifetime = mode.lifetime.unwrap();
1972 self.push_str("&");
1973 if lifetime != "'_" {
1974 self.push_str(lifetime);
1975 self.push_str(" ");
1976 }
1977 }
1978 let path = self.r#gen.map_type_path();
1979 self.push_str(&path);
1980 self.push_str("::<");
1981 self.print_ty(key, key_mode);
1982 self.push_str(", ");
1983 self.print_ty(value, value_mode);
1984 self.push_str(">");
1985 }
1986
1987 fn print_generics(&mut self, lifetime: Option<&str>) {
1988 if lifetime.is_none() {

Callers 3

print_tyMethod · 0.80
type_mapMethod · 0.80
anonymous_type_mapMethod · 0.80

Calls 4

filter_modeMethod · 0.80
map_type_pathMethod · 0.80
push_strMethod · 0.45
print_tyMethod · 0.45

Tested by

no test coverage detected