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

Function emitRustTypeAlias

scripts/codegen/rust.ts:522–544  ·  view source on GitHub ↗
(
	typeName: string,
	schema: JSONSchema7,
	aliasType: string,
	ctx: RustCodegenCtx,
	description?: string,
)

Source from the content-addressed store, hash-verified

520}
521
522function emitRustTypeAlias(
523 typeName: string,
524 schema: JSONSchema7,
525 aliasType: string,
526 ctx: RustCodegenCtx,
527 description?: string,
528): void {
529 if (ctx.generatedNames.has(typeName)) return;
530 ctx.generatedNames.add(typeName);
531
532 const lines: string[] = [];
533 pushRustDoc(lines, description || schema.description);
534 pushRustExperimentalDocs(
535 lines,
536 isSchemaExperimental(schema) || ctx.experimentalTypeNames.has(typeName),
537 );
538 if (isSchemaDeprecated(schema)) {
539 lines.push(...rustDeprecatedAttributes());
540 }
541 const aliasVis = isSchemaInternal(schema) ? "pub(crate)" : "pub";
542 lines.push(`${aliasVis} type ${typeName} = ${aliasType};`);
543 ctx.typeAliases.push(lines.join("\n"));
544}
545
546function emitRustArrayAlias(
547 typeName: string,

Callers 2

emitRustArrayAliasFunction · 0.85
emitRustMapAliasFunction · 0.85

Calls 9

pushRustDocFunction · 0.85
pushRustExperimentalDocsFunction · 0.85
isSchemaExperimentalFunction · 0.85
isSchemaDeprecatedFunction · 0.85
rustDeprecatedAttributesFunction · 0.85
isSchemaInternalFunction · 0.85
joinMethod · 0.80
addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…