pub struct ClientState {
pub connection_state: ConnectionState,
pub auth_contexts: HashMap<String, AuthContext>,
pub services: ServiceManager,
pub session_id: Option<String>,
pub client_id: String,
pub server_version: Option<String>,
pub last_activity: DateTime<Utc>,
}Expand description
Represents the complete client state
Fields§
§connection_state: ConnectionStateCurrent connection state
auth_contexts: HashMap<String, AuthContext>Active authentication contexts per tenant
services: ServiceManagerService manager
session_id: Option<String>Session ID
client_id: StringClient ID
server_version: Option<String>Server version
last_activity: DateTime<Utc>Last activity timestamp
Implementations§
Source§impl ClientState
impl ClientState
Sourcepub fn idle_seconds(&self) -> u64
pub fn idle_seconds(&self) -> u64
Get idle duration in seconds
Sourcepub fn add_auth_context(&mut self, tenant_id: String, context: AuthContext)
pub fn add_auth_context(&mut self, tenant_id: String, context: AuthContext)
Add authentication context
Sourcepub fn get_auth_context(&self, tenant_id: &str) -> Option<&AuthContext>
pub fn get_auth_context(&self, tenant_id: &str) -> Option<&AuthContext>
Get authentication context for a tenant
Sourcepub fn is_authenticated_to(&self, tenant_id: &str) -> bool
pub fn is_authenticated_to(&self, tenant_id: &str) -> bool
Check if authenticated to a tenant
Sourcepub fn authenticated_tenants(&self) -> Vec<&str>
pub fn authenticated_tenants(&self) -> Vec<&str>
List authenticated tenants
Sourcepub fn clear_auth(&mut self, tenant_id: &str)
pub fn clear_auth(&mut self, tenant_id: &str)
Clear authentication for a tenant
Sourcepub fn clear_all_auth(&mut self)
pub fn clear_all_auth(&mut self)
Clear all authentication
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientState
impl RefUnwindSafe for ClientState
impl Send for ClientState
impl Sync for ClientState
impl Unpin for ClientState
impl UnsafeUnpin for ClientState
impl UnwindSafe for ClientState
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