15#include "librats/util/rats_export.h"
17#include "librats/core/types.h"
20#include "librats/peer/peer_table.h"
31 const PeerId&
id() const noexcept {
return id_; }
44 bool send(std::string_view channel,
ByteView payload, SendOptions options = {})
const;
50 std::optional<PeerInfo>
info()
const;
55 : id_(
std::move(
id)), route_(route), node_(&node) {}
Lightweight byte container aliases and a non-owning byte view.
Non-owning view over a contiguous run of bytes.
std::optional< PeerInfo > info() const
Look up the peer's metadata in the directory (nullopt if gone).
bool send(std::string_view channel, ByteView payload, SendOptions options={}) const
Send bytes on a named application channel, to this peer over whichever connection currently serves it...
const PeerId & id() const noexcept
void disconnect() const
Request this peer be disconnected.
Self-certifying peer identity.
Addressing/metadata for a peer — the shareable, persistable identity.