# RustAppResource

- Module: [Aspire.Hosting.Rust](/reference/api/go/aspire.hosting.rust.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Represents a Rust application resource in the distributed application model.

## Definition

```go
type RustAppResource interface {
    IComputeResource
    IContainerFilesDestinationResource
    Resource
    ResourceWithArgs
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `IComputeResource`
- `IContainerFilesDestinationResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property

## Methods

- [WithCargoArgs](/reference/api/go/aspire.hosting.rust/rustappresource/withcargoargs.md) -- `method` -- Adds command-line arguments to the cargo command used by a Rust application.
  ```go
  WithCargoArgs(args []string) RustAppResource
  ```
- [WithCargoBinTarget](/reference/api/go/aspire.hosting.rust/rustappresource/withcargobintarget.md) -- `method` -- Configures the binary target to run for Rust applications that declare more than one.
  ```go
  WithCargoBinTarget(binName string) RustAppResource
  ```
- [WithCargoExample](/reference/api/go/aspire.hosting.rust/rustappresource/withcargoexample.md) -- `method` -- Configures an example target to run instead of a binary.
  ```go
  WithCargoExample(exampleName string) RustAppResource
  ```
- [WithCargoFeatures](/reference/api/go/aspire.hosting.rust/rustappresource/withcargofeatures.md) -- `method` -- Adds cargo features for the Rust application.
  ```go
  WithCargoFeatures(features []string) RustAppResource
  ```
- [WithCargoLocked](/reference/api/go/aspire.hosting.rust/rustappresource/withcargolocked.md) -- `method` -- Configures the Rust application to build and run with the exact dependency versions recorded in `Cargo.lock`.
  ```go
  WithCargoLocked(options ...*WithCargoLockedOptions) RustAppResource
  ```
- [WithCargoManifestPath](/reference/api/go/aspire.hosting.rust/rustappresource/withcargomanifestpath.md) -- `method` -- Configures the `Cargo.toml` cargo builds from.
  ```go
  WithCargoManifestPath(manifestPath string) RustAppResource
  ```
- [WithCargoPackage](/reference/api/go/aspire.hosting.rust/rustappresource/withcargopackage.md) -- `method` -- Configures the workspace package to build and run.
  ```go
  WithCargoPackage(packageName string) RustAppResource
  ```
- [WithCargoProfile](/reference/api/go/aspire.hosting.rust/rustappresource/withcargoprofile.md) -- `method` -- Configures the named cargo profile to build with.
  ```go
  WithCargoProfile(profileName string) RustAppResource
  ```
- [WithCargoReleaseBuild](/reference/api/go/aspire.hosting.rust/rustappresource/withcargoreleasebuild.md) -- `method` -- Configures the Rust application to run using release optimization.
  ```go
  WithCargoReleaseBuild(options ...*WithCargoReleaseBuildOptions) RustAppResource
  ```
- [WithCargoTarget](/reference/api/go/aspire.hosting.rust/rustappresource/withcargotarget.md) -- `method` -- Configures the target triple cargo builds for.
  ```go
  WithCargoTarget(target string) RustAppResource
  ```
