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

Method result_name

crates/rust/src/interface.rs:2455–2463  ·  view source on GitHub ↗
(&self, ty: TypeId)

Source from the content-addressed store, hash-verified

2453 }
2454
2455 fn result_name(&self, ty: TypeId) -> String {
2456 let info = self.info(ty);
2457 let name = to_upper_camel_case(self.resolve.types[ty].name.as_ref().unwrap());
2458 if self.uses_two_names(&info) {
2459 format!("{name}Result")
2460 } else {
2461 name
2462 }
2463 }
2464
2465 fn uses_two_names(&self, info: &TypeInfo) -> bool {
2466 // Types are only duplicated if explicitly requested ...

Callers 2

type_pathMethod · 0.80
modes_ofMethod · 0.80

Calls 3

to_upper_camel_caseFunction · 0.85
infoMethod · 0.80
uses_two_namesMethod · 0.80

Tested by

no test coverage detected