pub trait HyperionHeartbeatMessage {
// Required methods
fn as_heartbeat_request(&self) -> Option<HeartbeatRequest>;
fn as_heartbeat_response(&self) -> Option<HeartbeatResponse>;
fn make_heartbeat_request(
request_id: u64,
sender_name: String,
timestamp_ms: u64,
) -> Option<Self>
where Self: Sized;
fn make_heartbeat_response(
request_id: u64,
timestamp_ms: u64,
component_alive: bool,
ms_since_last_activity: u64,
container_state_val: usize,
) -> Option<Self>
where Self: Sized;
}Expand description
Allows the container infrastructure to construct and parse heartbeat messages from the
application’s message type T without knowing what T is.
Implement this on your top-level message enum (e.g. ContainerMessage).
Required Methods§
fn as_heartbeat_request(&self) -> Option<HeartbeatRequest>
fn as_heartbeat_response(&self) -> Option<HeartbeatResponse>
fn make_heartbeat_request(
request_id: u64,
sender_name: String,
timestamp_ms: u64,
) -> Option<Self>where
Self: Sized,
fn make_heartbeat_response(
request_id: u64,
timestamp_ms: u64,
component_alive: bool,
ms_since_last_activity: u64,
container_state_val: usize,
) -> Option<Self>where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".