Skip to main content

systemprompt_identifiers/
context.rs

1//! Execution-context identifier (one per logical conversation/task tree).
2
3crate::define_id!(ContextId, generate, schema);
4
5impl ContextId {
6    pub fn system() -> Self {
7        Self("system".to_string())
8    }
9
10    pub const fn empty() -> Self {
11        Self(String::new())
12    }
13
14    pub fn is_empty(&self) -> bool {
15        self.0.is_empty()
16    }
17
18    pub fn is_system(&self) -> bool {
19        self.0 == "system"
20    }
21
22    pub fn is_anonymous(&self) -> bool {
23        self.0 == "anonymous"
24    }
25}