pub fn gen_heartbeat_message<'a, 'b: 'a, W: Write + 'a>(
    message: &'b HeartbeatMessage
) -> impl SerializeFn<W> + 'a