docs: add Rust client emitter documentation#10974
Conversation
Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
heaths
left a comment
There was a problem hiding this comment.
@copilot also create an http-client-rust subdirectory next to introduction.mdx with relevant files as other languages have containing installation instructions, all documented emitter options, and decorators. You can identify decorators if you search code in https://github.com/Azure/typespec-rust under the packages/typespec-rust/src directory for patterns like decorators.filter((decorator) => decorator.name === 'Azure.ClientGenerator.Core.@clientOption') for which decorators we support. Summarize what they are for.
Besides the link, the rest of the changes to introduction.mdx are fine so leave them.
Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
Created
Also added Rust to |
|
You can try these changes here
|
|
I gave it context to our guidelines (if needed - didn't see them linked), specific files in our emitter repo, Rust does have unbranded crates, but I don't think the emitter support it currently. Can you leave PR feedback next time? Makes it hard to reply to or ask of specific comments otherwise. But I'm looking at the rendered page and see no unexpected diffs from "CSharp" (honestly, why isn't this "C#" - the actual Microsoft brand name of the language?). |

Adds Rust (
@azure-tools/typespec-rust) to the client emitters introduction page and creates a dedicatedhttp-client-rustreference subdirectory, on par with the existing JS, Python, Java, and C# sections.Changes to
website/src/content/docs/docs/emitters/clients/introduction.mdxOverview — Updated intro text and emitters table to include Rust with a live npm version badge
Settings section — New
### Rust Client Emitter Settingssubsection documenting all emitter options fromlib.ts:crate-namecrate-versionomit-constructorsfalseoverwrite-cargo-tomlfalseoverwrite-lib-rsfalseemit-error-traitsfalseExample section — Full 3-step example (install →
tspconfig.yaml→ compile) parallel to the existing language examples, with version pinned to^0.41.0:Multi-emitter CLI example — Added Rust to the combined
emit+optionsblockDisclaimer — Added link to the TypeSpec Rust emitter README
package.jsonsnippet — Added@azure-tools/typespec-rust: "^0.41.0"to the dependency exampleNew:
website/src/content/docs/docs/emitters/clients/http-client-rust/reference/Three reference files parallel to the other language subdirectories:
index.mdx— Overview page withnpm installtabs (in a spec vs in a library) and links to the emitter and decorator reference pages.emitter.md— Emitter usage (CLI andtspconfig.yamlconfig) plus all documented options:emitter-output-dir,crate-name(required),crate-version(required),omit-constructors,overwrite-cargo-toml,overwrite-lib-rs,emit-error-traits, andtemp-omit-doc-links.decorators.md— Documents the decorators the Rust emitter recognizes, identified fromdecorator.namepatterns inpackages/typespec-rust/src/tcgcadapter/adapter.ts:@@clientOption(TCGC) with Rust-specific named options:omitEndpointMethod(on clients),forcePageIterator(on paging operations),deserialize_with/serialize_with(on model properties)@deserializeEmptyStringAsNull(TCGC) — on model properties; deserializes""asNone@clientName(TCGC) — on clients/operations; overrides auto-generated Rust names@encodedName,TypeSpec.Xml.@name,@attribute,@unwrapped) — affect XML serialization outputChanges to
website/src/content/current-sidebar.tscreateLibraryReferenceStructureso the new reference pages appear in the website navigation under Clients with a "preview" badge.