Building an annoying parallel resolver API for APT:
struct Query {
enum class Type {
SRV,
IP,
}
std::string name;
};
struct Result {
std::string server_name; // Hostname we SRV queried for
std::string connect_name; // Hostname SRV resolved to
std::string connect_ip; // IP of connect_name
int port;
};
class Resolver {
std::expected<void, Error> query(Query query);
std::expected<Result, Error> next();
};