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

# Stream Callback • Rust AI Agent SDK

> StreamCallback: Trait for synchronous stream event callbacks.

# StreamCallback

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

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

Trait for synchronous stream event callbacks.

## Methods

### `on_event`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn on_event(&self, event: &StreamEvent) -> ()
```

Called when a stream event is emitted

**Parameters:**

| Name    | Type           |
| ------- | -------------- |
| `event` | `&StreamEvent` |

## Source

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