Skip to main content

rune_framework/
context.rs

1//! Execution context passed to rune handlers.
2
3use std::collections::HashMap;
4
5use tokio_util::sync::CancellationToken;
6
7/// Execution context passed to every Rune handler invocation.
8#[derive(Debug, Clone)]
9pub struct RuneContext {
10    /// Name of the Rune being invoked.
11    pub rune_name: String,
12    /// Unique request ID for this invocation.
13    pub request_id: String,
14    /// Arbitrary key-value context from the caller.
15    pub context: HashMap<String, String>,
16    /// Cancellation token that fires when the request is cancelled.
17    pub cancellation: CancellationToken,
18}