# RustAppResource.WithCargoFeatures

- Module: [Aspire.Hosting.Rust](/reference/api/go/aspire.hosting.rust.md)
- Defined on: [RustAppResource](/reference/api/go/aspire.hosting.rust/rustappresource.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`

Adds cargo features for the Rust application.

## Remarks

Repeated calls accumulate features in call order.

## Definition

```go
type RustAppResource interface {
    // ... omitted for brevity
    WithCargoFeatures(features []string) RustAppResource
}
```

## Signature

```go
WithCargoFeatures(features []string) RustAppResource
```

## Parameters

- `features` (`[]string`) -- The features to enable.

## Returns

[`RustAppResource`](/reference/api/go/aspire.hosting.rust/rustappresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [RustAppResource](/reference/api/go/aspire.hosting.rust/rustappresource.md) -- `handle`
