// services/webnn/public/mojom/webnn_service_introspection.mojom.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef SERVICES_WEBNN_PUBLIC_MOJOM_WEBNN_SERVICE_INTROSPECTION_MOJOM_H_
#define SERVICES_WEBNN_PUBLIC_MOJOM_WEBNN_SERVICE_INTROSPECTION_MOJOM_H_

#include <stdint.h>

#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "services/webnn/public/mojom/webnn_service_introspection.mojom-features.h"  // IWYU pragma: export
#include "services/webnn/public/mojom/webnn_service_introspection.mojom-shared.h"  // IWYU pragma: export
#include "services/webnn/public/mojom/webnn_service_introspection.mojom-forward.h"  // IWYU pragma: export
#include <string>
#include <vector>

#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"


#include "base/component_export.h"




namespace webnn::mojom {

class WebNNServiceIntrospectionClientProxy;

template <typename ImplRefTraits>
class WebNNServiceIntrospectionClientStub;

class WebNNServiceIntrospectionClientRequestValidator;


class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionClient
    : public WebNNServiceIntrospectionClientInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "webnn.mojom.WebNNServiceIntrospectionClient";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = WebNNServiceIntrospectionClientInterfaceBase;
  using Proxy_ = WebNNServiceIntrospectionClientProxy;

  template <typename ImplRefTraits>
  using Stub_ = WebNNServiceIntrospectionClientStub<ImplRefTraits>;

  using RequestValidator_ = WebNNServiceIntrospectionClientRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
    kOnUpdateExistingContextDetailsMinVersion = 0,
    kOnUpdateAvailableExecutionProvidersDetailsMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct OnUpdateExistingContextDetails_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct OnUpdateAvailableExecutionProvidersDetails_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~WebNNServiceIntrospectionClient() = default;

  virtual void OnUpdateExistingContextDetails(std::vector<WebNNContextIntrospectionDetailsPtr> contexts_details) = 0;

  virtual void OnUpdateAvailableExecutionProvidersDetails(std::vector<WebNNExecutionProviderDetailsPtr> available_execution_providers) = 0;
};

class WebNNServiceIntrospectionProxy;

template <typename ImplRefTraits>
class WebNNServiceIntrospectionStub;

class WebNNServiceIntrospectionRequestValidator;
class WebNNServiceIntrospectionResponseValidator;


class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospection
    : public WebNNServiceIntrospectionInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "webnn.mojom.WebNNServiceIntrospection";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = WebNNServiceIntrospectionInterfaceBase;
  using Proxy_ = WebNNServiceIntrospectionProxy;

  template <typename ImplRefTraits>
  using Stub_ = WebNNServiceIntrospectionStub<ImplRefTraits>;

  using RequestValidator_ = WebNNServiceIntrospectionRequestValidator;
  using ResponseValidator_ = WebNNServiceIntrospectionResponseValidator;
  enum MethodMinVersions : uint32_t {
    kSetClientMinVersion = 0,
    kGetExistingContextsDetailsMinVersion = 0,
    kGetAvailableExecutionProvidersDetailsMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct SetClient_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct GetExistingContextsDetails_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct GetAvailableExecutionProvidersDetails_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~WebNNServiceIntrospection() = default;

  virtual void SetClient(::mojo::PendingRemote<WebNNServiceIntrospectionClient> client) = 0;

  using GetExistingContextsDetailsCallback = base::OnceCallback<void(std::vector<WebNNContextIntrospectionDetailsPtr>)>;
  using GetExistingContextsDetailsMojoCallback = base::OnceCallback<void(std::vector<WebNNContextIntrospectionDetailsPtr>)>;

  virtual void GetExistingContextsDetails(GetExistingContextsDetailsCallback callback) = 0;

  using GetAvailableExecutionProvidersDetailsCallback = base::OnceCallback<void(std::vector<WebNNExecutionProviderDetailsPtr>)>;
  using GetAvailableExecutionProvidersDetailsMojoCallback = base::OnceCallback<void(std::vector<WebNNExecutionProviderDetailsPtr>)>;

  virtual void GetAvailableExecutionProvidersDetails(GetAvailableExecutionProvidersDetailsCallback callback) = 0;
};



class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionClientProxy
    : public WebNNServiceIntrospectionClient {
 public:
  using InterfaceType = WebNNServiceIntrospectionClient;

  explicit WebNNServiceIntrospectionClientProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void OnUpdateExistingContextDetails(std::vector<WebNNContextIntrospectionDetailsPtr> contexts_details) final;
  
  void OnUpdateAvailableExecutionProvidersDetails(std::vector<WebNNExecutionProviderDetailsPtr> available_execution_providers) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionProxy
    : public WebNNServiceIntrospection {
 public:
  using InterfaceType = WebNNServiceIntrospection;

  explicit WebNNServiceIntrospectionProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void SetClient(::mojo::PendingRemote<WebNNServiceIntrospectionClient> client) final;
  
  void GetExistingContextsDetails(GetExistingContextsDetailsCallback callback) final;
  
  void GetAvailableExecutionProvidersDetails(GetAvailableExecutionProvidersDetailsCallback callback) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};
class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionClientStubDispatch {
 public:
  static bool Accept(WebNNServiceIntrospectionClient* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      WebNNServiceIntrospectionClient* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<WebNNServiceIntrospectionClient>>
class WebNNServiceIntrospectionClientStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  WebNNServiceIntrospectionClientStub() = default;
  ~WebNNServiceIntrospectionClientStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return WebNNServiceIntrospectionClientStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return WebNNServiceIntrospectionClientStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionStubDispatch {
 public:
  static bool Accept(WebNNServiceIntrospection* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      WebNNServiceIntrospection* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<WebNNServiceIntrospection>>
class WebNNServiceIntrospectionStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  WebNNServiceIntrospectionStub() = default;
  ~WebNNServiceIntrospectionStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return WebNNServiceIntrospectionStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return WebNNServiceIntrospectionStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionClientRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNServiceIntrospectionResponseValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};









class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNExecutionProviderDetails {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<WebNNExecutionProviderDetails, T>::value>;
  using DataView = WebNNExecutionProviderDetailsDataView;
  using Data_ = internal::WebNNExecutionProviderDetails_Data;

  template <typename... Args>
  static WebNNExecutionProviderDetailsPtr New(Args&&... args) {
    return WebNNExecutionProviderDetailsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static WebNNExecutionProviderDetailsPtr From(const U& u) {
    return mojo::TypeConverter<WebNNExecutionProviderDetailsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, WebNNExecutionProviderDetails>::Convert(*this);
  }


  WebNNExecutionProviderDetails();

  WebNNExecutionProviderDetails(
      const std::string& name,
      const std::string& vendor,
      const std::string& hardware_type,
      const std::string& vendor_id,
      const std::string& device_id,
      const std::string& version,
      bool first_selected);


  ~WebNNExecutionProviderDetails();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = WebNNExecutionProviderDetailsPtr>
  WebNNExecutionProviderDetailsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }
  size_t Hash(size_t seed) const;

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        WebNNExecutionProviderDetails::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        WebNNExecutionProviderDetails::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        WebNNExecutionProviderDetails::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::WebNNExecutionProviderDetails_UnserializedMessageContext<
            UserType, WebNNExecutionProviderDetails::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<WebNNExecutionProviderDetails::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return WebNNExecutionProviderDetails::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::WebNNExecutionProviderDetails_UnserializedMessageContext<
            UserType, WebNNExecutionProviderDetails::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<WebNNExecutionProviderDetails::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string name;
  
  std::string vendor;
  
  std::string hardware_type;
  
  std::string vendor_id;
  
  std::string device_id;
  
  std::string version;
  
  bool first_selected;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) WebNNContextIntrospectionDetails {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<WebNNContextIntrospectionDetails, T>::value>;
  using DataView = WebNNContextIntrospectionDetailsDataView;
  using Data_ = internal::WebNNContextIntrospectionDetails_Data;

  template <typename... Args>
  static WebNNContextIntrospectionDetailsPtr New(Args&&... args) {
    return WebNNContextIntrospectionDetailsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static WebNNContextIntrospectionDetailsPtr From(const U& u) {
    return mojo::TypeConverter<WebNNContextIntrospectionDetailsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, WebNNContextIntrospectionDetails>::Convert(*this);
  }


  WebNNContextIntrospectionDetails();

  WebNNContextIntrospectionDetails(
      int32_t context_id,
      const std::string& context_backend,
      std::vector<WebNNExecutionProviderDetailsPtr> execution_providers);

WebNNContextIntrospectionDetails(const WebNNContextIntrospectionDetails&) = delete;
WebNNContextIntrospectionDetails& operator=(const WebNNContextIntrospectionDetails&) = delete;

  ~WebNNContextIntrospectionDetails();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = WebNNContextIntrospectionDetailsPtr>
  WebNNContextIntrospectionDetailsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        WebNNContextIntrospectionDetails::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        WebNNContextIntrospectionDetails::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        WebNNContextIntrospectionDetails::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::WebNNContextIntrospectionDetails_UnserializedMessageContext<
            UserType, WebNNContextIntrospectionDetails::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<WebNNContextIntrospectionDetails::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return WebNNContextIntrospectionDetails::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::WebNNContextIntrospectionDetails_UnserializedMessageContext<
            UserType, WebNNContextIntrospectionDetails::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<WebNNContextIntrospectionDetails::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  int32_t context_id;
  
  std::string context_backend;
  
  std::vector<WebNNExecutionProviderDetailsPtr> execution_providers;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}

template <typename StructPtrType>
WebNNExecutionProviderDetailsPtr WebNNExecutionProviderDetails::Clone() const {
  return New(
      mojo::Clone(name),
      mojo::Clone(vendor),
      mojo::Clone(hardware_type),
      mojo::Clone(vendor_id),
      mojo::Clone(device_id),
      mojo::Clone(version),
      mojo::Clone(first_selected)
  );
}

template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>*>
bool WebNNExecutionProviderDetails::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->name, other_struct.name))
    return false;
  if (!mojo::Equals(this->vendor, other_struct.vendor))
    return false;
  if (!mojo::Equals(this->hardware_type, other_struct.hardware_type))
    return false;
  if (!mojo::Equals(this->vendor_id, other_struct.vendor_id))
    return false;
  if (!mojo::Equals(this->device_id, other_struct.device_id))
    return false;
  if (!mojo::Equals(this->version, other_struct.version))
    return false;
  if (!mojo::Equals(this->first_selected, other_struct.first_selected))
    return false;
  return true;
}

template <typename T, WebNNExecutionProviderDetails::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.name < rhs.name)
    return true;
  if (rhs.name < lhs.name)
    return false;
  if (lhs.vendor < rhs.vendor)
    return true;
  if (rhs.vendor < lhs.vendor)
    return false;
  if (lhs.hardware_type < rhs.hardware_type)
    return true;
  if (rhs.hardware_type < lhs.hardware_type)
    return false;
  if (lhs.vendor_id < rhs.vendor_id)
    return true;
  if (rhs.vendor_id < lhs.vendor_id)
    return false;
  if (lhs.device_id < rhs.device_id)
    return true;
  if (rhs.device_id < lhs.device_id)
    return false;
  if (lhs.version < rhs.version)
    return true;
  if (rhs.version < lhs.version)
    return false;
  if (lhs.first_selected < rhs.first_selected)
    return true;
  if (rhs.first_selected < lhs.first_selected)
    return false;
  return false;
}
template <typename StructPtrType>
WebNNContextIntrospectionDetailsPtr WebNNContextIntrospectionDetails::Clone() const {
  return New(
      mojo::Clone(context_id),
      mojo::Clone(context_backend),
      mojo::Clone(execution_providers)
  );
}

template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>*>
bool WebNNContextIntrospectionDetails::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->context_id, other_struct.context_id))
    return false;
  if (!mojo::Equals(this->context_backend, other_struct.context_backend))
    return false;
  if (!mojo::Equals(this->execution_providers, other_struct.execution_providers))
    return false;
  return true;
}

template <typename T, WebNNContextIntrospectionDetails::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.context_id < rhs.context_id)
    return true;
  if (rhs.context_id < lhs.context_id)
    return false;
  if (lhs.context_backend < rhs.context_backend)
    return true;
  if (rhs.context_backend < lhs.context_backend)
    return false;
  if (lhs.execution_providers < rhs.execution_providers)
    return true;
  if (rhs.execution_providers < lhs.execution_providers)
    return false;
  return false;
}


}  // webnn::mojom

namespace mojo {


template <>
struct COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) StructTraits<::webnn::mojom::WebNNExecutionProviderDetails::DataView,
                                         ::webnn::mojom::WebNNExecutionProviderDetailsPtr> {
  static bool IsNull(const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) { return !input; }
  static void SetToNull(::webnn::mojom::WebNNExecutionProviderDetailsPtr* output) { output->reset(); }

  static const decltype(::webnn::mojom::WebNNExecutionProviderDetails::name)& name(
      const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) {
    return input->name;
  }

  static const decltype(::webnn::mojom::WebNNExecutionProviderDetails::vendor)& vendor(
      const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) {
    return input->vendor;
  }

  static const decltype(::webnn::mojom::WebNNExecutionProviderDetails::hardware_type)& hardware_type(
      const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) {
    return input->hardware_type;
  }

  static const decltype(::webnn::mojom::WebNNExecutionProviderDetails::vendor_id)& vendor_id(
      const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) {
    return input->vendor_id;
  }

  static const decltype(::webnn::mojom::WebNNExecutionProviderDetails::device_id)& device_id(
      const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) {
    return input->device_id;
  }

  static const decltype(::webnn::mojom::WebNNExecutionProviderDetails::version)& version(
      const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) {
    return input->version;
  }

  static decltype(::webnn::mojom::WebNNExecutionProviderDetails::first_selected) first_selected(
      const ::webnn::mojom::WebNNExecutionProviderDetailsPtr& input) {
    return input->first_selected;
  }

  static bool Read(::webnn::mojom::WebNNExecutionProviderDetails::DataView input, ::webnn::mojom::WebNNExecutionProviderDetailsPtr* output);
};


template <>
struct COMPONENT_EXPORT(WEBNN_MOJOM_WEBNN_SERVICE_INTROSPECTION) StructTraits<::webnn::mojom::WebNNContextIntrospectionDetails::DataView,
                                         ::webnn::mojom::WebNNContextIntrospectionDetailsPtr> {
  static bool IsNull(const ::webnn::mojom::WebNNContextIntrospectionDetailsPtr& input) { return !input; }
  static void SetToNull(::webnn::mojom::WebNNContextIntrospectionDetailsPtr* output) { output->reset(); }

  static decltype(::webnn::mojom::WebNNContextIntrospectionDetails::context_id) context_id(
      const ::webnn::mojom::WebNNContextIntrospectionDetailsPtr& input) {
    return input->context_id;
  }

  static const decltype(::webnn::mojom::WebNNContextIntrospectionDetails::context_backend)& context_backend(
      const ::webnn::mojom::WebNNContextIntrospectionDetailsPtr& input) {
    return input->context_backend;
  }

  static const decltype(::webnn::mojom::WebNNContextIntrospectionDetails::execution_providers)& execution_providers(
      const ::webnn::mojom::WebNNContextIntrospectionDetailsPtr& input) {
    return input->execution_providers;
  }

  static bool Read(::webnn::mojom::WebNNContextIntrospectionDetails::DataView input, ::webnn::mojom::WebNNContextIntrospectionDetailsPtr* output);
};

}  // namespace mojo

#endif  // SERVICES_WEBNN_PUBLIC_MOJOM_WEBNN_SERVICE_INTROSPECTION_MOJOM_H_