pub enum McpAuthState {
Authenticated(AuthenticatedUser),
Anonymous,
}Expand description
Authentication state for MCP connections
Variants§
Authenticated(AuthenticatedUser)
Anonymous
Implementations§
Source§impl McpAuthState
impl McpAuthState
pub const fn is_authenticated(&self) -> bool
pub const fn is_anonymous(&self) -> bool
pub const fn user(&self) -> Option<&AuthenticatedUser>
pub fn has_permission(&self, permission: Permission) -> bool
pub fn username(&self) -> String
Trait Implementations§
Source§impl Clone for McpAuthState
impl Clone for McpAuthState
Source§fn clone(&self) -> McpAuthState
fn clone(&self) -> McpAuthState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for McpAuthState
impl Debug for McpAuthState
Source§impl<'de> Deserialize<'de> for McpAuthState
impl<'de> Deserialize<'de> for McpAuthState
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
Auto Trait Implementations§
impl Freeze for McpAuthState
impl RefUnwindSafe for McpAuthState
impl Send for McpAuthState
impl Sync for McpAuthState
impl Unpin for McpAuthState
impl UnwindSafe for McpAuthState
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