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,

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.

Implementors§

§

impl<T, F> HeartbeatHandler for T
where T: Fn(Option<Duration>) -> F + Send + Sync + 'static, F: Future<Output = Result<(), Box<dyn Error>>> + Send,