> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fast Context Result • Rust AI Agent SDK

> FastContextResult: Result of a fast context search.

# FastContextResult

> Defined in the [**context**](../modules/context) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Result of a fast context search.

## Fields

| Name               | Type                   | Description                  |
| ------------------ | ---------------------- | ---------------------------- |
| `query`            | `String`               | Original query               |
| `files`            | `Vec&lt;FileMatch&gt;` | Matching files               |
| `search_time_ms`   | `u64`                  | Search time in milliseconds  |
| `turns_used`       | `usize`                | Number of turns used         |
| `total_tool_calls` | `usize`                | Total tool calls made        |
| `from_cache`       | `bool`                 | Whether result is from cache |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(query: impl Into<String>) -> Self
```

Create a new result.

**Parameters:**

| Name    | Type                      |
| ------- | ------------------------- |
| `query` | `impl Into&lt;String&gt;` |

### `add_file`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn add_file(&mut self, file: FileMatch) -> ()
```

Add a file match.

**Parameters:**

| Name   | Type        |
| ------ | ----------- |
| `file` | `FileMatch` |

### `total_files`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn total_files(&self) -> usize
```

Get total number of files.

### `is_empty`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn is_empty(&self) -> bool
```

Check if empty.

### `to_context_string`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn to_context_string(&self) -> String
```

Convert to context string for agent injection.

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/context/mod.rs#L631">
  `praisonai/src/context/mod.rs` at line 631
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Context Management" icon="layer-group" href="/docs/rust/context-management" />

  <Card title="Rust Token Management" icon="coins" href="/docs/rust/token-management" />
</CardGroup>
