Rust quickstart

View as Markdown

Generate a Rust SDK by following the instructions on this page.

This page assumes that you have:

Pass fern check

Run fern check to ensure that your API definition is valid. If there are any errors, fix them before proceeding.

If you’re using an OpenAPI Specification, check out all of our supported extensions.

4

Add the SDK generator

Run the following command to add the Rust SDK generator to generators.yml:

$fern add fern-rust-sdk --group rust-sdk

rust-sdk is the name of the generators.yml group that configures your Rust SDK’s output location and other metadata. You can customize this group name to differentiate between multiple SDKs across different languages (e.g., python-sdk, etc) in your organization.

This command adds the following group to generators.yml:

generators.yml
1 rust-sdk: # group name
2 generators:
3 - name: fernapi/fern-rust-sdk
4 version: 0.13.3
5 output:
6 location: local-file-system
7 path: ../sdks/rust
5

Generate the SDK

Run the following command to generate your SDK:

$fern generate --group rust-sdk

This creates a sdks folder in your current directory. The resulting folder structure looks like this:

fern# created by fern init
sdks# created by fern generate --group rust-sdk
rust
Cargo.toml
README.md
reference.md
rustfmt.toml
src