pub struct PingManager { /* private fields */ }Expand description
Ping manager for connection health monitoring
Implementations§
Source§impl PingManager
impl PingManager
Sourcepub fn new(ping_interval: Duration, ping_timeout: Duration) -> PingManager
pub fn new(ping_interval: Duration, ping_timeout: Duration) -> PingManager
Create a new ping manager
Sourcepub fn with_sender(
self,
sender: Arc<dyn PingSender + Send + Sync>,
) -> PingManager
pub fn with_sender( self, sender: Arc<dyn PingSender + Send + Sync>, ) -> PingManager
Set the ping sender
Sourcepub async fn start_monitoring(&self) -> Result<(), MCPError>
pub async fn start_monitoring(&self) -> Result<(), MCPError>
Start periodic ping monitoring
Sourcepub async fn handle_ping(
&self,
request: PingRequest,
) -> Result<PingResponse, MCPError>
pub async fn handle_ping( &self, request: PingRequest, ) -> Result<PingResponse, MCPError>
Handle a ping request and return a pong response
Trait Implementations§
Source§impl Clone for PingManager
impl Clone for PingManager
Source§fn clone(&self) -> PingManager
fn clone(&self) -> PingManager
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 PingManager
impl Debug for PingManager
Source§impl Default for PingManager
impl Default for PingManager
Source§fn default() -> PingManager
fn default() -> PingManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PingManager
impl !RefUnwindSafe for PingManager
impl Send for PingManager
impl Sync for PingManager
impl Unpin for PingManager
impl !UnwindSafe for PingManager
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