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

Method func_params

crates/go/src/lib.rs:1408–1428  ·  view source on GitHub ↗
(
        &mut self,
        resolve: &Resolve,
        func: &Function,
        interface: Option<&WorldKey>,
        in_import: bool,
        imports: &mut BTreeSet<String>,
        has_self: bool,

Source from the content-addressed store, hash-verified

1406
1407 #[expect(clippy::too_many_arguments, reason = "required context for codegen")]
1408 fn func_params(
1409 &mut self,
1410 resolve: &Resolve,
1411 func: &Function,
1412 interface: Option<&WorldKey>,
1413 in_import: bool,
1414 imports: &mut BTreeSet<String>,
1415 has_self: bool,
1416 prefix: &str,
1417 ) -> String {
1418 func.params
1419 .iter()
1420 .skip(if has_self { 1 } else { 0 })
1421 .map(|Param { name, ty, .. }| {
1422 let name = name.to_lower_camel_case();
1423 let ty = self.type_name(resolve, *ty, interface, in_import, imports);
1424 format!("{prefix}{name} {ty}")
1425 })
1426 .collect::<Vec<_>>()
1427 .join(", ")
1428 }
1429
1430 fn func_results(
1431 &mut self,

Callers 2

importMethod · 0.80
exportMethod · 0.80

Calls 4

joinMethod · 0.80
mapMethod · 0.80
iterMethod · 0.45
type_nameMethod · 0.45

Tested by

no test coverage detected