pub struct ClientSession {
pub client_id: String,
pub client_name: Option<String>,
pub connected_at: DateTime<Utc>,
pub last_activity: DateTime<Utc>,
pub request_count: usize,
pub transport_type: String,
pub authenticated: bool,
pub capabilities: Option<Value>,
pub metadata: HashMap<String, Value>,
}
Expand description
Client session information for tracking and analytics
Fields§
§client_id: String
Unique client identifier
client_name: Option<String>
Client name (optional, human-readable)
connected_at: DateTime<Utc>
When the client connected
last_activity: DateTime<Utc>
Last activity timestamp
request_count: usize
Number of requests made
transport_type: String
Transport type (stdio, http, websocket, etc.)
authenticated: bool
Authentication status
capabilities: Option<Value>
Client capabilities (optional)
metadata: HashMap<String, Value>
Additional metadata
Implementations§
Source§impl ClientSession
impl ClientSession
Sourcepub fn update_activity(&mut self)
pub fn update_activity(&mut self)
Update activity timestamp and increment request count
Sourcepub fn authenticate(&mut self, client_name: Option<String>)
pub fn authenticate(&mut self, client_name: Option<String>)
Set authentication status and client info
Sourcepub fn set_capabilities(&mut self, capabilities: Value)
pub fn set_capabilities(&mut self, capabilities: Value)
Set client capabilities
Sourcepub fn session_duration(&self) -> Duration
pub fn session_duration(&self) -> Duration
Get session duration
Trait Implementations§
Source§impl Clone for ClientSession
impl Clone for ClientSession
Source§fn clone(&self) -> ClientSession
fn clone(&self) -> ClientSession
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 ClientSession
impl Debug for ClientSession
Source§impl<'de> Deserialize<'de> for ClientSession
impl<'de> Deserialize<'de> for ClientSession
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 ClientSession
impl RefUnwindSafe for ClientSession
impl Send for ClientSession
impl Sync for ClientSession
impl Unpin for ClientSession
impl UnwindSafe for ClientSession
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