# RustCargoArgsCallbackContext

- Kind: `class`
- Package: [Aspire.Hosting.Rust](/reference/api/csharp/aspire.hosting.rust.md)
- Version: `13.6.0-preview.1.26478.8`
- Namespace: `Aspire.Hosting.Rust`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.Rust/RustCargoArgsCallbackAnnotation.cs)

Represents callback context for cargo-level command-line arguments.

## Definition

```csharp
namespace Aspire.Hosting.Rust;

public sealed class RustCargoArgsCallbackContext
{
    // ...
}
```

## Remarks

Unlike program arguments, cargo arguments are plain strings rather than `Object`. They select build behaviour ( `--release`, `--features`, `--bin`) before the program starts, so there is nothing for a deferred value such as an endpoint reference to resolve against; those belong after the `--` separator and are added with `WithArgs`.

## Constructors

- [RustCargoArgsCallbackContext(RustAppResource, IList<string>, CancellationToken)](/reference/api/csharp/aspire.hosting.rust/rustcargoargscallbackcontext/constructors.md#constructor-rustappresource-ilist-string-cancellationtoken) -- Represents callback context for cargo-level command-line arguments.

## Properties

- [Args](/reference/api/csharp/aspire.hosting.rust/rustcargoargscallbackcontext/properties.md#args) : `IList<string>` `get` -- Gets the list of command-line arguments.
- [CancellationToken](/reference/api/csharp/aspire.hosting.rust/rustcargoargscallbackcontext/properties.md#cancellationtoken) : `CancellationToken` `get` -- Gets the cancellation token associated with the callback context.
- [Resource](/reference/api/csharp/aspire.hosting.rust/rustcargoargscallbackcontext/properties.md#resource) : [RustAppResource](/reference/api/csharp/aspire.hosting.rust/rustappresource.md) `get` -- Gets the Rust application resource whose cargo arguments are being built.
