Trait ngrok::session::HeartbeatHandler
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 Error>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
A handler called on every heartbeat with the latency for that beat.
Required Methods§
fn handle_heartbeat<'life0, 'async_trait>(
&'life0 self,
latency: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_heartbeat<'life0, 'async_trait>(
&'life0 self,
latency: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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.