chromium/net/base/transport_info.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_BASE_TRANSPORT_INFO_H_
#define NET_BASE_TRANSPORT_INFO_H_

#include <iosfwd>
#include <string>
#include <string_view>

#include "net/base/ip_endpoint.h"
#include "net/base/net_export.h"
#include "net/socket/next_proto.h"

namespace net {

// Specifies the type of a network transport over which a resource is loaded.
enum class TransportType {};

// Returns a string representation of the given transport type.
// The returned std::string_view is static, has no lifetime restrictions.
NET_EXPORT std::string_view TransportTypeToString(TransportType type);

// Describes a network transport.
struct NET_EXPORT TransportInfo {};

// Instances of these types are streamable for easier debugging.
NET_EXPORT std::ostream& operator<<(std::ostream& out, TransportType type);
NET_EXPORT std::ostream& operator<<(std::ostream& out,
                                    const TransportInfo& info);

}  // namespace net

#endif  // NET_BASE_TRANSPORT_INFO_H_