pub struct FunctionPingHandler { /* private fields */ }
Expand description
Function-based ping handler
Implementations§
Source§impl FunctionPingHandler
impl FunctionPingHandler
Sourcepub fn new<F, Fut>(handler: F) -> Selfwhere
F: Fn(PingRequest, RequestContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ServerResult<PingResult>> + Send + 'static,
pub fn new<F, Fut>(handler: F) -> Selfwhere
F: Fn(PingRequest, RequestContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ServerResult<PingResult>> + Send + 'static,
Create a new function-based ping handler
Trait Implementations§
Source§impl Debug for FunctionPingHandler
impl Debug for FunctionPingHandler
Source§impl PingHandler for FunctionPingHandler
impl PingHandler for FunctionPingHandler
Source§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,
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
Source§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_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
Source§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 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
Source§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 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
Source§fn include_health_details(&self) -> bool
fn include_health_details(&self) -> bool
Check if ping should include detailed health information
Source§fn response_threshold_ms(&self) -> u64
fn response_threshold_ms(&self) -> u64
Get expected response time threshold in milliseconds
Source§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,
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
Auto Trait Implementations§
impl Freeze for FunctionPingHandler
impl !RefUnwindSafe for FunctionPingHandler
impl Send for FunctionPingHandler
impl Sync for FunctionPingHandler
impl Unpin for FunctionPingHandler
impl !UnwindSafe for FunctionPingHandler
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