Skip to main content

systemprompt_identifiers/
user.rs

1//! User identifier.
2
3crate::define_id!(UserId, schema);
4
5impl UserId {
6    pub fn anonymous() -> Self {
7        Self("anonymous".to_owned())
8    }
9
10    pub fn system() -> Self {
11        Self("system".to_owned())
12    }
13
14    pub fn bootstrap(value: &'static str) -> Self {
15        Self(value.to_owned())
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}