blob: e638e40436fed28861ee8420f670f0cae0fa805c [file] [log] [blame] [edit]
// WARNING: This file is machine generated by fidlgen.
#include <fidl/test/protocols/llcpp/fidl.h>
#include <memory>
#ifdef __Fuchsia__
void ::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResponse::
_CloseHandles() {
h.reset();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
void ::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult::
SizeAndOffsetAssertionHelper() {
static_assert(sizeof(WithErrorSyntaxHandleInResultResult) ==
sizeof(fidl_xunion_t));
static_assert(offsetof(WithErrorSyntaxHandleInResultResult, ordinal_) ==
offsetof(fidl_xunion_t, tag));
static_assert(offsetof(WithErrorSyntaxHandleInResultResult, envelope_) ==
offsetof(fidl_xunion_t, envelope));
}
void ::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult::
_CloseHandles() {
switch (ordinal_) {
case ::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult::
Ordinal::kResponse: {
mutable_response()._CloseHandles();
break;
}
default:
break;
}
}
#endif // __Fuchsia__
namespace fidl_test_protocols {
[[maybe_unused]] constexpr uint64_t
kHandleRightsProtocol_NoResponseMethod_Ordinal = 5073990954122988412lu;
extern "C" const fidl_type_t
fidl_test_protocols_HandleRightsProtocolNoResponseMethodRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_HandleRightsProtocolNoResponseMethodResponseTable;
[[maybe_unused]] constexpr uint64_t
kHandleRightsProtocol_ResponseMethod_Ordinal = 6841738779450413052lu;
extern "C" const fidl_type_t
fidl_test_protocols_HandleRightsProtocolResponseMethodRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_HandleRightsProtocolResponseMethodResponseTable;
[[maybe_unused]] constexpr uint64_t kHandleRightsProtocol_AnEvent_Ordinal =
929632006073412977lu;
extern "C" const fidl_type_t
fidl_test_protocols_HandleRightsProtocolAnEventRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_HandleRightsProtocolAnEventEventTable;
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<
::fidl_test_protocols::HandleRightsProtocol::NoResponseMethod>::
WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>
_client,
::zx::socket&& h) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::NoResponseMethod>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<
::fidl_test_protocols::HandleRightsProtocol::NoResponseMethod>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::zx::socket&& h) {
::fidl::UnownedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::NoResponseMethod>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>::
WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>
_client,
::zx::socket&& h) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>::
WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>
_client,
::zx::socket&& h, zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::zx::socket&& h, uint8_t* _response_bytes,
uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::UnownedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
} // namespace fidl_test_protocols
#ifdef __Fuchsia__
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::HandleRightsProtocol>::
NoResponseMethod(::zx::socket&& h) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireResult<
::fidl_test_protocols::HandleRightsProtocol::NoResponseMethod>(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>(
_channel->handle()),
std::move(h));
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::HandleRightsProtocol>::
NoResponseMethod(::fidl::BufferSpan _request_buffer, ::zx::socket&& h) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireUnownedResult<
::fidl_test_protocols::HandleRightsProtocol::NoResponseMethod>(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, std::move(h));
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>
fidl::internal::WireClientImpl<::fidl_test_protocols::HandleRightsProtocol>::
ResponseMethod_Sync(::zx::socket&& h) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>(
_channel->handle()),
std::move(h));
}
return ::fidl::WireResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>
fidl::internal::WireClientImpl<::fidl_test_protocols::HandleRightsProtocol>::
ResponseMethod_Sync(::fidl::BufferSpan _request_buffer, ::zx::socket&& h,
::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, std::move(h),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kHandleRightsProtocol_ResponseMethod_Ordinal) {
}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::HandleRightsProtocol>::ResponseMethod(
::zx::socket&& h,
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod> {
public:
ResponseContext(
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>*
response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid(), std::move(h));
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::HandleRightsProtocol>::ResponseMethod(
::fidl::BufferSpan _request_buffer, ::zx::socket&& h,
::fidl::WireResponseContext<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>*
_context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>::
UnownedEncodedMessage _request(_request_buffer.data,
_request_buffer.capacity, _context->Txid(),
std::move(h));
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
std::optional<::fidl::UnbindInfo> fidl::internal::
WireClientImpl<::fidl_test_protocols::HandleRightsProtocol>::DispatchEvent(
fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler) {
auto* event_handler = static_cast<::fidl::WireAsyncEventHandler<
::fidl_test_protocols::HandleRightsProtocol>*>(maybe_event_handler);
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::kHandleRightsProtocol_AnEvent_Ordinal: {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::AnEvent>>
decoded{std::move(msg)};
if (!decoded.ok()) {
return ::fidl::UnbindInfo{decoded};
}
if (event_handler) {
event_handler->AnEvent(decoded.PrimaryObject());
}
return std::nullopt;
}
default:
break;
}
return ::fidl::UnbindInfo::UnknownOrdinal();
}
#endif // __Fuchsia__
::fidl::Result
fidl::WireSyncEventHandler<::fidl_test_protocols::HandleRightsProtocol>::
HandleOneEvent(
::fidl::UnownedClientEnd<::fidl_test_protocols::HandleRightsProtocol>
client_end) {
zx_status_t status = client_end.channel()->wait_one(
ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ::zx::time::infinite(),
nullptr);
if (status != ZX_OK) {
return ::fidl::Result::TransportError(
status, ::fidl::internal::kErrorWaitOneFailed);
}
constexpr uint32_t kHandleAllocSize = ([]() constexpr {
uint32_t x = 0;
if (::fidl::WireResponse<::fidl_test_protocols::HandleRightsProtocol::
AnEvent>::MaxNumHandles >= x) {
x = ::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::AnEvent>::MaxNumHandles;
}
if (x > ZX_CHANNEL_MAX_MSG_HANDLES) {
x = ZX_CHANNEL_MAX_MSG_HANDLES;
}
return x;
})();
static_assert(kHandleAllocSize <= ZX_CHANNEL_MAX_MSG_HANDLES);
::fidl::internal::InlineMessageBuffer<24> read_storage;
std::array<zx_handle_info_t, kHandleAllocSize> read_handles;
::fidl::IncomingMessage msg =
fidl::ChannelReadEtc(client_end.handle(), ZX_CHANNEL_READ_MAY_DISCARD,
read_storage.view(), cpp20::span(read_handles));
if (msg.status() == ZX_ERR_BUFFER_TOO_SMALL) {
// Message size is unexpectedly larger than calculated.
// This can only be due to a newer version of the protocol defining a new
// event, whose size exceeds the maximum of known events in the current
// protocol.
return ::fidl::Result::UnexpectedMessage(Unknown());
}
if (!msg.ok()) {
return msg;
}
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::kHandleRightsProtocol_AnEvent_Ordinal: {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::AnEvent>>
decoded{::std::move(msg)};
if (!decoded.ok()) {
return ::fidl::Result(decoded);
}
AnEvent(decoded.PrimaryObject());
return ::fidl::Result::Ok();
}
default: {
return ::fidl::Result::UnexpectedMessage(Unknown());
}
}
}
#ifdef __Fuchsia__
::fidl::DispatchResult fidl::internal::WireServerDispatcher<
::fidl_test_protocols::HandleRightsProtocol>::
TryDispatch(
::fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn) {
static const ::fidl::internal::MethodEntry entries[] = {
{
::fidl_test_protocols::kHandleRightsProtocol_NoResponseMethod_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::NoResponseMethod>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>::
NoResponseMethodCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::HandleRightsProtocol>*>(interface)
->NoResponseMethod(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kHandleRightsProtocol_ResponseMethod_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>::
ResponseMethodCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::HandleRightsProtocol>*>(interface)
->ResponseMethod(primary, completer);
return ZX_OK;
},
},
};
return ::fidl::internal::TryDispatch(
impl, msg, txn, entries,
entries + sizeof(entries) / sizeof(::fidl::internal::MethodEntry));
}
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::HandleRightsProtocol>::Dispatch(
::fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn);
if (unlikely(dispatch_result == ::fidl::DispatchResult::kNotFound)) {
std::move(msg).CloseHandles();
txn->InternalError(::fidl::UnbindInfo::UnknownOrdinal());
}
return dispatch_result;
}
::fidl::DispatchResult
fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>::dispatch_message(
fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
return ::fidl::internal::WireServerDispatcher<
::fidl_test_protocols::HandleRightsProtocol>::Dispatch(this,
std::move(msg),
txn);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>::
ResponseMethodCompleterBase::Reply(::zx::socket&& h) {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>>
_response{::fidl::internal::AllowUnownedInputRef{}, std::move(h)};
return ::fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>::
ResponseMethodCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::HandleRightsProtocol>::
ResponseMethodCompleterBase::Reply(::fidl::BufferSpan _buffer,
::zx::socket&& h) {
::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::ResponseMethod>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity,
std::move(h));
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::HandleRightsProtocol::
NoResponseMethod>::_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kHandleRightsProtocol_NoResponseMethod_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::HandleRightsProtocol::
NoResponseMethod>::_CloseHandles() {
h.reset();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>::_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kHandleRightsProtocol_ResponseMethod_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>::_CloseHandles() {
h.reset();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
void ::fidl::WireResponse<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::kHandleRightsProtocol_ResponseMethod_Ordinal);
}
void ::fidl::WireResponse<::fidl_test_protocols::HandleRightsProtocol::
ResponseMethod>::_CloseHandles() {
h.reset();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
void ::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::AnEvent>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0, ::fidl_test_protocols::kHandleRightsProtocol_AnEvent_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::AnEvent>::_CloseHandles() {
h.reset();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
zx_status_t
fidl::WireEventSender<::fidl_test_protocols::HandleRightsProtocol>::AnEvent(
::zx::socket&& h) const {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::AnEvent>>
_response{::fidl::internal::AllowUnownedInputRef{}, std::move(h)};
_response.Write(server_end_);
return _response.status();
}
zx_status_t
fidl::WireEventSender<::fidl_test_protocols::HandleRightsProtocol>::AnEvent(
::fidl::BufferSpan _buffer, ::zx::socket&& h) const {
::fidl::UnownedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::HandleRightsProtocol::AnEvent>>
_response(_buffer.data, _buffer.capacity, std::move(h));
_response.Write(server_end_);
return _response.status();
}
#endif // __Fuchsia__
void ::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResult::
SizeAndOffsetAssertionHelper() {
static_assert(sizeof(WithErrorSyntaxResponseAsStructResult) ==
sizeof(fidl_xunion_t));
static_assert(offsetof(WithErrorSyntaxResponseAsStructResult, ordinal_) ==
offsetof(fidl_xunion_t, tag));
static_assert(offsetof(WithErrorSyntaxResponseAsStructResult, envelope_) ==
offsetof(fidl_xunion_t, envelope));
}
void ::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResult::
SizeAndOffsetAssertionHelper() {
static_assert(sizeof(WithErrorSyntaxErrorAsPrimitiveResult) ==
sizeof(fidl_xunion_t));
static_assert(offsetof(WithErrorSyntaxErrorAsPrimitiveResult, ordinal_) ==
offsetof(fidl_xunion_t, tag));
static_assert(offsetof(WithErrorSyntaxErrorAsPrimitiveResult, envelope_) ==
offsetof(fidl_xunion_t, envelope));
}
namespace fidl_test_protocols {
[[maybe_unused]] constexpr uint64_t kTransitional_Request_Ordinal =
7121112290509197032lu;
extern "C" const fidl_type_t
fidl_test_protocols_TransitionalRequestRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_TransitionalRequestResponseTable;
[[maybe_unused]] constexpr uint64_t kTransitional_OneWay_Ordinal =
1124136612964114085lu;
extern "C" const fidl_type_t fidl_test_protocols_TransitionalOneWayRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_TransitionalOneWayResponseTable;
[[maybe_unused]] constexpr uint64_t kTransitional_Event_Ordinal =
6033576734966581606lu;
extern "C" const fidl_type_t fidl_test_protocols_TransitionalEventRequestTable;
extern "C" const fidl_type_t fidl_test_protocols_TransitionalEventEventTable;
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::Transitional::Request>::WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional> _client,
int64_t x) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::Transitional::Request>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), x);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing
.Call<::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::Transitional::Request>::WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional> _client,
int64_t x, zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::Transitional::Request>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), x);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing
.Call<::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::Transitional::Request>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional> _client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity, int64_t x,
uint8_t* _response_bytes, uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::Transitional::Request>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0), x);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing
.Call<::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::Transitional::OneWay>::WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional> _client,
int64_t x) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::Transitional::OneWay>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), x);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::Transitional::OneWay>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional> _client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity, int64_t x) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::Transitional::OneWay>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0), x);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
} // namespace fidl_test_protocols
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::Transitional::Request>
fidl::internal::WireClientImpl<
::fidl_test_protocols::Transitional>::Request_Sync(int64_t x) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<::fidl_test_protocols::Transitional::Request>(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional>(
_channel->handle()),
x);
}
return ::fidl::WireResult<::fidl_test_protocols::Transitional::Request>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<::fidl_test_protocols::Transitional::Request> fidl::
internal::WireClientImpl<::fidl_test_protocols::Transitional>::Request_Sync(
::fidl::BufferSpan _request_buffer, int64_t x,
::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::Transitional::Request>(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, x,
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::Transitional::Request>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::Transitional::Request>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kTransitional_Request_Ordinal) {}
zx_status_t
fidl::WireResponseContext<::fidl_test_protocols::Transitional::Request>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::Transitional>::Request(
int64_t x,
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>*
response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::Transitional::Request> {
public:
ResponseContext(
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>*
response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(
::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>*
response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>*
response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::Transitional::Request>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid(), x);
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::Transitional>::Request(
::fidl::BufferSpan _request_buffer, int64_t x,
::fidl::WireResponseContext<::fidl_test_protocols::Transitional::Request>*
_context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::Transitional::Request>::
UnownedEncodedMessage _request(
_request_buffer.data, _request_buffer.capacity, _context->Txid(), x);
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::Transitional>::OneWay(int64_t x) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireResult<::fidl_test_protocols::Transitional::OneWay>(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional>(
_channel->handle()),
x);
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::Transitional>::OneWay(
::fidl::BufferSpan _request_buffer, int64_t x) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res =
::fidl::WireUnownedResult<::fidl_test_protocols::Transitional::OneWay>(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, x);
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
std::optional<::fidl::UnbindInfo> fidl::internal::
WireClientImpl<::fidl_test_protocols::Transitional>::DispatchEvent(
fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler) {
auto* event_handler = static_cast<
::fidl::WireAsyncEventHandler<::fidl_test_protocols::Transitional>*>(
maybe_event_handler);
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::kTransitional_Event_Ordinal: {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::Transitional::Event>>
decoded{std::move(msg)};
if (!decoded.ok()) {
return ::fidl::UnbindInfo{decoded};
}
if (event_handler) {
event_handler->Event(decoded.PrimaryObject());
}
return std::nullopt;
}
default:
break;
}
return ::fidl::UnbindInfo::UnknownOrdinal();
}
#endif // __Fuchsia__
::fidl::Result
fidl::WireSyncEventHandler<::fidl_test_protocols::Transitional>::HandleOneEvent(
::fidl::UnownedClientEnd<::fidl_test_protocols::Transitional> client_end) {
zx_status_t status = client_end.channel()->wait_one(
ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ::zx::time::infinite(),
nullptr);
if (status != ZX_OK) {
return ::fidl::Result::TransportError(
status, ::fidl::internal::kErrorWaitOneFailed);
}
constexpr uint32_t kHandleAllocSize = ([]() constexpr {
uint32_t x = 0;
if (::fidl::WireResponse<
::fidl_test_protocols::Transitional::Event>::MaxNumHandles >= x) {
x = ::fidl::WireResponse<
::fidl_test_protocols::Transitional::Event>::MaxNumHandles;
}
if (x > ZX_CHANNEL_MAX_MSG_HANDLES) {
x = ZX_CHANNEL_MAX_MSG_HANDLES;
}
return x;
})();
static_assert(kHandleAllocSize <= ZX_CHANNEL_MAX_MSG_HANDLES);
::fidl::internal::InlineMessageBuffer<24> read_storage;
std::array<zx_handle_info_t, kHandleAllocSize> read_handles;
::fidl::IncomingMessage msg =
fidl::ChannelReadEtc(client_end.handle(), ZX_CHANNEL_READ_MAY_DISCARD,
read_storage.view(), cpp20::span(read_handles));
if (msg.status() == ZX_ERR_BUFFER_TOO_SMALL) {
// Message size is unexpectedly larger than calculated.
// This can only be due to a newer version of the protocol defining a new
// event, whose size exceeds the maximum of known events in the current
// protocol.
return ::fidl::Result::UnexpectedMessage(Unknown());
}
if (!msg.ok()) {
return msg;
}
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::kTransitional_Event_Ordinal: {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::Transitional::Event>>
decoded{::std::move(msg)};
if (!decoded.ok()) {
return ::fidl::Result(decoded);
}
Event(decoded.PrimaryObject());
return ::fidl::Result::Ok();
}
default: {
return ::fidl::Result::UnexpectedMessage(Unknown());
}
}
}
#ifdef __Fuchsia__
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::Transitional>::TryDispatch(
::fidl::WireServer<::fidl_test_protocols::Transitional>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn) {
static const ::fidl::internal::MethodEntry entries[] = {
{
::fidl_test_protocols::kTransitional_Request_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::Transitional::Request>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::Transitional>::
RequestCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::Transitional>*>(
interface)
->Request(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kTransitional_OneWay_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::Transitional::OneWay>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::Transitional>::
OneWayCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::Transitional>*>(
interface)
->OneWay(primary, completer);
return ZX_OK;
},
},
};
return ::fidl::internal::TryDispatch(
impl, msg, txn, entries,
entries + sizeof(entries) / sizeof(::fidl::internal::MethodEntry));
}
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::Transitional>::Dispatch(
::fidl::WireServer<::fidl_test_protocols::Transitional>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn);
if (unlikely(dispatch_result == ::fidl::DispatchResult::kNotFound)) {
std::move(msg).CloseHandles();
txn->InternalError(::fidl::UnbindInfo::UnknownOrdinal());
}
return dispatch_result;
}
::fidl::DispatchResult
fidl::WireServer<::fidl_test_protocols::Transitional>::dispatch_message(
fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
return ::fidl::internal::WireServerDispatcher<
::fidl_test_protocols::Transitional>::Dispatch(this, std::move(msg), txn);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::Transitional>::
RequestCompleterBase::Reply(int64_t y) {
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>>
_response{::fidl::internal::AllowUnownedInputRef{}, y};
return ::fidl::WireServer<::fidl_test_protocols::Transitional>::
RequestCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::Transitional>::
RequestCompleterBase::Reply(::fidl::BufferSpan _buffer, int64_t y) {
::fidl::WireResponse<::fidl_test_protocols::Transitional::Request>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity, y);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::Transitional::Request>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(&_hdr, _txid,
::fidl_test_protocols::kTransitional_Request_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::Transitional::Request>::_InitHeader() {
fidl_init_txn_header(&_hdr, 0,
::fidl_test_protocols::kTransitional_Request_Ordinal);
}
void ::fidl::WireRequest<
::fidl_test_protocols::Transitional::OneWay>::_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(&_hdr, _txid,
::fidl_test_protocols::kTransitional_OneWay_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::Transitional::Event>::_InitHeader() {
fidl_init_txn_header(&_hdr, 0,
::fidl_test_protocols::kTransitional_Event_Ordinal);
}
#ifdef __Fuchsia__
zx_status_t fidl::WireEventSender<::fidl_test_protocols::Transitional>::Event(
int64_t x) const {
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::Transitional::Event>>
_response{::fidl::internal::AllowUnownedInputRef{}, x};
_response.Write(server_end_);
return _response.status();
}
zx_status_t fidl::WireEventSender<::fidl_test_protocols::Transitional>::Event(
::fidl::BufferSpan _buffer, int64_t x) const {
::fidl::UnownedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::Transitional::Event>>
_response(_buffer.data, _buffer.capacity, x);
_response.Write(server_end_);
return _response.status();
}
#endif // __Fuchsia__
namespace fidl_test_protocols {
[[maybe_unused]] constexpr uint64_t kChannelProtocol_MethodA_Ordinal =
565531679656837166lu;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolMethodARequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolMethodAResponseTable;
[[maybe_unused]] constexpr uint64_t kChannelProtocol_EventA_Ordinal =
5963604044179602938lu;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolEventARequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolEventAEventTable;
[[maybe_unused]] constexpr uint64_t kChannelProtocol_MethodB_Ordinal =
6746905632127147242lu;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolMethodBRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolMethodBResponseTable;
[[maybe_unused]] constexpr uint64_t kChannelProtocol_TakeHandle_Ordinal =
875219241480379432lu;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolTakeHandleRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolTakeHandleResponseTable;
[[maybe_unused]] constexpr uint64_t kChannelProtocol_MutateSocket_Ordinal =
9065806117349865322lu;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolMutateSocketRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_ChannelProtocolMutateSocketResponseTable;
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MethodA>::WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol> _client,
int64_t a, int64_t b) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodA>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), a, b);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::ChannelProtocol::MethodA>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity, int64_t a,
int64_t b) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodA>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0), a, b);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MethodB>::WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol> _client,
int64_t a, int64_t b) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodB>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), a, b);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MethodB>::WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol> _client,
int64_t a, int64_t b, zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodB>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), a, b);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::ChannelProtocol::MethodB>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity, int64_t a,
int64_t b, uint8_t* _response_bytes, uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodB>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0), a, b);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::TakeHandle>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
::zx::handle&& h) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::TakeHandle>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::TakeHandle>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::TakeHandle>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
::zx::handle&& h, zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::TakeHandle>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::TakeHandle>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::ChannelProtocol::TakeHandle>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::zx::handle&& h, uint8_t* _response_bytes,
uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::TakeHandle>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0),
std::move(h));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::TakeHandle>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MutateSocket>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
::zx::socket&& a) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MutateSocket>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0),
std::move(a));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MutateSocket>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
::zx::socket&& a, zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MutateSocket>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0),
std::move(a));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::MutateSocket>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::zx::socket&& a, uint8_t* _response_bytes,
uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MutateSocket>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0),
std::move(a));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
} // namespace fidl_test_protocols
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::ChannelProtocol>::MethodA(int64_t a, int64_t b) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res =
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MethodA>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
a, b);
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::ChannelProtocol>::MethodA(
::fidl::BufferSpan _request_buffer, int64_t a, int64_t b) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::MethodA>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, a, b);
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MethodB>
fidl::internal::WireClientImpl<
::fidl_test_protocols::ChannelProtocol>::MethodB_Sync(int64_t a,
int64_t b) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MethodB>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
a, b);
}
return ::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MethodB>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<::fidl_test_protocols::ChannelProtocol::MethodB>
fidl::internal::WireClientImpl<::fidl_test_protocols::ChannelProtocol>::
MethodB_Sync(::fidl::BufferSpan _request_buffer, int64_t a, int64_t b,
::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::MethodB>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, a, b,
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::MethodB>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::MethodB>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kChannelProtocol_MethodB_Ordinal) {}
zx_status_t
fidl::WireResponseContext<::fidl_test_protocols::ChannelProtocol::MethodB>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::ChannelProtocol>::MethodB(
int64_t a, int64_t b,
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>*
response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::MethodB> {
public:
ResponseContext(
::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MethodB>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>*
response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>*
response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodB>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid(), a, b);
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result
fidl::internal::WireClientImpl<::fidl_test_protocols::ChannelProtocol>::MethodB(
::fidl::BufferSpan _request_buffer, int64_t a, int64_t b,
::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::MethodB>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodB>::
UnownedEncodedMessage _request(_request_buffer.data,
_request_buffer.capacity, _context->Txid(),
a, b);
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::TakeHandle>
fidl::internal::WireClientImpl<
::fidl_test_protocols::ChannelProtocol>::TakeHandle_Sync(::zx::handle&& h) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::ChannelProtocol::TakeHandle>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
std::move(h));
}
return ::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::TakeHandle>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<::fidl_test_protocols::ChannelProtocol::TakeHandle>
fidl::internal::WireClientImpl<::fidl_test_protocols::ChannelProtocol>::
TakeHandle_Sync(::fidl::BufferSpan _request_buffer, ::zx::handle&& h,
::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::TakeHandle>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, std::move(h),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::TakeHandle>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::TakeHandle>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kChannelProtocol_TakeHandle_Ordinal) {}
zx_status_t
fidl::WireResponseContext<::fidl_test_protocols::ChannelProtocol::TakeHandle>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::TakeHandle>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::ChannelProtocol>::TakeHandle(
::zx::handle&& h,
::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::TakeHandle>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::TakeHandle> {
public:
ResponseContext(
::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::TakeHandle>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::TakeHandle>* response)
override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::TakeHandle>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::TakeHandle>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid(), std::move(h));
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::ChannelProtocol>::TakeHandle(
::fidl::BufferSpan _request_buffer, ::zx::handle&& h,
::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::TakeHandle>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::TakeHandle>::
UnownedEncodedMessage _request(_request_buffer.data,
_request_buffer.capacity, _context->Txid(),
std::move(h));
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::ChannelProtocol::MutateSocket>
fidl::internal::WireClientImpl<::fidl_test_protocols::ChannelProtocol>::
MutateSocket_Sync(::zx::socket&& a) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::ChannelProtocol::MutateSocket>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
std::move(a));
}
return ::fidl::WireResult<
::fidl_test_protocols::ChannelProtocol::MutateSocket>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<::fidl_test_protocols::ChannelProtocol::MutateSocket>
fidl::internal::WireClientImpl<::fidl_test_protocols::ChannelProtocol>::
MutateSocket_Sync(::fidl::BufferSpan _request_buffer, ::zx::socket&& a,
::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::MutateSocket>(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, std::move(a),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::ChannelProtocol::MutateSocket>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::MutateSocket>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kChannelProtocol_MutateSocket_Ordinal) {}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::MutateSocket>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::ChannelProtocol>::MutateSocket(
::zx::socket&& a,
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::
MutateSocket>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::MutateSocket> {
public:
ResponseContext(::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>*
response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>*
response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MutateSocket>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid(), std::move(a));
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::ChannelProtocol>::MutateSocket(
::fidl::BufferSpan _request_buffer, ::zx::socket&& a,
::fidl::WireResponseContext<
::fidl_test_protocols::ChannelProtocol::MutateSocket>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MutateSocket>::
UnownedEncodedMessage _request(_request_buffer.data,
_request_buffer.capacity, _context->Txid(),
std::move(a));
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
std::optional<::fidl::UnbindInfo> fidl::internal::
WireClientImpl<::fidl_test_protocols::ChannelProtocol>::DispatchEvent(
fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler) {
auto* event_handler = static_cast<
::fidl::WireAsyncEventHandler<::fidl_test_protocols::ChannelProtocol>*>(
maybe_event_handler);
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::kChannelProtocol_EventA_Ordinal: {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::EventA>>
decoded{std::move(msg)};
if (!decoded.ok()) {
return ::fidl::UnbindInfo{decoded};
}
if (event_handler) {
event_handler->EventA(decoded.PrimaryObject());
}
return std::nullopt;
}
default:
break;
}
return ::fidl::UnbindInfo::UnknownOrdinal();
}
#endif // __Fuchsia__
::fidl::Result
fidl::WireSyncEventHandler<::fidl_test_protocols::ChannelProtocol>::
HandleOneEvent(
::fidl::UnownedClientEnd<::fidl_test_protocols::ChannelProtocol>
client_end) {
zx_status_t status = client_end.channel()->wait_one(
ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ::zx::time::infinite(),
nullptr);
if (status != ZX_OK) {
return ::fidl::Result::TransportError(
status, ::fidl::internal::kErrorWaitOneFailed);
}
constexpr uint32_t kHandleAllocSize = ([]() constexpr {
uint32_t x = 0;
if (::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::EventA>::MaxNumHandles >=
x) {
x = ::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::EventA>::MaxNumHandles;
}
if (x > ZX_CHANNEL_MAX_MSG_HANDLES) {
x = ZX_CHANNEL_MAX_MSG_HANDLES;
}
return x;
})();
static_assert(kHandleAllocSize <= ZX_CHANNEL_MAX_MSG_HANDLES);
::fidl::internal::InlineMessageBuffer<32> read_storage;
std::array<zx_handle_info_t, kHandleAllocSize> read_handles;
::fidl::IncomingMessage msg =
fidl::ChannelReadEtc(client_end.handle(), ZX_CHANNEL_READ_MAY_DISCARD,
read_storage.view(), cpp20::span(read_handles));
if (msg.status() == ZX_ERR_BUFFER_TOO_SMALL) {
// Message size is unexpectedly larger than calculated.
// This can only be due to a newer version of the protocol defining a new
// event, whose size exceeds the maximum of known events in the current
// protocol.
return ::fidl::Result::UnexpectedMessage(Unknown());
}
if (!msg.ok()) {
return msg;
}
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::kChannelProtocol_EventA_Ordinal: {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::EventA>>
decoded{::std::move(msg)};
if (!decoded.ok()) {
return ::fidl::Result(decoded);
}
EventA(decoded.PrimaryObject());
return ::fidl::Result::Ok();
}
default: {
return ::fidl::Result::UnexpectedMessage(Unknown());
}
}
}
#ifdef __Fuchsia__
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::ChannelProtocol>::TryDispatch(
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn) {
static const ::fidl::internal::MethodEntry entries[] = {
{
::fidl_test_protocols::kChannelProtocol_MethodA_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::ChannelProtocol::MethodA>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MethodACompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>*>(
interface)
->MethodA(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kChannelProtocol_MethodB_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::ChannelProtocol::MethodB>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MethodBCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>*>(
interface)
->MethodB(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kChannelProtocol_TakeHandle_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::ChannelProtocol::TakeHandle>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
TakeHandleCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>*>(
interface)
->TakeHandle(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kChannelProtocol_MutateSocket_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::ChannelProtocol::MutateSocket>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MutateSocketCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>*>(
interface)
->MutateSocket(primary, completer);
return ZX_OK;
},
},
};
return ::fidl::internal::TryDispatch(
impl, msg, txn, entries,
entries + sizeof(entries) / sizeof(::fidl::internal::MethodEntry));
}
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::ChannelProtocol>::Dispatch(
::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn);
if (unlikely(dispatch_result == ::fidl::DispatchResult::kNotFound)) {
std::move(msg).CloseHandles();
txn->InternalError(::fidl::UnbindInfo::UnknownOrdinal());
}
return dispatch_result;
}
::fidl::DispatchResult
fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::dispatch_message(
fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
return ::fidl::internal::WireServerDispatcher<
::fidl_test_protocols::ChannelProtocol>::Dispatch(this, std::move(msg),
txn);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MethodBCompleterBase::Reply(int64_t result) {
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>>
_response{::fidl::internal::AllowUnownedInputRef{}, result};
return ::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MethodBCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MethodBCompleterBase::Reply(::fidl::BufferSpan _buffer, int64_t result) {
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MethodB>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity, result);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<
::fidl_test_protocols::ChannelProtocol>::TakeHandleCompleterBase::Reply() {
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::TakeHandle>>
_response{::fidl::internal::AllowUnownedInputRef{}};
return ::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
TakeHandleCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MutateSocketCompleterBase::Reply(::zx::socket&& b) {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>>
_response{::fidl::internal::AllowUnownedInputRef{}, std::move(b)};
return ::fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MutateSocketCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::ChannelProtocol>::
MutateSocketCompleterBase::Reply(::fidl::BufferSpan _buffer,
::zx::socket&& b) {
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::MutateSocket>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity,
std::move(b));
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodA>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(&_hdr, _txid,
::fidl_test_protocols::kChannelProtocol_MethodA_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::EventA>::_InitHeader() {
fidl_init_txn_header(&_hdr, 0,
::fidl_test_protocols::kChannelProtocol_EventA_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MethodB>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(&_hdr, _txid,
::fidl_test_protocols::kChannelProtocol_MethodB_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MethodB>::_InitHeader() {
fidl_init_txn_header(&_hdr, 0,
::fidl_test_protocols::kChannelProtocol_MethodB_Ordinal);
}
#ifdef __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::TakeHandle>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid, ::fidl_test_protocols::kChannelProtocol_TakeHandle_Ordinal);
}
void ::fidl::WireRequest<
::fidl_test_protocols::ChannelProtocol::TakeHandle>::_CloseHandles() {
h.reset();
}
#endif // __Fuchsia__
void ::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::TakeHandle>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0, ::fidl_test_protocols::kChannelProtocol_TakeHandle_Ordinal);
}
#ifdef __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::ChannelProtocol::MutateSocket>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kChannelProtocol_MutateSocket_Ordinal);
}
void ::fidl::WireRequest<
::fidl_test_protocols::ChannelProtocol::MutateSocket>::_CloseHandles() {
a.reset();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
void ::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0, ::fidl_test_protocols::kChannelProtocol_MutateSocket_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::ChannelProtocol::MutateSocket>::_CloseHandles() {
b.reset();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
zx_status_t
fidl::WireEventSender<::fidl_test_protocols::ChannelProtocol>::EventA(
int64_t a, int64_t b) const {
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::EventA>>
_response{::fidl::internal::AllowUnownedInputRef{}, a, b};
_response.Write(server_end_);
return _response.status();
}
zx_status_t
fidl::WireEventSender<::fidl_test_protocols::ChannelProtocol>::EventA(
::fidl::BufferSpan _buffer, int64_t a, int64_t b) const {
::fidl::UnownedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::ChannelProtocol::EventA>>
_response(_buffer.data, _buffer.capacity, a, b);
_response.Write(server_end_);
return _response.status();
}
#endif // __Fuchsia__
namespace fidl_test_protocols {
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_NoRequestNoResponse_Ordinal =
7699066378708085668lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseNoRequestNoResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseNoRequestNoResponseResponseTable;
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_NoRequestEmptyResponse_Ordinal =
4641225961522096302lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseNoRequestEmptyResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseNoRequestEmptyResponseResponseTable;
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_NoRequestWithResponse_Ordinal =
4935493674668456948lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseNoRequestWithResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseNoRequestWithResponseResponseTable;
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_WithRequestNoResponse_Ordinal =
8985942600963248509lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseWithRequestNoResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseWithRequestNoResponseResponseTable;
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_WithRequestEmptyResponse_Ordinal =
7344052883704365182lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseWithRequestEmptyResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseWithRequestEmptyResponseResponseTable;
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_WithRequestWithResponse_Ordinal =
2103802322332450033lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseWithRequestWithResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseWithRequestWithResponseResponseTable;
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_OnEmptyResponse_Ordinal =
1323081535741489193lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseOnEmptyResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseOnEmptyResponseEventTable;
[[maybe_unused]] constexpr uint64_t
kWithAndWithoutRequestResponse_OnWithResponse_Ordinal =
1691906546593908418lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseOnWithResponseRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithAndWithoutRequestResponseOnWithResponseEventTable;
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::NoRequestNoResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestNoResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>>(_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>>(_client, bytes_.data(), bytes_.size(),
_deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>(_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>(_client, bytes_.data(), bytes_.size(),
_deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::
WireUnownedResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
uint8_t* _response_bytes,
uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>(_client, _response_bytes,
_response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
::fidl::StringView arg) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>::
WireUnownedResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::fidl::StringView arg) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
::fidl::StringView arg) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>(_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
::fidl::StringView arg, zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>(_client, bytes_.data(), bytes_.size(),
_deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::
WireUnownedResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::fidl::StringView arg, uint8_t* _response_bytes,
uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>(_client, _response_bytes,
_response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
::fidl::StringView arg) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>(_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::
WireResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
::fidl::StringView arg, zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>(_client, bytes_.data(), bytes_.size(),
_deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::
WireUnownedResult(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
_client,
uint8_t* _request_bytes, uint32_t _request_byte_capacity,
::fidl::StringView arg, uint8_t* _response_bytes,
uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::UnownedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>
_request(_request_bytes, _request_byte_capacity, zx_txid_t(0), arg);
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>(_client, _response_bytes,
_response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
} // namespace fidl_test_protocols
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestNoResponse() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestNoResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()));
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestEmptyResponse_Sync() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()));
}
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestEmptyResponse_Ordinal) {}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestEmptyResponse(
::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse> {
public:
ResponseContext(::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>* response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::OwnedEncodedMessage
_request(::fidl::internal::AllowUnownedInputRef{}, _context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestEmptyResponse(
::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::OwnedEncodedMessage
_request(::fidl::internal::AllowUnownedInputRef{}, _context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::NoRequestWithResponse>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponse_Sync() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()));
}
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::NoRequestWithResponse>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponse_Sync(::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestWithResponse_Ordinal) {}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponse(
::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse> {
public:
ResponseContext(::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>* response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::OwnedEncodedMessage
_request(::fidl::internal::AllowUnownedInputRef{}, _context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponse(::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::OwnedEncodedMessage
_request(::fidl::internal::AllowUnownedInputRef{}, _context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestNoResponse(::fidl::StringView arg) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()),
arg);
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestNoResponse(::fidl::BufferSpan _request_buffer,
::fidl::StringView arg) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, arg);
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestEmptyResponse_Sync(::fidl::StringView arg) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()),
arg);
}
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestEmptyResponse_Sync(::fidl::BufferSpan _request_buffer,
::fidl::StringView arg,
::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, arg,
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestEmptyResponse_Ordinal) {
}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestEmptyResponse(
::fidl::StringView arg,
::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse> {
public:
ResponseContext(::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>* response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::OwnedEncodedMessage
_request(::fidl::internal::AllowUnownedInputRef{}, _context->Txid(), arg);
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestEmptyResponse(
::fidl::BufferSpan _request_buffer, ::fidl::StringView arg,
::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::UnownedEncodedMessage
_request(_request_buffer.data, _request_buffer.capacity, _context->Txid(),
arg);
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponse_Sync(::fidl::StringView arg) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()),
arg);
}
return ::fidl::WireResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponse_Sync(::fidl::BufferSpan _request_buffer,
::fidl::StringView arg,
::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>(
::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>(
_channel->handle()),
_request_buffer.data, _request_buffer.capacity, arg,
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>(::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestWithResponse_Ordinal) {}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponse(
::fidl::StringView arg,
::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse> {
public:
ResponseContext(::fit::callback<
void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>* response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::OwnedEncodedMessage
_request(::fidl::internal::AllowUnownedInputRef{}, _context->Txid(), arg);
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponse(
::fidl::BufferSpan _request_buffer, ::fidl::StringView arg,
::fidl::WireResponseContext<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::UnownedEncodedMessage
_request(_request_buffer.data, _request_buffer.capacity, _context->Txid(),
arg);
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
std::optional<::fidl::UnbindInfo> fidl::internal::WireClientImpl<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
DispatchEvent(fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler) {
auto* event_handler = static_cast<::fidl::WireAsyncEventHandler<
::fidl_test_protocols::WithAndWithoutRequestResponse>*>(
maybe_event_handler);
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::
kWithAndWithoutRequestResponse_OnEmptyResponse_Ordinal: {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
OnEmptyResponse>>
decoded{std::move(msg)};
if (!decoded.ok()) {
return ::fidl::UnbindInfo{decoded};
}
if (event_handler) {
event_handler->OnEmptyResponse(decoded.PrimaryObject());
}
return std::nullopt;
}
case ::fidl_test_protocols::
kWithAndWithoutRequestResponse_OnWithResponse_Ordinal: {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::OnWithResponse>>
decoded{std::move(msg)};
if (!decoded.ok()) {
return ::fidl::UnbindInfo{decoded};
}
if (event_handler) {
event_handler->OnWithResponse(decoded.PrimaryObject());
}
return std::nullopt;
}
default:
break;
}
return ::fidl::UnbindInfo::UnknownOrdinal();
}
#endif // __Fuchsia__
::fidl::Result fidl::WireSyncEventHandler<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
HandleOneEvent(::fidl::UnownedClientEnd<
::fidl_test_protocols::WithAndWithoutRequestResponse>
client_end) {
zx_status_t status = client_end.channel()->wait_one(
ZX_CHANNEL_READABLE | ZX_CHANNEL_PEER_CLOSED, ::zx::time::infinite(),
nullptr);
if (status != ZX_OK) {
return ::fidl::Result::TransportError(
status, ::fidl::internal::kErrorWaitOneFailed);
}
constexpr uint32_t kHandleAllocSize = ([]() constexpr {
uint32_t x = 0;
if (::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
OnEmptyResponse>::MaxNumHandles >= x) {
x = ::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
OnEmptyResponse>::MaxNumHandles;
}
if (::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
OnWithResponse>::MaxNumHandles >= x) {
x = ::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
OnWithResponse>::MaxNumHandles;
}
if (x > ZX_CHANNEL_MAX_MSG_HANDLES) {
x = ZX_CHANNEL_MAX_MSG_HANDLES;
}
return x;
})();
static_assert(kHandleAllocSize <= ZX_CHANNEL_MAX_MSG_HANDLES);
::fidl::internal::BoxedMessageBuffer<ZX_CHANNEL_MAX_MSG_BYTES> read_storage;
std::array<zx_handle_info_t, kHandleAllocSize> read_handles;
::fidl::IncomingMessage msg =
fidl::ChannelReadEtc(client_end.handle(), ZX_CHANNEL_READ_MAY_DISCARD,
read_storage.view(), cpp20::span(read_handles));
if (msg.status() == ZX_ERR_BUFFER_TOO_SMALL) {
// Message size is unexpectedly larger than calculated.
// This can only be due to a newer version of the protocol defining a new
// event, whose size exceeds the maximum of known events in the current
// protocol.
return ::fidl::Result::UnexpectedMessage(Unknown());
}
if (!msg.ok()) {
return msg;
}
fidl_message_header_t* hdr = msg.header();
switch (hdr->ordinal) {
case ::fidl_test_protocols::
kWithAndWithoutRequestResponse_OnEmptyResponse_Ordinal: {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
OnEmptyResponse>>
decoded{::std::move(msg)};
if (!decoded.ok()) {
return ::fidl::Result(decoded);
}
OnEmptyResponse(decoded.PrimaryObject());
return ::fidl::Result::Ok();
}
case ::fidl_test_protocols::
kWithAndWithoutRequestResponse_OnWithResponse_Ordinal: {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::OnWithResponse>>
decoded{::std::move(msg)};
if (!decoded.ok()) {
return ::fidl::Result(decoded);
}
OnWithResponse(decoded.PrimaryObject());
return ::fidl::Result::Ok();
}
default: {
return ::fidl::Result::UnexpectedMessage(Unknown());
}
}
}
#ifdef __Fuchsia__
::fidl::DispatchResult fidl::internal::WireServerDispatcher<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
TryDispatch(::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn) {
static const ::fidl::internal::MethodEntry entries[] = {
{
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestNoResponse_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestNoResponse>*>(msg.bytes());
::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestNoResponseCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>*>(
interface)
->NoRequestNoResponse(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestEmptyResponse_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>*>(msg.bytes());
::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestEmptyResponseCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>*>(
interface)
->NoRequestEmptyResponse(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestWithResponse_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>*>(msg.bytes());
::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponseCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>*>(
interface)
->NoRequestWithResponse(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestNoResponse_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestNoResponseCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>*>(
interface)
->WithRequestNoResponse(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestEmptyResponse_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestEmptyResponseCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>*>(
interface)
->WithRequestEmptyResponse(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestWithResponse_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
::fidl::DecodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
auto* primary = decoded.PrimaryObject();
::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponseCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>*>(
interface)
->WithRequestWithResponse(primary, completer);
return ZX_OK;
},
},
};
return ::fidl::internal::TryDispatch(
impl, msg, txn, entries,
entries + sizeof(entries) / sizeof(::fidl::internal::MethodEntry));
}
::fidl::DispatchResult fidl::internal::WireServerDispatcher<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
Dispatch(::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn);
if (unlikely(dispatch_result == ::fidl::DispatchResult::kNotFound)) {
std::move(msg).CloseHandles();
txn->InternalError(::fidl::UnbindInfo::UnknownOrdinal());
}
return dispatch_result;
}
::fidl::DispatchResult
fidl::WireServer<::fidl_test_protocols::WithAndWithoutRequestResponse>::
dispatch_message(fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
return ::fidl::internal::WireServerDispatcher<
::fidl_test_protocols::WithAndWithoutRequestResponse>::Dispatch(this,
std::move(
msg),
txn);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::WireServer<::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestEmptyResponseCompleterBase::Reply() {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>>
_response{::fidl::internal::AllowUnownedInputRef{}};
return ::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestEmptyResponseCompleterBase::SendReply(
&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::WireServer<::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponseCompleterBase::Reply(::fidl::StringView ret) {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>>
_response{::fidl::internal::AllowUnownedInputRef{}, ret};
return ::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponseCompleterBase::SendReply(
&_response.GetOutgoingMessage());
}
::fidl::Result
fidl::WireServer<::fidl_test_protocols::WithAndWithoutRequestResponse>::
NoRequestWithResponseCompleterBase::Reply(::fidl::BufferSpan _buffer,
::fidl::StringView ret) {
::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::UnownedEncodedMessage
_response(_buffer.data, _buffer.capacity, ret);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::WireServer<::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestEmptyResponseCompleterBase::Reply() {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>>
_response{::fidl::internal::AllowUnownedInputRef{}};
return ::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestEmptyResponseCompleterBase::SendReply(
&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result
fidl::WireServer<::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponseCompleterBase::Reply(::fidl::StringView ret) {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>>
_response{::fidl::internal::AllowUnownedInputRef{}, ret};
return ::fidl::WireServer<
::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponseCompleterBase::SendReply(
&_response.GetOutgoingMessage());
}
::fidl::Result
fidl::WireServer<::fidl_test_protocols::WithAndWithoutRequestResponse>::
WithRequestWithResponseCompleterBase::Reply(::fidl::BufferSpan _buffer,
::fidl::StringView ret) {
::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::UnownedEncodedMessage
_response(_buffer.data, _buffer.capacity, ret);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
#endif // __Fuchsia__
void ::fidl::WireRequest<
::fidl_test_protocols::WithAndWithoutRequestResponse::NoRequestNoResponse>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestNoResponse_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::_InitHeader(zx_txid_t
_txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestEmptyResponse_Ordinal);
}
void ::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestEmptyResponse>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestEmptyResponse_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::_InitHeader(zx_txid_t
_txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestWithResponse_Ordinal);
}
void ::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
NoRequestWithResponse>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_NoRequestWithResponse_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestNoResponse>::_InitHeader(zx_txid_t
_txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestNoResponse_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::_InitHeader(zx_txid_t
_txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestEmptyResponse_Ordinal);
}
void ::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestEmptyResponse>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestEmptyResponse_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::_InitHeader(zx_txid_t
_txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestWithResponse_Ordinal);
}
void ::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
WithRequestWithResponse>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_WithRequestWithResponse_Ordinal);
}
void ::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
OnEmptyResponse>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_OnEmptyResponse_Ordinal);
}
void ::fidl::WireResponse<::fidl_test_protocols::WithAndWithoutRequestResponse::
OnWithResponse>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::
kWithAndWithoutRequestResponse_OnWithResponse_Ordinal);
}
#ifdef __Fuchsia__
zx_status_t fidl::WireEventSender<
::fidl_test_protocols::WithAndWithoutRequestResponse>::OnEmptyResponse()
const {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::OnEmptyResponse>>
_response{::fidl::internal::AllowUnownedInputRef{}};
_response.Write(server_end_);
return _response.status();
}
zx_status_t
fidl::WireEventSender<::fidl_test_protocols::WithAndWithoutRequestResponse>::
OnWithResponse(::fidl::StringView ret) const {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::OnWithResponse>>
_response{::fidl::internal::AllowUnownedInputRef{}, ret};
_response.Write(server_end_);
return _response.status();
}
zx_status_t
fidl::WireEventSender<::fidl_test_protocols::WithAndWithoutRequestResponse>::
OnWithResponse(::fidl::BufferSpan _buffer, ::fidl::StringView ret) const {
::fidl::UnownedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithAndWithoutRequestResponse::OnWithResponse>>
_response(_buffer.data, _buffer.capacity, ret);
_response.Write(server_end_);
return _response.status();
}
#endif // __Fuchsia__
void ::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResult::
SizeAndOffsetAssertionHelper() {
static_assert(sizeof(WithErrorSyntaxErrorAsEnumResult) ==
sizeof(fidl_xunion_t));
static_assert(offsetof(WithErrorSyntaxErrorAsEnumResult, ordinal_) ==
offsetof(fidl_xunion_t, tag));
static_assert(offsetof(WithErrorSyntaxErrorAsEnumResult, envelope_) ==
offsetof(fidl_xunion_t, envelope));
}
namespace fidl_test_protocols {
[[maybe_unused]] constexpr uint64_t kWithErrorSyntax_ResponseAsStruct_Ordinal =
4000554951765344912lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxResponseAsStructRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxResponseAsStructResponseTable;
[[maybe_unused]] constexpr uint64_t kWithErrorSyntax_ErrorAsPrimitive_Ordinal =
3421672554503271630lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxErrorAsPrimitiveRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxErrorAsPrimitiveResponseTable;
[[maybe_unused]] constexpr uint64_t kWithErrorSyntax_ErrorAsEnum_Ordinal =
627496610701472780lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxErrorAsEnumRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxErrorAsEnumResponseTable;
[[maybe_unused]] constexpr uint64_t kWithErrorSyntax_HandleInResult_Ordinal =
2147949819621101463lu;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxHandleInResultRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_WithErrorSyntaxHandleInResultResponseTable;
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
uint8_t* _response_bytes, uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
uint8_t* _response_bytes, uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
uint8_t* _response_bytes, uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::HandleInResult>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>(
_client, bytes_.data(), bytes_.size());
SetResult(_outgoing);
}
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::HandleInResult>::
WireResult(::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
zx_time_t _deadline) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>(
_client, bytes_.data(), bytes_.size(), _deadline);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>::
WireUnownedResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>
_client,
uint8_t* _response_bytes, uint32_t _response_byte_capacity)
: bytes_(_response_bytes) {
::fidl::OwnedEncodedMessage<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Call<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>(
_client, _response_bytes, _response_byte_capacity);
::fidl::Result::operator=(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
} // namespace fidl_test_protocols
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithErrorSyntax>::ResponseAsStruct_Sync() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()));
}
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>
fidl::internal::WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStruct_Sync(::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<::fidl_test_protocols::WithErrorSyntax::
ResponseAsStruct>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kWithErrorSyntax_ResponseAsStruct_Ordinal) {}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::ResponseAsStruct(
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
ResponseAsStruct>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct> {
public:
ResponseContext(
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
ResponseAsStruct>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>*
response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
ResponseAsStruct>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::ResponseAsStruct(
::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>*
_context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithErrorSyntax>::ErrorAsPrimitive_Sync() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()));
}
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>
fidl::internal::WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitive_Sync(::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<::fidl_test_protocols::WithErrorSyntax::
ErrorAsPrimitive>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kWithErrorSyntax_ErrorAsPrimitive_Ordinal) {}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::ErrorAsPrimitive(
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
ErrorAsPrimitive>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive> {
public:
ResponseContext(
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
ErrorAsPrimitive>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>*
response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
ErrorAsPrimitive>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::ErrorAsPrimitive(
::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>*
_context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithErrorSyntax>::ErrorAsEnum_Sync() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()));
}
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>
fidl::internal::WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnum_Sync(::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kWithErrorSyntax_ErrorAsEnum_Ordinal) {}
zx_status_t
fidl::WireResponseContext<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<
::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::ErrorAsEnum(
::fit::callback<void(
::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum> {
public:
ResponseContext(
::fit::callback<void(
::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>* response)
override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::ErrorAsEnum(
::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResult<::fidl_test_protocols::WithErrorSyntax::HandleInResult>
fidl::internal::WireClientImpl<
::fidl_test_protocols::WithErrorSyntax>::HandleInResult_Sync() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()));
}
return ::fidl::WireResult<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>
fidl::internal::WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::
HandleInResult_Sync(::fidl::BufferSpan _response_buffer) {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>(
::fidl::UnownedClientEnd<::fidl_test_protocols::WithErrorSyntax>(
_channel->handle()),
_response_buffer.data, _response_buffer.capacity);
}
return ::fidl::WireUnownedResult<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>(
::fidl::Result::Unbound());
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::WireResponseContext<::fidl_test_protocols::WithErrorSyntax::
HandleInResult>::WireResponseContext()
: ::fidl::internal::ResponseContext(
::fidl_test_protocols::kWithErrorSyntax_HandleInResult_Ordinal) {}
zx_status_t fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>::
OnRawReply(::fidl::IncomingMessage&& msg) {
::fidl::DecodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>
decoded{std::move(msg)};
if (unlikely(!decoded.ok())) {
return decoded.status();
}
OnReply(decoded.PrimaryObject());
return ZX_OK;
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::HandleInResult(
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
HandleInResult>* response)>
_cb) {
class ResponseContext final
: public ::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::HandleInResult> {
public:
ResponseContext(
::fit::callback<
void(::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::
HandleInResult>* response)>
cb)
: cb_(std::move(cb)) {}
void OnReply(::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>*
response) override {
cb_(response);
delete this;
}
void OnError() override { delete this; }
private:
::fit::callback<void(
::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>* response)>
cb_;
};
auto* _context = new ResponseContext(std::move(_cb));
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::HandleInResult>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
::fidl::Result fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::HandleInResult(
::fidl::WireResponseContext<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>* _context) {
::fidl::internal::ClientBase::PrepareAsyncTxn(_context);
::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::HandleInResult>::
OwnedEncodedMessage _request(::fidl::internal::AllowUnownedInputRef{},
_context->Txid());
return _request.GetOutgoingMessage().Write(this, _context);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
std::optional<::fidl::UnbindInfo> fidl::internal::
WireClientImpl<::fidl_test_protocols::WithErrorSyntax>::DispatchEvent(
fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler) {
return ::fidl::UnbindInfo::UnknownOrdinal();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::WithErrorSyntax>::TryDispatch(
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn) {
static const ::fidl::internal::MethodEntry entries[] = {
{
::fidl_test_protocols::kWithErrorSyntax_ResponseAsStruct_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>*>(
msg.bytes());
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStructCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>*>(
interface)
->ResponseAsStruct(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kWithErrorSyntax_ErrorAsPrimitive_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>*>(
msg.bytes());
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitiveCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>*>(
interface)
->ErrorAsPrimitive(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kWithErrorSyntax_ErrorAsEnum_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>*>(
msg.bytes());
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnumCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>*>(
interface)
->ErrorAsEnum(primary, completer);
return ZX_OK;
},
},
{
::fidl_test_protocols::kWithErrorSyntax_HandleInResult_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>*>(
msg.bytes());
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
HandleInResultCompleter::Sync completer(txn);
reinterpret_cast<
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>*>(
interface)
->HandleInResult(primary, completer);
return ZX_OK;
},
},
};
return ::fidl::internal::TryDispatch(
impl, msg, txn, entries,
entries + sizeof(entries) / sizeof(::fidl::internal::MethodEntry));
}
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::WithErrorSyntax>::Dispatch(
::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn);
if (unlikely(dispatch_result == ::fidl::DispatchResult::kNotFound)) {
std::move(msg).CloseHandles();
txn->InternalError(::fidl::UnbindInfo::UnknownOrdinal());
}
return dispatch_result;
}
::fidl::DispatchResult
fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::dispatch_message(
fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
return ::fidl::internal::WireServerDispatcher<
::fidl_test_protocols::WithErrorSyntax>::Dispatch(this, std::move(msg),
txn);
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStructCompleterBase::Reply(
::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResult
result) {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>>
_response{::fidl::internal::AllowUnownedInputRef{}, result};
return ::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStructCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStructCompleterBase::ReplySuccess(int64_t a, int64_t b,
int64_t c) {
::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResponse
_response;
_response.a = std::move(a);
_response.b = std::move(b);
_response.c = std::move(c);
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxResponseAsStructResponse>::
FromExternal(&_response)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStructCompleterBase::ReplyError(uint32_t error) {
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResult::
WithErr(::fidl::ObjectView<uint32_t>::FromExternal(&error)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStructCompleterBase::Reply(
::fidl::BufferSpan _buffer,
::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResult
result) {
::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity, result);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ResponseAsStructCompleterBase::ReplySuccess(::fidl::BufferSpan _buffer,
int64_t a, int64_t b,
int64_t c) {
::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResponse response;
response.a = std::move(a);
response.b = std::move(b);
response.c = std::move(c);
return Reply(
std::move(_buffer),
::fidl_test_protocols::wire::WithErrorSyntaxResponseAsStructResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxResponseAsStructResponse>::
FromExternal(&response)));
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitiveCompleterBase::Reply(
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResult
result) {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>>
_response{::fidl::internal::AllowUnownedInputRef{}, result};
return ::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitiveCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitiveCompleterBase::ReplySuccess() {
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResponse
_response;
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxErrorAsPrimitiveResponse>::
FromExternal(&_response)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitiveCompleterBase::ReplyError(uint32_t error) {
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResult::
WithErr(::fidl::ObjectView<uint32_t>::FromExternal(&error)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitiveCompleterBase::Reply(
::fidl::BufferSpan _buffer,
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResult
result) {
::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity, result);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsPrimitiveCompleterBase::ReplySuccess(::fidl::BufferSpan _buffer) {
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResponse response;
return Reply(
std::move(_buffer),
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsPrimitiveResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxErrorAsPrimitiveResponse>::
FromExternal(&response)));
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnumCompleterBase::Reply(
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResult result) {
::fidl::OwnedEncodedMessage<
::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>>
_response{::fidl::internal::AllowUnownedInputRef{}, result};
return ::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnumCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnumCompleterBase::ReplySuccess() {
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResponse _response;
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxErrorAsEnumResponse>::
FromExternal(&_response)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnumCompleterBase::ReplyError(
::fidl_test_protocols::wire::ErrorEnum error) {
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResult::WithErr(
::fidl::ObjectView<
::fidl_test_protocols::wire::ErrorEnum>::FromExternal(&error)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnumCompleterBase::Reply(
::fidl::BufferSpan _buffer,
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResult result) {
::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity, result);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
ErrorAsEnumCompleterBase::ReplySuccess(::fidl::BufferSpan _buffer) {
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResponse response;
return Reply(
std::move(_buffer),
::fidl_test_protocols::wire::WithErrorSyntaxErrorAsEnumResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxErrorAsEnumResponse>::
FromExternal(&response)));
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
HandleInResultCompleterBase::Reply(
::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult
result) {
::fidl::OwnedEncodedMessage<::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>>
_response{::fidl::internal::AllowUnownedInputRef{}, result};
return ::fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
HandleInResultCompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
HandleInResultCompleterBase::ReplySuccess(::zx::handle&& h) {
::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResponse _response;
_response.h = std::move(h);
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxHandleInResultResponse>::
FromExternal(&_response)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
HandleInResultCompleterBase::ReplyError(uint32_t error) {
return Reply(
::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult::WithErr(
::fidl::ObjectView<uint32_t>::FromExternal(&error)));
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
HandleInResultCompleterBase::Reply(
::fidl::BufferSpan _buffer,
::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult
result) {
::fidl::WireResponse<::fidl_test_protocols::WithErrorSyntax::HandleInResult>::
UnownedEncodedMessage _response(_buffer.data, _buffer.capacity, result);
return CompleterBase::SendReply(&_response.GetOutgoingMessage());
}
::fidl::Result fidl::WireServer<::fidl_test_protocols::WithErrorSyntax>::
HandleInResultCompleterBase::ReplySuccess(::fidl::BufferSpan _buffer,
::zx::handle&& h) {
::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResponse response;
response.h = std::move(h);
return Reply(
std::move(_buffer),
::fidl_test_protocols::wire::WithErrorSyntaxHandleInResultResult::
WithResponse(
::fidl::ObjectView<::fidl_test_protocols::wire::
WithErrorSyntaxHandleInResultResponse>::
FromExternal(&response)));
}
#endif // __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::
ResponseAsStruct>::_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kWithErrorSyntax_ResponseAsStruct_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ResponseAsStruct>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::kWithErrorSyntax_ResponseAsStruct_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::
ErrorAsPrimitive>::_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kWithErrorSyntax_ErrorAsPrimitive_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsPrimitive>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0,
::fidl_test_protocols::kWithErrorSyntax_ErrorAsPrimitive_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kWithErrorSyntax_ErrorAsEnum_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::ErrorAsEnum>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0, ::fidl_test_protocols::kWithErrorSyntax_ErrorAsEnum_Ordinal);
}
void ::fidl::WireRequest<::fidl_test_protocols::WithErrorSyntax::
HandleInResult>::_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kWithErrorSyntax_HandleInResult_Ordinal);
}
#ifdef __Fuchsia__
void ::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>::_InitHeader() {
fidl_init_txn_header(
&_hdr, 0, ::fidl_test_protocols::kWithErrorSyntax_HandleInResult_Ordinal);
}
void ::fidl::WireResponse<
::fidl_test_protocols::WithErrorSyntax::HandleInResult>::_CloseHandles() {
result._CloseHandles();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
#endif // __Fuchsia__
namespace fidl_test_protocols {
[[maybe_unused]] constexpr uint64_t kDiscoverableProtocol_Method_Ordinal =
16177161678225767lu;
extern "C" const fidl_type_t
fidl_test_protocols_DiscoverableProtocolMethodRequestTable;
extern "C" const fidl_type_t
fidl_test_protocols_DiscoverableProtocolMethodResponseTable;
#ifdef __Fuchsia__
} // namespace fidl_test_protocols
::fidl::WireResult<::fidl_test_protocols::DiscoverableProtocol::Method>::
WireResult(
::fidl::UnownedClientEnd<::fidl_test_protocols::DiscoverableProtocol>
_client) {
::fidl::OwnedEncodedMessage<
::fidl::WireRequest<::fidl_test_protocols::DiscoverableProtocol::Method>>
_request(::fidl::internal::AllowUnownedInputRef{}, zx_txid_t(0));
auto& _outgoing = _request.GetOutgoingMessage();
_outgoing.Write(_client);
SetResult(_outgoing);
}
namespace fidl_test_protocols {
#endif // __Fuchsia__
} // namespace fidl_test_protocols
#ifdef __Fuchsia__
::fidl::Result fidl::internal::WireClientImpl<
::fidl_test_protocols::DiscoverableProtocol>::Method() {
if (auto _channel = ::fidl::internal::ClientBase::GetChannel()) {
auto _res = ::fidl::WireResult<
::fidl_test_protocols::DiscoverableProtocol::Method>(
::fidl::UnownedClientEnd<::fidl_test_protocols::DiscoverableProtocol>(
_channel->handle()));
return _res;
}
return ::fidl::Result::Unbound();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
std::optional<::fidl::UnbindInfo> fidl::internal::
WireClientImpl<::fidl_test_protocols::DiscoverableProtocol>::DispatchEvent(
fidl::IncomingMessage& msg,
::fidl::internal::AsyncEventHandler* maybe_event_handler) {
return ::fidl::UnbindInfo::UnknownOrdinal();
}
#endif // __Fuchsia__
#ifdef __Fuchsia__
::fidl::DispatchResult fidl::internal::WireServerDispatcher<
::fidl_test_protocols::DiscoverableProtocol>::
TryDispatch(
::fidl::WireServer<::fidl_test_protocols::DiscoverableProtocol>* impl,
::fidl::IncomingMessage& msg, ::fidl::Transaction* txn) {
static const ::fidl::internal::MethodEntry entries[] = {
{
::fidl_test_protocols::kDiscoverableProtocol_Method_Ordinal,
[](void* interface, ::fidl::IncomingMessage&& msg,
::fidl::Transaction* txn) {
auto* primary = reinterpret_cast<::fidl::WireRequest<
::fidl_test_protocols::DiscoverableProtocol::Method>*>(
msg.bytes());
::fidl::WireServer<::fidl_test_protocols::DiscoverableProtocol>::
MethodCompleter::Sync completer(txn);
reinterpret_cast<::fidl::WireServer<
::fidl_test_protocols::DiscoverableProtocol>*>(interface)
->Method(primary, completer);
return ZX_OK;
},
},
};
return ::fidl::internal::TryDispatch(
impl, msg, txn, entries,
entries + sizeof(entries) / sizeof(::fidl::internal::MethodEntry));
}
::fidl::DispatchResult fidl::internal::
WireServerDispatcher<::fidl_test_protocols::DiscoverableProtocol>::Dispatch(
::fidl::WireServer<::fidl_test_protocols::DiscoverableProtocol>* impl,
::fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
::fidl::DispatchResult dispatch_result = TryDispatch(impl, msg, txn);
if (unlikely(dispatch_result == ::fidl::DispatchResult::kNotFound)) {
std::move(msg).CloseHandles();
txn->InternalError(::fidl::UnbindInfo::UnknownOrdinal());
}
return dispatch_result;
}
::fidl::DispatchResult
fidl::WireServer<::fidl_test_protocols::DiscoverableProtocol>::dispatch_message(
fidl::IncomingMessage&& msg, ::fidl::Transaction* txn) {
return ::fidl::internal::WireServerDispatcher<
::fidl_test_protocols::DiscoverableProtocol>::Dispatch(this,
std::move(msg),
txn);
}
#endif // __Fuchsia__
void ::fidl::WireRequest<::fidl_test_protocols::DiscoverableProtocol::Method>::
_InitHeader(zx_txid_t _txid) {
fidl_init_txn_header(
&_hdr, _txid,
::fidl_test_protocols::kDiscoverableProtocol_Method_Ordinal);
}
#ifdef __Fuchsia__
#endif // __Fuchsia__