ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
database_status_message Struct Referencefinal

Server-initiated notification of database status. More...

#include <subscription_protocol.hpp>

Collaboration diagram for database_status_message:
Collaboration graph

Public Member Functions

std::vector< std::byte > serialize () const
 Serialize notification to bytes.
 

Static Public Member Functions

static std::expected< database_status_message, error_code > deserialize (std::span< const std::byte > data)
 Deserialize notification from bytes.
 

Public Attributes

bool available
 Whether the database is available.
 
std::string error_message
 Error message if unavailable, empty otherwise.
 
std::chrono::system_clock::time_point timestamp
 Timestamp of when the status was checked (UTC).
 

Detailed Description

Server-initiated notification of database status.

This is a push message from the server to connected clients. It informs clients about database connectivity status.

Member Function Documentation

◆ serialize()

std::vector< std::byte > serialize ( ) const

Serialize notification to bytes.

Format:

  • 1 byte: available (0 or 1)
  • 2 bytes: error_message length
  • N bytes: error_message (UTF-8)
  • 8 bytes: timestamp (milliseconds since epoch, int64_t)