blob: ef99a9d861217f1dccce70aa576f56911a244b55 [file] [log] [blame]
{{/*
// Copyright 2018 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 "GenerateSourceFile" -}}
// WARNING: This file is machine generated by fidlgen.
{{ "" }}
{{- range .Experiments }}
// fidl_experiment = {{ . }}
{{- end }}
#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
zx_status as zx_status,
fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect},
futures::future::{self, MaybeDone, TryFutureExt},
};
{{- if UsingCommon }}
pub use {{UseCommon}}::*;
{{- end }}
{{- if FDomain }}
use fdomain_client::fidl::{ControlHandle as _, Responder as _, FDomainFlexibleIntoResult as _};
{{- else if not IsCommon }}
use fidl::{
endpoints::{ControlHandle as _, Responder as _},
client::QueryResponseFut,
};
{{- end }}
{{- range .Aliases }}
{{ template "AliasDeclaration" . }}
{{- end }}
{{- if IsCommon }}
{{- range .Consts }}
{{ template "ConstDeclaration" . }}
{{- end }}
{{- range .Bits }}
{{ template "BitsDeclaration" . }}
{{- end }}
{{- range .Enums }}
{{ template "EnumDeclaration" . }}
{{- end }}
{{- end }}
{{- range .Structs }}
{{ template "StructDeclaration" . }}
{{- end }}
{{- range .Tables }}
{{ template "TableDeclaration" . }}
{{- end }}
{{- range .Unions }}
{{ template "UnionDeclaration" . }}
{{- end }}
{{- if IsCommon }}
{{- range .Protocols }}
{{ template "ProtocolOrdinals" . }}
{{- end }}
{{- else }}
{{- range .Protocols }}
{{ template "ProtocolDeclaration" . }}
{{ template "DriverProtocolDeclaration" . }}
{{- end }}
{{- if not FDomain }}
{{- range .Services }}
{{ template "ServiceDeclaration" . }}
{{- end }}
{{- end }}
{{- end }}
mod internal {
use super::*;
{{- if IsCommon }}
{{- range .Bits }}
{{ template "BitsInternal" . }}
{{- end }}
{{- range .Enums }}
{{ template "EnumInternal" . }}
{{- end }}
{{- end }}
{{- range .Structs }}
{{ template "StructInternal" . }}
{{- end }}
{{- range .Tables }}
{{ template "TableInternal" . }}
{{- end }}
{{- range .Unions }}
{{ template "UnionInternal" . }}
{{- end }}
}
{{- end }}