| {{/* |
| // Copyright 2021 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:ClientImplOnewayBuffer:WireMessagingHeader" }} |
| {{ .Docs }} |
| {{- if .DocComments }} |
| // |
| {{- end }} |
| // Caller provides the backing storage for FIDL message. |
| ::fidl::OneWayStatus {{ .Name }}({{ RenderParams .RequestArgs }}); |
| {{ end }} |
| |
| |
| {{- define "Method:ClientImplOnewayBuffer:WireMessagingSource" }} |
| ::fidl::OneWayStatus {{ .Protocol.WireWeakOnewayBufferClientImpl.NoLeading }}::{{ .Name }}( |
| {{- RenderParams .RequestArgs }}) { |
| constexpr uint32_t _buffer_size = ::fidl::AsyncClientMethodBufferSizeInChannel<{{ .Marker }}>(); |
| ::fit::result<::fidl::Error, ::fidl::BufferSpan> _allocation = |
| _allocator().TryAllocate(_buffer_size); |
| if (!_allocation.is_ok()) { |
| return ::fidl::OneWayStatus{_allocation.error_value()}; |
| } |
| |
| {{ .WireTransactionalRequest }} _request{ {{ RenderForwardParams .RequestArgs }} }; |
| ::fidl::internal::UnownedEncodedMessage<{{ .WireTransactionalRequest }}> _request_message( |
| _allocation->data, _buffer_size, &_request); |
| return _client_base()->SendOneWay(_request_message.GetOutgoingMessage()); |
| } |
| {{- end }} |