pub trait PingHandler: Send + Sync {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
request: PingRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<PingResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn get_health_status<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_connection_metrics<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn handle_timeout<'life0, 'life1, 'async_trait>(
&'life0 self,
_request_id: &'life1 str,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn include_health_details(&self) -> bool { ... }
fn response_threshold_ms(&self) -> u64 { ... }
fn process_ping_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: Option<&'life1 Value>,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
Ping handler trait for bidirectional health monitoring
Required Methods§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
request: PingRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<PingResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request: PingRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<PingResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a ping request
Provided Methods§
Sourcefn get_health_status<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_health_status<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current health status
Sourcefn get_connection_metrics<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_connection_metrics<'life0, 'async_trait>(
&'life0 self,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get connection metrics if available
Sourcefn handle_timeout<'life0, 'life1, 'async_trait>(
&'life0 self,
_request_id: &'life1 str,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_timeout<'life0, 'life1, 'async_trait>(
&'life0 self,
_request_id: &'life1 str,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle ping timeout
Sourcefn include_health_details(&self) -> bool
fn include_health_details(&self) -> bool
Check if ping should include detailed health information
Sourcefn response_threshold_ms(&self) -> u64
fn response_threshold_ms(&self) -> u64
Get expected response time threshold in milliseconds
Sourcefn process_ping_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: Option<&'life1 Value>,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_ping_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: Option<&'life1 Value>,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process custom ping payload