blob: 6b1d7a1c29c4adfbc04a1379c4840210e7f60f1c [file] [log] [blame]
{{/*
// Copyright 2019 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 "ResultDeclaration" }}
pub type {{ .Name }} = std::result::Result< (
{{- if gt (len .Ok) 1 }}
{{- range $ok := .Ok }}
{{ $ok.Type }},
{{- end }}
{{- else }}
{{- range $ok := .Ok }}
{{ $ok.Type }}
{{- end }}
{{- end }}
), {{ .ErrType }} >;
pub type {{ .Name }}HandleWrapper = std::result::Result< (
{{- range $ok := .Ok }}
{{ if $ok.HasHandleMetadata }}
{{ $ok.HandleWrapperName }}<{{ $ok.Type }}>,
{{ else }}
{{ $ok.Type }},
{{ end }}
{{- end }}
), {{ .ErrType }} >;
{{- end }}