pub trait HeartbeatHandler:
Send
+ Sync
+ 'static {
// Required method
fn handle_heartbeat<'life0, 'async_trait>(
&'life0 self,
latency: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A handler called on every heartbeat with the latency for that beat.
Required Methods§
Sourcefn handle_heartbeat<'life0, 'async_trait>(
&'life0 self,
latency: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_heartbeat<'life0, 'async_trait>(
&'life0 self,
latency: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle the heartbeat
A None latency implies that the timeout was reached before the
heartbeat reply was received.
If this returns an error, the heartbeat task will exit.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".