# RustAppResource.WithCargoManifestPath

- 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 `Cargo.toml` cargo builds from.

## Remarks

Passed to cargo as `--manifest-path`. Cargo otherwise discovers the manifest by searching upwards
from the app directory, which is what most apps want, so this is only needed to point at a manifest
somewhere else -- for example the crate of one workspace member when the app directory is the
workspace root.
Publishing copies the app directory into the container image and rewrites the manifest path to match,
so the manifest has to live inside the app directory and the path has to be relative to it. An absolute
path is accepted when running and rejected when publishing.

## Definition

```go
type RustAppResource interface {
    // ... omitted for brevity
    WithCargoManifestPath(manifestPath string) RustAppResource
}
```

## Signature

```go
WithCargoManifestPath(manifestPath string) RustAppResource
```

## Parameters

- `manifestPath` (`string`) -- The path to the manifest, absolute or relative to the app directory.

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