blob: 385c15200c7b287501cda4911338861ed4a4245b [file] [log] [blame]
{{/*
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
*/}}
{{- define "Method:Types:WireMessagingHeader" }}
{{ IfdefFuchsia }}
{{ EnsureNamespace "" }}
template<>
struct {{ .WireMethodTypes }} {
using Completer = fidl::Completer<{{ .WireCompleterBase }}>;
{{ if .Result }}
using ApplicationError = {{ .Result.ErrorDecl }};
{{ end }}
using Thenable = ::fidl::internal::WireThenableImpl<
{{ .Marker }},
::fidl::unstable::OwnedEncodedMessage<
{{ .WireTransactionalRequest }}, {{ .Transport.Type }}
>
>;
using BufferThenable = ::fidl::internal::WireThenableImpl<
{{ .Marker }},
::fidl::unstable::UnownedEncodedMessage<
{{ .WireTransactionalRequest }}, {{ .Transport.Type }}
>
>;
};
{{ EndifFuchsia }}
{{- end }}
{{- define "Method:Types:NaturalMessagingHeader" }}
{{ EnsureNamespace "" }}
template<>
struct {{ .NaturalMethodTypes }} {
using Completer = fidl::Completer<{{ .NaturalCompleterBase }}>;
using ResultCallback =
::fit::callback<void ({{ .NaturalResult }}&)>;
{{ if .Result }}
static constexpr bool HasApplicationError = true;
{{ if .Result.ValueParameters }}
static constexpr bool IsEmptyStructPayload = false;
{{ else }}
static constexpr bool IsEmptyStructPayload = true;
{{ end }}
{{ else }}
static constexpr bool HasApplicationError = false;
{{ end }}
{{ if .ResponseArgs }}
static constexpr bool IsAbsentBody = false;
{{ else }}
static constexpr bool IsAbsentBody = true;
{{ end }}
};
{{- end }}