pub struct TransportInfo {
pub transport_type: String,
pub connected: bool,
pub connected_since: Option<SystemTime>,
pub requests_sent: u64,
pub responses_received: u64,
pub notifications_sent: u64,
pub notifications_received: u64,
pub errors: u64,
pub metadata: HashMap<String, Value>,
}Expand description
Transport information and statistics.
This structure provides insight into the transport’s current state, performance characteristics, and any relevant metadata.
Fields§
§transport_type: StringType of transport (stdio, http-sse, http-stream)
connected: boolWhether the transport is currently connected
connected_since: Option<SystemTime>Connection establishment time (if connected)
requests_sent: u64Number of requests sent
responses_received: u64Number of responses received
notifications_sent: u64Number of notifications sent
notifications_received: u64Number of notifications received
errors: u64Number of errors encountered
metadata: HashMap<String, Value>Transport-specific metadata
Implementations§
Source§impl TransportInfo
impl TransportInfo
Sourcepub fn mark_connected(&mut self)
pub fn mark_connected(&mut self)
Mark the transport as connected.
Sourcepub fn mark_disconnected(&mut self)
pub fn mark_disconnected(&mut self)
Mark the transport as disconnected.
Sourcepub fn increment_requests_sent(&mut self)
pub fn increment_requests_sent(&mut self)
Increment the request counter.
Sourcepub fn increment_responses_received(&mut self)
pub fn increment_responses_received(&mut self)
Increment the response counter.
Sourcepub fn increment_notifications_sent(&mut self)
pub fn increment_notifications_sent(&mut self)
Increment the notification sent counter.
Sourcepub fn increment_notifications_received(&mut self)
pub fn increment_notifications_received(&mut self)
Increment the notification received counter.
Sourcepub fn increment_errors(&mut self)
pub fn increment_errors(&mut self)
Increment the error counter.
Sourcepub fn add_metadata(&mut self, key: impl Into<String>, value: Value)
pub fn add_metadata(&mut self, key: impl Into<String>, value: Value)
Add transport-specific metadata.
Sourcepub fn connection_duration(&self) -> Option<Duration>
pub fn connection_duration(&self) -> Option<Duration>
Get the duration since connection was established.
Trait Implementations§
Source§impl Clone for TransportInfo
impl Clone for TransportInfo
Source§fn clone(&self) -> TransportInfo
fn clone(&self) -> TransportInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more