pub enum UserType {
Admin,
User,
A2a,
Mcp,
Service,
Anon,
Unknown,
}Variants§
Implementations§
Source§impl UserType
impl UserType
Sourcepub fn from_permissions(permissions: &[Permission]) -> Self
pub fn from_permissions(permissions: &[Permission]) -> Self
Derives the caller type from a permission set, the single source of
truth for the permission → type mapping. The precedence is
privilege-descending (Admin wins over User, etc.); the hook scopes
resolve to Service so a hook principal is never silently downgraded
to Anon.
pub const fn as_str(&self) -> &'static str
pub const fn rate_tier(&self) -> RateLimitTier
pub const fn reconcile_with(self, user_is_admin: bool) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UserType
impl<'de> Deserialize<'de> for UserType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for UserType
impl Eq for UserType
impl StructuralPartialEq for UserType
Auto Trait Implementations§
impl Freeze for UserType
impl RefUnwindSafe for UserType
impl Send for UserType
impl Sync for UserType
impl Unpin for UserType
impl UnsafeUnpin for UserType
impl UnwindSafe for UserType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.