# RustCargoArgsCallbackContext Properties

- Package: [Aspire.Hosting.Rust](/reference/api/csharp/aspire.hosting.rust.md)
- Type: [RustCargoArgsCallbackContext](/reference/api/csharp/aspire.hosting.rust/rustcargoargscallbackcontext.md)
- Kind: `Properties`
- Members: `3`

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

<a id="args"></a>

## Args

- Name: `Args`
- Modifiers: `get`
- Returns: `IList<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.Rust/RustCargoArgsCallbackAnnotation.cs#L61)

Gets the list of command-line arguments.

```csharp
public IList<string> Args { get; }
```

<a id="cancellationtoken"></a>

## CancellationToken

- Name: `CancellationToken`
- Modifiers: `get`
- Returns: `CancellationToken`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.Rust/RustCargoArgsCallbackAnnotation.cs#L66)

Gets the cancellation token associated with the callback context.

```csharp
public CancellationToken CancellationToken { get; }
```

<a id="resource"></a>

## Resource

- Name: `Resource`
- Modifiers: `get`
- Returns: [RustAppResource](/reference/api/csharp/aspire.hosting.rust/rustappresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.Rust/RustCargoArgsCallbackAnnotation.cs#L56)

Gets the Rust application resource whose cargo arguments are being built.

```csharp
public RustAppResource Resource { get; }
```

## Remarks

The same callbacks run for both the local `cargo run` command line and the generated Dockerfile, so a callback that needs to know which resource it is configuring -- or that needs to read annotations placed on it -- reads them from here rather than capturing the resource itself.
