# RustAppResource

- Module: [Aspire.Hosting.Rust](/reference/api/typescript/aspire.hosting.rust.md)
- Version: `13.6.0-preview.1.26478.8`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62)

Represents a Rust application resource in the distributed application model.

## Definition

```typescript
interface RustAppResource
  extends IComputeResource,
    IContainerFilesDestinationResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IResourceWithServiceDiscovery {
  withCargoArgs(args: string[]): RustAppResource;
  withCargoBinTarget(binName: string): RustAppResource;
  withCargoExample(exampleName: string): RustAppResource;
  withCargoFeatures(features: string[]): RustAppResource;
  withCargoLocked(locked?: boolean): RustAppResource;
  withCargoManifestPath(manifestPath: string): RustAppResource;
  withCargoPackage(packageName: string): RustAppResource;
  withCargoProfile(profileName: string): RustAppResource;
  withCargoReleaseBuild(releaseBuild?: boolean): RustAppResource;
  withCargoTarget(target: string): RustAppResource;
}
```

## Methods

- [withCargoArgs](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargoargs.md) -- `method` -- Adds command-line arguments to the cargo command used by a Rust application.
    ```typescript
  withCargoArgs(args: string[]): RustAppResource
  ```
- [withCargoBinTarget](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargobintarget.md) -- `method` -- Configures the binary target to run for Rust applications that declare more than one.
    ```typescript
  withCargoBinTarget(binName: string): RustAppResource
  ```
- [withCargoExample](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargoexample.md) -- `method` -- Configures an example target to run instead of a binary.
    ```typescript
  withCargoExample(exampleName: string): RustAppResource
  ```
- [withCargoFeatures](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargofeatures.md) -- `method` -- Adds cargo features for the Rust application.
    ```typescript
  withCargoFeatures(features: string[]): RustAppResource
  ```
- [withCargoLocked](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargolocked.md) -- `method` -- Configures the Rust application to build and run with the exact dependency versions recorded in `Cargo.lock`.
    ```typescript
  withCargoLocked(locked?: boolean): RustAppResource
  ```
- [withCargoManifestPath](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargomanifestpath.md) -- `method` -- Configures the `Cargo.toml` cargo builds from.
    ```typescript
  withCargoManifestPath(manifestPath: string): RustAppResource
  ```
- [withCargoPackage](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargopackage.md) -- `method` -- Configures the workspace package to build and run.
    ```typescript
  withCargoPackage(packageName: string): RustAppResource
  ```
- [withCargoProfile](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargoprofile.md) -- `method` -- Configures the named cargo profile to build with.
    ```typescript
  withCargoProfile(profileName: string): RustAppResource
  ```
- [withCargoReleaseBuild](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargoreleasebuild.md) -- `method` -- Configures the Rust application to run using release optimization.
    ```typescript
  withCargoReleaseBuild(releaseBuild?: boolean): RustAppResource
  ```
- [withCargoTarget](/reference/api/typescript/aspire.hosting.rust/rustappresource/withcargotarget.md) -- `method` -- Configures the target triple cargo builds for.
    ```typescript
  withCargoTarget(target: string): RustAppResource
  ```
