pub trait FrontendHeartbeatExtension: Send + Sync {
// Required method
fn name(&self) -> &str;
// Provided methods
fn request_extensions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FrontendHeartbeatExtensionResult<HashMap<String, Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn response_handler(&self) -> Option<HeartbeatResponseHandlerRef> { ... }
fn connected<'life0, 'async_trait>(
&'life0 self,
_generation: u64,
) -> Pin<Box<dyn Future<Output = FrontendHeartbeatExtensionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FrontendHeartbeatExtensionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
An extension to frontend heartbeat requests, responses, and lifecycle events.
FrontendHeartbeatExtension::request_extensions is called for every heartbeat. A failed call
is isolated from the base heartbeat and from other extensions.
FrontendHeartbeatExtension::connected is called once for every successfully established
connection generation, including reconnects; implementations must therefore be idempotent.
FrontendHeartbeatExtension::shutdown is called once during task shutdown after heartbeat
I/O has stopped.
Required Methods§
Provided Methods§
Sourcefn request_extensions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FrontendHeartbeatExtensionResult<HashMap<String, Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn request_extensions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FrontendHeartbeatExtensionResult<HashMap<String, Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generates request extensions for one heartbeat.
Sourcefn response_handler(&self) -> Option<HeartbeatResponseHandlerRef>
fn response_handler(&self) -> Option<HeartbeatResponseHandlerRef>
Returns a handler to insert into the heartbeat response handler chain.
Errors and common_meta::heartbeat::handler::HandleControl::Done are isolated to this
extension so they cannot skip later extensions or mandatory OSS handlers.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".