# RustAppResource.WithCargoBinTarget

- 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`

Configures the binary target to run for Rust applications that declare more than one.

## Remarks

Passed to cargo as `--bin`. Debugging and publishing also use it to work out which file cargo
produces, so a package with several binaries must select one here (or set `default-run` in
Cargo.toml).

## Definition

```go
type RustAppResource interface {
    // ... omitted for brevity
    WithCargoBinTarget(binName string) RustAppResource
}
```

## Signature

```go
WithCargoBinTarget(binName string) RustAppResource
```

## Parameters

- `binName` (`string`) -- The binary target name, as declared by `[[bin]] name` in Cargo.toml.

## 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`
