systemprompt_identifiers/user.rs
1//! User identifier with `system` and `anonymous` constants.
2
3crate::define_id!(UserId, schema);
4
5impl UserId {
6 pub fn anonymous() -> Self {
7 Self("anonymous".to_string())
8 }
9
10 pub fn system() -> Self {
11 Self("system".to_string())
12 }
13
14 pub fn is_system(&self) -> bool {
15 self.0 == "system"
16 }
17
18 pub fn is_anonymous(&self) -> bool {
19 self.0 == "anonymous"
20 }
21}