Radix Relay
Hybrid mesh communications with Signal Protocol encryption
Loading...
Searching...
No Matches
radix_relay::concepts::transport_stream Concept Reference

Concept defining the interface for transport stream operations. More...

#include <transport_stream.hpp>

Concept definition

template<typename T>
concept radix_relay::concepts::transport_stream = requires(T &stream,
typename T::connection_params_t params,
const std::span<const std::byte> data,
const boost::asio::mutable_buffer &buffer,
std::function<void(const boost::system::error_code &, std::size_t)> handler) {
typename T::connection_params_t;
{ stream.async_connect(params, handler) } -> std::same_as<void>;
{ stream.async_write(data, handler) } -> std::same_as<void>;
{ stream.async_read(buffer, handler) } -> std::same_as<void>;
{ stream.async_close(handler) } -> std::same_as<void>;
}
Concept defining the interface for transport stream operations.

Detailed Description

Concept defining the interface for transport stream operations.

Types satisfying this concept provide async operations for byte stream connections, including connect, read, write, and close. This abstraction works for any transport mechanism (WebSocket, BLE, etc.).

Each stream type must define a connection_params_t type alias specifying the connection parameters type it requires (e.g., websocket_connection_params, ble_connection_params).

Definition at line 23 of file transport_stream.hpp.