MCPcopy Index your code
hub / github.com/github/copilot-sdk / rustParamsTypeName

Function rustParamsTypeName

scripts/codegen/rust.ts:1306–1325  ·  view source on GitHub ↗
(
	method: RpcMethod,
	context: DefinitionCollections | RustCodegenCtx,
)

Source from the content-addressed store, hash-verified

1304}
1305
1306function rustParamsTypeName(
1307 method: RpcMethod,
1308 context: DefinitionCollections | RustCodegenCtx,
1309): string {
1310 const ctx = "externalTypeRefs" in context ? context : undefined;
1311 const defCollections = ctx?.definitions ?? context;
1312 const params = method.params as (JSONSchema7 & { $ref?: string }) | undefined;
1313 if (typeof params?.$ref === "string") {
1314 if (ctx) {
1315 recordExternalRustTypeRef(params.$ref, ctx);
1316 }
1317 return rustRefTypeName(params.$ref, defCollections);
1318 }
1319
1320 const resolved = params ? resolveSchema(params, defCollections) : undefined;
1321 return getRpcSchemaTypeName(
1322 resolved ?? params,
1323 `${toPascalCase(method.rpcMethod)}Params`,
1324 );
1325}
1326
1327function rustResultTypeName(method: RpcMethod, ctx: RustCodegenCtx): string {
1328 if (method.result?.$ref && parseExternalSchemaRef(method.result.$ref)) {

Callers 2

generateApiTypesCodeFunction · 0.85
getMethodParamsInfoFunction · 0.85

Calls 5

rustRefTypeNameFunction · 0.85
resolveSchemaFunction · 0.85
getRpcSchemaTypeNameFunction · 0.85
toPascalCaseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…