MCPcopy Create free account
hub / github.com/arcjet/gravity / analyze_interface_method

Method analyze_interface_method

cmd/gravity/src/codegen/imports.rs:117–140  ·  view source on GitHub ↗
(&self, func: &Function, _interface_name: &str)

Source from the content-addressed store, hash-verified

115 }
116
117 fn analyze_interface_method(&self, func: &Function, _interface_name: &str) -> InterfaceMethod {
118 let parameters = func
119 .params
120 .iter()
121 .map(|Param { name, ty, .. }| Parameter {
122 name: GoIdentifier::private(name),
123 go_type: resolve_param_type(ty, self.resolve),
124 wit_type: *ty,
125 })
126 .collect();
127
128 let return_type = func.result.as_ref().map(|wit_type| WitReturn {
129 go_type: resolve_type(wit_type, self.resolve),
130 wit_type: *wit_type,
131 });
132
133 InterfaceMethod {
134 name: func.name.clone(),
135 go_method_name: GoIdentifier::public(&func.name),
136 parameters,
137 return_type,
138 wit_function: func.clone(),
139 }
140 }
141
142 fn analyze_type(&self, type_id: TypeId) -> Option<AnalyzedType> {
143 let type_def = &self.resolve.types[type_id];

Callers 1

analyze_interfaceMethod · 0.80

Calls 2

resolve_param_typeFunction · 0.85
resolve_typeFunction · 0.85

Tested by

no test coverage detected