use std::collections::HashMap;
use tokio_util::sync::CancellationToken;
#[derive(Debug, Clone)]
pub struct RuneContext {
pub rune_name: String,
pub request_id: String,
pub context: HashMap<String, String>,
pub cancellation: CancellationToken,
}
impl RuneContext {
pub fn trace_id(&self) -> Option<&str> {
self.context.get("trace_id").map(String::as_str)
}
pub fn parent_request_id(&self) -> Option<&str> {
self.context.get("parent_request_id").map(String::as_str)
}
}