#include <address.h>
|
| static std::optional< Address > | parse (std::string_view text) |
| | Parse "host:port" or "[ipv6]:port".
|
| |
|
| std::string | ip |
| |
| uint16_t | port = 0 |
| |
Definition at line 26 of file address.h.
◆ Address() [1/2]
| librats::Address::Address |
( |
| ) |
|
|
default |
◆ Address() [2/2]
| librats::Address::Address |
( |
std::string |
ip, |
|
|
uint16_t |
port |
|
) |
| |
|
inline |
◆ operator!=()
| bool librats::Address::operator!= |
( |
const Address & |
o | ) |
const |
|
inline |
◆ operator==()
| bool librats::Address::operator== |
( |
const Address & |
o | ) |
const |
|
inline |
◆ parse()
| static std::optional< Address > librats::Address::parse |
( |
std::string_view |
text | ) |
|
|
inlinestatic |
Parse "host:port" or "[ipv6]:port".
Returns nullopt if the port is missing/invalid, or for a bare (unbracketed) IPv6 literal whose own colons make the port ambiguous. Exact inverse of to_string().
Definition at line 36 of file address.h.
References port.
◆ to_string()
| std::string librats::Address::to_string |
( |
| ) |
const |
|
inline |
IPv6 literals (any ip containing ':') serialise bracketed; everything else plain.
Definition at line 61 of file address.h.
References ip, and port.
◆ ip
| std::string librats::Address::ip |
◆ port
| uint16_t librats::Address::port = 0 |
The documentation for this struct was generated from the following file: