1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_hardware_audio_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct CodecConnectorConnectRequest {
16 pub codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for CodecConnectorConnectRequest
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct CompositeConnectorConnectRequest {
26 pub composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for CompositeConnectorConnectRequest
31{
32}
33
34#[derive(Debug, PartialEq)]
35pub struct CompositeCreateRingBufferRequest {
36 pub processing_element_id: u64,
37 pub format: Format,
38 pub ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
39}
40
41impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
42 for CompositeCreateRingBufferRequest
43{
44}
45
46#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
47pub struct DaiConnectorConnectRequest {
48 pub dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
49}
50
51impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
52 for DaiConnectorConnectRequest
53{
54}
55
56#[derive(Debug, PartialEq)]
57pub struct DaiCreateRingBufferRequest {
58 pub dai_format: DaiFormat,
59 pub ring_buffer_format: Format,
60 pub ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
61}
62
63impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
64 for DaiCreateRingBufferRequest
65{
66}
67
68#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
69pub struct RingBufferGetVmoResponse {
70 pub num_frames: u32,
71 pub ring_buffer: fidl::Vmo,
72}
73
74impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RingBufferGetVmoResponse {}
75
76#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
77pub struct StreamConfigConnectorConnectRequest {
78 pub protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
79}
80
81impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
82 for StreamConfigConnectorConnectRequest
83{
84}
85
86#[derive(Debug, PartialEq)]
87pub struct StreamConfigCreateRingBufferRequest {
88 pub format: Format,
89 pub ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
90}
91
92impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
93 for StreamConfigCreateRingBufferRequest
94{
95}
96
97#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
98pub struct CodecMarker;
99
100impl fidl::endpoints::ProtocolMarker for CodecMarker {
101 type Proxy = CodecProxy;
102 type RequestStream = CodecRequestStream;
103 #[cfg(target_os = "fuchsia")]
104 type SynchronousProxy = CodecSynchronousProxy;
105
106 const DEBUG_NAME: &'static str = "(anonymous) Codec";
107}
108pub type CodecGetDaiFormatsResult = Result<Vec<DaiSupportedFormats>, i32>;
109pub type CodecSetDaiFormatResult = Result<CodecFormatInfo, i32>;
110
111pub trait CodecProxyInterface: Send + Sync {
112 type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
113 + Send;
114 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
115 fn r#signal_processing_connect(
116 &self,
117 protocol: fidl::endpoints::ServerEnd<
118 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
119 >,
120 ) -> Result<(), fidl::Error>;
121 type ResetResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
122 fn r#reset(&self) -> Self::ResetResponseFut;
123 type GetPropertiesResponseFut: std::future::Future<Output = Result<CodecProperties, fidl::Error>>
124 + Send;
125 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
126 type StopResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
127 fn r#stop(&self) -> Self::StopResponseFut;
128 type StartResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
129 fn r#start(&self) -> Self::StartResponseFut;
130 type IsBridgeableResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
131 fn r#is_bridgeable(&self) -> Self::IsBridgeableResponseFut;
132 fn r#set_bridged_mode(&self, enable_bridged_mode: bool) -> Result<(), fidl::Error>;
133 type GetDaiFormatsResponseFut: std::future::Future<Output = Result<CodecGetDaiFormatsResult, fidl::Error>>
134 + Send;
135 fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut;
136 type SetDaiFormatResponseFut: std::future::Future<Output = Result<CodecSetDaiFormatResult, fidl::Error>>
137 + Send;
138 fn r#set_dai_format(&self, format: &DaiFormat) -> Self::SetDaiFormatResponseFut;
139 type WatchPlugStateResponseFut: std::future::Future<Output = Result<PlugState, fidl::Error>>
140 + Send;
141 fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut;
142}
143#[derive(Debug)]
144#[cfg(target_os = "fuchsia")]
145pub struct CodecSynchronousProxy {
146 client: fidl::client::sync::Client,
147}
148
149#[cfg(target_os = "fuchsia")]
150impl fidl::endpoints::SynchronousProxy for CodecSynchronousProxy {
151 type Proxy = CodecProxy;
152 type Protocol = CodecMarker;
153
154 fn from_channel(inner: fidl::Channel) -> Self {
155 Self::new(inner)
156 }
157
158 fn into_channel(self) -> fidl::Channel {
159 self.client.into_channel()
160 }
161
162 fn as_channel(&self) -> &fidl::Channel {
163 self.client.as_channel()
164 }
165}
166
167#[cfg(target_os = "fuchsia")]
168impl CodecSynchronousProxy {
169 pub fn new(channel: fidl::Channel) -> Self {
170 let protocol_name = <CodecMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
171 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
172 }
173
174 pub fn into_channel(self) -> fidl::Channel {
175 self.client.into_channel()
176 }
177
178 pub fn wait_for_event(
181 &self,
182 deadline: zx::MonotonicInstant,
183 ) -> Result<CodecEvent, fidl::Error> {
184 CodecEvent::decode(self.client.wait_for_event(deadline)?)
185 }
186
187 pub fn r#get_health_state(
190 &self,
191 ___deadline: zx::MonotonicInstant,
192 ) -> Result<HealthState, fidl::Error> {
193 let _response =
194 self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
195 (),
196 0x4e146d6bca733a84,
197 fidl::encoding::DynamicFlags::empty(),
198 ___deadline,
199 )?;
200 Ok(_response.state)
201 }
202
203 pub fn r#signal_processing_connect(
215 &self,
216 mut protocol: fidl::endpoints::ServerEnd<
217 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
218 >,
219 ) -> Result<(), fidl::Error> {
220 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
221 (protocol,),
222 0xa81907ce6066295,
223 fidl::encoding::DynamicFlags::empty(),
224 )
225 }
226
227 pub fn r#reset(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
232 let _response =
233 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
234 (),
235 0x50757ae579a7bd6b,
236 fidl::encoding::DynamicFlags::empty(),
237 ___deadline,
238 )?;
239 Ok(_response)
240 }
241
242 pub fn r#get_properties(
244 &self,
245 ___deadline: zx::MonotonicInstant,
246 ) -> Result<CodecProperties, fidl::Error> {
247 let _response =
248 self.client.send_query::<fidl::encoding::EmptyPayload, CodecGetPropertiesResponse>(
249 (),
250 0x7a0d138a6a1d9d90,
251 fidl::encoding::DynamicFlags::empty(),
252 ___deadline,
253 )?;
254 Ok(_response.properties)
255 }
256
257 pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<i64, fidl::Error> {
266 let _response = self.client.send_query::<fidl::encoding::EmptyPayload, CodecStopResponse>(
267 (),
268 0x5c2e380df1332dbd,
269 fidl::encoding::DynamicFlags::empty(),
270 ___deadline,
271 )?;
272 Ok(_response.stop_time)
273 }
274
275 pub fn r#start(&self, ___deadline: zx::MonotonicInstant) -> Result<i64, fidl::Error> {
284 let _response =
285 self.client.send_query::<fidl::encoding::EmptyPayload, CodecStartResponse>(
286 (),
287 0x329cdacb286ab00,
288 fidl::encoding::DynamicFlags::empty(),
289 ___deadline,
290 )?;
291 Ok(_response.start_time)
292 }
293
294 pub fn r#is_bridgeable(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
301 let _response =
302 self.client.send_query::<fidl::encoding::EmptyPayload, CodecIsBridgeableResponse>(
303 (),
304 0x26b0684f603f88ec,
305 fidl::encoding::DynamicFlags::empty(),
306 ___deadline,
307 )?;
308 Ok(_response.supports_bridged_mode)
309 }
310
311 pub fn r#set_bridged_mode(&self, mut enable_bridged_mode: bool) -> Result<(), fidl::Error> {
319 self.client.send::<CodecSetBridgedModeRequest>(
320 (enable_bridged_mode,),
321 0x2bd8f7bfd0b0aa36,
322 fidl::encoding::DynamicFlags::empty(),
323 )
324 }
325
326 pub fn r#get_dai_formats(
331 &self,
332 ___deadline: zx::MonotonicInstant,
333 ) -> Result<CodecGetDaiFormatsResult, fidl::Error> {
334 let _response = self.client.send_query::<
335 fidl::encoding::EmptyPayload,
336 fidl::encoding::ResultType<CodecGetDaiFormatsResponse, i32>,
337 >(
338 (),
339 0xf8bbc46b4ba6a52,
340 fidl::encoding::DynamicFlags::empty(),
341 ___deadline,
342 )?;
343 Ok(_response.map(|x| x.formats))
344 }
345
346 pub fn r#set_dai_format(
349 &self,
350 mut format: &DaiFormat,
351 ___deadline: zx::MonotonicInstant,
352 ) -> Result<CodecSetDaiFormatResult, fidl::Error> {
353 let _response = self.client.send_query::<
354 CodecSetDaiFormatRequest,
355 fidl::encoding::ResultType<CodecSetDaiFormatResponse, i32>,
356 >(
357 (format,),
358 0x2f829df9e5a7a1ea,
359 fidl::encoding::DynamicFlags::empty(),
360 ___deadline,
361 )?;
362 Ok(_response.map(|x| x.state))
363 }
364
365 pub fn r#watch_plug_state(
369 &self,
370 ___deadline: zx::MonotonicInstant,
371 ) -> Result<PlugState, fidl::Error> {
372 let _response =
373 self.client.send_query::<fidl::encoding::EmptyPayload, CodecWatchPlugStateResponse>(
374 (),
375 0x182b87f935ca7326,
376 fidl::encoding::DynamicFlags::empty(),
377 ___deadline,
378 )?;
379 Ok(_response.plug_state)
380 }
381}
382
383#[cfg(target_os = "fuchsia")]
384impl From<CodecSynchronousProxy> for zx::Handle {
385 fn from(value: CodecSynchronousProxy) -> Self {
386 value.into_channel().into()
387 }
388}
389
390#[cfg(target_os = "fuchsia")]
391impl From<fidl::Channel> for CodecSynchronousProxy {
392 fn from(value: fidl::Channel) -> Self {
393 Self::new(value)
394 }
395}
396
397#[derive(Debug, Clone)]
398pub struct CodecProxy {
399 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
400}
401
402impl fidl::endpoints::Proxy for CodecProxy {
403 type Protocol = CodecMarker;
404
405 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
406 Self::new(inner)
407 }
408
409 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
410 self.client.into_channel().map_err(|client| Self { client })
411 }
412
413 fn as_channel(&self) -> &::fidl::AsyncChannel {
414 self.client.as_channel()
415 }
416}
417
418impl CodecProxy {
419 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
421 let protocol_name = <CodecMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
422 Self { client: fidl::client::Client::new(channel, protocol_name) }
423 }
424
425 pub fn take_event_stream(&self) -> CodecEventStream {
431 CodecEventStream { event_receiver: self.client.take_event_receiver() }
432 }
433
434 pub fn r#get_health_state(
437 &self,
438 ) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
439 {
440 CodecProxyInterface::r#get_health_state(self)
441 }
442
443 pub fn r#signal_processing_connect(
455 &self,
456 mut protocol: fidl::endpoints::ServerEnd<
457 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
458 >,
459 ) -> Result<(), fidl::Error> {
460 CodecProxyInterface::r#signal_processing_connect(self, protocol)
461 }
462
463 pub fn r#reset(
468 &self,
469 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
470 CodecProxyInterface::r#reset(self)
471 }
472
473 pub fn r#get_properties(
475 &self,
476 ) -> fidl::client::QueryResponseFut<
477 CodecProperties,
478 fidl::encoding::DefaultFuchsiaResourceDialect,
479 > {
480 CodecProxyInterface::r#get_properties(self)
481 }
482
483 pub fn r#stop(
492 &self,
493 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
494 CodecProxyInterface::r#stop(self)
495 }
496
497 pub fn r#start(
506 &self,
507 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
508 CodecProxyInterface::r#start(self)
509 }
510
511 pub fn r#is_bridgeable(
518 &self,
519 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
520 CodecProxyInterface::r#is_bridgeable(self)
521 }
522
523 pub fn r#set_bridged_mode(&self, mut enable_bridged_mode: bool) -> Result<(), fidl::Error> {
531 CodecProxyInterface::r#set_bridged_mode(self, enable_bridged_mode)
532 }
533
534 pub fn r#get_dai_formats(
539 &self,
540 ) -> fidl::client::QueryResponseFut<
541 CodecGetDaiFormatsResult,
542 fidl::encoding::DefaultFuchsiaResourceDialect,
543 > {
544 CodecProxyInterface::r#get_dai_formats(self)
545 }
546
547 pub fn r#set_dai_format(
550 &self,
551 mut format: &DaiFormat,
552 ) -> fidl::client::QueryResponseFut<
553 CodecSetDaiFormatResult,
554 fidl::encoding::DefaultFuchsiaResourceDialect,
555 > {
556 CodecProxyInterface::r#set_dai_format(self, format)
557 }
558
559 pub fn r#watch_plug_state(
563 &self,
564 ) -> fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>
565 {
566 CodecProxyInterface::r#watch_plug_state(self)
567 }
568}
569
570impl CodecProxyInterface for CodecProxy {
571 type GetHealthStateResponseFut =
572 fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
573 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
574 fn _decode(
575 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
576 ) -> Result<HealthState, fidl::Error> {
577 let _response = fidl::client::decode_transaction_body::<
578 HealthGetHealthStateResponse,
579 fidl::encoding::DefaultFuchsiaResourceDialect,
580 0x4e146d6bca733a84,
581 >(_buf?)?;
582 Ok(_response.state)
583 }
584 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
585 (),
586 0x4e146d6bca733a84,
587 fidl::encoding::DynamicFlags::empty(),
588 _decode,
589 )
590 }
591
592 fn r#signal_processing_connect(
593 &self,
594 mut protocol: fidl::endpoints::ServerEnd<
595 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
596 >,
597 ) -> Result<(), fidl::Error> {
598 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
599 (protocol,),
600 0xa81907ce6066295,
601 fidl::encoding::DynamicFlags::empty(),
602 )
603 }
604
605 type ResetResponseFut =
606 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
607 fn r#reset(&self) -> Self::ResetResponseFut {
608 fn _decode(
609 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
610 ) -> Result<(), fidl::Error> {
611 let _response = fidl::client::decode_transaction_body::<
612 fidl::encoding::EmptyPayload,
613 fidl::encoding::DefaultFuchsiaResourceDialect,
614 0x50757ae579a7bd6b,
615 >(_buf?)?;
616 Ok(_response)
617 }
618 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
619 (),
620 0x50757ae579a7bd6b,
621 fidl::encoding::DynamicFlags::empty(),
622 _decode,
623 )
624 }
625
626 type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
627 CodecProperties,
628 fidl::encoding::DefaultFuchsiaResourceDialect,
629 >;
630 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
631 fn _decode(
632 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
633 ) -> Result<CodecProperties, fidl::Error> {
634 let _response = fidl::client::decode_transaction_body::<
635 CodecGetPropertiesResponse,
636 fidl::encoding::DefaultFuchsiaResourceDialect,
637 0x7a0d138a6a1d9d90,
638 >(_buf?)?;
639 Ok(_response.properties)
640 }
641 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CodecProperties>(
642 (),
643 0x7a0d138a6a1d9d90,
644 fidl::encoding::DynamicFlags::empty(),
645 _decode,
646 )
647 }
648
649 type StopResponseFut =
650 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
651 fn r#stop(&self) -> Self::StopResponseFut {
652 fn _decode(
653 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
654 ) -> Result<i64, fidl::Error> {
655 let _response = fidl::client::decode_transaction_body::<
656 CodecStopResponse,
657 fidl::encoding::DefaultFuchsiaResourceDialect,
658 0x5c2e380df1332dbd,
659 >(_buf?)?;
660 Ok(_response.stop_time)
661 }
662 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i64>(
663 (),
664 0x5c2e380df1332dbd,
665 fidl::encoding::DynamicFlags::empty(),
666 _decode,
667 )
668 }
669
670 type StartResponseFut =
671 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
672 fn r#start(&self) -> Self::StartResponseFut {
673 fn _decode(
674 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
675 ) -> Result<i64, fidl::Error> {
676 let _response = fidl::client::decode_transaction_body::<
677 CodecStartResponse,
678 fidl::encoding::DefaultFuchsiaResourceDialect,
679 0x329cdacb286ab00,
680 >(_buf?)?;
681 Ok(_response.start_time)
682 }
683 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i64>(
684 (),
685 0x329cdacb286ab00,
686 fidl::encoding::DynamicFlags::empty(),
687 _decode,
688 )
689 }
690
691 type IsBridgeableResponseFut =
692 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
693 fn r#is_bridgeable(&self) -> Self::IsBridgeableResponseFut {
694 fn _decode(
695 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
696 ) -> Result<bool, fidl::Error> {
697 let _response = fidl::client::decode_transaction_body::<
698 CodecIsBridgeableResponse,
699 fidl::encoding::DefaultFuchsiaResourceDialect,
700 0x26b0684f603f88ec,
701 >(_buf?)?;
702 Ok(_response.supports_bridged_mode)
703 }
704 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
705 (),
706 0x26b0684f603f88ec,
707 fidl::encoding::DynamicFlags::empty(),
708 _decode,
709 )
710 }
711
712 fn r#set_bridged_mode(&self, mut enable_bridged_mode: bool) -> Result<(), fidl::Error> {
713 self.client.send::<CodecSetBridgedModeRequest>(
714 (enable_bridged_mode,),
715 0x2bd8f7bfd0b0aa36,
716 fidl::encoding::DynamicFlags::empty(),
717 )
718 }
719
720 type GetDaiFormatsResponseFut = fidl::client::QueryResponseFut<
721 CodecGetDaiFormatsResult,
722 fidl::encoding::DefaultFuchsiaResourceDialect,
723 >;
724 fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut {
725 fn _decode(
726 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
727 ) -> Result<CodecGetDaiFormatsResult, fidl::Error> {
728 let _response = fidl::client::decode_transaction_body::<
729 fidl::encoding::ResultType<CodecGetDaiFormatsResponse, i32>,
730 fidl::encoding::DefaultFuchsiaResourceDialect,
731 0xf8bbc46b4ba6a52,
732 >(_buf?)?;
733 Ok(_response.map(|x| x.formats))
734 }
735 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CodecGetDaiFormatsResult>(
736 (),
737 0xf8bbc46b4ba6a52,
738 fidl::encoding::DynamicFlags::empty(),
739 _decode,
740 )
741 }
742
743 type SetDaiFormatResponseFut = fidl::client::QueryResponseFut<
744 CodecSetDaiFormatResult,
745 fidl::encoding::DefaultFuchsiaResourceDialect,
746 >;
747 fn r#set_dai_format(&self, mut format: &DaiFormat) -> Self::SetDaiFormatResponseFut {
748 fn _decode(
749 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
750 ) -> Result<CodecSetDaiFormatResult, fidl::Error> {
751 let _response = fidl::client::decode_transaction_body::<
752 fidl::encoding::ResultType<CodecSetDaiFormatResponse, i32>,
753 fidl::encoding::DefaultFuchsiaResourceDialect,
754 0x2f829df9e5a7a1ea,
755 >(_buf?)?;
756 Ok(_response.map(|x| x.state))
757 }
758 self.client.send_query_and_decode::<CodecSetDaiFormatRequest, CodecSetDaiFormatResult>(
759 (format,),
760 0x2f829df9e5a7a1ea,
761 fidl::encoding::DynamicFlags::empty(),
762 _decode,
763 )
764 }
765
766 type WatchPlugStateResponseFut =
767 fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>;
768 fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut {
769 fn _decode(
770 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
771 ) -> Result<PlugState, fidl::Error> {
772 let _response = fidl::client::decode_transaction_body::<
773 CodecWatchPlugStateResponse,
774 fidl::encoding::DefaultFuchsiaResourceDialect,
775 0x182b87f935ca7326,
776 >(_buf?)?;
777 Ok(_response.plug_state)
778 }
779 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PlugState>(
780 (),
781 0x182b87f935ca7326,
782 fidl::encoding::DynamicFlags::empty(),
783 _decode,
784 )
785 }
786}
787
788pub struct CodecEventStream {
789 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
790}
791
792impl std::marker::Unpin for CodecEventStream {}
793
794impl futures::stream::FusedStream for CodecEventStream {
795 fn is_terminated(&self) -> bool {
796 self.event_receiver.is_terminated()
797 }
798}
799
800impl futures::Stream for CodecEventStream {
801 type Item = Result<CodecEvent, fidl::Error>;
802
803 fn poll_next(
804 mut self: std::pin::Pin<&mut Self>,
805 cx: &mut std::task::Context<'_>,
806 ) -> std::task::Poll<Option<Self::Item>> {
807 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
808 &mut self.event_receiver,
809 cx
810 )?) {
811 Some(buf) => std::task::Poll::Ready(Some(CodecEvent::decode(buf))),
812 None => std::task::Poll::Ready(None),
813 }
814 }
815}
816
817#[derive(Debug)]
818pub enum CodecEvent {}
819
820impl CodecEvent {
821 fn decode(
823 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
824 ) -> Result<CodecEvent, fidl::Error> {
825 let (bytes, _handles) = buf.split_mut();
826 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
827 debug_assert_eq!(tx_header.tx_id, 0);
828 match tx_header.ordinal {
829 _ => Err(fidl::Error::UnknownOrdinal {
830 ordinal: tx_header.ordinal,
831 protocol_name: <CodecMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
832 }),
833 }
834 }
835}
836
837pub struct CodecRequestStream {
839 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
840 is_terminated: bool,
841}
842
843impl std::marker::Unpin for CodecRequestStream {}
844
845impl futures::stream::FusedStream for CodecRequestStream {
846 fn is_terminated(&self) -> bool {
847 self.is_terminated
848 }
849}
850
851impl fidl::endpoints::RequestStream for CodecRequestStream {
852 type Protocol = CodecMarker;
853 type ControlHandle = CodecControlHandle;
854
855 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
856 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
857 }
858
859 fn control_handle(&self) -> Self::ControlHandle {
860 CodecControlHandle { inner: self.inner.clone() }
861 }
862
863 fn into_inner(
864 self,
865 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
866 {
867 (self.inner, self.is_terminated)
868 }
869
870 fn from_inner(
871 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
872 is_terminated: bool,
873 ) -> Self {
874 Self { inner, is_terminated }
875 }
876}
877
878impl futures::Stream for CodecRequestStream {
879 type Item = Result<CodecRequest, fidl::Error>;
880
881 fn poll_next(
882 mut self: std::pin::Pin<&mut Self>,
883 cx: &mut std::task::Context<'_>,
884 ) -> std::task::Poll<Option<Self::Item>> {
885 let this = &mut *self;
886 if this.inner.check_shutdown(cx) {
887 this.is_terminated = true;
888 return std::task::Poll::Ready(None);
889 }
890 if this.is_terminated {
891 panic!("polled CodecRequestStream after completion");
892 }
893 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
894 |bytes, handles| {
895 match this.inner.channel().read_etc(cx, bytes, handles) {
896 std::task::Poll::Ready(Ok(())) => {}
897 std::task::Poll::Pending => return std::task::Poll::Pending,
898 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
899 this.is_terminated = true;
900 return std::task::Poll::Ready(None);
901 }
902 std::task::Poll::Ready(Err(e)) => {
903 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
904 e.into(),
905 ))))
906 }
907 }
908
909 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
911
912 std::task::Poll::Ready(Some(match header.ordinal {
913 0x4e146d6bca733a84 => {
914 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
915 let mut req = fidl::new_empty!(
916 fidl::encoding::EmptyPayload,
917 fidl::encoding::DefaultFuchsiaResourceDialect
918 );
919 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
920 let control_handle = CodecControlHandle { inner: this.inner.clone() };
921 Ok(CodecRequest::GetHealthState {
922 responder: CodecGetHealthStateResponder {
923 control_handle: std::mem::ManuallyDrop::new(control_handle),
924 tx_id: header.tx_id,
925 },
926 })
927 }
928 0xa81907ce6066295 => {
929 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
930 let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
931 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
932 let control_handle = CodecControlHandle { inner: this.inner.clone() };
933 Ok(CodecRequest::SignalProcessingConnect {
934 protocol: req.protocol,
935
936 control_handle,
937 })
938 }
939 0x50757ae579a7bd6b => {
940 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
941 let mut req = fidl::new_empty!(
942 fidl::encoding::EmptyPayload,
943 fidl::encoding::DefaultFuchsiaResourceDialect
944 );
945 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
946 let control_handle = CodecControlHandle { inner: this.inner.clone() };
947 Ok(CodecRequest::Reset {
948 responder: CodecResetResponder {
949 control_handle: std::mem::ManuallyDrop::new(control_handle),
950 tx_id: header.tx_id,
951 },
952 })
953 }
954 0x7a0d138a6a1d9d90 => {
955 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
956 let mut req = fidl::new_empty!(
957 fidl::encoding::EmptyPayload,
958 fidl::encoding::DefaultFuchsiaResourceDialect
959 );
960 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
961 let control_handle = CodecControlHandle { inner: this.inner.clone() };
962 Ok(CodecRequest::GetProperties {
963 responder: CodecGetPropertiesResponder {
964 control_handle: std::mem::ManuallyDrop::new(control_handle),
965 tx_id: header.tx_id,
966 },
967 })
968 }
969 0x5c2e380df1332dbd => {
970 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
971 let mut req = fidl::new_empty!(
972 fidl::encoding::EmptyPayload,
973 fidl::encoding::DefaultFuchsiaResourceDialect
974 );
975 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
976 let control_handle = CodecControlHandle { inner: this.inner.clone() };
977 Ok(CodecRequest::Stop {
978 responder: CodecStopResponder {
979 control_handle: std::mem::ManuallyDrop::new(control_handle),
980 tx_id: header.tx_id,
981 },
982 })
983 }
984 0x329cdacb286ab00 => {
985 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
986 let mut req = fidl::new_empty!(
987 fidl::encoding::EmptyPayload,
988 fidl::encoding::DefaultFuchsiaResourceDialect
989 );
990 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
991 let control_handle = CodecControlHandle { inner: this.inner.clone() };
992 Ok(CodecRequest::Start {
993 responder: CodecStartResponder {
994 control_handle: std::mem::ManuallyDrop::new(control_handle),
995 tx_id: header.tx_id,
996 },
997 })
998 }
999 0x26b0684f603f88ec => {
1000 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1001 let mut req = fidl::new_empty!(
1002 fidl::encoding::EmptyPayload,
1003 fidl::encoding::DefaultFuchsiaResourceDialect
1004 );
1005 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1006 let control_handle = CodecControlHandle { inner: this.inner.clone() };
1007 Ok(CodecRequest::IsBridgeable {
1008 responder: CodecIsBridgeableResponder {
1009 control_handle: std::mem::ManuallyDrop::new(control_handle),
1010 tx_id: header.tx_id,
1011 },
1012 })
1013 }
1014 0x2bd8f7bfd0b0aa36 => {
1015 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1016 let mut req = fidl::new_empty!(
1017 CodecSetBridgedModeRequest,
1018 fidl::encoding::DefaultFuchsiaResourceDialect
1019 );
1020 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CodecSetBridgedModeRequest>(&header, _body_bytes, handles, &mut req)?;
1021 let control_handle = CodecControlHandle { inner: this.inner.clone() };
1022 Ok(CodecRequest::SetBridgedMode {
1023 enable_bridged_mode: req.enable_bridged_mode,
1024
1025 control_handle,
1026 })
1027 }
1028 0xf8bbc46b4ba6a52 => {
1029 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1030 let mut req = fidl::new_empty!(
1031 fidl::encoding::EmptyPayload,
1032 fidl::encoding::DefaultFuchsiaResourceDialect
1033 );
1034 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1035 let control_handle = CodecControlHandle { inner: this.inner.clone() };
1036 Ok(CodecRequest::GetDaiFormats {
1037 responder: CodecGetDaiFormatsResponder {
1038 control_handle: std::mem::ManuallyDrop::new(control_handle),
1039 tx_id: header.tx_id,
1040 },
1041 })
1042 }
1043 0x2f829df9e5a7a1ea => {
1044 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1045 let mut req = fidl::new_empty!(
1046 CodecSetDaiFormatRequest,
1047 fidl::encoding::DefaultFuchsiaResourceDialect
1048 );
1049 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CodecSetDaiFormatRequest>(&header, _body_bytes, handles, &mut req)?;
1050 let control_handle = CodecControlHandle { inner: this.inner.clone() };
1051 Ok(CodecRequest::SetDaiFormat {
1052 format: req.format,
1053
1054 responder: CodecSetDaiFormatResponder {
1055 control_handle: std::mem::ManuallyDrop::new(control_handle),
1056 tx_id: header.tx_id,
1057 },
1058 })
1059 }
1060 0x182b87f935ca7326 => {
1061 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1062 let mut req = fidl::new_empty!(
1063 fidl::encoding::EmptyPayload,
1064 fidl::encoding::DefaultFuchsiaResourceDialect
1065 );
1066 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1067 let control_handle = CodecControlHandle { inner: this.inner.clone() };
1068 Ok(CodecRequest::WatchPlugState {
1069 responder: CodecWatchPlugStateResponder {
1070 control_handle: std::mem::ManuallyDrop::new(control_handle),
1071 tx_id: header.tx_id,
1072 },
1073 })
1074 }
1075 _ => Err(fidl::Error::UnknownOrdinal {
1076 ordinal: header.ordinal,
1077 protocol_name: <CodecMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1078 }),
1079 }))
1080 },
1081 )
1082 }
1083}
1084
1085#[derive(Debug)]
1094pub enum CodecRequest {
1095 GetHealthState { responder: CodecGetHealthStateResponder },
1098 SignalProcessingConnect {
1110 protocol: fidl::endpoints::ServerEnd<
1111 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
1112 >,
1113 control_handle: CodecControlHandle,
1114 },
1115 Reset { responder: CodecResetResponder },
1120 GetProperties { responder: CodecGetPropertiesResponder },
1122 Stop { responder: CodecStopResponder },
1131 Start { responder: CodecStartResponder },
1140 IsBridgeable { responder: CodecIsBridgeableResponder },
1147 SetBridgedMode { enable_bridged_mode: bool, control_handle: CodecControlHandle },
1155 GetDaiFormats { responder: CodecGetDaiFormatsResponder },
1160 SetDaiFormat { format: DaiFormat, responder: CodecSetDaiFormatResponder },
1163 WatchPlugState { responder: CodecWatchPlugStateResponder },
1167}
1168
1169impl CodecRequest {
1170 #[allow(irrefutable_let_patterns)]
1171 pub fn into_get_health_state(self) -> Option<(CodecGetHealthStateResponder)> {
1172 if let CodecRequest::GetHealthState { responder } = self {
1173 Some((responder))
1174 } else {
1175 None
1176 }
1177 }
1178
1179 #[allow(irrefutable_let_patterns)]
1180 pub fn into_signal_processing_connect(
1181 self,
1182 ) -> Option<(
1183 fidl::endpoints::ServerEnd<
1184 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
1185 >,
1186 CodecControlHandle,
1187 )> {
1188 if let CodecRequest::SignalProcessingConnect { protocol, control_handle } = self {
1189 Some((protocol, control_handle))
1190 } else {
1191 None
1192 }
1193 }
1194
1195 #[allow(irrefutable_let_patterns)]
1196 pub fn into_reset(self) -> Option<(CodecResetResponder)> {
1197 if let CodecRequest::Reset { responder } = self {
1198 Some((responder))
1199 } else {
1200 None
1201 }
1202 }
1203
1204 #[allow(irrefutable_let_patterns)]
1205 pub fn into_get_properties(self) -> Option<(CodecGetPropertiesResponder)> {
1206 if let CodecRequest::GetProperties { responder } = self {
1207 Some((responder))
1208 } else {
1209 None
1210 }
1211 }
1212
1213 #[allow(irrefutable_let_patterns)]
1214 pub fn into_stop(self) -> Option<(CodecStopResponder)> {
1215 if let CodecRequest::Stop { responder } = self {
1216 Some((responder))
1217 } else {
1218 None
1219 }
1220 }
1221
1222 #[allow(irrefutable_let_patterns)]
1223 pub fn into_start(self) -> Option<(CodecStartResponder)> {
1224 if let CodecRequest::Start { responder } = self {
1225 Some((responder))
1226 } else {
1227 None
1228 }
1229 }
1230
1231 #[allow(irrefutable_let_patterns)]
1232 pub fn into_is_bridgeable(self) -> Option<(CodecIsBridgeableResponder)> {
1233 if let CodecRequest::IsBridgeable { responder } = self {
1234 Some((responder))
1235 } else {
1236 None
1237 }
1238 }
1239
1240 #[allow(irrefutable_let_patterns)]
1241 pub fn into_set_bridged_mode(self) -> Option<(bool, CodecControlHandle)> {
1242 if let CodecRequest::SetBridgedMode { enable_bridged_mode, control_handle } = self {
1243 Some((enable_bridged_mode, control_handle))
1244 } else {
1245 None
1246 }
1247 }
1248
1249 #[allow(irrefutable_let_patterns)]
1250 pub fn into_get_dai_formats(self) -> Option<(CodecGetDaiFormatsResponder)> {
1251 if let CodecRequest::GetDaiFormats { responder } = self {
1252 Some((responder))
1253 } else {
1254 None
1255 }
1256 }
1257
1258 #[allow(irrefutable_let_patterns)]
1259 pub fn into_set_dai_format(self) -> Option<(DaiFormat, CodecSetDaiFormatResponder)> {
1260 if let CodecRequest::SetDaiFormat { format, responder } = self {
1261 Some((format, responder))
1262 } else {
1263 None
1264 }
1265 }
1266
1267 #[allow(irrefutable_let_patterns)]
1268 pub fn into_watch_plug_state(self) -> Option<(CodecWatchPlugStateResponder)> {
1269 if let CodecRequest::WatchPlugState { responder } = self {
1270 Some((responder))
1271 } else {
1272 None
1273 }
1274 }
1275
1276 pub fn method_name(&self) -> &'static str {
1278 match *self {
1279 CodecRequest::GetHealthState { .. } => "get_health_state",
1280 CodecRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
1281 CodecRequest::Reset { .. } => "reset",
1282 CodecRequest::GetProperties { .. } => "get_properties",
1283 CodecRequest::Stop { .. } => "stop",
1284 CodecRequest::Start { .. } => "start",
1285 CodecRequest::IsBridgeable { .. } => "is_bridgeable",
1286 CodecRequest::SetBridgedMode { .. } => "set_bridged_mode",
1287 CodecRequest::GetDaiFormats { .. } => "get_dai_formats",
1288 CodecRequest::SetDaiFormat { .. } => "set_dai_format",
1289 CodecRequest::WatchPlugState { .. } => "watch_plug_state",
1290 }
1291 }
1292}
1293
1294#[derive(Debug, Clone)]
1295pub struct CodecControlHandle {
1296 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1297}
1298
1299impl fidl::endpoints::ControlHandle for CodecControlHandle {
1300 fn shutdown(&self) {
1301 self.inner.shutdown()
1302 }
1303 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1304 self.inner.shutdown_with_epitaph(status)
1305 }
1306
1307 fn is_closed(&self) -> bool {
1308 self.inner.channel().is_closed()
1309 }
1310 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1311 self.inner.channel().on_closed()
1312 }
1313
1314 #[cfg(target_os = "fuchsia")]
1315 fn signal_peer(
1316 &self,
1317 clear_mask: zx::Signals,
1318 set_mask: zx::Signals,
1319 ) -> Result<(), zx_status::Status> {
1320 use fidl::Peered;
1321 self.inner.channel().signal_peer(clear_mask, set_mask)
1322 }
1323}
1324
1325impl CodecControlHandle {}
1326
1327#[must_use = "FIDL methods require a response to be sent"]
1328#[derive(Debug)]
1329pub struct CodecGetHealthStateResponder {
1330 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1331 tx_id: u32,
1332}
1333
1334impl std::ops::Drop for CodecGetHealthStateResponder {
1338 fn drop(&mut self) {
1339 self.control_handle.shutdown();
1340 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1342 }
1343}
1344
1345impl fidl::endpoints::Responder for CodecGetHealthStateResponder {
1346 type ControlHandle = CodecControlHandle;
1347
1348 fn control_handle(&self) -> &CodecControlHandle {
1349 &self.control_handle
1350 }
1351
1352 fn drop_without_shutdown(mut self) {
1353 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1355 std::mem::forget(self);
1357 }
1358}
1359
1360impl CodecGetHealthStateResponder {
1361 pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
1365 let _result = self.send_raw(state);
1366 if _result.is_err() {
1367 self.control_handle.shutdown();
1368 }
1369 self.drop_without_shutdown();
1370 _result
1371 }
1372
1373 pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
1375 let _result = self.send_raw(state);
1376 self.drop_without_shutdown();
1377 _result
1378 }
1379
1380 fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
1381 self.control_handle.inner.send::<HealthGetHealthStateResponse>(
1382 (state,),
1383 self.tx_id,
1384 0x4e146d6bca733a84,
1385 fidl::encoding::DynamicFlags::empty(),
1386 )
1387 }
1388}
1389
1390#[must_use = "FIDL methods require a response to be sent"]
1391#[derive(Debug)]
1392pub struct CodecResetResponder {
1393 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1394 tx_id: u32,
1395}
1396
1397impl std::ops::Drop for CodecResetResponder {
1401 fn drop(&mut self) {
1402 self.control_handle.shutdown();
1403 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1405 }
1406}
1407
1408impl fidl::endpoints::Responder for CodecResetResponder {
1409 type ControlHandle = CodecControlHandle;
1410
1411 fn control_handle(&self) -> &CodecControlHandle {
1412 &self.control_handle
1413 }
1414
1415 fn drop_without_shutdown(mut self) {
1416 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1418 std::mem::forget(self);
1420 }
1421}
1422
1423impl CodecResetResponder {
1424 pub fn send(self) -> Result<(), fidl::Error> {
1428 let _result = self.send_raw();
1429 if _result.is_err() {
1430 self.control_handle.shutdown();
1431 }
1432 self.drop_without_shutdown();
1433 _result
1434 }
1435
1436 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1438 let _result = self.send_raw();
1439 self.drop_without_shutdown();
1440 _result
1441 }
1442
1443 fn send_raw(&self) -> Result<(), fidl::Error> {
1444 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1445 (),
1446 self.tx_id,
1447 0x50757ae579a7bd6b,
1448 fidl::encoding::DynamicFlags::empty(),
1449 )
1450 }
1451}
1452
1453#[must_use = "FIDL methods require a response to be sent"]
1454#[derive(Debug)]
1455pub struct CodecGetPropertiesResponder {
1456 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1457 tx_id: u32,
1458}
1459
1460impl std::ops::Drop for CodecGetPropertiesResponder {
1464 fn drop(&mut self) {
1465 self.control_handle.shutdown();
1466 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1468 }
1469}
1470
1471impl fidl::endpoints::Responder for CodecGetPropertiesResponder {
1472 type ControlHandle = CodecControlHandle;
1473
1474 fn control_handle(&self) -> &CodecControlHandle {
1475 &self.control_handle
1476 }
1477
1478 fn drop_without_shutdown(mut self) {
1479 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1481 std::mem::forget(self);
1483 }
1484}
1485
1486impl CodecGetPropertiesResponder {
1487 pub fn send(self, mut properties: &CodecProperties) -> Result<(), fidl::Error> {
1491 let _result = self.send_raw(properties);
1492 if _result.is_err() {
1493 self.control_handle.shutdown();
1494 }
1495 self.drop_without_shutdown();
1496 _result
1497 }
1498
1499 pub fn send_no_shutdown_on_err(
1501 self,
1502 mut properties: &CodecProperties,
1503 ) -> Result<(), fidl::Error> {
1504 let _result = self.send_raw(properties);
1505 self.drop_without_shutdown();
1506 _result
1507 }
1508
1509 fn send_raw(&self, mut properties: &CodecProperties) -> Result<(), fidl::Error> {
1510 self.control_handle.inner.send::<CodecGetPropertiesResponse>(
1511 (properties,),
1512 self.tx_id,
1513 0x7a0d138a6a1d9d90,
1514 fidl::encoding::DynamicFlags::empty(),
1515 )
1516 }
1517}
1518
1519#[must_use = "FIDL methods require a response to be sent"]
1520#[derive(Debug)]
1521pub struct CodecStopResponder {
1522 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1523 tx_id: u32,
1524}
1525
1526impl std::ops::Drop for CodecStopResponder {
1530 fn drop(&mut self) {
1531 self.control_handle.shutdown();
1532 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1534 }
1535}
1536
1537impl fidl::endpoints::Responder for CodecStopResponder {
1538 type ControlHandle = CodecControlHandle;
1539
1540 fn control_handle(&self) -> &CodecControlHandle {
1541 &self.control_handle
1542 }
1543
1544 fn drop_without_shutdown(mut self) {
1545 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1547 std::mem::forget(self);
1549 }
1550}
1551
1552impl CodecStopResponder {
1553 pub fn send(self, mut stop_time: i64) -> Result<(), fidl::Error> {
1557 let _result = self.send_raw(stop_time);
1558 if _result.is_err() {
1559 self.control_handle.shutdown();
1560 }
1561 self.drop_without_shutdown();
1562 _result
1563 }
1564
1565 pub fn send_no_shutdown_on_err(self, mut stop_time: i64) -> Result<(), fidl::Error> {
1567 let _result = self.send_raw(stop_time);
1568 self.drop_without_shutdown();
1569 _result
1570 }
1571
1572 fn send_raw(&self, mut stop_time: i64) -> Result<(), fidl::Error> {
1573 self.control_handle.inner.send::<CodecStopResponse>(
1574 (stop_time,),
1575 self.tx_id,
1576 0x5c2e380df1332dbd,
1577 fidl::encoding::DynamicFlags::empty(),
1578 )
1579 }
1580}
1581
1582#[must_use = "FIDL methods require a response to be sent"]
1583#[derive(Debug)]
1584pub struct CodecStartResponder {
1585 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1586 tx_id: u32,
1587}
1588
1589impl std::ops::Drop for CodecStartResponder {
1593 fn drop(&mut self) {
1594 self.control_handle.shutdown();
1595 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1597 }
1598}
1599
1600impl fidl::endpoints::Responder for CodecStartResponder {
1601 type ControlHandle = CodecControlHandle;
1602
1603 fn control_handle(&self) -> &CodecControlHandle {
1604 &self.control_handle
1605 }
1606
1607 fn drop_without_shutdown(mut self) {
1608 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1610 std::mem::forget(self);
1612 }
1613}
1614
1615impl CodecStartResponder {
1616 pub fn send(self, mut start_time: i64) -> Result<(), fidl::Error> {
1620 let _result = self.send_raw(start_time);
1621 if _result.is_err() {
1622 self.control_handle.shutdown();
1623 }
1624 self.drop_without_shutdown();
1625 _result
1626 }
1627
1628 pub fn send_no_shutdown_on_err(self, mut start_time: i64) -> Result<(), fidl::Error> {
1630 let _result = self.send_raw(start_time);
1631 self.drop_without_shutdown();
1632 _result
1633 }
1634
1635 fn send_raw(&self, mut start_time: i64) -> Result<(), fidl::Error> {
1636 self.control_handle.inner.send::<CodecStartResponse>(
1637 (start_time,),
1638 self.tx_id,
1639 0x329cdacb286ab00,
1640 fidl::encoding::DynamicFlags::empty(),
1641 )
1642 }
1643}
1644
1645#[must_use = "FIDL methods require a response to be sent"]
1646#[derive(Debug)]
1647pub struct CodecIsBridgeableResponder {
1648 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1649 tx_id: u32,
1650}
1651
1652impl std::ops::Drop for CodecIsBridgeableResponder {
1656 fn drop(&mut self) {
1657 self.control_handle.shutdown();
1658 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1660 }
1661}
1662
1663impl fidl::endpoints::Responder for CodecIsBridgeableResponder {
1664 type ControlHandle = CodecControlHandle;
1665
1666 fn control_handle(&self) -> &CodecControlHandle {
1667 &self.control_handle
1668 }
1669
1670 fn drop_without_shutdown(mut self) {
1671 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1673 std::mem::forget(self);
1675 }
1676}
1677
1678impl CodecIsBridgeableResponder {
1679 pub fn send(self, mut supports_bridged_mode: bool) -> Result<(), fidl::Error> {
1683 let _result = self.send_raw(supports_bridged_mode);
1684 if _result.is_err() {
1685 self.control_handle.shutdown();
1686 }
1687 self.drop_without_shutdown();
1688 _result
1689 }
1690
1691 pub fn send_no_shutdown_on_err(
1693 self,
1694 mut supports_bridged_mode: bool,
1695 ) -> Result<(), fidl::Error> {
1696 let _result = self.send_raw(supports_bridged_mode);
1697 self.drop_without_shutdown();
1698 _result
1699 }
1700
1701 fn send_raw(&self, mut supports_bridged_mode: bool) -> Result<(), fidl::Error> {
1702 self.control_handle.inner.send::<CodecIsBridgeableResponse>(
1703 (supports_bridged_mode,),
1704 self.tx_id,
1705 0x26b0684f603f88ec,
1706 fidl::encoding::DynamicFlags::empty(),
1707 )
1708 }
1709}
1710
1711#[must_use = "FIDL methods require a response to be sent"]
1712#[derive(Debug)]
1713pub struct CodecGetDaiFormatsResponder {
1714 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1715 tx_id: u32,
1716}
1717
1718impl std::ops::Drop for CodecGetDaiFormatsResponder {
1722 fn drop(&mut self) {
1723 self.control_handle.shutdown();
1724 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1726 }
1727}
1728
1729impl fidl::endpoints::Responder for CodecGetDaiFormatsResponder {
1730 type ControlHandle = CodecControlHandle;
1731
1732 fn control_handle(&self) -> &CodecControlHandle {
1733 &self.control_handle
1734 }
1735
1736 fn drop_without_shutdown(mut self) {
1737 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1739 std::mem::forget(self);
1741 }
1742}
1743
1744impl CodecGetDaiFormatsResponder {
1745 pub fn send(self, mut result: Result<&[DaiSupportedFormats], i32>) -> Result<(), fidl::Error> {
1749 let _result = self.send_raw(result);
1750 if _result.is_err() {
1751 self.control_handle.shutdown();
1752 }
1753 self.drop_without_shutdown();
1754 _result
1755 }
1756
1757 pub fn send_no_shutdown_on_err(
1759 self,
1760 mut result: Result<&[DaiSupportedFormats], i32>,
1761 ) -> Result<(), fidl::Error> {
1762 let _result = self.send_raw(result);
1763 self.drop_without_shutdown();
1764 _result
1765 }
1766
1767 fn send_raw(&self, mut result: Result<&[DaiSupportedFormats], i32>) -> Result<(), fidl::Error> {
1768 self.control_handle
1769 .inner
1770 .send::<fidl::encoding::ResultType<CodecGetDaiFormatsResponse, i32>>(
1771 result.map(|formats| (formats,)),
1772 self.tx_id,
1773 0xf8bbc46b4ba6a52,
1774 fidl::encoding::DynamicFlags::empty(),
1775 )
1776 }
1777}
1778
1779#[must_use = "FIDL methods require a response to be sent"]
1780#[derive(Debug)]
1781pub struct CodecSetDaiFormatResponder {
1782 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1783 tx_id: u32,
1784}
1785
1786impl std::ops::Drop for CodecSetDaiFormatResponder {
1790 fn drop(&mut self) {
1791 self.control_handle.shutdown();
1792 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1794 }
1795}
1796
1797impl fidl::endpoints::Responder for CodecSetDaiFormatResponder {
1798 type ControlHandle = CodecControlHandle;
1799
1800 fn control_handle(&self) -> &CodecControlHandle {
1801 &self.control_handle
1802 }
1803
1804 fn drop_without_shutdown(mut self) {
1805 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1807 std::mem::forget(self);
1809 }
1810}
1811
1812impl CodecSetDaiFormatResponder {
1813 pub fn send(self, mut result: Result<&CodecFormatInfo, i32>) -> Result<(), fidl::Error> {
1817 let _result = self.send_raw(result);
1818 if _result.is_err() {
1819 self.control_handle.shutdown();
1820 }
1821 self.drop_without_shutdown();
1822 _result
1823 }
1824
1825 pub fn send_no_shutdown_on_err(
1827 self,
1828 mut result: Result<&CodecFormatInfo, i32>,
1829 ) -> Result<(), fidl::Error> {
1830 let _result = self.send_raw(result);
1831 self.drop_without_shutdown();
1832 _result
1833 }
1834
1835 fn send_raw(&self, mut result: Result<&CodecFormatInfo, i32>) -> Result<(), fidl::Error> {
1836 self.control_handle
1837 .inner
1838 .send::<fidl::encoding::ResultType<CodecSetDaiFormatResponse, i32>>(
1839 result.map(|state| (state,)),
1840 self.tx_id,
1841 0x2f829df9e5a7a1ea,
1842 fidl::encoding::DynamicFlags::empty(),
1843 )
1844 }
1845}
1846
1847#[must_use = "FIDL methods require a response to be sent"]
1848#[derive(Debug)]
1849pub struct CodecWatchPlugStateResponder {
1850 control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
1851 tx_id: u32,
1852}
1853
1854impl std::ops::Drop for CodecWatchPlugStateResponder {
1858 fn drop(&mut self) {
1859 self.control_handle.shutdown();
1860 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1862 }
1863}
1864
1865impl fidl::endpoints::Responder for CodecWatchPlugStateResponder {
1866 type ControlHandle = CodecControlHandle;
1867
1868 fn control_handle(&self) -> &CodecControlHandle {
1869 &self.control_handle
1870 }
1871
1872 fn drop_without_shutdown(mut self) {
1873 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1875 std::mem::forget(self);
1877 }
1878}
1879
1880impl CodecWatchPlugStateResponder {
1881 pub fn send(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
1885 let _result = self.send_raw(plug_state);
1886 if _result.is_err() {
1887 self.control_handle.shutdown();
1888 }
1889 self.drop_without_shutdown();
1890 _result
1891 }
1892
1893 pub fn send_no_shutdown_on_err(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
1895 let _result = self.send_raw(plug_state);
1896 self.drop_without_shutdown();
1897 _result
1898 }
1899
1900 fn send_raw(&self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
1901 self.control_handle.inner.send::<CodecWatchPlugStateResponse>(
1902 (plug_state,),
1903 self.tx_id,
1904 0x182b87f935ca7326,
1905 fidl::encoding::DynamicFlags::empty(),
1906 )
1907 }
1908}
1909
1910#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1911pub struct CodecConnectorMarker;
1912
1913impl fidl::endpoints::ProtocolMarker for CodecConnectorMarker {
1914 type Proxy = CodecConnectorProxy;
1915 type RequestStream = CodecConnectorRequestStream;
1916 #[cfg(target_os = "fuchsia")]
1917 type SynchronousProxy = CodecConnectorSynchronousProxy;
1918
1919 const DEBUG_NAME: &'static str = "(anonymous) CodecConnector";
1920}
1921
1922pub trait CodecConnectorProxyInterface: Send + Sync {
1923 fn r#connect(
1924 &self,
1925 codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
1926 ) -> Result<(), fidl::Error>;
1927}
1928#[derive(Debug)]
1929#[cfg(target_os = "fuchsia")]
1930pub struct CodecConnectorSynchronousProxy {
1931 client: fidl::client::sync::Client,
1932}
1933
1934#[cfg(target_os = "fuchsia")]
1935impl fidl::endpoints::SynchronousProxy for CodecConnectorSynchronousProxy {
1936 type Proxy = CodecConnectorProxy;
1937 type Protocol = CodecConnectorMarker;
1938
1939 fn from_channel(inner: fidl::Channel) -> Self {
1940 Self::new(inner)
1941 }
1942
1943 fn into_channel(self) -> fidl::Channel {
1944 self.client.into_channel()
1945 }
1946
1947 fn as_channel(&self) -> &fidl::Channel {
1948 self.client.as_channel()
1949 }
1950}
1951
1952#[cfg(target_os = "fuchsia")]
1953impl CodecConnectorSynchronousProxy {
1954 pub fn new(channel: fidl::Channel) -> Self {
1955 let protocol_name = <CodecConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1956 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1957 }
1958
1959 pub fn into_channel(self) -> fidl::Channel {
1960 self.client.into_channel()
1961 }
1962
1963 pub fn wait_for_event(
1966 &self,
1967 deadline: zx::MonotonicInstant,
1968 ) -> Result<CodecConnectorEvent, fidl::Error> {
1969 CodecConnectorEvent::decode(self.client.wait_for_event(deadline)?)
1970 }
1971
1972 pub fn r#connect(
1976 &self,
1977 mut codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
1978 ) -> Result<(), fidl::Error> {
1979 self.client.send::<CodecConnectorConnectRequest>(
1980 (codec_protocol,),
1981 0x1413f551544026c9,
1982 fidl::encoding::DynamicFlags::empty(),
1983 )
1984 }
1985}
1986
1987#[cfg(target_os = "fuchsia")]
1988impl From<CodecConnectorSynchronousProxy> for zx::Handle {
1989 fn from(value: CodecConnectorSynchronousProxy) -> Self {
1990 value.into_channel().into()
1991 }
1992}
1993
1994#[cfg(target_os = "fuchsia")]
1995impl From<fidl::Channel> for CodecConnectorSynchronousProxy {
1996 fn from(value: fidl::Channel) -> Self {
1997 Self::new(value)
1998 }
1999}
2000
2001#[derive(Debug, Clone)]
2002pub struct CodecConnectorProxy {
2003 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2004}
2005
2006impl fidl::endpoints::Proxy for CodecConnectorProxy {
2007 type Protocol = CodecConnectorMarker;
2008
2009 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2010 Self::new(inner)
2011 }
2012
2013 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2014 self.client.into_channel().map_err(|client| Self { client })
2015 }
2016
2017 fn as_channel(&self) -> &::fidl::AsyncChannel {
2018 self.client.as_channel()
2019 }
2020}
2021
2022impl CodecConnectorProxy {
2023 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2025 let protocol_name = <CodecConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2026 Self { client: fidl::client::Client::new(channel, protocol_name) }
2027 }
2028
2029 pub fn take_event_stream(&self) -> CodecConnectorEventStream {
2035 CodecConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2036 }
2037
2038 pub fn r#connect(
2042 &self,
2043 mut codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
2044 ) -> Result<(), fidl::Error> {
2045 CodecConnectorProxyInterface::r#connect(self, codec_protocol)
2046 }
2047}
2048
2049impl CodecConnectorProxyInterface for CodecConnectorProxy {
2050 fn r#connect(
2051 &self,
2052 mut codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
2053 ) -> Result<(), fidl::Error> {
2054 self.client.send::<CodecConnectorConnectRequest>(
2055 (codec_protocol,),
2056 0x1413f551544026c9,
2057 fidl::encoding::DynamicFlags::empty(),
2058 )
2059 }
2060}
2061
2062pub struct CodecConnectorEventStream {
2063 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2064}
2065
2066impl std::marker::Unpin for CodecConnectorEventStream {}
2067
2068impl futures::stream::FusedStream for CodecConnectorEventStream {
2069 fn is_terminated(&self) -> bool {
2070 self.event_receiver.is_terminated()
2071 }
2072}
2073
2074impl futures::Stream for CodecConnectorEventStream {
2075 type Item = Result<CodecConnectorEvent, fidl::Error>;
2076
2077 fn poll_next(
2078 mut self: std::pin::Pin<&mut Self>,
2079 cx: &mut std::task::Context<'_>,
2080 ) -> std::task::Poll<Option<Self::Item>> {
2081 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2082 &mut self.event_receiver,
2083 cx
2084 )?) {
2085 Some(buf) => std::task::Poll::Ready(Some(CodecConnectorEvent::decode(buf))),
2086 None => std::task::Poll::Ready(None),
2087 }
2088 }
2089}
2090
2091#[derive(Debug)]
2092pub enum CodecConnectorEvent {}
2093
2094impl CodecConnectorEvent {
2095 fn decode(
2097 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2098 ) -> Result<CodecConnectorEvent, fidl::Error> {
2099 let (bytes, _handles) = buf.split_mut();
2100 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2101 debug_assert_eq!(tx_header.tx_id, 0);
2102 match tx_header.ordinal {
2103 _ => Err(fidl::Error::UnknownOrdinal {
2104 ordinal: tx_header.ordinal,
2105 protocol_name:
2106 <CodecConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2107 }),
2108 }
2109 }
2110}
2111
2112pub struct CodecConnectorRequestStream {
2114 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2115 is_terminated: bool,
2116}
2117
2118impl std::marker::Unpin for CodecConnectorRequestStream {}
2119
2120impl futures::stream::FusedStream for CodecConnectorRequestStream {
2121 fn is_terminated(&self) -> bool {
2122 self.is_terminated
2123 }
2124}
2125
2126impl fidl::endpoints::RequestStream for CodecConnectorRequestStream {
2127 type Protocol = CodecConnectorMarker;
2128 type ControlHandle = CodecConnectorControlHandle;
2129
2130 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2131 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2132 }
2133
2134 fn control_handle(&self) -> Self::ControlHandle {
2135 CodecConnectorControlHandle { inner: self.inner.clone() }
2136 }
2137
2138 fn into_inner(
2139 self,
2140 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2141 {
2142 (self.inner, self.is_terminated)
2143 }
2144
2145 fn from_inner(
2146 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2147 is_terminated: bool,
2148 ) -> Self {
2149 Self { inner, is_terminated }
2150 }
2151}
2152
2153impl futures::Stream for CodecConnectorRequestStream {
2154 type Item = Result<CodecConnectorRequest, fidl::Error>;
2155
2156 fn poll_next(
2157 mut self: std::pin::Pin<&mut Self>,
2158 cx: &mut std::task::Context<'_>,
2159 ) -> std::task::Poll<Option<Self::Item>> {
2160 let this = &mut *self;
2161 if this.inner.check_shutdown(cx) {
2162 this.is_terminated = true;
2163 return std::task::Poll::Ready(None);
2164 }
2165 if this.is_terminated {
2166 panic!("polled CodecConnectorRequestStream after completion");
2167 }
2168 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2169 |bytes, handles| {
2170 match this.inner.channel().read_etc(cx, bytes, handles) {
2171 std::task::Poll::Ready(Ok(())) => {}
2172 std::task::Poll::Pending => return std::task::Poll::Pending,
2173 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2174 this.is_terminated = true;
2175 return std::task::Poll::Ready(None);
2176 }
2177 std::task::Poll::Ready(Err(e)) => {
2178 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2179 e.into(),
2180 ))))
2181 }
2182 }
2183
2184 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2186
2187 std::task::Poll::Ready(Some(match header.ordinal {
2188 0x1413f551544026c9 => {
2189 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2190 let mut req = fidl::new_empty!(
2191 CodecConnectorConnectRequest,
2192 fidl::encoding::DefaultFuchsiaResourceDialect
2193 );
2194 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CodecConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2195 let control_handle =
2196 CodecConnectorControlHandle { inner: this.inner.clone() };
2197 Ok(CodecConnectorRequest::Connect {
2198 codec_protocol: req.codec_protocol,
2199
2200 control_handle,
2201 })
2202 }
2203 _ => Err(fidl::Error::UnknownOrdinal {
2204 ordinal: header.ordinal,
2205 protocol_name:
2206 <CodecConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2207 }),
2208 }))
2209 },
2210 )
2211 }
2212}
2213
2214#[derive(Debug)]
2223pub enum CodecConnectorRequest {
2224 Connect {
2228 codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
2229 control_handle: CodecConnectorControlHandle,
2230 },
2231}
2232
2233impl CodecConnectorRequest {
2234 #[allow(irrefutable_let_patterns)]
2235 pub fn into_connect(
2236 self,
2237 ) -> Option<(fidl::endpoints::ServerEnd<CodecMarker>, CodecConnectorControlHandle)> {
2238 if let CodecConnectorRequest::Connect { codec_protocol, control_handle } = self {
2239 Some((codec_protocol, control_handle))
2240 } else {
2241 None
2242 }
2243 }
2244
2245 pub fn method_name(&self) -> &'static str {
2247 match *self {
2248 CodecConnectorRequest::Connect { .. } => "connect",
2249 }
2250 }
2251}
2252
2253#[derive(Debug, Clone)]
2254pub struct CodecConnectorControlHandle {
2255 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2256}
2257
2258impl fidl::endpoints::ControlHandle for CodecConnectorControlHandle {
2259 fn shutdown(&self) {
2260 self.inner.shutdown()
2261 }
2262 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2263 self.inner.shutdown_with_epitaph(status)
2264 }
2265
2266 fn is_closed(&self) -> bool {
2267 self.inner.channel().is_closed()
2268 }
2269 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2270 self.inner.channel().on_closed()
2271 }
2272
2273 #[cfg(target_os = "fuchsia")]
2274 fn signal_peer(
2275 &self,
2276 clear_mask: zx::Signals,
2277 set_mask: zx::Signals,
2278 ) -> Result<(), zx_status::Status> {
2279 use fidl::Peered;
2280 self.inner.channel().signal_peer(clear_mask, set_mask)
2281 }
2282}
2283
2284impl CodecConnectorControlHandle {}
2285
2286#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2287pub struct CompositeMarker;
2288
2289impl fidl::endpoints::ProtocolMarker for CompositeMarker {
2290 type Proxy = CompositeProxy;
2291 type RequestStream = CompositeRequestStream;
2292 #[cfg(target_os = "fuchsia")]
2293 type SynchronousProxy = CompositeSynchronousProxy;
2294
2295 const DEBUG_NAME: &'static str = "(anonymous) Composite";
2296}
2297pub type CompositeResetResult = Result<(), DriverError>;
2298pub type CompositeGetRingBufferFormatsResult = Result<Vec<SupportedFormats>, DriverError>;
2299pub type CompositeCreateRingBufferResult = Result<(), DriverError>;
2300pub type CompositeGetDaiFormatsResult = Result<Vec<DaiSupportedFormats>, DriverError>;
2301pub type CompositeSetDaiFormatResult = Result<(), DriverError>;
2302
2303pub trait CompositeProxyInterface: Send + Sync {
2304 type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
2305 + Send;
2306 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
2307 fn r#signal_processing_connect(
2308 &self,
2309 protocol: fidl::endpoints::ServerEnd<
2310 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
2311 >,
2312 ) -> Result<(), fidl::Error>;
2313 type ResetResponseFut: std::future::Future<Output = Result<CompositeResetResult, fidl::Error>>
2314 + Send;
2315 fn r#reset(&self) -> Self::ResetResponseFut;
2316 type GetPropertiesResponseFut: std::future::Future<Output = Result<CompositeProperties, fidl::Error>>
2317 + Send;
2318 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
2319 type GetRingBufferFormatsResponseFut: std::future::Future<Output = Result<CompositeGetRingBufferFormatsResult, fidl::Error>>
2320 + Send;
2321 fn r#get_ring_buffer_formats(
2322 &self,
2323 processing_element_id: u64,
2324 ) -> Self::GetRingBufferFormatsResponseFut;
2325 type CreateRingBufferResponseFut: std::future::Future<Output = Result<CompositeCreateRingBufferResult, fidl::Error>>
2326 + Send;
2327 fn r#create_ring_buffer(
2328 &self,
2329 processing_element_id: u64,
2330 format: &Format,
2331 ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
2332 ) -> Self::CreateRingBufferResponseFut;
2333 type GetDaiFormatsResponseFut: std::future::Future<Output = Result<CompositeGetDaiFormatsResult, fidl::Error>>
2334 + Send;
2335 fn r#get_dai_formats(&self, processing_element_id: u64) -> Self::GetDaiFormatsResponseFut;
2336 type SetDaiFormatResponseFut: std::future::Future<Output = Result<CompositeSetDaiFormatResult, fidl::Error>>
2337 + Send;
2338 fn r#set_dai_format(
2339 &self,
2340 processing_element_id: u64,
2341 format: &DaiFormat,
2342 ) -> Self::SetDaiFormatResponseFut;
2343}
2344#[derive(Debug)]
2345#[cfg(target_os = "fuchsia")]
2346pub struct CompositeSynchronousProxy {
2347 client: fidl::client::sync::Client,
2348}
2349
2350#[cfg(target_os = "fuchsia")]
2351impl fidl::endpoints::SynchronousProxy for CompositeSynchronousProxy {
2352 type Proxy = CompositeProxy;
2353 type Protocol = CompositeMarker;
2354
2355 fn from_channel(inner: fidl::Channel) -> Self {
2356 Self::new(inner)
2357 }
2358
2359 fn into_channel(self) -> fidl::Channel {
2360 self.client.into_channel()
2361 }
2362
2363 fn as_channel(&self) -> &fidl::Channel {
2364 self.client.as_channel()
2365 }
2366}
2367
2368#[cfg(target_os = "fuchsia")]
2369impl CompositeSynchronousProxy {
2370 pub fn new(channel: fidl::Channel) -> Self {
2371 let protocol_name = <CompositeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2372 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2373 }
2374
2375 pub fn into_channel(self) -> fidl::Channel {
2376 self.client.into_channel()
2377 }
2378
2379 pub fn wait_for_event(
2382 &self,
2383 deadline: zx::MonotonicInstant,
2384 ) -> Result<CompositeEvent, fidl::Error> {
2385 CompositeEvent::decode(self.client.wait_for_event(deadline)?)
2386 }
2387
2388 pub fn r#get_health_state(
2391 &self,
2392 ___deadline: zx::MonotonicInstant,
2393 ) -> Result<HealthState, fidl::Error> {
2394 let _response =
2395 self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
2396 (),
2397 0x4e146d6bca733a84,
2398 fidl::encoding::DynamicFlags::empty(),
2399 ___deadline,
2400 )?;
2401 Ok(_response.state)
2402 }
2403
2404 pub fn r#signal_processing_connect(
2416 &self,
2417 mut protocol: fidl::endpoints::ServerEnd<
2418 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
2419 >,
2420 ) -> Result<(), fidl::Error> {
2421 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
2422 (protocol,),
2423 0xa81907ce6066295,
2424 fidl::encoding::DynamicFlags::empty(),
2425 )
2426 }
2427
2428 pub fn r#reset(
2438 &self,
2439 ___deadline: zx::MonotonicInstant,
2440 ) -> Result<CompositeResetResult, fidl::Error> {
2441 let _response = self.client.send_query::<
2442 fidl::encoding::EmptyPayload,
2443 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
2444 >(
2445 (),
2446 0xac355fb98341996,
2447 fidl::encoding::DynamicFlags::empty(),
2448 ___deadline,
2449 )?;
2450 Ok(_response.map(|x| x))
2451 }
2452
2453 pub fn r#get_properties(
2455 &self,
2456 ___deadline: zx::MonotonicInstant,
2457 ) -> Result<CompositeProperties, fidl::Error> {
2458 let _response = self
2459 .client
2460 .send_query::<fidl::encoding::EmptyPayload, CompositeGetPropertiesResponse>(
2461 (),
2462 0x31846fa0a459942b,
2463 fidl::encoding::DynamicFlags::empty(),
2464 ___deadline,
2465 )?;
2466 Ok(_response.properties)
2467 }
2468
2469 pub fn r#get_ring_buffer_formats(
2481 &self,
2482 mut processing_element_id: u64,
2483 ___deadline: zx::MonotonicInstant,
2484 ) -> Result<CompositeGetRingBufferFormatsResult, fidl::Error> {
2485 let _response = self.client.send_query::<
2486 CompositeGetRingBufferFormatsRequest,
2487 fidl::encoding::ResultType<CompositeGetRingBufferFormatsResponse, DriverError>,
2488 >(
2489 (processing_element_id,),
2490 0x1d89b701b6816ac4,
2491 fidl::encoding::DynamicFlags::empty(),
2492 ___deadline,
2493 )?;
2494 Ok(_response.map(|x| x.ring_buffer_formats))
2495 }
2496
2497 pub fn r#create_ring_buffer(
2507 &self,
2508 mut processing_element_id: u64,
2509 mut format: &Format,
2510 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
2511 ___deadline: zx::MonotonicInstant,
2512 ) -> Result<CompositeCreateRingBufferResult, fidl::Error> {
2513 let _response = self.client.send_query::<
2514 CompositeCreateRingBufferRequest,
2515 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
2516 >(
2517 (processing_element_id, format, ring_buffer,),
2518 0x28c5685f85262033,
2519 fidl::encoding::DynamicFlags::empty(),
2520 ___deadline,
2521 )?;
2522 Ok(_response.map(|x| x))
2523 }
2524
2525 pub fn r#get_dai_formats(
2537 &self,
2538 mut processing_element_id: u64,
2539 ___deadline: zx::MonotonicInstant,
2540 ) -> Result<CompositeGetDaiFormatsResult, fidl::Error> {
2541 let _response = self.client.send_query::<
2542 CompositeGetDaiFormatsRequest,
2543 fidl::encoding::ResultType<CompositeGetDaiFormatsResponse, DriverError>,
2544 >(
2545 (processing_element_id,),
2546 0x3cbeaed59c8f69b,
2547 fidl::encoding::DynamicFlags::empty(),
2548 ___deadline,
2549 )?;
2550 Ok(_response.map(|x| x.dai_formats))
2551 }
2552
2553 pub fn r#set_dai_format(
2562 &self,
2563 mut processing_element_id: u64,
2564 mut format: &DaiFormat,
2565 ___deadline: zx::MonotonicInstant,
2566 ) -> Result<CompositeSetDaiFormatResult, fidl::Error> {
2567 let _response = self.client.send_query::<
2568 CompositeSetDaiFormatRequest,
2569 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
2570 >(
2571 (processing_element_id, format,),
2572 0x155acf5cc0dc8a84,
2573 fidl::encoding::DynamicFlags::empty(),
2574 ___deadline,
2575 )?;
2576 Ok(_response.map(|x| x))
2577 }
2578}
2579
2580#[cfg(target_os = "fuchsia")]
2581impl From<CompositeSynchronousProxy> for zx::Handle {
2582 fn from(value: CompositeSynchronousProxy) -> Self {
2583 value.into_channel().into()
2584 }
2585}
2586
2587#[cfg(target_os = "fuchsia")]
2588impl From<fidl::Channel> for CompositeSynchronousProxy {
2589 fn from(value: fidl::Channel) -> Self {
2590 Self::new(value)
2591 }
2592}
2593
2594#[derive(Debug, Clone)]
2595pub struct CompositeProxy {
2596 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2597}
2598
2599impl fidl::endpoints::Proxy for CompositeProxy {
2600 type Protocol = CompositeMarker;
2601
2602 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2603 Self::new(inner)
2604 }
2605
2606 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2607 self.client.into_channel().map_err(|client| Self { client })
2608 }
2609
2610 fn as_channel(&self) -> &::fidl::AsyncChannel {
2611 self.client.as_channel()
2612 }
2613}
2614
2615impl CompositeProxy {
2616 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2618 let protocol_name = <CompositeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2619 Self { client: fidl::client::Client::new(channel, protocol_name) }
2620 }
2621
2622 pub fn take_event_stream(&self) -> CompositeEventStream {
2628 CompositeEventStream { event_receiver: self.client.take_event_receiver() }
2629 }
2630
2631 pub fn r#get_health_state(
2634 &self,
2635 ) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
2636 {
2637 CompositeProxyInterface::r#get_health_state(self)
2638 }
2639
2640 pub fn r#signal_processing_connect(
2652 &self,
2653 mut protocol: fidl::endpoints::ServerEnd<
2654 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
2655 >,
2656 ) -> Result<(), fidl::Error> {
2657 CompositeProxyInterface::r#signal_processing_connect(self, protocol)
2658 }
2659
2660 pub fn r#reset(
2670 &self,
2671 ) -> fidl::client::QueryResponseFut<
2672 CompositeResetResult,
2673 fidl::encoding::DefaultFuchsiaResourceDialect,
2674 > {
2675 CompositeProxyInterface::r#reset(self)
2676 }
2677
2678 pub fn r#get_properties(
2680 &self,
2681 ) -> fidl::client::QueryResponseFut<
2682 CompositeProperties,
2683 fidl::encoding::DefaultFuchsiaResourceDialect,
2684 > {
2685 CompositeProxyInterface::r#get_properties(self)
2686 }
2687
2688 pub fn r#get_ring_buffer_formats(
2700 &self,
2701 mut processing_element_id: u64,
2702 ) -> fidl::client::QueryResponseFut<
2703 CompositeGetRingBufferFormatsResult,
2704 fidl::encoding::DefaultFuchsiaResourceDialect,
2705 > {
2706 CompositeProxyInterface::r#get_ring_buffer_formats(self, processing_element_id)
2707 }
2708
2709 pub fn r#create_ring_buffer(
2719 &self,
2720 mut processing_element_id: u64,
2721 mut format: &Format,
2722 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
2723 ) -> fidl::client::QueryResponseFut<
2724 CompositeCreateRingBufferResult,
2725 fidl::encoding::DefaultFuchsiaResourceDialect,
2726 > {
2727 CompositeProxyInterface::r#create_ring_buffer(
2728 self,
2729 processing_element_id,
2730 format,
2731 ring_buffer,
2732 )
2733 }
2734
2735 pub fn r#get_dai_formats(
2747 &self,
2748 mut processing_element_id: u64,
2749 ) -> fidl::client::QueryResponseFut<
2750 CompositeGetDaiFormatsResult,
2751 fidl::encoding::DefaultFuchsiaResourceDialect,
2752 > {
2753 CompositeProxyInterface::r#get_dai_formats(self, processing_element_id)
2754 }
2755
2756 pub fn r#set_dai_format(
2765 &self,
2766 mut processing_element_id: u64,
2767 mut format: &DaiFormat,
2768 ) -> fidl::client::QueryResponseFut<
2769 CompositeSetDaiFormatResult,
2770 fidl::encoding::DefaultFuchsiaResourceDialect,
2771 > {
2772 CompositeProxyInterface::r#set_dai_format(self, processing_element_id, format)
2773 }
2774}
2775
2776impl CompositeProxyInterface for CompositeProxy {
2777 type GetHealthStateResponseFut =
2778 fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
2779 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
2780 fn _decode(
2781 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2782 ) -> Result<HealthState, fidl::Error> {
2783 let _response = fidl::client::decode_transaction_body::<
2784 HealthGetHealthStateResponse,
2785 fidl::encoding::DefaultFuchsiaResourceDialect,
2786 0x4e146d6bca733a84,
2787 >(_buf?)?;
2788 Ok(_response.state)
2789 }
2790 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
2791 (),
2792 0x4e146d6bca733a84,
2793 fidl::encoding::DynamicFlags::empty(),
2794 _decode,
2795 )
2796 }
2797
2798 fn r#signal_processing_connect(
2799 &self,
2800 mut protocol: fidl::endpoints::ServerEnd<
2801 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
2802 >,
2803 ) -> Result<(), fidl::Error> {
2804 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
2805 (protocol,),
2806 0xa81907ce6066295,
2807 fidl::encoding::DynamicFlags::empty(),
2808 )
2809 }
2810
2811 type ResetResponseFut = fidl::client::QueryResponseFut<
2812 CompositeResetResult,
2813 fidl::encoding::DefaultFuchsiaResourceDialect,
2814 >;
2815 fn r#reset(&self) -> Self::ResetResponseFut {
2816 fn _decode(
2817 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2818 ) -> Result<CompositeResetResult, fidl::Error> {
2819 let _response = fidl::client::decode_transaction_body::<
2820 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
2821 fidl::encoding::DefaultFuchsiaResourceDialect,
2822 0xac355fb98341996,
2823 >(_buf?)?;
2824 Ok(_response.map(|x| x))
2825 }
2826 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CompositeResetResult>(
2827 (),
2828 0xac355fb98341996,
2829 fidl::encoding::DynamicFlags::empty(),
2830 _decode,
2831 )
2832 }
2833
2834 type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
2835 CompositeProperties,
2836 fidl::encoding::DefaultFuchsiaResourceDialect,
2837 >;
2838 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
2839 fn _decode(
2840 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2841 ) -> Result<CompositeProperties, fidl::Error> {
2842 let _response = fidl::client::decode_transaction_body::<
2843 CompositeGetPropertiesResponse,
2844 fidl::encoding::DefaultFuchsiaResourceDialect,
2845 0x31846fa0a459942b,
2846 >(_buf?)?;
2847 Ok(_response.properties)
2848 }
2849 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CompositeProperties>(
2850 (),
2851 0x31846fa0a459942b,
2852 fidl::encoding::DynamicFlags::empty(),
2853 _decode,
2854 )
2855 }
2856
2857 type GetRingBufferFormatsResponseFut = fidl::client::QueryResponseFut<
2858 CompositeGetRingBufferFormatsResult,
2859 fidl::encoding::DefaultFuchsiaResourceDialect,
2860 >;
2861 fn r#get_ring_buffer_formats(
2862 &self,
2863 mut processing_element_id: u64,
2864 ) -> Self::GetRingBufferFormatsResponseFut {
2865 fn _decode(
2866 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2867 ) -> Result<CompositeGetRingBufferFormatsResult, fidl::Error> {
2868 let _response = fidl::client::decode_transaction_body::<
2869 fidl::encoding::ResultType<CompositeGetRingBufferFormatsResponse, DriverError>,
2870 fidl::encoding::DefaultFuchsiaResourceDialect,
2871 0x1d89b701b6816ac4,
2872 >(_buf?)?;
2873 Ok(_response.map(|x| x.ring_buffer_formats))
2874 }
2875 self.client.send_query_and_decode::<
2876 CompositeGetRingBufferFormatsRequest,
2877 CompositeGetRingBufferFormatsResult,
2878 >(
2879 (processing_element_id,),
2880 0x1d89b701b6816ac4,
2881 fidl::encoding::DynamicFlags::empty(),
2882 _decode,
2883 )
2884 }
2885
2886 type CreateRingBufferResponseFut = fidl::client::QueryResponseFut<
2887 CompositeCreateRingBufferResult,
2888 fidl::encoding::DefaultFuchsiaResourceDialect,
2889 >;
2890 fn r#create_ring_buffer(
2891 &self,
2892 mut processing_element_id: u64,
2893 mut format: &Format,
2894 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
2895 ) -> Self::CreateRingBufferResponseFut {
2896 fn _decode(
2897 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2898 ) -> Result<CompositeCreateRingBufferResult, fidl::Error> {
2899 let _response = fidl::client::decode_transaction_body::<
2900 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
2901 fidl::encoding::DefaultFuchsiaResourceDialect,
2902 0x28c5685f85262033,
2903 >(_buf?)?;
2904 Ok(_response.map(|x| x))
2905 }
2906 self.client.send_query_and_decode::<
2907 CompositeCreateRingBufferRequest,
2908 CompositeCreateRingBufferResult,
2909 >(
2910 (processing_element_id, format, ring_buffer,),
2911 0x28c5685f85262033,
2912 fidl::encoding::DynamicFlags::empty(),
2913 _decode,
2914 )
2915 }
2916
2917 type GetDaiFormatsResponseFut = fidl::client::QueryResponseFut<
2918 CompositeGetDaiFormatsResult,
2919 fidl::encoding::DefaultFuchsiaResourceDialect,
2920 >;
2921 fn r#get_dai_formats(&self, mut processing_element_id: u64) -> Self::GetDaiFormatsResponseFut {
2922 fn _decode(
2923 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2924 ) -> Result<CompositeGetDaiFormatsResult, fidl::Error> {
2925 let _response = fidl::client::decode_transaction_body::<
2926 fidl::encoding::ResultType<CompositeGetDaiFormatsResponse, DriverError>,
2927 fidl::encoding::DefaultFuchsiaResourceDialect,
2928 0x3cbeaed59c8f69b,
2929 >(_buf?)?;
2930 Ok(_response.map(|x| x.dai_formats))
2931 }
2932 self.client
2933 .send_query_and_decode::<CompositeGetDaiFormatsRequest, CompositeGetDaiFormatsResult>(
2934 (processing_element_id,),
2935 0x3cbeaed59c8f69b,
2936 fidl::encoding::DynamicFlags::empty(),
2937 _decode,
2938 )
2939 }
2940
2941 type SetDaiFormatResponseFut = fidl::client::QueryResponseFut<
2942 CompositeSetDaiFormatResult,
2943 fidl::encoding::DefaultFuchsiaResourceDialect,
2944 >;
2945 fn r#set_dai_format(
2946 &self,
2947 mut processing_element_id: u64,
2948 mut format: &DaiFormat,
2949 ) -> Self::SetDaiFormatResponseFut {
2950 fn _decode(
2951 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2952 ) -> Result<CompositeSetDaiFormatResult, fidl::Error> {
2953 let _response = fidl::client::decode_transaction_body::<
2954 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
2955 fidl::encoding::DefaultFuchsiaResourceDialect,
2956 0x155acf5cc0dc8a84,
2957 >(_buf?)?;
2958 Ok(_response.map(|x| x))
2959 }
2960 self.client
2961 .send_query_and_decode::<CompositeSetDaiFormatRequest, CompositeSetDaiFormatResult>(
2962 (processing_element_id, format),
2963 0x155acf5cc0dc8a84,
2964 fidl::encoding::DynamicFlags::empty(),
2965 _decode,
2966 )
2967 }
2968}
2969
2970pub struct CompositeEventStream {
2971 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2972}
2973
2974impl std::marker::Unpin for CompositeEventStream {}
2975
2976impl futures::stream::FusedStream for CompositeEventStream {
2977 fn is_terminated(&self) -> bool {
2978 self.event_receiver.is_terminated()
2979 }
2980}
2981
2982impl futures::Stream for CompositeEventStream {
2983 type Item = Result<CompositeEvent, fidl::Error>;
2984
2985 fn poll_next(
2986 mut self: std::pin::Pin<&mut Self>,
2987 cx: &mut std::task::Context<'_>,
2988 ) -> std::task::Poll<Option<Self::Item>> {
2989 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2990 &mut self.event_receiver,
2991 cx
2992 )?) {
2993 Some(buf) => std::task::Poll::Ready(Some(CompositeEvent::decode(buf))),
2994 None => std::task::Poll::Ready(None),
2995 }
2996 }
2997}
2998
2999#[derive(Debug)]
3000pub enum CompositeEvent {}
3001
3002impl CompositeEvent {
3003 fn decode(
3005 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3006 ) -> Result<CompositeEvent, fidl::Error> {
3007 let (bytes, _handles) = buf.split_mut();
3008 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3009 debug_assert_eq!(tx_header.tx_id, 0);
3010 match tx_header.ordinal {
3011 _ => Err(fidl::Error::UnknownOrdinal {
3012 ordinal: tx_header.ordinal,
3013 protocol_name: <CompositeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3014 }),
3015 }
3016 }
3017}
3018
3019pub struct CompositeRequestStream {
3021 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3022 is_terminated: bool,
3023}
3024
3025impl std::marker::Unpin for CompositeRequestStream {}
3026
3027impl futures::stream::FusedStream for CompositeRequestStream {
3028 fn is_terminated(&self) -> bool {
3029 self.is_terminated
3030 }
3031}
3032
3033impl fidl::endpoints::RequestStream for CompositeRequestStream {
3034 type Protocol = CompositeMarker;
3035 type ControlHandle = CompositeControlHandle;
3036
3037 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3038 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3039 }
3040
3041 fn control_handle(&self) -> Self::ControlHandle {
3042 CompositeControlHandle { inner: self.inner.clone() }
3043 }
3044
3045 fn into_inner(
3046 self,
3047 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3048 {
3049 (self.inner, self.is_terminated)
3050 }
3051
3052 fn from_inner(
3053 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3054 is_terminated: bool,
3055 ) -> Self {
3056 Self { inner, is_terminated }
3057 }
3058}
3059
3060impl futures::Stream for CompositeRequestStream {
3061 type Item = Result<CompositeRequest, fidl::Error>;
3062
3063 fn poll_next(
3064 mut self: std::pin::Pin<&mut Self>,
3065 cx: &mut std::task::Context<'_>,
3066 ) -> std::task::Poll<Option<Self::Item>> {
3067 let this = &mut *self;
3068 if this.inner.check_shutdown(cx) {
3069 this.is_terminated = true;
3070 return std::task::Poll::Ready(None);
3071 }
3072 if this.is_terminated {
3073 panic!("polled CompositeRequestStream after completion");
3074 }
3075 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3076 |bytes, handles| {
3077 match this.inner.channel().read_etc(cx, bytes, handles) {
3078 std::task::Poll::Ready(Ok(())) => {}
3079 std::task::Poll::Pending => return std::task::Poll::Pending,
3080 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3081 this.is_terminated = true;
3082 return std::task::Poll::Ready(None);
3083 }
3084 std::task::Poll::Ready(Err(e)) => {
3085 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3086 e.into(),
3087 ))))
3088 }
3089 }
3090
3091 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3093
3094 std::task::Poll::Ready(Some(match header.ordinal {
3095 0x4e146d6bca733a84 => {
3096 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3097 let mut req = fidl::new_empty!(
3098 fidl::encoding::EmptyPayload,
3099 fidl::encoding::DefaultFuchsiaResourceDialect
3100 );
3101 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3102 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3103 Ok(CompositeRequest::GetHealthState {
3104 responder: CompositeGetHealthStateResponder {
3105 control_handle: std::mem::ManuallyDrop::new(control_handle),
3106 tx_id: header.tx_id,
3107 },
3108 })
3109 }
3110 0xa81907ce6066295 => {
3111 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3112 let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3113 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
3114 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3115 Ok(CompositeRequest::SignalProcessingConnect {
3116 protocol: req.protocol,
3117
3118 control_handle,
3119 })
3120 }
3121 0xac355fb98341996 => {
3122 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3123 let mut req = fidl::new_empty!(
3124 fidl::encoding::EmptyPayload,
3125 fidl::encoding::DefaultFuchsiaResourceDialect
3126 );
3127 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3128 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3129 Ok(CompositeRequest::Reset {
3130 responder: CompositeResetResponder {
3131 control_handle: std::mem::ManuallyDrop::new(control_handle),
3132 tx_id: header.tx_id,
3133 },
3134 })
3135 }
3136 0x31846fa0a459942b => {
3137 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3138 let mut req = fidl::new_empty!(
3139 fidl::encoding::EmptyPayload,
3140 fidl::encoding::DefaultFuchsiaResourceDialect
3141 );
3142 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3143 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3144 Ok(CompositeRequest::GetProperties {
3145 responder: CompositeGetPropertiesResponder {
3146 control_handle: std::mem::ManuallyDrop::new(control_handle),
3147 tx_id: header.tx_id,
3148 },
3149 })
3150 }
3151 0x1d89b701b6816ac4 => {
3152 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3153 let mut req = fidl::new_empty!(
3154 CompositeGetRingBufferFormatsRequest,
3155 fidl::encoding::DefaultFuchsiaResourceDialect
3156 );
3157 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeGetRingBufferFormatsRequest>(&header, _body_bytes, handles, &mut req)?;
3158 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3159 Ok(CompositeRequest::GetRingBufferFormats {
3160 processing_element_id: req.processing_element_id,
3161
3162 responder: CompositeGetRingBufferFormatsResponder {
3163 control_handle: std::mem::ManuallyDrop::new(control_handle),
3164 tx_id: header.tx_id,
3165 },
3166 })
3167 }
3168 0x28c5685f85262033 => {
3169 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3170 let mut req = fidl::new_empty!(
3171 CompositeCreateRingBufferRequest,
3172 fidl::encoding::DefaultFuchsiaResourceDialect
3173 );
3174 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeCreateRingBufferRequest>(&header, _body_bytes, handles, &mut req)?;
3175 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3176 Ok(CompositeRequest::CreateRingBuffer {
3177 processing_element_id: req.processing_element_id,
3178 format: req.format,
3179 ring_buffer: req.ring_buffer,
3180
3181 responder: CompositeCreateRingBufferResponder {
3182 control_handle: std::mem::ManuallyDrop::new(control_handle),
3183 tx_id: header.tx_id,
3184 },
3185 })
3186 }
3187 0x3cbeaed59c8f69b => {
3188 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3189 let mut req = fidl::new_empty!(
3190 CompositeGetDaiFormatsRequest,
3191 fidl::encoding::DefaultFuchsiaResourceDialect
3192 );
3193 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeGetDaiFormatsRequest>(&header, _body_bytes, handles, &mut req)?;
3194 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3195 Ok(CompositeRequest::GetDaiFormats {
3196 processing_element_id: req.processing_element_id,
3197
3198 responder: CompositeGetDaiFormatsResponder {
3199 control_handle: std::mem::ManuallyDrop::new(control_handle),
3200 tx_id: header.tx_id,
3201 },
3202 })
3203 }
3204 0x155acf5cc0dc8a84 => {
3205 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3206 let mut req = fidl::new_empty!(
3207 CompositeSetDaiFormatRequest,
3208 fidl::encoding::DefaultFuchsiaResourceDialect
3209 );
3210 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeSetDaiFormatRequest>(&header, _body_bytes, handles, &mut req)?;
3211 let control_handle = CompositeControlHandle { inner: this.inner.clone() };
3212 Ok(CompositeRequest::SetDaiFormat {
3213 processing_element_id: req.processing_element_id,
3214 format: req.format,
3215
3216 responder: CompositeSetDaiFormatResponder {
3217 control_handle: std::mem::ManuallyDrop::new(control_handle),
3218 tx_id: header.tx_id,
3219 },
3220 })
3221 }
3222 _ => Err(fidl::Error::UnknownOrdinal {
3223 ordinal: header.ordinal,
3224 protocol_name:
3225 <CompositeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3226 }),
3227 }))
3228 },
3229 )
3230 }
3231}
3232
3233#[derive(Debug)]
3242pub enum CompositeRequest {
3243 GetHealthState { responder: CompositeGetHealthStateResponder },
3246 SignalProcessingConnect {
3258 protocol: fidl::endpoints::ServerEnd<
3259 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
3260 >,
3261 control_handle: CompositeControlHandle,
3262 },
3263 Reset { responder: CompositeResetResponder },
3273 GetProperties { responder: CompositeGetPropertiesResponder },
3275 GetRingBufferFormats {
3287 processing_element_id: u64,
3288 responder: CompositeGetRingBufferFormatsResponder,
3289 },
3290 CreateRingBuffer {
3300 processing_element_id: u64,
3301 format: Format,
3302 ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
3303 responder: CompositeCreateRingBufferResponder,
3304 },
3305 GetDaiFormats { processing_element_id: u64, responder: CompositeGetDaiFormatsResponder },
3317 SetDaiFormat {
3326 processing_element_id: u64,
3327 format: DaiFormat,
3328 responder: CompositeSetDaiFormatResponder,
3329 },
3330}
3331
3332impl CompositeRequest {
3333 #[allow(irrefutable_let_patterns)]
3334 pub fn into_get_health_state(self) -> Option<(CompositeGetHealthStateResponder)> {
3335 if let CompositeRequest::GetHealthState { responder } = self {
3336 Some((responder))
3337 } else {
3338 None
3339 }
3340 }
3341
3342 #[allow(irrefutable_let_patterns)]
3343 pub fn into_signal_processing_connect(
3344 self,
3345 ) -> Option<(
3346 fidl::endpoints::ServerEnd<
3347 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
3348 >,
3349 CompositeControlHandle,
3350 )> {
3351 if let CompositeRequest::SignalProcessingConnect { protocol, control_handle } = self {
3352 Some((protocol, control_handle))
3353 } else {
3354 None
3355 }
3356 }
3357
3358 #[allow(irrefutable_let_patterns)]
3359 pub fn into_reset(self) -> Option<(CompositeResetResponder)> {
3360 if let CompositeRequest::Reset { responder } = self {
3361 Some((responder))
3362 } else {
3363 None
3364 }
3365 }
3366
3367 #[allow(irrefutable_let_patterns)]
3368 pub fn into_get_properties(self) -> Option<(CompositeGetPropertiesResponder)> {
3369 if let CompositeRequest::GetProperties { responder } = self {
3370 Some((responder))
3371 } else {
3372 None
3373 }
3374 }
3375
3376 #[allow(irrefutable_let_patterns)]
3377 pub fn into_get_ring_buffer_formats(
3378 self,
3379 ) -> Option<(u64, CompositeGetRingBufferFormatsResponder)> {
3380 if let CompositeRequest::GetRingBufferFormats { processing_element_id, responder } = self {
3381 Some((processing_element_id, responder))
3382 } else {
3383 None
3384 }
3385 }
3386
3387 #[allow(irrefutable_let_patterns)]
3388 pub fn into_create_ring_buffer(
3389 self,
3390 ) -> Option<(
3391 u64,
3392 Format,
3393 fidl::endpoints::ServerEnd<RingBufferMarker>,
3394 CompositeCreateRingBufferResponder,
3395 )> {
3396 if let CompositeRequest::CreateRingBuffer {
3397 processing_element_id,
3398 format,
3399 ring_buffer,
3400 responder,
3401 } = self
3402 {
3403 Some((processing_element_id, format, ring_buffer, responder))
3404 } else {
3405 None
3406 }
3407 }
3408
3409 #[allow(irrefutable_let_patterns)]
3410 pub fn into_get_dai_formats(self) -> Option<(u64, CompositeGetDaiFormatsResponder)> {
3411 if let CompositeRequest::GetDaiFormats { processing_element_id, responder } = self {
3412 Some((processing_element_id, responder))
3413 } else {
3414 None
3415 }
3416 }
3417
3418 #[allow(irrefutable_let_patterns)]
3419 pub fn into_set_dai_format(self) -> Option<(u64, DaiFormat, CompositeSetDaiFormatResponder)> {
3420 if let CompositeRequest::SetDaiFormat { processing_element_id, format, responder } = self {
3421 Some((processing_element_id, format, responder))
3422 } else {
3423 None
3424 }
3425 }
3426
3427 pub fn method_name(&self) -> &'static str {
3429 match *self {
3430 CompositeRequest::GetHealthState { .. } => "get_health_state",
3431 CompositeRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
3432 CompositeRequest::Reset { .. } => "reset",
3433 CompositeRequest::GetProperties { .. } => "get_properties",
3434 CompositeRequest::GetRingBufferFormats { .. } => "get_ring_buffer_formats",
3435 CompositeRequest::CreateRingBuffer { .. } => "create_ring_buffer",
3436 CompositeRequest::GetDaiFormats { .. } => "get_dai_formats",
3437 CompositeRequest::SetDaiFormat { .. } => "set_dai_format",
3438 }
3439 }
3440}
3441
3442#[derive(Debug, Clone)]
3443pub struct CompositeControlHandle {
3444 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3445}
3446
3447impl fidl::endpoints::ControlHandle for CompositeControlHandle {
3448 fn shutdown(&self) {
3449 self.inner.shutdown()
3450 }
3451 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3452 self.inner.shutdown_with_epitaph(status)
3453 }
3454
3455 fn is_closed(&self) -> bool {
3456 self.inner.channel().is_closed()
3457 }
3458 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3459 self.inner.channel().on_closed()
3460 }
3461
3462 #[cfg(target_os = "fuchsia")]
3463 fn signal_peer(
3464 &self,
3465 clear_mask: zx::Signals,
3466 set_mask: zx::Signals,
3467 ) -> Result<(), zx_status::Status> {
3468 use fidl::Peered;
3469 self.inner.channel().signal_peer(clear_mask, set_mask)
3470 }
3471}
3472
3473impl CompositeControlHandle {}
3474
3475#[must_use = "FIDL methods require a response to be sent"]
3476#[derive(Debug)]
3477pub struct CompositeGetHealthStateResponder {
3478 control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
3479 tx_id: u32,
3480}
3481
3482impl std::ops::Drop for CompositeGetHealthStateResponder {
3486 fn drop(&mut self) {
3487 self.control_handle.shutdown();
3488 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3490 }
3491}
3492
3493impl fidl::endpoints::Responder for CompositeGetHealthStateResponder {
3494 type ControlHandle = CompositeControlHandle;
3495
3496 fn control_handle(&self) -> &CompositeControlHandle {
3497 &self.control_handle
3498 }
3499
3500 fn drop_without_shutdown(mut self) {
3501 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3503 std::mem::forget(self);
3505 }
3506}
3507
3508impl CompositeGetHealthStateResponder {
3509 pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
3513 let _result = self.send_raw(state);
3514 if _result.is_err() {
3515 self.control_handle.shutdown();
3516 }
3517 self.drop_without_shutdown();
3518 _result
3519 }
3520
3521 pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
3523 let _result = self.send_raw(state);
3524 self.drop_without_shutdown();
3525 _result
3526 }
3527
3528 fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
3529 self.control_handle.inner.send::<HealthGetHealthStateResponse>(
3530 (state,),
3531 self.tx_id,
3532 0x4e146d6bca733a84,
3533 fidl::encoding::DynamicFlags::empty(),
3534 )
3535 }
3536}
3537
3538#[must_use = "FIDL methods require a response to be sent"]
3539#[derive(Debug)]
3540pub struct CompositeResetResponder {
3541 control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
3542 tx_id: u32,
3543}
3544
3545impl std::ops::Drop for CompositeResetResponder {
3549 fn drop(&mut self) {
3550 self.control_handle.shutdown();
3551 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3553 }
3554}
3555
3556impl fidl::endpoints::Responder for CompositeResetResponder {
3557 type ControlHandle = CompositeControlHandle;
3558
3559 fn control_handle(&self) -> &CompositeControlHandle {
3560 &self.control_handle
3561 }
3562
3563 fn drop_without_shutdown(mut self) {
3564 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3566 std::mem::forget(self);
3568 }
3569}
3570
3571impl CompositeResetResponder {
3572 pub fn send(self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
3576 let _result = self.send_raw(result);
3577 if _result.is_err() {
3578 self.control_handle.shutdown();
3579 }
3580 self.drop_without_shutdown();
3581 _result
3582 }
3583
3584 pub fn send_no_shutdown_on_err(
3586 self,
3587 mut result: Result<(), DriverError>,
3588 ) -> Result<(), fidl::Error> {
3589 let _result = self.send_raw(result);
3590 self.drop_without_shutdown();
3591 _result
3592 }
3593
3594 fn send_raw(&self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
3595 self.control_handle.inner.send::<fidl::encoding::ResultType<
3596 fidl::encoding::EmptyStruct,
3597 DriverError,
3598 >>(
3599 result,
3600 self.tx_id,
3601 0xac355fb98341996,
3602 fidl::encoding::DynamicFlags::empty(),
3603 )
3604 }
3605}
3606
3607#[must_use = "FIDL methods require a response to be sent"]
3608#[derive(Debug)]
3609pub struct CompositeGetPropertiesResponder {
3610 control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
3611 tx_id: u32,
3612}
3613
3614impl std::ops::Drop for CompositeGetPropertiesResponder {
3618 fn drop(&mut self) {
3619 self.control_handle.shutdown();
3620 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3622 }
3623}
3624
3625impl fidl::endpoints::Responder for CompositeGetPropertiesResponder {
3626 type ControlHandle = CompositeControlHandle;
3627
3628 fn control_handle(&self) -> &CompositeControlHandle {
3629 &self.control_handle
3630 }
3631
3632 fn drop_without_shutdown(mut self) {
3633 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3635 std::mem::forget(self);
3637 }
3638}
3639
3640impl CompositeGetPropertiesResponder {
3641 pub fn send(self, mut properties: &CompositeProperties) -> Result<(), fidl::Error> {
3645 let _result = self.send_raw(properties);
3646 if _result.is_err() {
3647 self.control_handle.shutdown();
3648 }
3649 self.drop_without_shutdown();
3650 _result
3651 }
3652
3653 pub fn send_no_shutdown_on_err(
3655 self,
3656 mut properties: &CompositeProperties,
3657 ) -> Result<(), fidl::Error> {
3658 let _result = self.send_raw(properties);
3659 self.drop_without_shutdown();
3660 _result
3661 }
3662
3663 fn send_raw(&self, mut properties: &CompositeProperties) -> Result<(), fidl::Error> {
3664 self.control_handle.inner.send::<CompositeGetPropertiesResponse>(
3665 (properties,),
3666 self.tx_id,
3667 0x31846fa0a459942b,
3668 fidl::encoding::DynamicFlags::empty(),
3669 )
3670 }
3671}
3672
3673#[must_use = "FIDL methods require a response to be sent"]
3674#[derive(Debug)]
3675pub struct CompositeGetRingBufferFormatsResponder {
3676 control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
3677 tx_id: u32,
3678}
3679
3680impl std::ops::Drop for CompositeGetRingBufferFormatsResponder {
3684 fn drop(&mut self) {
3685 self.control_handle.shutdown();
3686 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3688 }
3689}
3690
3691impl fidl::endpoints::Responder for CompositeGetRingBufferFormatsResponder {
3692 type ControlHandle = CompositeControlHandle;
3693
3694 fn control_handle(&self) -> &CompositeControlHandle {
3695 &self.control_handle
3696 }
3697
3698 fn drop_without_shutdown(mut self) {
3699 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3701 std::mem::forget(self);
3703 }
3704}
3705
3706impl CompositeGetRingBufferFormatsResponder {
3707 pub fn send(
3711 self,
3712 mut result: Result<&[SupportedFormats], DriverError>,
3713 ) -> Result<(), fidl::Error> {
3714 let _result = self.send_raw(result);
3715 if _result.is_err() {
3716 self.control_handle.shutdown();
3717 }
3718 self.drop_without_shutdown();
3719 _result
3720 }
3721
3722 pub fn send_no_shutdown_on_err(
3724 self,
3725 mut result: Result<&[SupportedFormats], DriverError>,
3726 ) -> Result<(), fidl::Error> {
3727 let _result = self.send_raw(result);
3728 self.drop_without_shutdown();
3729 _result
3730 }
3731
3732 fn send_raw(
3733 &self,
3734 mut result: Result<&[SupportedFormats], DriverError>,
3735 ) -> Result<(), fidl::Error> {
3736 self.control_handle.inner.send::<fidl::encoding::ResultType<
3737 CompositeGetRingBufferFormatsResponse,
3738 DriverError,
3739 >>(
3740 result.map(|ring_buffer_formats| (ring_buffer_formats,)),
3741 self.tx_id,
3742 0x1d89b701b6816ac4,
3743 fidl::encoding::DynamicFlags::empty(),
3744 )
3745 }
3746}
3747
3748#[must_use = "FIDL methods require a response to be sent"]
3749#[derive(Debug)]
3750pub struct CompositeCreateRingBufferResponder {
3751 control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
3752 tx_id: u32,
3753}
3754
3755impl std::ops::Drop for CompositeCreateRingBufferResponder {
3759 fn drop(&mut self) {
3760 self.control_handle.shutdown();
3761 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3763 }
3764}
3765
3766impl fidl::endpoints::Responder for CompositeCreateRingBufferResponder {
3767 type ControlHandle = CompositeControlHandle;
3768
3769 fn control_handle(&self) -> &CompositeControlHandle {
3770 &self.control_handle
3771 }
3772
3773 fn drop_without_shutdown(mut self) {
3774 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3776 std::mem::forget(self);
3778 }
3779}
3780
3781impl CompositeCreateRingBufferResponder {
3782 pub fn send(self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
3786 let _result = self.send_raw(result);
3787 if _result.is_err() {
3788 self.control_handle.shutdown();
3789 }
3790 self.drop_without_shutdown();
3791 _result
3792 }
3793
3794 pub fn send_no_shutdown_on_err(
3796 self,
3797 mut result: Result<(), DriverError>,
3798 ) -> Result<(), fidl::Error> {
3799 let _result = self.send_raw(result);
3800 self.drop_without_shutdown();
3801 _result
3802 }
3803
3804 fn send_raw(&self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
3805 self.control_handle.inner.send::<fidl::encoding::ResultType<
3806 fidl::encoding::EmptyStruct,
3807 DriverError,
3808 >>(
3809 result,
3810 self.tx_id,
3811 0x28c5685f85262033,
3812 fidl::encoding::DynamicFlags::empty(),
3813 )
3814 }
3815}
3816
3817#[must_use = "FIDL methods require a response to be sent"]
3818#[derive(Debug)]
3819pub struct CompositeGetDaiFormatsResponder {
3820 control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
3821 tx_id: u32,
3822}
3823
3824impl std::ops::Drop for CompositeGetDaiFormatsResponder {
3828 fn drop(&mut self) {
3829 self.control_handle.shutdown();
3830 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3832 }
3833}
3834
3835impl fidl::endpoints::Responder for CompositeGetDaiFormatsResponder {
3836 type ControlHandle = CompositeControlHandle;
3837
3838 fn control_handle(&self) -> &CompositeControlHandle {
3839 &self.control_handle
3840 }
3841
3842 fn drop_without_shutdown(mut self) {
3843 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3845 std::mem::forget(self);
3847 }
3848}
3849
3850impl CompositeGetDaiFormatsResponder {
3851 pub fn send(
3855 self,
3856 mut result: Result<&[DaiSupportedFormats], DriverError>,
3857 ) -> Result<(), fidl::Error> {
3858 let _result = self.send_raw(result);
3859 if _result.is_err() {
3860 self.control_handle.shutdown();
3861 }
3862 self.drop_without_shutdown();
3863 _result
3864 }
3865
3866 pub fn send_no_shutdown_on_err(
3868 self,
3869 mut result: Result<&[DaiSupportedFormats], DriverError>,
3870 ) -> Result<(), fidl::Error> {
3871 let _result = self.send_raw(result);
3872 self.drop_without_shutdown();
3873 _result
3874 }
3875
3876 fn send_raw(
3877 &self,
3878 mut result: Result<&[DaiSupportedFormats], DriverError>,
3879 ) -> Result<(), fidl::Error> {
3880 self.control_handle.inner.send::<fidl::encoding::ResultType<
3881 CompositeGetDaiFormatsResponse,
3882 DriverError,
3883 >>(
3884 result.map(|dai_formats| (dai_formats,)),
3885 self.tx_id,
3886 0x3cbeaed59c8f69b,
3887 fidl::encoding::DynamicFlags::empty(),
3888 )
3889 }
3890}
3891
3892#[must_use = "FIDL methods require a response to be sent"]
3893#[derive(Debug)]
3894pub struct CompositeSetDaiFormatResponder {
3895 control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
3896 tx_id: u32,
3897}
3898
3899impl std::ops::Drop for CompositeSetDaiFormatResponder {
3903 fn drop(&mut self) {
3904 self.control_handle.shutdown();
3905 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3907 }
3908}
3909
3910impl fidl::endpoints::Responder for CompositeSetDaiFormatResponder {
3911 type ControlHandle = CompositeControlHandle;
3912
3913 fn control_handle(&self) -> &CompositeControlHandle {
3914 &self.control_handle
3915 }
3916
3917 fn drop_without_shutdown(mut self) {
3918 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3920 std::mem::forget(self);
3922 }
3923}
3924
3925impl CompositeSetDaiFormatResponder {
3926 pub fn send(self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
3930 let _result = self.send_raw(result);
3931 if _result.is_err() {
3932 self.control_handle.shutdown();
3933 }
3934 self.drop_without_shutdown();
3935 _result
3936 }
3937
3938 pub fn send_no_shutdown_on_err(
3940 self,
3941 mut result: Result<(), DriverError>,
3942 ) -> Result<(), fidl::Error> {
3943 let _result = self.send_raw(result);
3944 self.drop_without_shutdown();
3945 _result
3946 }
3947
3948 fn send_raw(&self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
3949 self.control_handle.inner.send::<fidl::encoding::ResultType<
3950 fidl::encoding::EmptyStruct,
3951 DriverError,
3952 >>(
3953 result,
3954 self.tx_id,
3955 0x155acf5cc0dc8a84,
3956 fidl::encoding::DynamicFlags::empty(),
3957 )
3958 }
3959}
3960
3961#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3962pub struct CompositeConnectorMarker;
3963
3964impl fidl::endpoints::ProtocolMarker for CompositeConnectorMarker {
3965 type Proxy = CompositeConnectorProxy;
3966 type RequestStream = CompositeConnectorRequestStream;
3967 #[cfg(target_os = "fuchsia")]
3968 type SynchronousProxy = CompositeConnectorSynchronousProxy;
3969
3970 const DEBUG_NAME: &'static str = "(anonymous) CompositeConnector";
3971}
3972
3973pub trait CompositeConnectorProxyInterface: Send + Sync {
3974 fn r#connect(
3975 &self,
3976 composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
3977 ) -> Result<(), fidl::Error>;
3978}
3979#[derive(Debug)]
3980#[cfg(target_os = "fuchsia")]
3981pub struct CompositeConnectorSynchronousProxy {
3982 client: fidl::client::sync::Client,
3983}
3984
3985#[cfg(target_os = "fuchsia")]
3986impl fidl::endpoints::SynchronousProxy for CompositeConnectorSynchronousProxy {
3987 type Proxy = CompositeConnectorProxy;
3988 type Protocol = CompositeConnectorMarker;
3989
3990 fn from_channel(inner: fidl::Channel) -> Self {
3991 Self::new(inner)
3992 }
3993
3994 fn into_channel(self) -> fidl::Channel {
3995 self.client.into_channel()
3996 }
3997
3998 fn as_channel(&self) -> &fidl::Channel {
3999 self.client.as_channel()
4000 }
4001}
4002
4003#[cfg(target_os = "fuchsia")]
4004impl CompositeConnectorSynchronousProxy {
4005 pub fn new(channel: fidl::Channel) -> Self {
4006 let protocol_name =
4007 <CompositeConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4008 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4009 }
4010
4011 pub fn into_channel(self) -> fidl::Channel {
4012 self.client.into_channel()
4013 }
4014
4015 pub fn wait_for_event(
4018 &self,
4019 deadline: zx::MonotonicInstant,
4020 ) -> Result<CompositeConnectorEvent, fidl::Error> {
4021 CompositeConnectorEvent::decode(self.client.wait_for_event(deadline)?)
4022 }
4023
4024 pub fn r#connect(
4027 &self,
4028 mut composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
4029 ) -> Result<(), fidl::Error> {
4030 self.client.send::<CompositeConnectorConnectRequest>(
4031 (composite_protocol,),
4032 0x7ee557529079e466,
4033 fidl::encoding::DynamicFlags::empty(),
4034 )
4035 }
4036}
4037
4038#[cfg(target_os = "fuchsia")]
4039impl From<CompositeConnectorSynchronousProxy> for zx::Handle {
4040 fn from(value: CompositeConnectorSynchronousProxy) -> Self {
4041 value.into_channel().into()
4042 }
4043}
4044
4045#[cfg(target_os = "fuchsia")]
4046impl From<fidl::Channel> for CompositeConnectorSynchronousProxy {
4047 fn from(value: fidl::Channel) -> Self {
4048 Self::new(value)
4049 }
4050}
4051
4052#[derive(Debug, Clone)]
4053pub struct CompositeConnectorProxy {
4054 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4055}
4056
4057impl fidl::endpoints::Proxy for CompositeConnectorProxy {
4058 type Protocol = CompositeConnectorMarker;
4059
4060 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4061 Self::new(inner)
4062 }
4063
4064 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4065 self.client.into_channel().map_err(|client| Self { client })
4066 }
4067
4068 fn as_channel(&self) -> &::fidl::AsyncChannel {
4069 self.client.as_channel()
4070 }
4071}
4072
4073impl CompositeConnectorProxy {
4074 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4076 let protocol_name =
4077 <CompositeConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4078 Self { client: fidl::client::Client::new(channel, protocol_name) }
4079 }
4080
4081 pub fn take_event_stream(&self) -> CompositeConnectorEventStream {
4087 CompositeConnectorEventStream { event_receiver: self.client.take_event_receiver() }
4088 }
4089
4090 pub fn r#connect(
4093 &self,
4094 mut composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
4095 ) -> Result<(), fidl::Error> {
4096 CompositeConnectorProxyInterface::r#connect(self, composite_protocol)
4097 }
4098}
4099
4100impl CompositeConnectorProxyInterface for CompositeConnectorProxy {
4101 fn r#connect(
4102 &self,
4103 mut composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
4104 ) -> Result<(), fidl::Error> {
4105 self.client.send::<CompositeConnectorConnectRequest>(
4106 (composite_protocol,),
4107 0x7ee557529079e466,
4108 fidl::encoding::DynamicFlags::empty(),
4109 )
4110 }
4111}
4112
4113pub struct CompositeConnectorEventStream {
4114 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4115}
4116
4117impl std::marker::Unpin for CompositeConnectorEventStream {}
4118
4119impl futures::stream::FusedStream for CompositeConnectorEventStream {
4120 fn is_terminated(&self) -> bool {
4121 self.event_receiver.is_terminated()
4122 }
4123}
4124
4125impl futures::Stream for CompositeConnectorEventStream {
4126 type Item = Result<CompositeConnectorEvent, fidl::Error>;
4127
4128 fn poll_next(
4129 mut self: std::pin::Pin<&mut Self>,
4130 cx: &mut std::task::Context<'_>,
4131 ) -> std::task::Poll<Option<Self::Item>> {
4132 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4133 &mut self.event_receiver,
4134 cx
4135 )?) {
4136 Some(buf) => std::task::Poll::Ready(Some(CompositeConnectorEvent::decode(buf))),
4137 None => std::task::Poll::Ready(None),
4138 }
4139 }
4140}
4141
4142#[derive(Debug)]
4143pub enum CompositeConnectorEvent {}
4144
4145impl CompositeConnectorEvent {
4146 fn decode(
4148 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4149 ) -> Result<CompositeConnectorEvent, fidl::Error> {
4150 let (bytes, _handles) = buf.split_mut();
4151 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4152 debug_assert_eq!(tx_header.tx_id, 0);
4153 match tx_header.ordinal {
4154 _ => Err(fidl::Error::UnknownOrdinal {
4155 ordinal: tx_header.ordinal,
4156 protocol_name:
4157 <CompositeConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4158 }),
4159 }
4160 }
4161}
4162
4163pub struct CompositeConnectorRequestStream {
4165 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4166 is_terminated: bool,
4167}
4168
4169impl std::marker::Unpin for CompositeConnectorRequestStream {}
4170
4171impl futures::stream::FusedStream for CompositeConnectorRequestStream {
4172 fn is_terminated(&self) -> bool {
4173 self.is_terminated
4174 }
4175}
4176
4177impl fidl::endpoints::RequestStream for CompositeConnectorRequestStream {
4178 type Protocol = CompositeConnectorMarker;
4179 type ControlHandle = CompositeConnectorControlHandle;
4180
4181 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4182 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4183 }
4184
4185 fn control_handle(&self) -> Self::ControlHandle {
4186 CompositeConnectorControlHandle { inner: self.inner.clone() }
4187 }
4188
4189 fn into_inner(
4190 self,
4191 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4192 {
4193 (self.inner, self.is_terminated)
4194 }
4195
4196 fn from_inner(
4197 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4198 is_terminated: bool,
4199 ) -> Self {
4200 Self { inner, is_terminated }
4201 }
4202}
4203
4204impl futures::Stream for CompositeConnectorRequestStream {
4205 type Item = Result<CompositeConnectorRequest, fidl::Error>;
4206
4207 fn poll_next(
4208 mut self: std::pin::Pin<&mut Self>,
4209 cx: &mut std::task::Context<'_>,
4210 ) -> std::task::Poll<Option<Self::Item>> {
4211 let this = &mut *self;
4212 if this.inner.check_shutdown(cx) {
4213 this.is_terminated = true;
4214 return std::task::Poll::Ready(None);
4215 }
4216 if this.is_terminated {
4217 panic!("polled CompositeConnectorRequestStream after completion");
4218 }
4219 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4220 |bytes, handles| {
4221 match this.inner.channel().read_etc(cx, bytes, handles) {
4222 std::task::Poll::Ready(Ok(())) => {}
4223 std::task::Poll::Pending => return std::task::Poll::Pending,
4224 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4225 this.is_terminated = true;
4226 return std::task::Poll::Ready(None);
4227 }
4228 std::task::Poll::Ready(Err(e)) => {
4229 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4230 e.into(),
4231 ))))
4232 }
4233 }
4234
4235 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4237
4238 std::task::Poll::Ready(Some(match header.ordinal {
4239 0x7ee557529079e466 => {
4240 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4241 let mut req = fidl::new_empty!(CompositeConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4242 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
4243 let control_handle = CompositeConnectorControlHandle {
4244 inner: this.inner.clone(),
4245 };
4246 Ok(CompositeConnectorRequest::Connect {composite_protocol: req.composite_protocol,
4247
4248 control_handle,
4249 })
4250 }
4251 _ => Err(fidl::Error::UnknownOrdinal {
4252 ordinal: header.ordinal,
4253 protocol_name: <CompositeConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4254 }),
4255 }))
4256 },
4257 )
4258 }
4259}
4260
4261#[derive(Debug)]
4264pub enum CompositeConnectorRequest {
4265 Connect {
4268 composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
4269 control_handle: CompositeConnectorControlHandle,
4270 },
4271}
4272
4273impl CompositeConnectorRequest {
4274 #[allow(irrefutable_let_patterns)]
4275 pub fn into_connect(
4276 self,
4277 ) -> Option<(fidl::endpoints::ServerEnd<CompositeMarker>, CompositeConnectorControlHandle)>
4278 {
4279 if let CompositeConnectorRequest::Connect { composite_protocol, control_handle } = self {
4280 Some((composite_protocol, control_handle))
4281 } else {
4282 None
4283 }
4284 }
4285
4286 pub fn method_name(&self) -> &'static str {
4288 match *self {
4289 CompositeConnectorRequest::Connect { .. } => "connect",
4290 }
4291 }
4292}
4293
4294#[derive(Debug, Clone)]
4295pub struct CompositeConnectorControlHandle {
4296 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4297}
4298
4299impl fidl::endpoints::ControlHandle for CompositeConnectorControlHandle {
4300 fn shutdown(&self) {
4301 self.inner.shutdown()
4302 }
4303 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4304 self.inner.shutdown_with_epitaph(status)
4305 }
4306
4307 fn is_closed(&self) -> bool {
4308 self.inner.channel().is_closed()
4309 }
4310 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4311 self.inner.channel().on_closed()
4312 }
4313
4314 #[cfg(target_os = "fuchsia")]
4315 fn signal_peer(
4316 &self,
4317 clear_mask: zx::Signals,
4318 set_mask: zx::Signals,
4319 ) -> Result<(), zx_status::Status> {
4320 use fidl::Peered;
4321 self.inner.channel().signal_peer(clear_mask, set_mask)
4322 }
4323}
4324
4325impl CompositeConnectorControlHandle {}
4326
4327#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4328pub struct DaiMarker;
4329
4330impl fidl::endpoints::ProtocolMarker for DaiMarker {
4331 type Proxy = DaiProxy;
4332 type RequestStream = DaiRequestStream;
4333 #[cfg(target_os = "fuchsia")]
4334 type SynchronousProxy = DaiSynchronousProxy;
4335
4336 const DEBUG_NAME: &'static str = "(anonymous) Dai";
4337}
4338pub type DaiGetDaiFormatsResult = Result<Vec<DaiSupportedFormats>, i32>;
4339pub type DaiGetRingBufferFormatsResult = Result<Vec<SupportedFormats>, i32>;
4340
4341pub trait DaiProxyInterface: Send + Sync {
4342 type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
4343 + Send;
4344 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
4345 fn r#signal_processing_connect(
4346 &self,
4347 protocol: fidl::endpoints::ServerEnd<
4348 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
4349 >,
4350 ) -> Result<(), fidl::Error>;
4351 type ResetResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4352 fn r#reset(&self) -> Self::ResetResponseFut;
4353 type GetPropertiesResponseFut: std::future::Future<Output = Result<DaiProperties, fidl::Error>>
4354 + Send;
4355 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
4356 type GetDaiFormatsResponseFut: std::future::Future<Output = Result<DaiGetDaiFormatsResult, fidl::Error>>
4357 + Send;
4358 fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut;
4359 type GetRingBufferFormatsResponseFut: std::future::Future<Output = Result<DaiGetRingBufferFormatsResult, fidl::Error>>
4360 + Send;
4361 fn r#get_ring_buffer_formats(&self) -> Self::GetRingBufferFormatsResponseFut;
4362 fn r#create_ring_buffer(
4363 &self,
4364 dai_format: &DaiFormat,
4365 ring_buffer_format: &Format,
4366 ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
4367 ) -> Result<(), fidl::Error>;
4368}
4369#[derive(Debug)]
4370#[cfg(target_os = "fuchsia")]
4371pub struct DaiSynchronousProxy {
4372 client: fidl::client::sync::Client,
4373}
4374
4375#[cfg(target_os = "fuchsia")]
4376impl fidl::endpoints::SynchronousProxy for DaiSynchronousProxy {
4377 type Proxy = DaiProxy;
4378 type Protocol = DaiMarker;
4379
4380 fn from_channel(inner: fidl::Channel) -> Self {
4381 Self::new(inner)
4382 }
4383
4384 fn into_channel(self) -> fidl::Channel {
4385 self.client.into_channel()
4386 }
4387
4388 fn as_channel(&self) -> &fidl::Channel {
4389 self.client.as_channel()
4390 }
4391}
4392
4393#[cfg(target_os = "fuchsia")]
4394impl DaiSynchronousProxy {
4395 pub fn new(channel: fidl::Channel) -> Self {
4396 let protocol_name = <DaiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4397 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4398 }
4399
4400 pub fn into_channel(self) -> fidl::Channel {
4401 self.client.into_channel()
4402 }
4403
4404 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<DaiEvent, fidl::Error> {
4407 DaiEvent::decode(self.client.wait_for_event(deadline)?)
4408 }
4409
4410 pub fn r#get_health_state(
4413 &self,
4414 ___deadline: zx::MonotonicInstant,
4415 ) -> Result<HealthState, fidl::Error> {
4416 let _response =
4417 self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
4418 (),
4419 0x4e146d6bca733a84,
4420 fidl::encoding::DynamicFlags::empty(),
4421 ___deadline,
4422 )?;
4423 Ok(_response.state)
4424 }
4425
4426 pub fn r#signal_processing_connect(
4438 &self,
4439 mut protocol: fidl::endpoints::ServerEnd<
4440 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
4441 >,
4442 ) -> Result<(), fidl::Error> {
4443 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
4444 (protocol,),
4445 0xa81907ce6066295,
4446 fidl::encoding::DynamicFlags::empty(),
4447 )
4448 }
4449
4450 pub fn r#reset(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
4456 let _response =
4457 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
4458 (),
4459 0x69e5fa9fa2f78c14,
4460 fidl::encoding::DynamicFlags::empty(),
4461 ___deadline,
4462 )?;
4463 Ok(_response)
4464 }
4465
4466 pub fn r#get_properties(
4468 &self,
4469 ___deadline: zx::MonotonicInstant,
4470 ) -> Result<DaiProperties, fidl::Error> {
4471 let _response =
4472 self.client.send_query::<fidl::encoding::EmptyPayload, DaiGetPropertiesResponse>(
4473 (),
4474 0x2c25a1a66149510b,
4475 fidl::encoding::DynamicFlags::empty(),
4476 ___deadline,
4477 )?;
4478 Ok(_response.properties)
4479 }
4480
4481 pub fn r#get_dai_formats(
4486 &self,
4487 ___deadline: zx::MonotonicInstant,
4488 ) -> Result<DaiGetDaiFormatsResult, fidl::Error> {
4489 let _response = self.client.send_query::<
4490 fidl::encoding::EmptyPayload,
4491 fidl::encoding::ResultType<DaiGetDaiFormatsResponse, i32>,
4492 >(
4493 (),
4494 0x1eb37b0cddf79d69,
4495 fidl::encoding::DynamicFlags::empty(),
4496 ___deadline,
4497 )?;
4498 Ok(_response.map(|x| x.dai_formats))
4499 }
4500
4501 pub fn r#get_ring_buffer_formats(
4506 &self,
4507 ___deadline: zx::MonotonicInstant,
4508 ) -> Result<DaiGetRingBufferFormatsResult, fidl::Error> {
4509 let _response = self.client.send_query::<
4510 fidl::encoding::EmptyPayload,
4511 fidl::encoding::ResultType<DaiGetRingBufferFormatsResponse, i32>,
4512 >(
4513 (),
4514 0x760371081d8c92e4,
4515 fidl::encoding::DynamicFlags::empty(),
4516 ___deadline,
4517 )?;
4518 Ok(_response.map(|x| x.ring_buffer_formats))
4519 }
4520
4521 pub fn r#create_ring_buffer(
4528 &self,
4529 mut dai_format: &DaiFormat,
4530 mut ring_buffer_format: &Format,
4531 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
4532 ) -> Result<(), fidl::Error> {
4533 self.client.send::<DaiCreateRingBufferRequest>(
4534 (dai_format, ring_buffer_format, ring_buffer),
4535 0x5af9760589a75257,
4536 fidl::encoding::DynamicFlags::empty(),
4537 )
4538 }
4539}
4540
4541#[cfg(target_os = "fuchsia")]
4542impl From<DaiSynchronousProxy> for zx::Handle {
4543 fn from(value: DaiSynchronousProxy) -> Self {
4544 value.into_channel().into()
4545 }
4546}
4547
4548#[cfg(target_os = "fuchsia")]
4549impl From<fidl::Channel> for DaiSynchronousProxy {
4550 fn from(value: fidl::Channel) -> Self {
4551 Self::new(value)
4552 }
4553}
4554
4555#[derive(Debug, Clone)]
4556pub struct DaiProxy {
4557 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4558}
4559
4560impl fidl::endpoints::Proxy for DaiProxy {
4561 type Protocol = DaiMarker;
4562
4563 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4564 Self::new(inner)
4565 }
4566
4567 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4568 self.client.into_channel().map_err(|client| Self { client })
4569 }
4570
4571 fn as_channel(&self) -> &::fidl::AsyncChannel {
4572 self.client.as_channel()
4573 }
4574}
4575
4576impl DaiProxy {
4577 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4579 let protocol_name = <DaiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4580 Self { client: fidl::client::Client::new(channel, protocol_name) }
4581 }
4582
4583 pub fn take_event_stream(&self) -> DaiEventStream {
4589 DaiEventStream { event_receiver: self.client.take_event_receiver() }
4590 }
4591
4592 pub fn r#get_health_state(
4595 &self,
4596 ) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
4597 {
4598 DaiProxyInterface::r#get_health_state(self)
4599 }
4600
4601 pub fn r#signal_processing_connect(
4613 &self,
4614 mut protocol: fidl::endpoints::ServerEnd<
4615 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
4616 >,
4617 ) -> Result<(), fidl::Error> {
4618 DaiProxyInterface::r#signal_processing_connect(self, protocol)
4619 }
4620
4621 pub fn r#reset(
4627 &self,
4628 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4629 DaiProxyInterface::r#reset(self)
4630 }
4631
4632 pub fn r#get_properties(
4634 &self,
4635 ) -> fidl::client::QueryResponseFut<DaiProperties, fidl::encoding::DefaultFuchsiaResourceDialect>
4636 {
4637 DaiProxyInterface::r#get_properties(self)
4638 }
4639
4640 pub fn r#get_dai_formats(
4645 &self,
4646 ) -> fidl::client::QueryResponseFut<
4647 DaiGetDaiFormatsResult,
4648 fidl::encoding::DefaultFuchsiaResourceDialect,
4649 > {
4650 DaiProxyInterface::r#get_dai_formats(self)
4651 }
4652
4653 pub fn r#get_ring_buffer_formats(
4658 &self,
4659 ) -> fidl::client::QueryResponseFut<
4660 DaiGetRingBufferFormatsResult,
4661 fidl::encoding::DefaultFuchsiaResourceDialect,
4662 > {
4663 DaiProxyInterface::r#get_ring_buffer_formats(self)
4664 }
4665
4666 pub fn r#create_ring_buffer(
4673 &self,
4674 mut dai_format: &DaiFormat,
4675 mut ring_buffer_format: &Format,
4676 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
4677 ) -> Result<(), fidl::Error> {
4678 DaiProxyInterface::r#create_ring_buffer(self, dai_format, ring_buffer_format, ring_buffer)
4679 }
4680}
4681
4682impl DaiProxyInterface for DaiProxy {
4683 type GetHealthStateResponseFut =
4684 fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
4685 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
4686 fn _decode(
4687 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4688 ) -> Result<HealthState, fidl::Error> {
4689 let _response = fidl::client::decode_transaction_body::<
4690 HealthGetHealthStateResponse,
4691 fidl::encoding::DefaultFuchsiaResourceDialect,
4692 0x4e146d6bca733a84,
4693 >(_buf?)?;
4694 Ok(_response.state)
4695 }
4696 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
4697 (),
4698 0x4e146d6bca733a84,
4699 fidl::encoding::DynamicFlags::empty(),
4700 _decode,
4701 )
4702 }
4703
4704 fn r#signal_processing_connect(
4705 &self,
4706 mut protocol: fidl::endpoints::ServerEnd<
4707 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
4708 >,
4709 ) -> Result<(), fidl::Error> {
4710 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
4711 (protocol,),
4712 0xa81907ce6066295,
4713 fidl::encoding::DynamicFlags::empty(),
4714 )
4715 }
4716
4717 type ResetResponseFut =
4718 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4719 fn r#reset(&self) -> Self::ResetResponseFut {
4720 fn _decode(
4721 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4722 ) -> Result<(), fidl::Error> {
4723 let _response = fidl::client::decode_transaction_body::<
4724 fidl::encoding::EmptyPayload,
4725 fidl::encoding::DefaultFuchsiaResourceDialect,
4726 0x69e5fa9fa2f78c14,
4727 >(_buf?)?;
4728 Ok(_response)
4729 }
4730 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
4731 (),
4732 0x69e5fa9fa2f78c14,
4733 fidl::encoding::DynamicFlags::empty(),
4734 _decode,
4735 )
4736 }
4737
4738 type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
4739 DaiProperties,
4740 fidl::encoding::DefaultFuchsiaResourceDialect,
4741 >;
4742 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
4743 fn _decode(
4744 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4745 ) -> Result<DaiProperties, fidl::Error> {
4746 let _response = fidl::client::decode_transaction_body::<
4747 DaiGetPropertiesResponse,
4748 fidl::encoding::DefaultFuchsiaResourceDialect,
4749 0x2c25a1a66149510b,
4750 >(_buf?)?;
4751 Ok(_response.properties)
4752 }
4753 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DaiProperties>(
4754 (),
4755 0x2c25a1a66149510b,
4756 fidl::encoding::DynamicFlags::empty(),
4757 _decode,
4758 )
4759 }
4760
4761 type GetDaiFormatsResponseFut = fidl::client::QueryResponseFut<
4762 DaiGetDaiFormatsResult,
4763 fidl::encoding::DefaultFuchsiaResourceDialect,
4764 >;
4765 fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut {
4766 fn _decode(
4767 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4768 ) -> Result<DaiGetDaiFormatsResult, fidl::Error> {
4769 let _response = fidl::client::decode_transaction_body::<
4770 fidl::encoding::ResultType<DaiGetDaiFormatsResponse, i32>,
4771 fidl::encoding::DefaultFuchsiaResourceDialect,
4772 0x1eb37b0cddf79d69,
4773 >(_buf?)?;
4774 Ok(_response.map(|x| x.dai_formats))
4775 }
4776 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DaiGetDaiFormatsResult>(
4777 (),
4778 0x1eb37b0cddf79d69,
4779 fidl::encoding::DynamicFlags::empty(),
4780 _decode,
4781 )
4782 }
4783
4784 type GetRingBufferFormatsResponseFut = fidl::client::QueryResponseFut<
4785 DaiGetRingBufferFormatsResult,
4786 fidl::encoding::DefaultFuchsiaResourceDialect,
4787 >;
4788 fn r#get_ring_buffer_formats(&self) -> Self::GetRingBufferFormatsResponseFut {
4789 fn _decode(
4790 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4791 ) -> Result<DaiGetRingBufferFormatsResult, fidl::Error> {
4792 let _response = fidl::client::decode_transaction_body::<
4793 fidl::encoding::ResultType<DaiGetRingBufferFormatsResponse, i32>,
4794 fidl::encoding::DefaultFuchsiaResourceDialect,
4795 0x760371081d8c92e4,
4796 >(_buf?)?;
4797 Ok(_response.map(|x| x.ring_buffer_formats))
4798 }
4799 self.client
4800 .send_query_and_decode::<fidl::encoding::EmptyPayload, DaiGetRingBufferFormatsResult>(
4801 (),
4802 0x760371081d8c92e4,
4803 fidl::encoding::DynamicFlags::empty(),
4804 _decode,
4805 )
4806 }
4807
4808 fn r#create_ring_buffer(
4809 &self,
4810 mut dai_format: &DaiFormat,
4811 mut ring_buffer_format: &Format,
4812 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
4813 ) -> Result<(), fidl::Error> {
4814 self.client.send::<DaiCreateRingBufferRequest>(
4815 (dai_format, ring_buffer_format, ring_buffer),
4816 0x5af9760589a75257,
4817 fidl::encoding::DynamicFlags::empty(),
4818 )
4819 }
4820}
4821
4822pub struct DaiEventStream {
4823 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4824}
4825
4826impl std::marker::Unpin for DaiEventStream {}
4827
4828impl futures::stream::FusedStream for DaiEventStream {
4829 fn is_terminated(&self) -> bool {
4830 self.event_receiver.is_terminated()
4831 }
4832}
4833
4834impl futures::Stream for DaiEventStream {
4835 type Item = Result<DaiEvent, fidl::Error>;
4836
4837 fn poll_next(
4838 mut self: std::pin::Pin<&mut Self>,
4839 cx: &mut std::task::Context<'_>,
4840 ) -> std::task::Poll<Option<Self::Item>> {
4841 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4842 &mut self.event_receiver,
4843 cx
4844 )?) {
4845 Some(buf) => std::task::Poll::Ready(Some(DaiEvent::decode(buf))),
4846 None => std::task::Poll::Ready(None),
4847 }
4848 }
4849}
4850
4851#[derive(Debug)]
4852pub enum DaiEvent {}
4853
4854impl DaiEvent {
4855 fn decode(
4857 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4858 ) -> Result<DaiEvent, fidl::Error> {
4859 let (bytes, _handles) = buf.split_mut();
4860 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4861 debug_assert_eq!(tx_header.tx_id, 0);
4862 match tx_header.ordinal {
4863 _ => Err(fidl::Error::UnknownOrdinal {
4864 ordinal: tx_header.ordinal,
4865 protocol_name: <DaiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4866 }),
4867 }
4868 }
4869}
4870
4871pub struct DaiRequestStream {
4873 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4874 is_terminated: bool,
4875}
4876
4877impl std::marker::Unpin for DaiRequestStream {}
4878
4879impl futures::stream::FusedStream for DaiRequestStream {
4880 fn is_terminated(&self) -> bool {
4881 self.is_terminated
4882 }
4883}
4884
4885impl fidl::endpoints::RequestStream for DaiRequestStream {
4886 type Protocol = DaiMarker;
4887 type ControlHandle = DaiControlHandle;
4888
4889 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4890 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4891 }
4892
4893 fn control_handle(&self) -> Self::ControlHandle {
4894 DaiControlHandle { inner: self.inner.clone() }
4895 }
4896
4897 fn into_inner(
4898 self,
4899 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4900 {
4901 (self.inner, self.is_terminated)
4902 }
4903
4904 fn from_inner(
4905 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4906 is_terminated: bool,
4907 ) -> Self {
4908 Self { inner, is_terminated }
4909 }
4910}
4911
4912impl futures::Stream for DaiRequestStream {
4913 type Item = Result<DaiRequest, fidl::Error>;
4914
4915 fn poll_next(
4916 mut self: std::pin::Pin<&mut Self>,
4917 cx: &mut std::task::Context<'_>,
4918 ) -> std::task::Poll<Option<Self::Item>> {
4919 let this = &mut *self;
4920 if this.inner.check_shutdown(cx) {
4921 this.is_terminated = true;
4922 return std::task::Poll::Ready(None);
4923 }
4924 if this.is_terminated {
4925 panic!("polled DaiRequestStream after completion");
4926 }
4927 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4928 |bytes, handles| {
4929 match this.inner.channel().read_etc(cx, bytes, handles) {
4930 std::task::Poll::Ready(Ok(())) => {}
4931 std::task::Poll::Pending => return std::task::Poll::Pending,
4932 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4933 this.is_terminated = true;
4934 return std::task::Poll::Ready(None);
4935 }
4936 std::task::Poll::Ready(Err(e)) => {
4937 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4938 e.into(),
4939 ))))
4940 }
4941 }
4942
4943 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4945
4946 std::task::Poll::Ready(Some(match header.ordinal {
4947 0x4e146d6bca733a84 => {
4948 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4949 let mut req = fidl::new_empty!(
4950 fidl::encoding::EmptyPayload,
4951 fidl::encoding::DefaultFuchsiaResourceDialect
4952 );
4953 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4954 let control_handle = DaiControlHandle { inner: this.inner.clone() };
4955 Ok(DaiRequest::GetHealthState {
4956 responder: DaiGetHealthStateResponder {
4957 control_handle: std::mem::ManuallyDrop::new(control_handle),
4958 tx_id: header.tx_id,
4959 },
4960 })
4961 }
4962 0xa81907ce6066295 => {
4963 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4964 let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4965 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
4966 let control_handle = DaiControlHandle { inner: this.inner.clone() };
4967 Ok(DaiRequest::SignalProcessingConnect {
4968 protocol: req.protocol,
4969
4970 control_handle,
4971 })
4972 }
4973 0x69e5fa9fa2f78c14 => {
4974 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4975 let mut req = fidl::new_empty!(
4976 fidl::encoding::EmptyPayload,
4977 fidl::encoding::DefaultFuchsiaResourceDialect
4978 );
4979 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4980 let control_handle = DaiControlHandle { inner: this.inner.clone() };
4981 Ok(DaiRequest::Reset {
4982 responder: DaiResetResponder {
4983 control_handle: std::mem::ManuallyDrop::new(control_handle),
4984 tx_id: header.tx_id,
4985 },
4986 })
4987 }
4988 0x2c25a1a66149510b => {
4989 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4990 let mut req = fidl::new_empty!(
4991 fidl::encoding::EmptyPayload,
4992 fidl::encoding::DefaultFuchsiaResourceDialect
4993 );
4994 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4995 let control_handle = DaiControlHandle { inner: this.inner.clone() };
4996 Ok(DaiRequest::GetProperties {
4997 responder: DaiGetPropertiesResponder {
4998 control_handle: std::mem::ManuallyDrop::new(control_handle),
4999 tx_id: header.tx_id,
5000 },
5001 })
5002 }
5003 0x1eb37b0cddf79d69 => {
5004 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5005 let mut req = fidl::new_empty!(
5006 fidl::encoding::EmptyPayload,
5007 fidl::encoding::DefaultFuchsiaResourceDialect
5008 );
5009 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5010 let control_handle = DaiControlHandle { inner: this.inner.clone() };
5011 Ok(DaiRequest::GetDaiFormats {
5012 responder: DaiGetDaiFormatsResponder {
5013 control_handle: std::mem::ManuallyDrop::new(control_handle),
5014 tx_id: header.tx_id,
5015 },
5016 })
5017 }
5018 0x760371081d8c92e4 => {
5019 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5020 let mut req = fidl::new_empty!(
5021 fidl::encoding::EmptyPayload,
5022 fidl::encoding::DefaultFuchsiaResourceDialect
5023 );
5024 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5025 let control_handle = DaiControlHandle { inner: this.inner.clone() };
5026 Ok(DaiRequest::GetRingBufferFormats {
5027 responder: DaiGetRingBufferFormatsResponder {
5028 control_handle: std::mem::ManuallyDrop::new(control_handle),
5029 tx_id: header.tx_id,
5030 },
5031 })
5032 }
5033 0x5af9760589a75257 => {
5034 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5035 let mut req = fidl::new_empty!(
5036 DaiCreateRingBufferRequest,
5037 fidl::encoding::DefaultFuchsiaResourceDialect
5038 );
5039 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DaiCreateRingBufferRequest>(&header, _body_bytes, handles, &mut req)?;
5040 let control_handle = DaiControlHandle { inner: this.inner.clone() };
5041 Ok(DaiRequest::CreateRingBuffer {
5042 dai_format: req.dai_format,
5043 ring_buffer_format: req.ring_buffer_format,
5044 ring_buffer: req.ring_buffer,
5045
5046 control_handle,
5047 })
5048 }
5049 _ => Err(fidl::Error::UnknownOrdinal {
5050 ordinal: header.ordinal,
5051 protocol_name: <DaiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5052 }),
5053 }))
5054 },
5055 )
5056 }
5057}
5058
5059#[derive(Debug)]
5068pub enum DaiRequest {
5069 GetHealthState { responder: DaiGetHealthStateResponder },
5072 SignalProcessingConnect {
5084 protocol: fidl::endpoints::ServerEnd<
5085 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
5086 >,
5087 control_handle: DaiControlHandle,
5088 },
5089 Reset { responder: DaiResetResponder },
5095 GetProperties { responder: DaiGetPropertiesResponder },
5097 GetDaiFormats { responder: DaiGetDaiFormatsResponder },
5102 GetRingBufferFormats { responder: DaiGetRingBufferFormatsResponder },
5107 CreateRingBuffer {
5114 dai_format: DaiFormat,
5115 ring_buffer_format: Format,
5116 ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
5117 control_handle: DaiControlHandle,
5118 },
5119}
5120
5121impl DaiRequest {
5122 #[allow(irrefutable_let_patterns)]
5123 pub fn into_get_health_state(self) -> Option<(DaiGetHealthStateResponder)> {
5124 if let DaiRequest::GetHealthState { responder } = self {
5125 Some((responder))
5126 } else {
5127 None
5128 }
5129 }
5130
5131 #[allow(irrefutable_let_patterns)]
5132 pub fn into_signal_processing_connect(
5133 self,
5134 ) -> Option<(
5135 fidl::endpoints::ServerEnd<
5136 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
5137 >,
5138 DaiControlHandle,
5139 )> {
5140 if let DaiRequest::SignalProcessingConnect { protocol, control_handle } = self {
5141 Some((protocol, control_handle))
5142 } else {
5143 None
5144 }
5145 }
5146
5147 #[allow(irrefutable_let_patterns)]
5148 pub fn into_reset(self) -> Option<(DaiResetResponder)> {
5149 if let DaiRequest::Reset { responder } = self {
5150 Some((responder))
5151 } else {
5152 None
5153 }
5154 }
5155
5156 #[allow(irrefutable_let_patterns)]
5157 pub fn into_get_properties(self) -> Option<(DaiGetPropertiesResponder)> {
5158 if let DaiRequest::GetProperties { responder } = self {
5159 Some((responder))
5160 } else {
5161 None
5162 }
5163 }
5164
5165 #[allow(irrefutable_let_patterns)]
5166 pub fn into_get_dai_formats(self) -> Option<(DaiGetDaiFormatsResponder)> {
5167 if let DaiRequest::GetDaiFormats { responder } = self {
5168 Some((responder))
5169 } else {
5170 None
5171 }
5172 }
5173
5174 #[allow(irrefutable_let_patterns)]
5175 pub fn into_get_ring_buffer_formats(self) -> Option<(DaiGetRingBufferFormatsResponder)> {
5176 if let DaiRequest::GetRingBufferFormats { responder } = self {
5177 Some((responder))
5178 } else {
5179 None
5180 }
5181 }
5182
5183 #[allow(irrefutable_let_patterns)]
5184 pub fn into_create_ring_buffer(
5185 self,
5186 ) -> Option<(DaiFormat, Format, fidl::endpoints::ServerEnd<RingBufferMarker>, DaiControlHandle)>
5187 {
5188 if let DaiRequest::CreateRingBuffer {
5189 dai_format,
5190 ring_buffer_format,
5191 ring_buffer,
5192 control_handle,
5193 } = self
5194 {
5195 Some((dai_format, ring_buffer_format, ring_buffer, control_handle))
5196 } else {
5197 None
5198 }
5199 }
5200
5201 pub fn method_name(&self) -> &'static str {
5203 match *self {
5204 DaiRequest::GetHealthState { .. } => "get_health_state",
5205 DaiRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
5206 DaiRequest::Reset { .. } => "reset",
5207 DaiRequest::GetProperties { .. } => "get_properties",
5208 DaiRequest::GetDaiFormats { .. } => "get_dai_formats",
5209 DaiRequest::GetRingBufferFormats { .. } => "get_ring_buffer_formats",
5210 DaiRequest::CreateRingBuffer { .. } => "create_ring_buffer",
5211 }
5212 }
5213}
5214
5215#[derive(Debug, Clone)]
5216pub struct DaiControlHandle {
5217 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5218}
5219
5220impl fidl::endpoints::ControlHandle for DaiControlHandle {
5221 fn shutdown(&self) {
5222 self.inner.shutdown()
5223 }
5224 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5225 self.inner.shutdown_with_epitaph(status)
5226 }
5227
5228 fn is_closed(&self) -> bool {
5229 self.inner.channel().is_closed()
5230 }
5231 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5232 self.inner.channel().on_closed()
5233 }
5234
5235 #[cfg(target_os = "fuchsia")]
5236 fn signal_peer(
5237 &self,
5238 clear_mask: zx::Signals,
5239 set_mask: zx::Signals,
5240 ) -> Result<(), zx_status::Status> {
5241 use fidl::Peered;
5242 self.inner.channel().signal_peer(clear_mask, set_mask)
5243 }
5244}
5245
5246impl DaiControlHandle {}
5247
5248#[must_use = "FIDL methods require a response to be sent"]
5249#[derive(Debug)]
5250pub struct DaiGetHealthStateResponder {
5251 control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
5252 tx_id: u32,
5253}
5254
5255impl std::ops::Drop for DaiGetHealthStateResponder {
5259 fn drop(&mut self) {
5260 self.control_handle.shutdown();
5261 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5263 }
5264}
5265
5266impl fidl::endpoints::Responder for DaiGetHealthStateResponder {
5267 type ControlHandle = DaiControlHandle;
5268
5269 fn control_handle(&self) -> &DaiControlHandle {
5270 &self.control_handle
5271 }
5272
5273 fn drop_without_shutdown(mut self) {
5274 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5276 std::mem::forget(self);
5278 }
5279}
5280
5281impl DaiGetHealthStateResponder {
5282 pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
5286 let _result = self.send_raw(state);
5287 if _result.is_err() {
5288 self.control_handle.shutdown();
5289 }
5290 self.drop_without_shutdown();
5291 _result
5292 }
5293
5294 pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
5296 let _result = self.send_raw(state);
5297 self.drop_without_shutdown();
5298 _result
5299 }
5300
5301 fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
5302 self.control_handle.inner.send::<HealthGetHealthStateResponse>(
5303 (state,),
5304 self.tx_id,
5305 0x4e146d6bca733a84,
5306 fidl::encoding::DynamicFlags::empty(),
5307 )
5308 }
5309}
5310
5311#[must_use = "FIDL methods require a response to be sent"]
5312#[derive(Debug)]
5313pub struct DaiResetResponder {
5314 control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
5315 tx_id: u32,
5316}
5317
5318impl std::ops::Drop for DaiResetResponder {
5322 fn drop(&mut self) {
5323 self.control_handle.shutdown();
5324 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5326 }
5327}
5328
5329impl fidl::endpoints::Responder for DaiResetResponder {
5330 type ControlHandle = DaiControlHandle;
5331
5332 fn control_handle(&self) -> &DaiControlHandle {
5333 &self.control_handle
5334 }
5335
5336 fn drop_without_shutdown(mut self) {
5337 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5339 std::mem::forget(self);
5341 }
5342}
5343
5344impl DaiResetResponder {
5345 pub fn send(self) -> Result<(), fidl::Error> {
5349 let _result = self.send_raw();
5350 if _result.is_err() {
5351 self.control_handle.shutdown();
5352 }
5353 self.drop_without_shutdown();
5354 _result
5355 }
5356
5357 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5359 let _result = self.send_raw();
5360 self.drop_without_shutdown();
5361 _result
5362 }
5363
5364 fn send_raw(&self) -> Result<(), fidl::Error> {
5365 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5366 (),
5367 self.tx_id,
5368 0x69e5fa9fa2f78c14,
5369 fidl::encoding::DynamicFlags::empty(),
5370 )
5371 }
5372}
5373
5374#[must_use = "FIDL methods require a response to be sent"]
5375#[derive(Debug)]
5376pub struct DaiGetPropertiesResponder {
5377 control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
5378 tx_id: u32,
5379}
5380
5381impl std::ops::Drop for DaiGetPropertiesResponder {
5385 fn drop(&mut self) {
5386 self.control_handle.shutdown();
5387 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5389 }
5390}
5391
5392impl fidl::endpoints::Responder for DaiGetPropertiesResponder {
5393 type ControlHandle = DaiControlHandle;
5394
5395 fn control_handle(&self) -> &DaiControlHandle {
5396 &self.control_handle
5397 }
5398
5399 fn drop_without_shutdown(mut self) {
5400 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5402 std::mem::forget(self);
5404 }
5405}
5406
5407impl DaiGetPropertiesResponder {
5408 pub fn send(self, mut properties: &DaiProperties) -> Result<(), fidl::Error> {
5412 let _result = self.send_raw(properties);
5413 if _result.is_err() {
5414 self.control_handle.shutdown();
5415 }
5416 self.drop_without_shutdown();
5417 _result
5418 }
5419
5420 pub fn send_no_shutdown_on_err(
5422 self,
5423 mut properties: &DaiProperties,
5424 ) -> Result<(), fidl::Error> {
5425 let _result = self.send_raw(properties);
5426 self.drop_without_shutdown();
5427 _result
5428 }
5429
5430 fn send_raw(&self, mut properties: &DaiProperties) -> Result<(), fidl::Error> {
5431 self.control_handle.inner.send::<DaiGetPropertiesResponse>(
5432 (properties,),
5433 self.tx_id,
5434 0x2c25a1a66149510b,
5435 fidl::encoding::DynamicFlags::empty(),
5436 )
5437 }
5438}
5439
5440#[must_use = "FIDL methods require a response to be sent"]
5441#[derive(Debug)]
5442pub struct DaiGetDaiFormatsResponder {
5443 control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
5444 tx_id: u32,
5445}
5446
5447impl std::ops::Drop for DaiGetDaiFormatsResponder {
5451 fn drop(&mut self) {
5452 self.control_handle.shutdown();
5453 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5455 }
5456}
5457
5458impl fidl::endpoints::Responder for DaiGetDaiFormatsResponder {
5459 type ControlHandle = DaiControlHandle;
5460
5461 fn control_handle(&self) -> &DaiControlHandle {
5462 &self.control_handle
5463 }
5464
5465 fn drop_without_shutdown(mut self) {
5466 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5468 std::mem::forget(self);
5470 }
5471}
5472
5473impl DaiGetDaiFormatsResponder {
5474 pub fn send(self, mut result: Result<&[DaiSupportedFormats], i32>) -> Result<(), fidl::Error> {
5478 let _result = self.send_raw(result);
5479 if _result.is_err() {
5480 self.control_handle.shutdown();
5481 }
5482 self.drop_without_shutdown();
5483 _result
5484 }
5485
5486 pub fn send_no_shutdown_on_err(
5488 self,
5489 mut result: Result<&[DaiSupportedFormats], i32>,
5490 ) -> Result<(), fidl::Error> {
5491 let _result = self.send_raw(result);
5492 self.drop_without_shutdown();
5493 _result
5494 }
5495
5496 fn send_raw(&self, mut result: Result<&[DaiSupportedFormats], i32>) -> Result<(), fidl::Error> {
5497 self.control_handle.inner.send::<fidl::encoding::ResultType<DaiGetDaiFormatsResponse, i32>>(
5498 result.map(|dai_formats| (dai_formats,)),
5499 self.tx_id,
5500 0x1eb37b0cddf79d69,
5501 fidl::encoding::DynamicFlags::empty(),
5502 )
5503 }
5504}
5505
5506#[must_use = "FIDL methods require a response to be sent"]
5507#[derive(Debug)]
5508pub struct DaiGetRingBufferFormatsResponder {
5509 control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
5510 tx_id: u32,
5511}
5512
5513impl std::ops::Drop for DaiGetRingBufferFormatsResponder {
5517 fn drop(&mut self) {
5518 self.control_handle.shutdown();
5519 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5521 }
5522}
5523
5524impl fidl::endpoints::Responder for DaiGetRingBufferFormatsResponder {
5525 type ControlHandle = DaiControlHandle;
5526
5527 fn control_handle(&self) -> &DaiControlHandle {
5528 &self.control_handle
5529 }
5530
5531 fn drop_without_shutdown(mut self) {
5532 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5534 std::mem::forget(self);
5536 }
5537}
5538
5539impl DaiGetRingBufferFormatsResponder {
5540 pub fn send(self, mut result: Result<&[SupportedFormats], i32>) -> Result<(), fidl::Error> {
5544 let _result = self.send_raw(result);
5545 if _result.is_err() {
5546 self.control_handle.shutdown();
5547 }
5548 self.drop_without_shutdown();
5549 _result
5550 }
5551
5552 pub fn send_no_shutdown_on_err(
5554 self,
5555 mut result: Result<&[SupportedFormats], i32>,
5556 ) -> Result<(), fidl::Error> {
5557 let _result = self.send_raw(result);
5558 self.drop_without_shutdown();
5559 _result
5560 }
5561
5562 fn send_raw(&self, mut result: Result<&[SupportedFormats], i32>) -> Result<(), fidl::Error> {
5563 self.control_handle
5564 .inner
5565 .send::<fidl::encoding::ResultType<DaiGetRingBufferFormatsResponse, i32>>(
5566 result.map(|ring_buffer_formats| (ring_buffer_formats,)),
5567 self.tx_id,
5568 0x760371081d8c92e4,
5569 fidl::encoding::DynamicFlags::empty(),
5570 )
5571 }
5572}
5573
5574#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5575pub struct DaiConnectorMarker;
5576
5577impl fidl::endpoints::ProtocolMarker for DaiConnectorMarker {
5578 type Proxy = DaiConnectorProxy;
5579 type RequestStream = DaiConnectorRequestStream;
5580 #[cfg(target_os = "fuchsia")]
5581 type SynchronousProxy = DaiConnectorSynchronousProxy;
5582
5583 const DEBUG_NAME: &'static str = "(anonymous) DaiConnector";
5584}
5585
5586pub trait DaiConnectorProxyInterface: Send + Sync {
5587 fn r#connect(
5588 &self,
5589 dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
5590 ) -> Result<(), fidl::Error>;
5591}
5592#[derive(Debug)]
5593#[cfg(target_os = "fuchsia")]
5594pub struct DaiConnectorSynchronousProxy {
5595 client: fidl::client::sync::Client,
5596}
5597
5598#[cfg(target_os = "fuchsia")]
5599impl fidl::endpoints::SynchronousProxy for DaiConnectorSynchronousProxy {
5600 type Proxy = DaiConnectorProxy;
5601 type Protocol = DaiConnectorMarker;
5602
5603 fn from_channel(inner: fidl::Channel) -> Self {
5604 Self::new(inner)
5605 }
5606
5607 fn into_channel(self) -> fidl::Channel {
5608 self.client.into_channel()
5609 }
5610
5611 fn as_channel(&self) -> &fidl::Channel {
5612 self.client.as_channel()
5613 }
5614}
5615
5616#[cfg(target_os = "fuchsia")]
5617impl DaiConnectorSynchronousProxy {
5618 pub fn new(channel: fidl::Channel) -> Self {
5619 let protocol_name = <DaiConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5620 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5621 }
5622
5623 pub fn into_channel(self) -> fidl::Channel {
5624 self.client.into_channel()
5625 }
5626
5627 pub fn wait_for_event(
5630 &self,
5631 deadline: zx::MonotonicInstant,
5632 ) -> Result<DaiConnectorEvent, fidl::Error> {
5633 DaiConnectorEvent::decode(self.client.wait_for_event(deadline)?)
5634 }
5635
5636 pub fn r#connect(
5638 &self,
5639 mut dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
5640 ) -> Result<(), fidl::Error> {
5641 self.client.send::<DaiConnectorConnectRequest>(
5642 (dai_protocol,),
5643 0x4e4db05c2eca1450,
5644 fidl::encoding::DynamicFlags::empty(),
5645 )
5646 }
5647}
5648
5649#[cfg(target_os = "fuchsia")]
5650impl From<DaiConnectorSynchronousProxy> for zx::Handle {
5651 fn from(value: DaiConnectorSynchronousProxy) -> Self {
5652 value.into_channel().into()
5653 }
5654}
5655
5656#[cfg(target_os = "fuchsia")]
5657impl From<fidl::Channel> for DaiConnectorSynchronousProxy {
5658 fn from(value: fidl::Channel) -> Self {
5659 Self::new(value)
5660 }
5661}
5662
5663#[derive(Debug, Clone)]
5664pub struct DaiConnectorProxy {
5665 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5666}
5667
5668impl fidl::endpoints::Proxy for DaiConnectorProxy {
5669 type Protocol = DaiConnectorMarker;
5670
5671 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5672 Self::new(inner)
5673 }
5674
5675 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5676 self.client.into_channel().map_err(|client| Self { client })
5677 }
5678
5679 fn as_channel(&self) -> &::fidl::AsyncChannel {
5680 self.client.as_channel()
5681 }
5682}
5683
5684impl DaiConnectorProxy {
5685 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5687 let protocol_name = <DaiConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5688 Self { client: fidl::client::Client::new(channel, protocol_name) }
5689 }
5690
5691 pub fn take_event_stream(&self) -> DaiConnectorEventStream {
5697 DaiConnectorEventStream { event_receiver: self.client.take_event_receiver() }
5698 }
5699
5700 pub fn r#connect(
5702 &self,
5703 mut dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
5704 ) -> Result<(), fidl::Error> {
5705 DaiConnectorProxyInterface::r#connect(self, dai_protocol)
5706 }
5707}
5708
5709impl DaiConnectorProxyInterface for DaiConnectorProxy {
5710 fn r#connect(
5711 &self,
5712 mut dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
5713 ) -> Result<(), fidl::Error> {
5714 self.client.send::<DaiConnectorConnectRequest>(
5715 (dai_protocol,),
5716 0x4e4db05c2eca1450,
5717 fidl::encoding::DynamicFlags::empty(),
5718 )
5719 }
5720}
5721
5722pub struct DaiConnectorEventStream {
5723 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5724}
5725
5726impl std::marker::Unpin for DaiConnectorEventStream {}
5727
5728impl futures::stream::FusedStream for DaiConnectorEventStream {
5729 fn is_terminated(&self) -> bool {
5730 self.event_receiver.is_terminated()
5731 }
5732}
5733
5734impl futures::Stream for DaiConnectorEventStream {
5735 type Item = Result<DaiConnectorEvent, fidl::Error>;
5736
5737 fn poll_next(
5738 mut self: std::pin::Pin<&mut Self>,
5739 cx: &mut std::task::Context<'_>,
5740 ) -> std::task::Poll<Option<Self::Item>> {
5741 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5742 &mut self.event_receiver,
5743 cx
5744 )?) {
5745 Some(buf) => std::task::Poll::Ready(Some(DaiConnectorEvent::decode(buf))),
5746 None => std::task::Poll::Ready(None),
5747 }
5748 }
5749}
5750
5751#[derive(Debug)]
5752pub enum DaiConnectorEvent {}
5753
5754impl DaiConnectorEvent {
5755 fn decode(
5757 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5758 ) -> Result<DaiConnectorEvent, fidl::Error> {
5759 let (bytes, _handles) = buf.split_mut();
5760 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5761 debug_assert_eq!(tx_header.tx_id, 0);
5762 match tx_header.ordinal {
5763 _ => Err(fidl::Error::UnknownOrdinal {
5764 ordinal: tx_header.ordinal,
5765 protocol_name: <DaiConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5766 }),
5767 }
5768 }
5769}
5770
5771pub struct DaiConnectorRequestStream {
5773 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5774 is_terminated: bool,
5775}
5776
5777impl std::marker::Unpin for DaiConnectorRequestStream {}
5778
5779impl futures::stream::FusedStream for DaiConnectorRequestStream {
5780 fn is_terminated(&self) -> bool {
5781 self.is_terminated
5782 }
5783}
5784
5785impl fidl::endpoints::RequestStream for DaiConnectorRequestStream {
5786 type Protocol = DaiConnectorMarker;
5787 type ControlHandle = DaiConnectorControlHandle;
5788
5789 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5790 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5791 }
5792
5793 fn control_handle(&self) -> Self::ControlHandle {
5794 DaiConnectorControlHandle { inner: self.inner.clone() }
5795 }
5796
5797 fn into_inner(
5798 self,
5799 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5800 {
5801 (self.inner, self.is_terminated)
5802 }
5803
5804 fn from_inner(
5805 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5806 is_terminated: bool,
5807 ) -> Self {
5808 Self { inner, is_terminated }
5809 }
5810}
5811
5812impl futures::Stream for DaiConnectorRequestStream {
5813 type Item = Result<DaiConnectorRequest, fidl::Error>;
5814
5815 fn poll_next(
5816 mut self: std::pin::Pin<&mut Self>,
5817 cx: &mut std::task::Context<'_>,
5818 ) -> std::task::Poll<Option<Self::Item>> {
5819 let this = &mut *self;
5820 if this.inner.check_shutdown(cx) {
5821 this.is_terminated = true;
5822 return std::task::Poll::Ready(None);
5823 }
5824 if this.is_terminated {
5825 panic!("polled DaiConnectorRequestStream after completion");
5826 }
5827 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5828 |bytes, handles| {
5829 match this.inner.channel().read_etc(cx, bytes, handles) {
5830 std::task::Poll::Ready(Ok(())) => {}
5831 std::task::Poll::Pending => return std::task::Poll::Pending,
5832 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5833 this.is_terminated = true;
5834 return std::task::Poll::Ready(None);
5835 }
5836 std::task::Poll::Ready(Err(e)) => {
5837 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5838 e.into(),
5839 ))))
5840 }
5841 }
5842
5843 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5845
5846 std::task::Poll::Ready(Some(match header.ordinal {
5847 0x4e4db05c2eca1450 => {
5848 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5849 let mut req = fidl::new_empty!(
5850 DaiConnectorConnectRequest,
5851 fidl::encoding::DefaultFuchsiaResourceDialect
5852 );
5853 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DaiConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
5854 let control_handle =
5855 DaiConnectorControlHandle { inner: this.inner.clone() };
5856 Ok(DaiConnectorRequest::Connect {
5857 dai_protocol: req.dai_protocol,
5858
5859 control_handle,
5860 })
5861 }
5862 _ => Err(fidl::Error::UnknownOrdinal {
5863 ordinal: header.ordinal,
5864 protocol_name:
5865 <DaiConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5866 }),
5867 }))
5868 },
5869 )
5870 }
5871}
5872
5873#[derive(Debug)]
5882pub enum DaiConnectorRequest {
5883 Connect {
5885 dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
5886 control_handle: DaiConnectorControlHandle,
5887 },
5888}
5889
5890impl DaiConnectorRequest {
5891 #[allow(irrefutable_let_patterns)]
5892 pub fn into_connect(
5893 self,
5894 ) -> Option<(fidl::endpoints::ServerEnd<DaiMarker>, DaiConnectorControlHandle)> {
5895 if let DaiConnectorRequest::Connect { dai_protocol, control_handle } = self {
5896 Some((dai_protocol, control_handle))
5897 } else {
5898 None
5899 }
5900 }
5901
5902 pub fn method_name(&self) -> &'static str {
5904 match *self {
5905 DaiConnectorRequest::Connect { .. } => "connect",
5906 }
5907 }
5908}
5909
5910#[derive(Debug, Clone)]
5911pub struct DaiConnectorControlHandle {
5912 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5913}
5914
5915impl fidl::endpoints::ControlHandle for DaiConnectorControlHandle {
5916 fn shutdown(&self) {
5917 self.inner.shutdown()
5918 }
5919 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5920 self.inner.shutdown_with_epitaph(status)
5921 }
5922
5923 fn is_closed(&self) -> bool {
5924 self.inner.channel().is_closed()
5925 }
5926 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5927 self.inner.channel().on_closed()
5928 }
5929
5930 #[cfg(target_os = "fuchsia")]
5931 fn signal_peer(
5932 &self,
5933 clear_mask: zx::Signals,
5934 set_mask: zx::Signals,
5935 ) -> Result<(), zx_status::Status> {
5936 use fidl::Peered;
5937 self.inner.channel().signal_peer(clear_mask, set_mask)
5938 }
5939}
5940
5941impl DaiConnectorControlHandle {}
5942
5943#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5944pub struct HealthMarker;
5945
5946impl fidl::endpoints::ProtocolMarker for HealthMarker {
5947 type Proxy = HealthProxy;
5948 type RequestStream = HealthRequestStream;
5949 #[cfg(target_os = "fuchsia")]
5950 type SynchronousProxy = HealthSynchronousProxy;
5951
5952 const DEBUG_NAME: &'static str = "(anonymous) Health";
5953}
5954
5955pub trait HealthProxyInterface: Send + Sync {
5956 type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
5957 + Send;
5958 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
5959}
5960#[derive(Debug)]
5961#[cfg(target_os = "fuchsia")]
5962pub struct HealthSynchronousProxy {
5963 client: fidl::client::sync::Client,
5964}
5965
5966#[cfg(target_os = "fuchsia")]
5967impl fidl::endpoints::SynchronousProxy for HealthSynchronousProxy {
5968 type Proxy = HealthProxy;
5969 type Protocol = HealthMarker;
5970
5971 fn from_channel(inner: fidl::Channel) -> Self {
5972 Self::new(inner)
5973 }
5974
5975 fn into_channel(self) -> fidl::Channel {
5976 self.client.into_channel()
5977 }
5978
5979 fn as_channel(&self) -> &fidl::Channel {
5980 self.client.as_channel()
5981 }
5982}
5983
5984#[cfg(target_os = "fuchsia")]
5985impl HealthSynchronousProxy {
5986 pub fn new(channel: fidl::Channel) -> Self {
5987 let protocol_name = <HealthMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5988 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5989 }
5990
5991 pub fn into_channel(self) -> fidl::Channel {
5992 self.client.into_channel()
5993 }
5994
5995 pub fn wait_for_event(
5998 &self,
5999 deadline: zx::MonotonicInstant,
6000 ) -> Result<HealthEvent, fidl::Error> {
6001 HealthEvent::decode(self.client.wait_for_event(deadline)?)
6002 }
6003
6004 pub fn r#get_health_state(
6007 &self,
6008 ___deadline: zx::MonotonicInstant,
6009 ) -> Result<HealthState, fidl::Error> {
6010 let _response =
6011 self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
6012 (),
6013 0x4e146d6bca733a84,
6014 fidl::encoding::DynamicFlags::empty(),
6015 ___deadline,
6016 )?;
6017 Ok(_response.state)
6018 }
6019}
6020
6021#[cfg(target_os = "fuchsia")]
6022impl From<HealthSynchronousProxy> for zx::Handle {
6023 fn from(value: HealthSynchronousProxy) -> Self {
6024 value.into_channel().into()
6025 }
6026}
6027
6028#[cfg(target_os = "fuchsia")]
6029impl From<fidl::Channel> for HealthSynchronousProxy {
6030 fn from(value: fidl::Channel) -> Self {
6031 Self::new(value)
6032 }
6033}
6034
6035#[derive(Debug, Clone)]
6036pub struct HealthProxy {
6037 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6038}
6039
6040impl fidl::endpoints::Proxy for HealthProxy {
6041 type Protocol = HealthMarker;
6042
6043 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6044 Self::new(inner)
6045 }
6046
6047 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6048 self.client.into_channel().map_err(|client| Self { client })
6049 }
6050
6051 fn as_channel(&self) -> &::fidl::AsyncChannel {
6052 self.client.as_channel()
6053 }
6054}
6055
6056impl HealthProxy {
6057 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6059 let protocol_name = <HealthMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6060 Self { client: fidl::client::Client::new(channel, protocol_name) }
6061 }
6062
6063 pub fn take_event_stream(&self) -> HealthEventStream {
6069 HealthEventStream { event_receiver: self.client.take_event_receiver() }
6070 }
6071
6072 pub fn r#get_health_state(
6075 &self,
6076 ) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
6077 {
6078 HealthProxyInterface::r#get_health_state(self)
6079 }
6080}
6081
6082impl HealthProxyInterface for HealthProxy {
6083 type GetHealthStateResponseFut =
6084 fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
6085 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
6086 fn _decode(
6087 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6088 ) -> Result<HealthState, fidl::Error> {
6089 let _response = fidl::client::decode_transaction_body::<
6090 HealthGetHealthStateResponse,
6091 fidl::encoding::DefaultFuchsiaResourceDialect,
6092 0x4e146d6bca733a84,
6093 >(_buf?)?;
6094 Ok(_response.state)
6095 }
6096 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
6097 (),
6098 0x4e146d6bca733a84,
6099 fidl::encoding::DynamicFlags::empty(),
6100 _decode,
6101 )
6102 }
6103}
6104
6105pub struct HealthEventStream {
6106 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6107}
6108
6109impl std::marker::Unpin for HealthEventStream {}
6110
6111impl futures::stream::FusedStream for HealthEventStream {
6112 fn is_terminated(&self) -> bool {
6113 self.event_receiver.is_terminated()
6114 }
6115}
6116
6117impl futures::Stream for HealthEventStream {
6118 type Item = Result<HealthEvent, fidl::Error>;
6119
6120 fn poll_next(
6121 mut self: std::pin::Pin<&mut Self>,
6122 cx: &mut std::task::Context<'_>,
6123 ) -> std::task::Poll<Option<Self::Item>> {
6124 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6125 &mut self.event_receiver,
6126 cx
6127 )?) {
6128 Some(buf) => std::task::Poll::Ready(Some(HealthEvent::decode(buf))),
6129 None => std::task::Poll::Ready(None),
6130 }
6131 }
6132}
6133
6134#[derive(Debug)]
6135pub enum HealthEvent {}
6136
6137impl HealthEvent {
6138 fn decode(
6140 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6141 ) -> Result<HealthEvent, fidl::Error> {
6142 let (bytes, _handles) = buf.split_mut();
6143 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6144 debug_assert_eq!(tx_header.tx_id, 0);
6145 match tx_header.ordinal {
6146 _ => Err(fidl::Error::UnknownOrdinal {
6147 ordinal: tx_header.ordinal,
6148 protocol_name: <HealthMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6149 }),
6150 }
6151 }
6152}
6153
6154pub struct HealthRequestStream {
6156 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6157 is_terminated: bool,
6158}
6159
6160impl std::marker::Unpin for HealthRequestStream {}
6161
6162impl futures::stream::FusedStream for HealthRequestStream {
6163 fn is_terminated(&self) -> bool {
6164 self.is_terminated
6165 }
6166}
6167
6168impl fidl::endpoints::RequestStream for HealthRequestStream {
6169 type Protocol = HealthMarker;
6170 type ControlHandle = HealthControlHandle;
6171
6172 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6173 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6174 }
6175
6176 fn control_handle(&self) -> Self::ControlHandle {
6177 HealthControlHandle { inner: self.inner.clone() }
6178 }
6179
6180 fn into_inner(
6181 self,
6182 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6183 {
6184 (self.inner, self.is_terminated)
6185 }
6186
6187 fn from_inner(
6188 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6189 is_terminated: bool,
6190 ) -> Self {
6191 Self { inner, is_terminated }
6192 }
6193}
6194
6195impl futures::Stream for HealthRequestStream {
6196 type Item = Result<HealthRequest, fidl::Error>;
6197
6198 fn poll_next(
6199 mut self: std::pin::Pin<&mut Self>,
6200 cx: &mut std::task::Context<'_>,
6201 ) -> std::task::Poll<Option<Self::Item>> {
6202 let this = &mut *self;
6203 if this.inner.check_shutdown(cx) {
6204 this.is_terminated = true;
6205 return std::task::Poll::Ready(None);
6206 }
6207 if this.is_terminated {
6208 panic!("polled HealthRequestStream after completion");
6209 }
6210 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6211 |bytes, handles| {
6212 match this.inner.channel().read_etc(cx, bytes, handles) {
6213 std::task::Poll::Ready(Ok(())) => {}
6214 std::task::Poll::Pending => return std::task::Poll::Pending,
6215 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6216 this.is_terminated = true;
6217 return std::task::Poll::Ready(None);
6218 }
6219 std::task::Poll::Ready(Err(e)) => {
6220 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6221 e.into(),
6222 ))))
6223 }
6224 }
6225
6226 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6228
6229 std::task::Poll::Ready(Some(match header.ordinal {
6230 0x4e146d6bca733a84 => {
6231 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6232 let mut req = fidl::new_empty!(
6233 fidl::encoding::EmptyPayload,
6234 fidl::encoding::DefaultFuchsiaResourceDialect
6235 );
6236 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6237 let control_handle = HealthControlHandle { inner: this.inner.clone() };
6238 Ok(HealthRequest::GetHealthState {
6239 responder: HealthGetHealthStateResponder {
6240 control_handle: std::mem::ManuallyDrop::new(control_handle),
6241 tx_id: header.tx_id,
6242 },
6243 })
6244 }
6245 _ => Err(fidl::Error::UnknownOrdinal {
6246 ordinal: header.ordinal,
6247 protocol_name:
6248 <HealthMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6249 }),
6250 }))
6251 },
6252 )
6253 }
6254}
6255
6256#[derive(Debug)]
6257pub enum HealthRequest {
6258 GetHealthState { responder: HealthGetHealthStateResponder },
6261}
6262
6263impl HealthRequest {
6264 #[allow(irrefutable_let_patterns)]
6265 pub fn into_get_health_state(self) -> Option<(HealthGetHealthStateResponder)> {
6266 if let HealthRequest::GetHealthState { responder } = self {
6267 Some((responder))
6268 } else {
6269 None
6270 }
6271 }
6272
6273 pub fn method_name(&self) -> &'static str {
6275 match *self {
6276 HealthRequest::GetHealthState { .. } => "get_health_state",
6277 }
6278 }
6279}
6280
6281#[derive(Debug, Clone)]
6282pub struct HealthControlHandle {
6283 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6284}
6285
6286impl fidl::endpoints::ControlHandle for HealthControlHandle {
6287 fn shutdown(&self) {
6288 self.inner.shutdown()
6289 }
6290 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6291 self.inner.shutdown_with_epitaph(status)
6292 }
6293
6294 fn is_closed(&self) -> bool {
6295 self.inner.channel().is_closed()
6296 }
6297 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6298 self.inner.channel().on_closed()
6299 }
6300
6301 #[cfg(target_os = "fuchsia")]
6302 fn signal_peer(
6303 &self,
6304 clear_mask: zx::Signals,
6305 set_mask: zx::Signals,
6306 ) -> Result<(), zx_status::Status> {
6307 use fidl::Peered;
6308 self.inner.channel().signal_peer(clear_mask, set_mask)
6309 }
6310}
6311
6312impl HealthControlHandle {}
6313
6314#[must_use = "FIDL methods require a response to be sent"]
6315#[derive(Debug)]
6316pub struct HealthGetHealthStateResponder {
6317 control_handle: std::mem::ManuallyDrop<HealthControlHandle>,
6318 tx_id: u32,
6319}
6320
6321impl std::ops::Drop for HealthGetHealthStateResponder {
6325 fn drop(&mut self) {
6326 self.control_handle.shutdown();
6327 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6329 }
6330}
6331
6332impl fidl::endpoints::Responder for HealthGetHealthStateResponder {
6333 type ControlHandle = HealthControlHandle;
6334
6335 fn control_handle(&self) -> &HealthControlHandle {
6336 &self.control_handle
6337 }
6338
6339 fn drop_without_shutdown(mut self) {
6340 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6342 std::mem::forget(self);
6344 }
6345}
6346
6347impl HealthGetHealthStateResponder {
6348 pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
6352 let _result = self.send_raw(state);
6353 if _result.is_err() {
6354 self.control_handle.shutdown();
6355 }
6356 self.drop_without_shutdown();
6357 _result
6358 }
6359
6360 pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
6362 let _result = self.send_raw(state);
6363 self.drop_without_shutdown();
6364 _result
6365 }
6366
6367 fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
6368 self.control_handle.inner.send::<HealthGetHealthStateResponse>(
6369 (state,),
6370 self.tx_id,
6371 0x4e146d6bca733a84,
6372 fidl::encoding::DynamicFlags::empty(),
6373 )
6374 }
6375}
6376
6377#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6378pub struct RingBufferMarker;
6379
6380impl fidl::endpoints::ProtocolMarker for RingBufferMarker {
6381 type Proxy = RingBufferProxy;
6382 type RequestStream = RingBufferRequestStream;
6383 #[cfg(target_os = "fuchsia")]
6384 type SynchronousProxy = RingBufferSynchronousProxy;
6385
6386 const DEBUG_NAME: &'static str = "(anonymous) RingBuffer";
6387}
6388pub type RingBufferGetVmoResult = Result<(u32, fidl::Vmo), GetVmoError>;
6389pub type RingBufferSetActiveChannelsResult = Result<i64, i32>;
6390
6391pub trait RingBufferProxyInterface: Send + Sync {
6392 type GetPropertiesResponseFut: std::future::Future<Output = Result<RingBufferProperties, fidl::Error>>
6393 + Send;
6394 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
6395 type WatchClockRecoveryPositionInfoResponseFut: std::future::Future<Output = Result<RingBufferPositionInfo, fidl::Error>>
6396 + Send;
6397 fn r#watch_clock_recovery_position_info(
6398 &self,
6399 ) -> Self::WatchClockRecoveryPositionInfoResponseFut;
6400 type GetVmoResponseFut: std::future::Future<Output = Result<RingBufferGetVmoResult, fidl::Error>>
6401 + Send;
6402 fn r#get_vmo(
6403 &self,
6404 min_frames: u32,
6405 clock_recovery_notifications_per_ring: u32,
6406 ) -> Self::GetVmoResponseFut;
6407 type StartResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
6408 fn r#start(&self) -> Self::StartResponseFut;
6409 type StopResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
6410 fn r#stop(&self) -> Self::StopResponseFut;
6411 type SetActiveChannelsResponseFut: std::future::Future<Output = Result<RingBufferSetActiveChannelsResult, fidl::Error>>
6412 + Send;
6413 fn r#set_active_channels(
6414 &self,
6415 active_channels_bitmask: u64,
6416 ) -> Self::SetActiveChannelsResponseFut;
6417 type WatchDelayInfoResponseFut: std::future::Future<Output = Result<DelayInfo, fidl::Error>>
6418 + Send;
6419 fn r#watch_delay_info(&self) -> Self::WatchDelayInfoResponseFut;
6420}
6421#[derive(Debug)]
6422#[cfg(target_os = "fuchsia")]
6423pub struct RingBufferSynchronousProxy {
6424 client: fidl::client::sync::Client,
6425}
6426
6427#[cfg(target_os = "fuchsia")]
6428impl fidl::endpoints::SynchronousProxy for RingBufferSynchronousProxy {
6429 type Proxy = RingBufferProxy;
6430 type Protocol = RingBufferMarker;
6431
6432 fn from_channel(inner: fidl::Channel) -> Self {
6433 Self::new(inner)
6434 }
6435
6436 fn into_channel(self) -> fidl::Channel {
6437 self.client.into_channel()
6438 }
6439
6440 fn as_channel(&self) -> &fidl::Channel {
6441 self.client.as_channel()
6442 }
6443}
6444
6445#[cfg(target_os = "fuchsia")]
6446impl RingBufferSynchronousProxy {
6447 pub fn new(channel: fidl::Channel) -> Self {
6448 let protocol_name = <RingBufferMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6449 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6450 }
6451
6452 pub fn into_channel(self) -> fidl::Channel {
6453 self.client.into_channel()
6454 }
6455
6456 pub fn wait_for_event(
6459 &self,
6460 deadline: zx::MonotonicInstant,
6461 ) -> Result<RingBufferEvent, fidl::Error> {
6462 RingBufferEvent::decode(self.client.wait_for_event(deadline)?)
6463 }
6464
6465 pub fn r#get_properties(
6467 &self,
6468 ___deadline: zx::MonotonicInstant,
6469 ) -> Result<RingBufferProperties, fidl::Error> {
6470 let _response = self
6471 .client
6472 .send_query::<fidl::encoding::EmptyPayload, RingBufferGetPropertiesResponse>(
6473 (),
6474 0x12947f061a8fe1,
6475 fidl::encoding::DynamicFlags::empty(),
6476 ___deadline,
6477 )?;
6478 Ok(_response.properties)
6479 }
6480
6481 pub fn r#watch_clock_recovery_position_info(
6498 &self,
6499 ___deadline: zx::MonotonicInstant,
6500 ) -> Result<RingBufferPositionInfo, fidl::Error> {
6501 let _response = self.client.send_query::<
6502 fidl::encoding::EmptyPayload,
6503 RingBufferWatchClockRecoveryPositionInfoResponse,
6504 >(
6505 (),
6506 0x694d5b898a4167e5,
6507 fidl::encoding::DynamicFlags::empty(),
6508 ___deadline,
6509 )?;
6510 Ok(_response.position_info)
6511 }
6512
6513 pub fn r#get_vmo(
6538 &self,
6539 mut min_frames: u32,
6540 mut clock_recovery_notifications_per_ring: u32,
6541 ___deadline: zx::MonotonicInstant,
6542 ) -> Result<RingBufferGetVmoResult, fidl::Error> {
6543 let _response = self.client.send_query::<
6544 RingBufferGetVmoRequest,
6545 fidl::encoding::ResultType<RingBufferGetVmoResponse, GetVmoError>,
6546 >(
6547 (min_frames, clock_recovery_notifications_per_ring,),
6548 0x44c8f4f5680e853a,
6549 fidl::encoding::DynamicFlags::empty(),
6550 ___deadline,
6551 )?;
6552 Ok(_response.map(|x| (x.num_frames, x.ring_buffer)))
6553 }
6554
6555 pub fn r#start(&self, ___deadline: zx::MonotonicInstant) -> Result<i64, fidl::Error> {
6566 let _response =
6567 self.client.send_query::<fidl::encoding::EmptyPayload, RingBufferStartResponse>(
6568 (),
6569 0x5dd780a769a8892d,
6570 fidl::encoding::DynamicFlags::empty(),
6571 ___deadline,
6572 )?;
6573 Ok(_response.start_time)
6574 }
6575
6576 pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
6580 let _response =
6581 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
6582 (),
6583 0x49a73d9cf1d4e110,
6584 fidl::encoding::DynamicFlags::empty(),
6585 ___deadline,
6586 )?;
6587 Ok(_response)
6588 }
6589
6590 pub fn r#set_active_channels(
6621 &self,
6622 mut active_channels_bitmask: u64,
6623 ___deadline: zx::MonotonicInstant,
6624 ) -> Result<RingBufferSetActiveChannelsResult, fidl::Error> {
6625 let _response = self.client.send_query::<
6626 RingBufferSetActiveChannelsRequest,
6627 fidl::encoding::ResultType<RingBufferSetActiveChannelsResponse, i32>,
6628 >(
6629 (active_channels_bitmask,),
6630 0x605464c1d384f309,
6631 fidl::encoding::DynamicFlags::empty(),
6632 ___deadline,
6633 )?;
6634 Ok(_response.map(|x| x.set_time))
6635 }
6636
6637 pub fn r#watch_delay_info(
6643 &self,
6644 ___deadline: zx::MonotonicInstant,
6645 ) -> Result<DelayInfo, fidl::Error> {
6646 let _response = self.client.send_query::<
6647 fidl::encoding::EmptyPayload,
6648 fidl::encoding::FlexibleType<RingBufferWatchDelayInfoResponse>,
6649 >(
6650 (),
6651 0x6c1248db213fcf9f,
6652 fidl::encoding::DynamicFlags::FLEXIBLE,
6653 ___deadline,
6654 )?
6655 .into_result::<RingBufferMarker>("watch_delay_info")?;
6656 Ok(_response.delay_info)
6657 }
6658}
6659
6660#[cfg(target_os = "fuchsia")]
6661impl From<RingBufferSynchronousProxy> for zx::Handle {
6662 fn from(value: RingBufferSynchronousProxy) -> Self {
6663 value.into_channel().into()
6664 }
6665}
6666
6667#[cfg(target_os = "fuchsia")]
6668impl From<fidl::Channel> for RingBufferSynchronousProxy {
6669 fn from(value: fidl::Channel) -> Self {
6670 Self::new(value)
6671 }
6672}
6673
6674#[derive(Debug, Clone)]
6675pub struct RingBufferProxy {
6676 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6677}
6678
6679impl fidl::endpoints::Proxy for RingBufferProxy {
6680 type Protocol = RingBufferMarker;
6681
6682 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6683 Self::new(inner)
6684 }
6685
6686 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6687 self.client.into_channel().map_err(|client| Self { client })
6688 }
6689
6690 fn as_channel(&self) -> &::fidl::AsyncChannel {
6691 self.client.as_channel()
6692 }
6693}
6694
6695impl RingBufferProxy {
6696 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6698 let protocol_name = <RingBufferMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6699 Self { client: fidl::client::Client::new(channel, protocol_name) }
6700 }
6701
6702 pub fn take_event_stream(&self) -> RingBufferEventStream {
6708 RingBufferEventStream { event_receiver: self.client.take_event_receiver() }
6709 }
6710
6711 pub fn r#get_properties(
6713 &self,
6714 ) -> fidl::client::QueryResponseFut<
6715 RingBufferProperties,
6716 fidl::encoding::DefaultFuchsiaResourceDialect,
6717 > {
6718 RingBufferProxyInterface::r#get_properties(self)
6719 }
6720
6721 pub fn r#watch_clock_recovery_position_info(
6738 &self,
6739 ) -> fidl::client::QueryResponseFut<
6740 RingBufferPositionInfo,
6741 fidl::encoding::DefaultFuchsiaResourceDialect,
6742 > {
6743 RingBufferProxyInterface::r#watch_clock_recovery_position_info(self)
6744 }
6745
6746 pub fn r#get_vmo(
6771 &self,
6772 mut min_frames: u32,
6773 mut clock_recovery_notifications_per_ring: u32,
6774 ) -> fidl::client::QueryResponseFut<
6775 RingBufferGetVmoResult,
6776 fidl::encoding::DefaultFuchsiaResourceDialect,
6777 > {
6778 RingBufferProxyInterface::r#get_vmo(self, min_frames, clock_recovery_notifications_per_ring)
6779 }
6780
6781 pub fn r#start(
6792 &self,
6793 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
6794 RingBufferProxyInterface::r#start(self)
6795 }
6796
6797 pub fn r#stop(
6801 &self,
6802 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6803 RingBufferProxyInterface::r#stop(self)
6804 }
6805
6806 pub fn r#set_active_channels(
6837 &self,
6838 mut active_channels_bitmask: u64,
6839 ) -> fidl::client::QueryResponseFut<
6840 RingBufferSetActiveChannelsResult,
6841 fidl::encoding::DefaultFuchsiaResourceDialect,
6842 > {
6843 RingBufferProxyInterface::r#set_active_channels(self, active_channels_bitmask)
6844 }
6845
6846 pub fn r#watch_delay_info(
6852 &self,
6853 ) -> fidl::client::QueryResponseFut<DelayInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
6854 {
6855 RingBufferProxyInterface::r#watch_delay_info(self)
6856 }
6857}
6858
6859impl RingBufferProxyInterface for RingBufferProxy {
6860 type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
6861 RingBufferProperties,
6862 fidl::encoding::DefaultFuchsiaResourceDialect,
6863 >;
6864 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
6865 fn _decode(
6866 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6867 ) -> Result<RingBufferProperties, fidl::Error> {
6868 let _response = fidl::client::decode_transaction_body::<
6869 RingBufferGetPropertiesResponse,
6870 fidl::encoding::DefaultFuchsiaResourceDialect,
6871 0x12947f061a8fe1,
6872 >(_buf?)?;
6873 Ok(_response.properties)
6874 }
6875 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, RingBufferProperties>(
6876 (),
6877 0x12947f061a8fe1,
6878 fidl::encoding::DynamicFlags::empty(),
6879 _decode,
6880 )
6881 }
6882
6883 type WatchClockRecoveryPositionInfoResponseFut = fidl::client::QueryResponseFut<
6884 RingBufferPositionInfo,
6885 fidl::encoding::DefaultFuchsiaResourceDialect,
6886 >;
6887 fn r#watch_clock_recovery_position_info(
6888 &self,
6889 ) -> Self::WatchClockRecoveryPositionInfoResponseFut {
6890 fn _decode(
6891 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6892 ) -> Result<RingBufferPositionInfo, fidl::Error> {
6893 let _response = fidl::client::decode_transaction_body::<
6894 RingBufferWatchClockRecoveryPositionInfoResponse,
6895 fidl::encoding::DefaultFuchsiaResourceDialect,
6896 0x694d5b898a4167e5,
6897 >(_buf?)?;
6898 Ok(_response.position_info)
6899 }
6900 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, RingBufferPositionInfo>(
6901 (),
6902 0x694d5b898a4167e5,
6903 fidl::encoding::DynamicFlags::empty(),
6904 _decode,
6905 )
6906 }
6907
6908 type GetVmoResponseFut = fidl::client::QueryResponseFut<
6909 RingBufferGetVmoResult,
6910 fidl::encoding::DefaultFuchsiaResourceDialect,
6911 >;
6912 fn r#get_vmo(
6913 &self,
6914 mut min_frames: u32,
6915 mut clock_recovery_notifications_per_ring: u32,
6916 ) -> Self::GetVmoResponseFut {
6917 fn _decode(
6918 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6919 ) -> Result<RingBufferGetVmoResult, fidl::Error> {
6920 let _response = fidl::client::decode_transaction_body::<
6921 fidl::encoding::ResultType<RingBufferGetVmoResponse, GetVmoError>,
6922 fidl::encoding::DefaultFuchsiaResourceDialect,
6923 0x44c8f4f5680e853a,
6924 >(_buf?)?;
6925 Ok(_response.map(|x| (x.num_frames, x.ring_buffer)))
6926 }
6927 self.client.send_query_and_decode::<RingBufferGetVmoRequest, RingBufferGetVmoResult>(
6928 (min_frames, clock_recovery_notifications_per_ring),
6929 0x44c8f4f5680e853a,
6930 fidl::encoding::DynamicFlags::empty(),
6931 _decode,
6932 )
6933 }
6934
6935 type StartResponseFut =
6936 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
6937 fn r#start(&self) -> Self::StartResponseFut {
6938 fn _decode(
6939 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6940 ) -> Result<i64, fidl::Error> {
6941 let _response = fidl::client::decode_transaction_body::<
6942 RingBufferStartResponse,
6943 fidl::encoding::DefaultFuchsiaResourceDialect,
6944 0x5dd780a769a8892d,
6945 >(_buf?)?;
6946 Ok(_response.start_time)
6947 }
6948 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i64>(
6949 (),
6950 0x5dd780a769a8892d,
6951 fidl::encoding::DynamicFlags::empty(),
6952 _decode,
6953 )
6954 }
6955
6956 type StopResponseFut =
6957 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6958 fn r#stop(&self) -> Self::StopResponseFut {
6959 fn _decode(
6960 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6961 ) -> Result<(), fidl::Error> {
6962 let _response = fidl::client::decode_transaction_body::<
6963 fidl::encoding::EmptyPayload,
6964 fidl::encoding::DefaultFuchsiaResourceDialect,
6965 0x49a73d9cf1d4e110,
6966 >(_buf?)?;
6967 Ok(_response)
6968 }
6969 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
6970 (),
6971 0x49a73d9cf1d4e110,
6972 fidl::encoding::DynamicFlags::empty(),
6973 _decode,
6974 )
6975 }
6976
6977 type SetActiveChannelsResponseFut = fidl::client::QueryResponseFut<
6978 RingBufferSetActiveChannelsResult,
6979 fidl::encoding::DefaultFuchsiaResourceDialect,
6980 >;
6981 fn r#set_active_channels(
6982 &self,
6983 mut active_channels_bitmask: u64,
6984 ) -> Self::SetActiveChannelsResponseFut {
6985 fn _decode(
6986 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6987 ) -> Result<RingBufferSetActiveChannelsResult, fidl::Error> {
6988 let _response = fidl::client::decode_transaction_body::<
6989 fidl::encoding::ResultType<RingBufferSetActiveChannelsResponse, i32>,
6990 fidl::encoding::DefaultFuchsiaResourceDialect,
6991 0x605464c1d384f309,
6992 >(_buf?)?;
6993 Ok(_response.map(|x| x.set_time))
6994 }
6995 self.client.send_query_and_decode::<
6996 RingBufferSetActiveChannelsRequest,
6997 RingBufferSetActiveChannelsResult,
6998 >(
6999 (active_channels_bitmask,),
7000 0x605464c1d384f309,
7001 fidl::encoding::DynamicFlags::empty(),
7002 _decode,
7003 )
7004 }
7005
7006 type WatchDelayInfoResponseFut =
7007 fidl::client::QueryResponseFut<DelayInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
7008 fn r#watch_delay_info(&self) -> Self::WatchDelayInfoResponseFut {
7009 fn _decode(
7010 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7011 ) -> Result<DelayInfo, fidl::Error> {
7012 let _response = fidl::client::decode_transaction_body::<
7013 fidl::encoding::FlexibleType<RingBufferWatchDelayInfoResponse>,
7014 fidl::encoding::DefaultFuchsiaResourceDialect,
7015 0x6c1248db213fcf9f,
7016 >(_buf?)?
7017 .into_result::<RingBufferMarker>("watch_delay_info")?;
7018 Ok(_response.delay_info)
7019 }
7020 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DelayInfo>(
7021 (),
7022 0x6c1248db213fcf9f,
7023 fidl::encoding::DynamicFlags::FLEXIBLE,
7024 _decode,
7025 )
7026 }
7027}
7028
7029pub struct RingBufferEventStream {
7030 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7031}
7032
7033impl std::marker::Unpin for RingBufferEventStream {}
7034
7035impl futures::stream::FusedStream for RingBufferEventStream {
7036 fn is_terminated(&self) -> bool {
7037 self.event_receiver.is_terminated()
7038 }
7039}
7040
7041impl futures::Stream for RingBufferEventStream {
7042 type Item = Result<RingBufferEvent, fidl::Error>;
7043
7044 fn poll_next(
7045 mut self: std::pin::Pin<&mut Self>,
7046 cx: &mut std::task::Context<'_>,
7047 ) -> std::task::Poll<Option<Self::Item>> {
7048 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7049 &mut self.event_receiver,
7050 cx
7051 )?) {
7052 Some(buf) => std::task::Poll::Ready(Some(RingBufferEvent::decode(buf))),
7053 None => std::task::Poll::Ready(None),
7054 }
7055 }
7056}
7057
7058#[derive(Debug)]
7059pub enum RingBufferEvent {
7060 #[non_exhaustive]
7061 _UnknownEvent {
7062 ordinal: u64,
7064 },
7065}
7066
7067impl RingBufferEvent {
7068 fn decode(
7070 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7071 ) -> Result<RingBufferEvent, fidl::Error> {
7072 let (bytes, _handles) = buf.split_mut();
7073 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7074 debug_assert_eq!(tx_header.tx_id, 0);
7075 match tx_header.ordinal {
7076 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7077 Ok(RingBufferEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7078 }
7079 _ => Err(fidl::Error::UnknownOrdinal {
7080 ordinal: tx_header.ordinal,
7081 protocol_name: <RingBufferMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7082 }),
7083 }
7084 }
7085}
7086
7087pub struct RingBufferRequestStream {
7089 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7090 is_terminated: bool,
7091}
7092
7093impl std::marker::Unpin for RingBufferRequestStream {}
7094
7095impl futures::stream::FusedStream for RingBufferRequestStream {
7096 fn is_terminated(&self) -> bool {
7097 self.is_terminated
7098 }
7099}
7100
7101impl fidl::endpoints::RequestStream for RingBufferRequestStream {
7102 type Protocol = RingBufferMarker;
7103 type ControlHandle = RingBufferControlHandle;
7104
7105 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7106 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7107 }
7108
7109 fn control_handle(&self) -> Self::ControlHandle {
7110 RingBufferControlHandle { inner: self.inner.clone() }
7111 }
7112
7113 fn into_inner(
7114 self,
7115 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7116 {
7117 (self.inner, self.is_terminated)
7118 }
7119
7120 fn from_inner(
7121 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7122 is_terminated: bool,
7123 ) -> Self {
7124 Self { inner, is_terminated }
7125 }
7126}
7127
7128impl futures::Stream for RingBufferRequestStream {
7129 type Item = Result<RingBufferRequest, fidl::Error>;
7130
7131 fn poll_next(
7132 mut self: std::pin::Pin<&mut Self>,
7133 cx: &mut std::task::Context<'_>,
7134 ) -> std::task::Poll<Option<Self::Item>> {
7135 let this = &mut *self;
7136 if this.inner.check_shutdown(cx) {
7137 this.is_terminated = true;
7138 return std::task::Poll::Ready(None);
7139 }
7140 if this.is_terminated {
7141 panic!("polled RingBufferRequestStream after completion");
7142 }
7143 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7144 |bytes, handles| {
7145 match this.inner.channel().read_etc(cx, bytes, handles) {
7146 std::task::Poll::Ready(Ok(())) => {}
7147 std::task::Poll::Pending => return std::task::Poll::Pending,
7148 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7149 this.is_terminated = true;
7150 return std::task::Poll::Ready(None);
7151 }
7152 std::task::Poll::Ready(Err(e)) => {
7153 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7154 e.into(),
7155 ))))
7156 }
7157 }
7158
7159 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7161
7162 std::task::Poll::Ready(Some(match header.ordinal {
7163 0x12947f061a8fe1 => {
7164 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7165 let mut req = fidl::new_empty!(
7166 fidl::encoding::EmptyPayload,
7167 fidl::encoding::DefaultFuchsiaResourceDialect
7168 );
7169 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7170 let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
7171 Ok(RingBufferRequest::GetProperties {
7172 responder: RingBufferGetPropertiesResponder {
7173 control_handle: std::mem::ManuallyDrop::new(control_handle),
7174 tx_id: header.tx_id,
7175 },
7176 })
7177 }
7178 0x694d5b898a4167e5 => {
7179 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7180 let mut req = fidl::new_empty!(
7181 fidl::encoding::EmptyPayload,
7182 fidl::encoding::DefaultFuchsiaResourceDialect
7183 );
7184 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7185 let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
7186 Ok(RingBufferRequest::WatchClockRecoveryPositionInfo {
7187 responder: RingBufferWatchClockRecoveryPositionInfoResponder {
7188 control_handle: std::mem::ManuallyDrop::new(control_handle),
7189 tx_id: header.tx_id,
7190 },
7191 })
7192 }
7193 0x44c8f4f5680e853a => {
7194 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7195 let mut req = fidl::new_empty!(
7196 RingBufferGetVmoRequest,
7197 fidl::encoding::DefaultFuchsiaResourceDialect
7198 );
7199 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RingBufferGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
7200 let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
7201 Ok(RingBufferRequest::GetVmo {
7202 min_frames: req.min_frames,
7203 clock_recovery_notifications_per_ring: req
7204 .clock_recovery_notifications_per_ring,
7205
7206 responder: RingBufferGetVmoResponder {
7207 control_handle: std::mem::ManuallyDrop::new(control_handle),
7208 tx_id: header.tx_id,
7209 },
7210 })
7211 }
7212 0x5dd780a769a8892d => {
7213 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7214 let mut req = fidl::new_empty!(
7215 fidl::encoding::EmptyPayload,
7216 fidl::encoding::DefaultFuchsiaResourceDialect
7217 );
7218 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7219 let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
7220 Ok(RingBufferRequest::Start {
7221 responder: RingBufferStartResponder {
7222 control_handle: std::mem::ManuallyDrop::new(control_handle),
7223 tx_id: header.tx_id,
7224 },
7225 })
7226 }
7227 0x49a73d9cf1d4e110 => {
7228 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7229 let mut req = fidl::new_empty!(
7230 fidl::encoding::EmptyPayload,
7231 fidl::encoding::DefaultFuchsiaResourceDialect
7232 );
7233 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7234 let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
7235 Ok(RingBufferRequest::Stop {
7236 responder: RingBufferStopResponder {
7237 control_handle: std::mem::ManuallyDrop::new(control_handle),
7238 tx_id: header.tx_id,
7239 },
7240 })
7241 }
7242 0x605464c1d384f309 => {
7243 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7244 let mut req = fidl::new_empty!(
7245 RingBufferSetActiveChannelsRequest,
7246 fidl::encoding::DefaultFuchsiaResourceDialect
7247 );
7248 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RingBufferSetActiveChannelsRequest>(&header, _body_bytes, handles, &mut req)?;
7249 let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
7250 Ok(RingBufferRequest::SetActiveChannels {
7251 active_channels_bitmask: req.active_channels_bitmask,
7252
7253 responder: RingBufferSetActiveChannelsResponder {
7254 control_handle: std::mem::ManuallyDrop::new(control_handle),
7255 tx_id: header.tx_id,
7256 },
7257 })
7258 }
7259 0x6c1248db213fcf9f => {
7260 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7261 let mut req = fidl::new_empty!(
7262 fidl::encoding::EmptyPayload,
7263 fidl::encoding::DefaultFuchsiaResourceDialect
7264 );
7265 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7266 let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
7267 Ok(RingBufferRequest::WatchDelayInfo {
7268 responder: RingBufferWatchDelayInfoResponder {
7269 control_handle: std::mem::ManuallyDrop::new(control_handle),
7270 tx_id: header.tx_id,
7271 },
7272 })
7273 }
7274 _ if header.tx_id == 0
7275 && header
7276 .dynamic_flags()
7277 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7278 {
7279 Ok(RingBufferRequest::_UnknownMethod {
7280 ordinal: header.ordinal,
7281 control_handle: RingBufferControlHandle { inner: this.inner.clone() },
7282 method_type: fidl::MethodType::OneWay,
7283 })
7284 }
7285 _ if header
7286 .dynamic_flags()
7287 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7288 {
7289 this.inner.send_framework_err(
7290 fidl::encoding::FrameworkErr::UnknownMethod,
7291 header.tx_id,
7292 header.ordinal,
7293 header.dynamic_flags(),
7294 (bytes, handles),
7295 )?;
7296 Ok(RingBufferRequest::_UnknownMethod {
7297 ordinal: header.ordinal,
7298 control_handle: RingBufferControlHandle { inner: this.inner.clone() },
7299 method_type: fidl::MethodType::TwoWay,
7300 })
7301 }
7302 _ => Err(fidl::Error::UnknownOrdinal {
7303 ordinal: header.ordinal,
7304 protocol_name:
7305 <RingBufferMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7306 }),
7307 }))
7308 },
7309 )
7310 }
7311}
7312
7313#[derive(Debug)]
7314pub enum RingBufferRequest {
7315 GetProperties { responder: RingBufferGetPropertiesResponder },
7317 WatchClockRecoveryPositionInfo { responder: RingBufferWatchClockRecoveryPositionInfoResponder },
7334 GetVmo {
7359 min_frames: u32,
7360 clock_recovery_notifications_per_ring: u32,
7361 responder: RingBufferGetVmoResponder,
7362 },
7363 Start { responder: RingBufferStartResponder },
7374 Stop { responder: RingBufferStopResponder },
7378 SetActiveChannels {
7409 active_channels_bitmask: u64,
7410 responder: RingBufferSetActiveChannelsResponder,
7411 },
7412 WatchDelayInfo { responder: RingBufferWatchDelayInfoResponder },
7418 #[non_exhaustive]
7420 _UnknownMethod {
7421 ordinal: u64,
7423 control_handle: RingBufferControlHandle,
7424 method_type: fidl::MethodType,
7425 },
7426}
7427
7428impl RingBufferRequest {
7429 #[allow(irrefutable_let_patterns)]
7430 pub fn into_get_properties(self) -> Option<(RingBufferGetPropertiesResponder)> {
7431 if let RingBufferRequest::GetProperties { responder } = self {
7432 Some((responder))
7433 } else {
7434 None
7435 }
7436 }
7437
7438 #[allow(irrefutable_let_patterns)]
7439 pub fn into_watch_clock_recovery_position_info(
7440 self,
7441 ) -> Option<(RingBufferWatchClockRecoveryPositionInfoResponder)> {
7442 if let RingBufferRequest::WatchClockRecoveryPositionInfo { responder } = self {
7443 Some((responder))
7444 } else {
7445 None
7446 }
7447 }
7448
7449 #[allow(irrefutable_let_patterns)]
7450 pub fn into_get_vmo(self) -> Option<(u32, u32, RingBufferGetVmoResponder)> {
7451 if let RingBufferRequest::GetVmo {
7452 min_frames,
7453 clock_recovery_notifications_per_ring,
7454 responder,
7455 } = self
7456 {
7457 Some((min_frames, clock_recovery_notifications_per_ring, responder))
7458 } else {
7459 None
7460 }
7461 }
7462
7463 #[allow(irrefutable_let_patterns)]
7464 pub fn into_start(self) -> Option<(RingBufferStartResponder)> {
7465 if let RingBufferRequest::Start { responder } = self {
7466 Some((responder))
7467 } else {
7468 None
7469 }
7470 }
7471
7472 #[allow(irrefutable_let_patterns)]
7473 pub fn into_stop(self) -> Option<(RingBufferStopResponder)> {
7474 if let RingBufferRequest::Stop { responder } = self {
7475 Some((responder))
7476 } else {
7477 None
7478 }
7479 }
7480
7481 #[allow(irrefutable_let_patterns)]
7482 pub fn into_set_active_channels(self) -> Option<(u64, RingBufferSetActiveChannelsResponder)> {
7483 if let RingBufferRequest::SetActiveChannels { active_channels_bitmask, responder } = self {
7484 Some((active_channels_bitmask, responder))
7485 } else {
7486 None
7487 }
7488 }
7489
7490 #[allow(irrefutable_let_patterns)]
7491 pub fn into_watch_delay_info(self) -> Option<(RingBufferWatchDelayInfoResponder)> {
7492 if let RingBufferRequest::WatchDelayInfo { responder } = self {
7493 Some((responder))
7494 } else {
7495 None
7496 }
7497 }
7498
7499 pub fn method_name(&self) -> &'static str {
7501 match *self {
7502 RingBufferRequest::GetProperties { .. } => "get_properties",
7503 RingBufferRequest::WatchClockRecoveryPositionInfo { .. } => {
7504 "watch_clock_recovery_position_info"
7505 }
7506 RingBufferRequest::GetVmo { .. } => "get_vmo",
7507 RingBufferRequest::Start { .. } => "start",
7508 RingBufferRequest::Stop { .. } => "stop",
7509 RingBufferRequest::SetActiveChannels { .. } => "set_active_channels",
7510 RingBufferRequest::WatchDelayInfo { .. } => "watch_delay_info",
7511 RingBufferRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7512 "unknown one-way method"
7513 }
7514 RingBufferRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7515 "unknown two-way method"
7516 }
7517 }
7518 }
7519}
7520
7521#[derive(Debug, Clone)]
7522pub struct RingBufferControlHandle {
7523 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7524}
7525
7526impl fidl::endpoints::ControlHandle for RingBufferControlHandle {
7527 fn shutdown(&self) {
7528 self.inner.shutdown()
7529 }
7530 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7531 self.inner.shutdown_with_epitaph(status)
7532 }
7533
7534 fn is_closed(&self) -> bool {
7535 self.inner.channel().is_closed()
7536 }
7537 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7538 self.inner.channel().on_closed()
7539 }
7540
7541 #[cfg(target_os = "fuchsia")]
7542 fn signal_peer(
7543 &self,
7544 clear_mask: zx::Signals,
7545 set_mask: zx::Signals,
7546 ) -> Result<(), zx_status::Status> {
7547 use fidl::Peered;
7548 self.inner.channel().signal_peer(clear_mask, set_mask)
7549 }
7550}
7551
7552impl RingBufferControlHandle {}
7553
7554#[must_use = "FIDL methods require a response to be sent"]
7555#[derive(Debug)]
7556pub struct RingBufferGetPropertiesResponder {
7557 control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
7558 tx_id: u32,
7559}
7560
7561impl std::ops::Drop for RingBufferGetPropertiesResponder {
7565 fn drop(&mut self) {
7566 self.control_handle.shutdown();
7567 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7569 }
7570}
7571
7572impl fidl::endpoints::Responder for RingBufferGetPropertiesResponder {
7573 type ControlHandle = RingBufferControlHandle;
7574
7575 fn control_handle(&self) -> &RingBufferControlHandle {
7576 &self.control_handle
7577 }
7578
7579 fn drop_without_shutdown(mut self) {
7580 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7582 std::mem::forget(self);
7584 }
7585}
7586
7587impl RingBufferGetPropertiesResponder {
7588 pub fn send(self, mut properties: &RingBufferProperties) -> Result<(), fidl::Error> {
7592 let _result = self.send_raw(properties);
7593 if _result.is_err() {
7594 self.control_handle.shutdown();
7595 }
7596 self.drop_without_shutdown();
7597 _result
7598 }
7599
7600 pub fn send_no_shutdown_on_err(
7602 self,
7603 mut properties: &RingBufferProperties,
7604 ) -> Result<(), fidl::Error> {
7605 let _result = self.send_raw(properties);
7606 self.drop_without_shutdown();
7607 _result
7608 }
7609
7610 fn send_raw(&self, mut properties: &RingBufferProperties) -> Result<(), fidl::Error> {
7611 self.control_handle.inner.send::<RingBufferGetPropertiesResponse>(
7612 (properties,),
7613 self.tx_id,
7614 0x12947f061a8fe1,
7615 fidl::encoding::DynamicFlags::empty(),
7616 )
7617 }
7618}
7619
7620#[must_use = "FIDL methods require a response to be sent"]
7621#[derive(Debug)]
7622pub struct RingBufferWatchClockRecoveryPositionInfoResponder {
7623 control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
7624 tx_id: u32,
7625}
7626
7627impl std::ops::Drop for RingBufferWatchClockRecoveryPositionInfoResponder {
7631 fn drop(&mut self) {
7632 self.control_handle.shutdown();
7633 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7635 }
7636}
7637
7638impl fidl::endpoints::Responder for RingBufferWatchClockRecoveryPositionInfoResponder {
7639 type ControlHandle = RingBufferControlHandle;
7640
7641 fn control_handle(&self) -> &RingBufferControlHandle {
7642 &self.control_handle
7643 }
7644
7645 fn drop_without_shutdown(mut self) {
7646 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7648 std::mem::forget(self);
7650 }
7651}
7652
7653impl RingBufferWatchClockRecoveryPositionInfoResponder {
7654 pub fn send(self, mut position_info: &RingBufferPositionInfo) -> Result<(), fidl::Error> {
7658 let _result = self.send_raw(position_info);
7659 if _result.is_err() {
7660 self.control_handle.shutdown();
7661 }
7662 self.drop_without_shutdown();
7663 _result
7664 }
7665
7666 pub fn send_no_shutdown_on_err(
7668 self,
7669 mut position_info: &RingBufferPositionInfo,
7670 ) -> Result<(), fidl::Error> {
7671 let _result = self.send_raw(position_info);
7672 self.drop_without_shutdown();
7673 _result
7674 }
7675
7676 fn send_raw(&self, mut position_info: &RingBufferPositionInfo) -> Result<(), fidl::Error> {
7677 self.control_handle.inner.send::<RingBufferWatchClockRecoveryPositionInfoResponse>(
7678 (position_info,),
7679 self.tx_id,
7680 0x694d5b898a4167e5,
7681 fidl::encoding::DynamicFlags::empty(),
7682 )
7683 }
7684}
7685
7686#[must_use = "FIDL methods require a response to be sent"]
7687#[derive(Debug)]
7688pub struct RingBufferGetVmoResponder {
7689 control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
7690 tx_id: u32,
7691}
7692
7693impl std::ops::Drop for RingBufferGetVmoResponder {
7697 fn drop(&mut self) {
7698 self.control_handle.shutdown();
7699 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7701 }
7702}
7703
7704impl fidl::endpoints::Responder for RingBufferGetVmoResponder {
7705 type ControlHandle = RingBufferControlHandle;
7706
7707 fn control_handle(&self) -> &RingBufferControlHandle {
7708 &self.control_handle
7709 }
7710
7711 fn drop_without_shutdown(mut self) {
7712 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7714 std::mem::forget(self);
7716 }
7717}
7718
7719impl RingBufferGetVmoResponder {
7720 pub fn send(
7724 self,
7725 mut result: Result<(u32, fidl::Vmo), GetVmoError>,
7726 ) -> Result<(), fidl::Error> {
7727 let _result = self.send_raw(result);
7728 if _result.is_err() {
7729 self.control_handle.shutdown();
7730 }
7731 self.drop_without_shutdown();
7732 _result
7733 }
7734
7735 pub fn send_no_shutdown_on_err(
7737 self,
7738 mut result: Result<(u32, fidl::Vmo), GetVmoError>,
7739 ) -> Result<(), fidl::Error> {
7740 let _result = self.send_raw(result);
7741 self.drop_without_shutdown();
7742 _result
7743 }
7744
7745 fn send_raw(
7746 &self,
7747 mut result: Result<(u32, fidl::Vmo), GetVmoError>,
7748 ) -> Result<(), fidl::Error> {
7749 self.control_handle
7750 .inner
7751 .send::<fidl::encoding::ResultType<RingBufferGetVmoResponse, GetVmoError>>(
7752 result,
7753 self.tx_id,
7754 0x44c8f4f5680e853a,
7755 fidl::encoding::DynamicFlags::empty(),
7756 )
7757 }
7758}
7759
7760#[must_use = "FIDL methods require a response to be sent"]
7761#[derive(Debug)]
7762pub struct RingBufferStartResponder {
7763 control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
7764 tx_id: u32,
7765}
7766
7767impl std::ops::Drop for RingBufferStartResponder {
7771 fn drop(&mut self) {
7772 self.control_handle.shutdown();
7773 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7775 }
7776}
7777
7778impl fidl::endpoints::Responder for RingBufferStartResponder {
7779 type ControlHandle = RingBufferControlHandle;
7780
7781 fn control_handle(&self) -> &RingBufferControlHandle {
7782 &self.control_handle
7783 }
7784
7785 fn drop_without_shutdown(mut self) {
7786 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7788 std::mem::forget(self);
7790 }
7791}
7792
7793impl RingBufferStartResponder {
7794 pub fn send(self, mut start_time: i64) -> Result<(), fidl::Error> {
7798 let _result = self.send_raw(start_time);
7799 if _result.is_err() {
7800 self.control_handle.shutdown();
7801 }
7802 self.drop_without_shutdown();
7803 _result
7804 }
7805
7806 pub fn send_no_shutdown_on_err(self, mut start_time: i64) -> Result<(), fidl::Error> {
7808 let _result = self.send_raw(start_time);
7809 self.drop_without_shutdown();
7810 _result
7811 }
7812
7813 fn send_raw(&self, mut start_time: i64) -> Result<(), fidl::Error> {
7814 self.control_handle.inner.send::<RingBufferStartResponse>(
7815 (start_time,),
7816 self.tx_id,
7817 0x5dd780a769a8892d,
7818 fidl::encoding::DynamicFlags::empty(),
7819 )
7820 }
7821}
7822
7823#[must_use = "FIDL methods require a response to be sent"]
7824#[derive(Debug)]
7825pub struct RingBufferStopResponder {
7826 control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
7827 tx_id: u32,
7828}
7829
7830impl std::ops::Drop for RingBufferStopResponder {
7834 fn drop(&mut self) {
7835 self.control_handle.shutdown();
7836 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7838 }
7839}
7840
7841impl fidl::endpoints::Responder for RingBufferStopResponder {
7842 type ControlHandle = RingBufferControlHandle;
7843
7844 fn control_handle(&self) -> &RingBufferControlHandle {
7845 &self.control_handle
7846 }
7847
7848 fn drop_without_shutdown(mut self) {
7849 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7851 std::mem::forget(self);
7853 }
7854}
7855
7856impl RingBufferStopResponder {
7857 pub fn send(self) -> Result<(), fidl::Error> {
7861 let _result = self.send_raw();
7862 if _result.is_err() {
7863 self.control_handle.shutdown();
7864 }
7865 self.drop_without_shutdown();
7866 _result
7867 }
7868
7869 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
7871 let _result = self.send_raw();
7872 self.drop_without_shutdown();
7873 _result
7874 }
7875
7876 fn send_raw(&self) -> Result<(), fidl::Error> {
7877 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
7878 (),
7879 self.tx_id,
7880 0x49a73d9cf1d4e110,
7881 fidl::encoding::DynamicFlags::empty(),
7882 )
7883 }
7884}
7885
7886#[must_use = "FIDL methods require a response to be sent"]
7887#[derive(Debug)]
7888pub struct RingBufferSetActiveChannelsResponder {
7889 control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
7890 tx_id: u32,
7891}
7892
7893impl std::ops::Drop for RingBufferSetActiveChannelsResponder {
7897 fn drop(&mut self) {
7898 self.control_handle.shutdown();
7899 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7901 }
7902}
7903
7904impl fidl::endpoints::Responder for RingBufferSetActiveChannelsResponder {
7905 type ControlHandle = RingBufferControlHandle;
7906
7907 fn control_handle(&self) -> &RingBufferControlHandle {
7908 &self.control_handle
7909 }
7910
7911 fn drop_without_shutdown(mut self) {
7912 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7914 std::mem::forget(self);
7916 }
7917}
7918
7919impl RingBufferSetActiveChannelsResponder {
7920 pub fn send(self, mut result: Result<i64, i32>) -> Result<(), fidl::Error> {
7924 let _result = self.send_raw(result);
7925 if _result.is_err() {
7926 self.control_handle.shutdown();
7927 }
7928 self.drop_without_shutdown();
7929 _result
7930 }
7931
7932 pub fn send_no_shutdown_on_err(self, mut result: Result<i64, i32>) -> Result<(), fidl::Error> {
7934 let _result = self.send_raw(result);
7935 self.drop_without_shutdown();
7936 _result
7937 }
7938
7939 fn send_raw(&self, mut result: Result<i64, i32>) -> Result<(), fidl::Error> {
7940 self.control_handle.inner.send::<fidl::encoding::ResultType<
7941 RingBufferSetActiveChannelsResponse,
7942 i32,
7943 >>(
7944 result.map(|set_time| (set_time,)),
7945 self.tx_id,
7946 0x605464c1d384f309,
7947 fidl::encoding::DynamicFlags::empty(),
7948 )
7949 }
7950}
7951
7952#[must_use = "FIDL methods require a response to be sent"]
7953#[derive(Debug)]
7954pub struct RingBufferWatchDelayInfoResponder {
7955 control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
7956 tx_id: u32,
7957}
7958
7959impl std::ops::Drop for RingBufferWatchDelayInfoResponder {
7963 fn drop(&mut self) {
7964 self.control_handle.shutdown();
7965 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7967 }
7968}
7969
7970impl fidl::endpoints::Responder for RingBufferWatchDelayInfoResponder {
7971 type ControlHandle = RingBufferControlHandle;
7972
7973 fn control_handle(&self) -> &RingBufferControlHandle {
7974 &self.control_handle
7975 }
7976
7977 fn drop_without_shutdown(mut self) {
7978 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7980 std::mem::forget(self);
7982 }
7983}
7984
7985impl RingBufferWatchDelayInfoResponder {
7986 pub fn send(self, mut delay_info: &DelayInfo) -> Result<(), fidl::Error> {
7990 let _result = self.send_raw(delay_info);
7991 if _result.is_err() {
7992 self.control_handle.shutdown();
7993 }
7994 self.drop_without_shutdown();
7995 _result
7996 }
7997
7998 pub fn send_no_shutdown_on_err(self, mut delay_info: &DelayInfo) -> Result<(), fidl::Error> {
8000 let _result = self.send_raw(delay_info);
8001 self.drop_without_shutdown();
8002 _result
8003 }
8004
8005 fn send_raw(&self, mut delay_info: &DelayInfo) -> Result<(), fidl::Error> {
8006 self.control_handle
8007 .inner
8008 .send::<fidl::encoding::FlexibleType<RingBufferWatchDelayInfoResponse>>(
8009 fidl::encoding::Flexible::new((delay_info,)),
8010 self.tx_id,
8011 0x6c1248db213fcf9f,
8012 fidl::encoding::DynamicFlags::FLEXIBLE,
8013 )
8014 }
8015}
8016
8017#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8018pub struct StreamConfigMarker;
8019
8020impl fidl::endpoints::ProtocolMarker for StreamConfigMarker {
8021 type Proxy = StreamConfigProxy;
8022 type RequestStream = StreamConfigRequestStream;
8023 #[cfg(target_os = "fuchsia")]
8024 type SynchronousProxy = StreamConfigSynchronousProxy;
8025
8026 const DEBUG_NAME: &'static str = "(anonymous) StreamConfig";
8027}
8028
8029pub trait StreamConfigProxyInterface: Send + Sync {
8030 type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
8031 + Send;
8032 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
8033 fn r#signal_processing_connect(
8034 &self,
8035 protocol: fidl::endpoints::ServerEnd<
8036 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
8037 >,
8038 ) -> Result<(), fidl::Error>;
8039 type GetPropertiesResponseFut: std::future::Future<Output = Result<StreamProperties, fidl::Error>>
8040 + Send;
8041 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
8042 type GetSupportedFormatsResponseFut: std::future::Future<Output = Result<Vec<SupportedFormats>, fidl::Error>>
8043 + Send;
8044 fn r#get_supported_formats(&self) -> Self::GetSupportedFormatsResponseFut;
8045 fn r#create_ring_buffer(
8046 &self,
8047 format: &Format,
8048 ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
8049 ) -> Result<(), fidl::Error>;
8050 type WatchGainStateResponseFut: std::future::Future<Output = Result<GainState, fidl::Error>>
8051 + Send;
8052 fn r#watch_gain_state(&self) -> Self::WatchGainStateResponseFut;
8053 fn r#set_gain(&self, target_state: &GainState) -> Result<(), fidl::Error>;
8054 type WatchPlugStateResponseFut: std::future::Future<Output = Result<PlugState, fidl::Error>>
8055 + Send;
8056 fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut;
8057}
8058#[derive(Debug)]
8059#[cfg(target_os = "fuchsia")]
8060pub struct StreamConfigSynchronousProxy {
8061 client: fidl::client::sync::Client,
8062}
8063
8064#[cfg(target_os = "fuchsia")]
8065impl fidl::endpoints::SynchronousProxy for StreamConfigSynchronousProxy {
8066 type Proxy = StreamConfigProxy;
8067 type Protocol = StreamConfigMarker;
8068
8069 fn from_channel(inner: fidl::Channel) -> Self {
8070 Self::new(inner)
8071 }
8072
8073 fn into_channel(self) -> fidl::Channel {
8074 self.client.into_channel()
8075 }
8076
8077 fn as_channel(&self) -> &fidl::Channel {
8078 self.client.as_channel()
8079 }
8080}
8081
8082#[cfg(target_os = "fuchsia")]
8083impl StreamConfigSynchronousProxy {
8084 pub fn new(channel: fidl::Channel) -> Self {
8085 let protocol_name = <StreamConfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8086 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8087 }
8088
8089 pub fn into_channel(self) -> fidl::Channel {
8090 self.client.into_channel()
8091 }
8092
8093 pub fn wait_for_event(
8096 &self,
8097 deadline: zx::MonotonicInstant,
8098 ) -> Result<StreamConfigEvent, fidl::Error> {
8099 StreamConfigEvent::decode(self.client.wait_for_event(deadline)?)
8100 }
8101
8102 pub fn r#get_health_state(
8105 &self,
8106 ___deadline: zx::MonotonicInstant,
8107 ) -> Result<HealthState, fidl::Error> {
8108 let _response =
8109 self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
8110 (),
8111 0x4e146d6bca733a84,
8112 fidl::encoding::DynamicFlags::empty(),
8113 ___deadline,
8114 )?;
8115 Ok(_response.state)
8116 }
8117
8118 pub fn r#signal_processing_connect(
8130 &self,
8131 mut protocol: fidl::endpoints::ServerEnd<
8132 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
8133 >,
8134 ) -> Result<(), fidl::Error> {
8135 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
8136 (protocol,),
8137 0xa81907ce6066295,
8138 fidl::encoding::DynamicFlags::empty(),
8139 )
8140 }
8141
8142 pub fn r#get_properties(
8144 &self,
8145 ___deadline: zx::MonotonicInstant,
8146 ) -> Result<StreamProperties, fidl::Error> {
8147 let _response = self
8148 .client
8149 .send_query::<fidl::encoding::EmptyPayload, StreamConfigGetPropertiesResponse>(
8150 (),
8151 0x7d89c02f3e2d3c01,
8152 fidl::encoding::DynamicFlags::empty(),
8153 ___deadline,
8154 )?;
8155 Ok(_response.properties)
8156 }
8157
8158 pub fn r#get_supported_formats(
8168 &self,
8169 ___deadline: zx::MonotonicInstant,
8170 ) -> Result<Vec<SupportedFormats>, fidl::Error> {
8171 let _response = self
8172 .client
8173 .send_query::<fidl::encoding::EmptyPayload, StreamConfigGetSupportedFormatsResponse>(
8174 (),
8175 0x448efa7850cafe7e,
8176 fidl::encoding::DynamicFlags::empty(),
8177 ___deadline,
8178 )?;
8179 Ok(_response.supported_formats)
8180 }
8181
8182 pub fn r#create_ring_buffer(
8189 &self,
8190 mut format: &Format,
8191 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
8192 ) -> Result<(), fidl::Error> {
8193 self.client.send::<StreamConfigCreateRingBufferRequest>(
8194 (format, ring_buffer),
8195 0x2afb19dd13faa1ba,
8196 fidl::encoding::DynamicFlags::empty(),
8197 )
8198 }
8199
8200 pub fn r#watch_gain_state(
8207 &self,
8208 ___deadline: zx::MonotonicInstant,
8209 ) -> Result<GainState, fidl::Error> {
8210 let _response = self
8211 .client
8212 .send_query::<fidl::encoding::EmptyPayload, StreamConfigWatchGainStateResponse>(
8213 (),
8214 0x4772506136ab65c1,
8215 fidl::encoding::DynamicFlags::empty(),
8216 ___deadline,
8217 )?;
8218 Ok(_response.gain_state)
8219 }
8220
8221 pub fn r#set_gain(&self, mut target_state: &GainState) -> Result<(), fidl::Error> {
8223 self.client.send::<StreamConfigSetGainRequest>(
8224 (target_state,),
8225 0x3943b41498c6a384,
8226 fidl::encoding::DynamicFlags::empty(),
8227 )
8228 }
8229
8230 pub fn r#watch_plug_state(
8236 &self,
8237 ___deadline: zx::MonotonicInstant,
8238 ) -> Result<PlugState, fidl::Error> {
8239 let _response = self
8240 .client
8241 .send_query::<fidl::encoding::EmptyPayload, StreamConfigWatchPlugStateResponse>(
8242 (),
8243 0x497345a6f048b2a6,
8244 fidl::encoding::DynamicFlags::empty(),
8245 ___deadline,
8246 )?;
8247 Ok(_response.plug_state)
8248 }
8249}
8250
8251#[cfg(target_os = "fuchsia")]
8252impl From<StreamConfigSynchronousProxy> for zx::Handle {
8253 fn from(value: StreamConfigSynchronousProxy) -> Self {
8254 value.into_channel().into()
8255 }
8256}
8257
8258#[cfg(target_os = "fuchsia")]
8259impl From<fidl::Channel> for StreamConfigSynchronousProxy {
8260 fn from(value: fidl::Channel) -> Self {
8261 Self::new(value)
8262 }
8263}
8264
8265#[derive(Debug, Clone)]
8266pub struct StreamConfigProxy {
8267 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8268}
8269
8270impl fidl::endpoints::Proxy for StreamConfigProxy {
8271 type Protocol = StreamConfigMarker;
8272
8273 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8274 Self::new(inner)
8275 }
8276
8277 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8278 self.client.into_channel().map_err(|client| Self { client })
8279 }
8280
8281 fn as_channel(&self) -> &::fidl::AsyncChannel {
8282 self.client.as_channel()
8283 }
8284}
8285
8286impl StreamConfigProxy {
8287 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8289 let protocol_name = <StreamConfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8290 Self { client: fidl::client::Client::new(channel, protocol_name) }
8291 }
8292
8293 pub fn take_event_stream(&self) -> StreamConfigEventStream {
8299 StreamConfigEventStream { event_receiver: self.client.take_event_receiver() }
8300 }
8301
8302 pub fn r#get_health_state(
8305 &self,
8306 ) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
8307 {
8308 StreamConfigProxyInterface::r#get_health_state(self)
8309 }
8310
8311 pub fn r#signal_processing_connect(
8323 &self,
8324 mut protocol: fidl::endpoints::ServerEnd<
8325 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
8326 >,
8327 ) -> Result<(), fidl::Error> {
8328 StreamConfigProxyInterface::r#signal_processing_connect(self, protocol)
8329 }
8330
8331 pub fn r#get_properties(
8333 &self,
8334 ) -> fidl::client::QueryResponseFut<
8335 StreamProperties,
8336 fidl::encoding::DefaultFuchsiaResourceDialect,
8337 > {
8338 StreamConfigProxyInterface::r#get_properties(self)
8339 }
8340
8341 pub fn r#get_supported_formats(
8351 &self,
8352 ) -> fidl::client::QueryResponseFut<
8353 Vec<SupportedFormats>,
8354 fidl::encoding::DefaultFuchsiaResourceDialect,
8355 > {
8356 StreamConfigProxyInterface::r#get_supported_formats(self)
8357 }
8358
8359 pub fn r#create_ring_buffer(
8366 &self,
8367 mut format: &Format,
8368 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
8369 ) -> Result<(), fidl::Error> {
8370 StreamConfigProxyInterface::r#create_ring_buffer(self, format, ring_buffer)
8371 }
8372
8373 pub fn r#watch_gain_state(
8380 &self,
8381 ) -> fidl::client::QueryResponseFut<GainState, fidl::encoding::DefaultFuchsiaResourceDialect>
8382 {
8383 StreamConfigProxyInterface::r#watch_gain_state(self)
8384 }
8385
8386 pub fn r#set_gain(&self, mut target_state: &GainState) -> Result<(), fidl::Error> {
8388 StreamConfigProxyInterface::r#set_gain(self, target_state)
8389 }
8390
8391 pub fn r#watch_plug_state(
8397 &self,
8398 ) -> fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>
8399 {
8400 StreamConfigProxyInterface::r#watch_plug_state(self)
8401 }
8402}
8403
8404impl StreamConfigProxyInterface for StreamConfigProxy {
8405 type GetHealthStateResponseFut =
8406 fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
8407 fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
8408 fn _decode(
8409 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8410 ) -> Result<HealthState, fidl::Error> {
8411 let _response = fidl::client::decode_transaction_body::<
8412 HealthGetHealthStateResponse,
8413 fidl::encoding::DefaultFuchsiaResourceDialect,
8414 0x4e146d6bca733a84,
8415 >(_buf?)?;
8416 Ok(_response.state)
8417 }
8418 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
8419 (),
8420 0x4e146d6bca733a84,
8421 fidl::encoding::DynamicFlags::empty(),
8422 _decode,
8423 )
8424 }
8425
8426 fn r#signal_processing_connect(
8427 &self,
8428 mut protocol: fidl::endpoints::ServerEnd<
8429 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
8430 >,
8431 ) -> Result<(), fidl::Error> {
8432 self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
8433 (protocol,),
8434 0xa81907ce6066295,
8435 fidl::encoding::DynamicFlags::empty(),
8436 )
8437 }
8438
8439 type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
8440 StreamProperties,
8441 fidl::encoding::DefaultFuchsiaResourceDialect,
8442 >;
8443 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
8444 fn _decode(
8445 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8446 ) -> Result<StreamProperties, fidl::Error> {
8447 let _response = fidl::client::decode_transaction_body::<
8448 StreamConfigGetPropertiesResponse,
8449 fidl::encoding::DefaultFuchsiaResourceDialect,
8450 0x7d89c02f3e2d3c01,
8451 >(_buf?)?;
8452 Ok(_response.properties)
8453 }
8454 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StreamProperties>(
8455 (),
8456 0x7d89c02f3e2d3c01,
8457 fidl::encoding::DynamicFlags::empty(),
8458 _decode,
8459 )
8460 }
8461
8462 type GetSupportedFormatsResponseFut = fidl::client::QueryResponseFut<
8463 Vec<SupportedFormats>,
8464 fidl::encoding::DefaultFuchsiaResourceDialect,
8465 >;
8466 fn r#get_supported_formats(&self) -> Self::GetSupportedFormatsResponseFut {
8467 fn _decode(
8468 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8469 ) -> Result<Vec<SupportedFormats>, fidl::Error> {
8470 let _response = fidl::client::decode_transaction_body::<
8471 StreamConfigGetSupportedFormatsResponse,
8472 fidl::encoding::DefaultFuchsiaResourceDialect,
8473 0x448efa7850cafe7e,
8474 >(_buf?)?;
8475 Ok(_response.supported_formats)
8476 }
8477 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<SupportedFormats>>(
8478 (),
8479 0x448efa7850cafe7e,
8480 fidl::encoding::DynamicFlags::empty(),
8481 _decode,
8482 )
8483 }
8484
8485 fn r#create_ring_buffer(
8486 &self,
8487 mut format: &Format,
8488 mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
8489 ) -> Result<(), fidl::Error> {
8490 self.client.send::<StreamConfigCreateRingBufferRequest>(
8491 (format, ring_buffer),
8492 0x2afb19dd13faa1ba,
8493 fidl::encoding::DynamicFlags::empty(),
8494 )
8495 }
8496
8497 type WatchGainStateResponseFut =
8498 fidl::client::QueryResponseFut<GainState, fidl::encoding::DefaultFuchsiaResourceDialect>;
8499 fn r#watch_gain_state(&self) -> Self::WatchGainStateResponseFut {
8500 fn _decode(
8501 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8502 ) -> Result<GainState, fidl::Error> {
8503 let _response = fidl::client::decode_transaction_body::<
8504 StreamConfigWatchGainStateResponse,
8505 fidl::encoding::DefaultFuchsiaResourceDialect,
8506 0x4772506136ab65c1,
8507 >(_buf?)?;
8508 Ok(_response.gain_state)
8509 }
8510 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GainState>(
8511 (),
8512 0x4772506136ab65c1,
8513 fidl::encoding::DynamicFlags::empty(),
8514 _decode,
8515 )
8516 }
8517
8518 fn r#set_gain(&self, mut target_state: &GainState) -> Result<(), fidl::Error> {
8519 self.client.send::<StreamConfigSetGainRequest>(
8520 (target_state,),
8521 0x3943b41498c6a384,
8522 fidl::encoding::DynamicFlags::empty(),
8523 )
8524 }
8525
8526 type WatchPlugStateResponseFut =
8527 fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>;
8528 fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut {
8529 fn _decode(
8530 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8531 ) -> Result<PlugState, fidl::Error> {
8532 let _response = fidl::client::decode_transaction_body::<
8533 StreamConfigWatchPlugStateResponse,
8534 fidl::encoding::DefaultFuchsiaResourceDialect,
8535 0x497345a6f048b2a6,
8536 >(_buf?)?;
8537 Ok(_response.plug_state)
8538 }
8539 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PlugState>(
8540 (),
8541 0x497345a6f048b2a6,
8542 fidl::encoding::DynamicFlags::empty(),
8543 _decode,
8544 )
8545 }
8546}
8547
8548pub struct StreamConfigEventStream {
8549 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8550}
8551
8552impl std::marker::Unpin for StreamConfigEventStream {}
8553
8554impl futures::stream::FusedStream for StreamConfigEventStream {
8555 fn is_terminated(&self) -> bool {
8556 self.event_receiver.is_terminated()
8557 }
8558}
8559
8560impl futures::Stream for StreamConfigEventStream {
8561 type Item = Result<StreamConfigEvent, fidl::Error>;
8562
8563 fn poll_next(
8564 mut self: std::pin::Pin<&mut Self>,
8565 cx: &mut std::task::Context<'_>,
8566 ) -> std::task::Poll<Option<Self::Item>> {
8567 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8568 &mut self.event_receiver,
8569 cx
8570 )?) {
8571 Some(buf) => std::task::Poll::Ready(Some(StreamConfigEvent::decode(buf))),
8572 None => std::task::Poll::Ready(None),
8573 }
8574 }
8575}
8576
8577#[derive(Debug)]
8578pub enum StreamConfigEvent {}
8579
8580impl StreamConfigEvent {
8581 fn decode(
8583 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8584 ) -> Result<StreamConfigEvent, fidl::Error> {
8585 let (bytes, _handles) = buf.split_mut();
8586 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8587 debug_assert_eq!(tx_header.tx_id, 0);
8588 match tx_header.ordinal {
8589 _ => Err(fidl::Error::UnknownOrdinal {
8590 ordinal: tx_header.ordinal,
8591 protocol_name: <StreamConfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8592 }),
8593 }
8594 }
8595}
8596
8597pub struct StreamConfigRequestStream {
8599 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8600 is_terminated: bool,
8601}
8602
8603impl std::marker::Unpin for StreamConfigRequestStream {}
8604
8605impl futures::stream::FusedStream for StreamConfigRequestStream {
8606 fn is_terminated(&self) -> bool {
8607 self.is_terminated
8608 }
8609}
8610
8611impl fidl::endpoints::RequestStream for StreamConfigRequestStream {
8612 type Protocol = StreamConfigMarker;
8613 type ControlHandle = StreamConfigControlHandle;
8614
8615 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8616 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8617 }
8618
8619 fn control_handle(&self) -> Self::ControlHandle {
8620 StreamConfigControlHandle { inner: self.inner.clone() }
8621 }
8622
8623 fn into_inner(
8624 self,
8625 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8626 {
8627 (self.inner, self.is_terminated)
8628 }
8629
8630 fn from_inner(
8631 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8632 is_terminated: bool,
8633 ) -> Self {
8634 Self { inner, is_terminated }
8635 }
8636}
8637
8638impl futures::Stream for StreamConfigRequestStream {
8639 type Item = Result<StreamConfigRequest, fidl::Error>;
8640
8641 fn poll_next(
8642 mut self: std::pin::Pin<&mut Self>,
8643 cx: &mut std::task::Context<'_>,
8644 ) -> std::task::Poll<Option<Self::Item>> {
8645 let this = &mut *self;
8646 if this.inner.check_shutdown(cx) {
8647 this.is_terminated = true;
8648 return std::task::Poll::Ready(None);
8649 }
8650 if this.is_terminated {
8651 panic!("polled StreamConfigRequestStream after completion");
8652 }
8653 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8654 |bytes, handles| {
8655 match this.inner.channel().read_etc(cx, bytes, handles) {
8656 std::task::Poll::Ready(Ok(())) => {}
8657 std::task::Poll::Pending => return std::task::Poll::Pending,
8658 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8659 this.is_terminated = true;
8660 return std::task::Poll::Ready(None);
8661 }
8662 std::task::Poll::Ready(Err(e)) => {
8663 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8664 e.into(),
8665 ))))
8666 }
8667 }
8668
8669 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8671
8672 std::task::Poll::Ready(Some(match header.ordinal {
8673 0x4e146d6bca733a84 => {
8674 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8675 let mut req = fidl::new_empty!(
8676 fidl::encoding::EmptyPayload,
8677 fidl::encoding::DefaultFuchsiaResourceDialect
8678 );
8679 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8680 let control_handle =
8681 StreamConfigControlHandle { inner: this.inner.clone() };
8682 Ok(StreamConfigRequest::GetHealthState {
8683 responder: StreamConfigGetHealthStateResponder {
8684 control_handle: std::mem::ManuallyDrop::new(control_handle),
8685 tx_id: header.tx_id,
8686 },
8687 })
8688 }
8689 0xa81907ce6066295 => {
8690 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8691 let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8692 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
8693 let control_handle =
8694 StreamConfigControlHandle { inner: this.inner.clone() };
8695 Ok(StreamConfigRequest::SignalProcessingConnect {
8696 protocol: req.protocol,
8697
8698 control_handle,
8699 })
8700 }
8701 0x7d89c02f3e2d3c01 => {
8702 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8703 let mut req = fidl::new_empty!(
8704 fidl::encoding::EmptyPayload,
8705 fidl::encoding::DefaultFuchsiaResourceDialect
8706 );
8707 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8708 let control_handle =
8709 StreamConfigControlHandle { inner: this.inner.clone() };
8710 Ok(StreamConfigRequest::GetProperties {
8711 responder: StreamConfigGetPropertiesResponder {
8712 control_handle: std::mem::ManuallyDrop::new(control_handle),
8713 tx_id: header.tx_id,
8714 },
8715 })
8716 }
8717 0x448efa7850cafe7e => {
8718 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8719 let mut req = fidl::new_empty!(
8720 fidl::encoding::EmptyPayload,
8721 fidl::encoding::DefaultFuchsiaResourceDialect
8722 );
8723 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8724 let control_handle =
8725 StreamConfigControlHandle { inner: this.inner.clone() };
8726 Ok(StreamConfigRequest::GetSupportedFormats {
8727 responder: StreamConfigGetSupportedFormatsResponder {
8728 control_handle: std::mem::ManuallyDrop::new(control_handle),
8729 tx_id: header.tx_id,
8730 },
8731 })
8732 }
8733 0x2afb19dd13faa1ba => {
8734 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8735 let mut req = fidl::new_empty!(
8736 StreamConfigCreateRingBufferRequest,
8737 fidl::encoding::DefaultFuchsiaResourceDialect
8738 );
8739 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamConfigCreateRingBufferRequest>(&header, _body_bytes, handles, &mut req)?;
8740 let control_handle =
8741 StreamConfigControlHandle { inner: this.inner.clone() };
8742 Ok(StreamConfigRequest::CreateRingBuffer {
8743 format: req.format,
8744 ring_buffer: req.ring_buffer,
8745
8746 control_handle,
8747 })
8748 }
8749 0x4772506136ab65c1 => {
8750 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8751 let mut req = fidl::new_empty!(
8752 fidl::encoding::EmptyPayload,
8753 fidl::encoding::DefaultFuchsiaResourceDialect
8754 );
8755 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8756 let control_handle =
8757 StreamConfigControlHandle { inner: this.inner.clone() };
8758 Ok(StreamConfigRequest::WatchGainState {
8759 responder: StreamConfigWatchGainStateResponder {
8760 control_handle: std::mem::ManuallyDrop::new(control_handle),
8761 tx_id: header.tx_id,
8762 },
8763 })
8764 }
8765 0x3943b41498c6a384 => {
8766 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8767 let mut req = fidl::new_empty!(
8768 StreamConfigSetGainRequest,
8769 fidl::encoding::DefaultFuchsiaResourceDialect
8770 );
8771 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamConfigSetGainRequest>(&header, _body_bytes, handles, &mut req)?;
8772 let control_handle =
8773 StreamConfigControlHandle { inner: this.inner.clone() };
8774 Ok(StreamConfigRequest::SetGain {
8775 target_state: req.target_state,
8776
8777 control_handle,
8778 })
8779 }
8780 0x497345a6f048b2a6 => {
8781 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8782 let mut req = fidl::new_empty!(
8783 fidl::encoding::EmptyPayload,
8784 fidl::encoding::DefaultFuchsiaResourceDialect
8785 );
8786 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8787 let control_handle =
8788 StreamConfigControlHandle { inner: this.inner.clone() };
8789 Ok(StreamConfigRequest::WatchPlugState {
8790 responder: StreamConfigWatchPlugStateResponder {
8791 control_handle: std::mem::ManuallyDrop::new(control_handle),
8792 tx_id: header.tx_id,
8793 },
8794 })
8795 }
8796 _ => Err(fidl::Error::UnknownOrdinal {
8797 ordinal: header.ordinal,
8798 protocol_name:
8799 <StreamConfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8800 }),
8801 }))
8802 },
8803 )
8804 }
8805}
8806
8807#[derive(Debug)]
8816pub enum StreamConfigRequest {
8817 GetHealthState { responder: StreamConfigGetHealthStateResponder },
8820 SignalProcessingConnect {
8832 protocol: fidl::endpoints::ServerEnd<
8833 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
8834 >,
8835 control_handle: StreamConfigControlHandle,
8836 },
8837 GetProperties { responder: StreamConfigGetPropertiesResponder },
8839 GetSupportedFormats { responder: StreamConfigGetSupportedFormatsResponder },
8849 CreateRingBuffer {
8856 format: Format,
8857 ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
8858 control_handle: StreamConfigControlHandle,
8859 },
8860 WatchGainState { responder: StreamConfigWatchGainStateResponder },
8867 SetGain { target_state: GainState, control_handle: StreamConfigControlHandle },
8869 WatchPlugState { responder: StreamConfigWatchPlugStateResponder },
8875}
8876
8877impl StreamConfigRequest {
8878 #[allow(irrefutable_let_patterns)]
8879 pub fn into_get_health_state(self) -> Option<(StreamConfigGetHealthStateResponder)> {
8880 if let StreamConfigRequest::GetHealthState { responder } = self {
8881 Some((responder))
8882 } else {
8883 None
8884 }
8885 }
8886
8887 #[allow(irrefutable_let_patterns)]
8888 pub fn into_signal_processing_connect(
8889 self,
8890 ) -> Option<(
8891 fidl::endpoints::ServerEnd<
8892 fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
8893 >,
8894 StreamConfigControlHandle,
8895 )> {
8896 if let StreamConfigRequest::SignalProcessingConnect { protocol, control_handle } = self {
8897 Some((protocol, control_handle))
8898 } else {
8899 None
8900 }
8901 }
8902
8903 #[allow(irrefutable_let_patterns)]
8904 pub fn into_get_properties(self) -> Option<(StreamConfigGetPropertiesResponder)> {
8905 if let StreamConfigRequest::GetProperties { responder } = self {
8906 Some((responder))
8907 } else {
8908 None
8909 }
8910 }
8911
8912 #[allow(irrefutable_let_patterns)]
8913 pub fn into_get_supported_formats(self) -> Option<(StreamConfigGetSupportedFormatsResponder)> {
8914 if let StreamConfigRequest::GetSupportedFormats { responder } = self {
8915 Some((responder))
8916 } else {
8917 None
8918 }
8919 }
8920
8921 #[allow(irrefutable_let_patterns)]
8922 pub fn into_create_ring_buffer(
8923 self,
8924 ) -> Option<(Format, fidl::endpoints::ServerEnd<RingBufferMarker>, StreamConfigControlHandle)>
8925 {
8926 if let StreamConfigRequest::CreateRingBuffer { format, ring_buffer, control_handle } = self
8927 {
8928 Some((format, ring_buffer, control_handle))
8929 } else {
8930 None
8931 }
8932 }
8933
8934 #[allow(irrefutable_let_patterns)]
8935 pub fn into_watch_gain_state(self) -> Option<(StreamConfigWatchGainStateResponder)> {
8936 if let StreamConfigRequest::WatchGainState { responder } = self {
8937 Some((responder))
8938 } else {
8939 None
8940 }
8941 }
8942
8943 #[allow(irrefutable_let_patterns)]
8944 pub fn into_set_gain(self) -> Option<(GainState, StreamConfigControlHandle)> {
8945 if let StreamConfigRequest::SetGain { target_state, control_handle } = self {
8946 Some((target_state, control_handle))
8947 } else {
8948 None
8949 }
8950 }
8951
8952 #[allow(irrefutable_let_patterns)]
8953 pub fn into_watch_plug_state(self) -> Option<(StreamConfigWatchPlugStateResponder)> {
8954 if let StreamConfigRequest::WatchPlugState { responder } = self {
8955 Some((responder))
8956 } else {
8957 None
8958 }
8959 }
8960
8961 pub fn method_name(&self) -> &'static str {
8963 match *self {
8964 StreamConfigRequest::GetHealthState { .. } => "get_health_state",
8965 StreamConfigRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
8966 StreamConfigRequest::GetProperties { .. } => "get_properties",
8967 StreamConfigRequest::GetSupportedFormats { .. } => "get_supported_formats",
8968 StreamConfigRequest::CreateRingBuffer { .. } => "create_ring_buffer",
8969 StreamConfigRequest::WatchGainState { .. } => "watch_gain_state",
8970 StreamConfigRequest::SetGain { .. } => "set_gain",
8971 StreamConfigRequest::WatchPlugState { .. } => "watch_plug_state",
8972 }
8973 }
8974}
8975
8976#[derive(Debug, Clone)]
8977pub struct StreamConfigControlHandle {
8978 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8979}
8980
8981impl fidl::endpoints::ControlHandle for StreamConfigControlHandle {
8982 fn shutdown(&self) {
8983 self.inner.shutdown()
8984 }
8985 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8986 self.inner.shutdown_with_epitaph(status)
8987 }
8988
8989 fn is_closed(&self) -> bool {
8990 self.inner.channel().is_closed()
8991 }
8992 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8993 self.inner.channel().on_closed()
8994 }
8995
8996 #[cfg(target_os = "fuchsia")]
8997 fn signal_peer(
8998 &self,
8999 clear_mask: zx::Signals,
9000 set_mask: zx::Signals,
9001 ) -> Result<(), zx_status::Status> {
9002 use fidl::Peered;
9003 self.inner.channel().signal_peer(clear_mask, set_mask)
9004 }
9005}
9006
9007impl StreamConfigControlHandle {}
9008
9009#[must_use = "FIDL methods require a response to be sent"]
9010#[derive(Debug)]
9011pub struct StreamConfigGetHealthStateResponder {
9012 control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
9013 tx_id: u32,
9014}
9015
9016impl std::ops::Drop for StreamConfigGetHealthStateResponder {
9020 fn drop(&mut self) {
9021 self.control_handle.shutdown();
9022 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9024 }
9025}
9026
9027impl fidl::endpoints::Responder for StreamConfigGetHealthStateResponder {
9028 type ControlHandle = StreamConfigControlHandle;
9029
9030 fn control_handle(&self) -> &StreamConfigControlHandle {
9031 &self.control_handle
9032 }
9033
9034 fn drop_without_shutdown(mut self) {
9035 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9037 std::mem::forget(self);
9039 }
9040}
9041
9042impl StreamConfigGetHealthStateResponder {
9043 pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
9047 let _result = self.send_raw(state);
9048 if _result.is_err() {
9049 self.control_handle.shutdown();
9050 }
9051 self.drop_without_shutdown();
9052 _result
9053 }
9054
9055 pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
9057 let _result = self.send_raw(state);
9058 self.drop_without_shutdown();
9059 _result
9060 }
9061
9062 fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
9063 self.control_handle.inner.send::<HealthGetHealthStateResponse>(
9064 (state,),
9065 self.tx_id,
9066 0x4e146d6bca733a84,
9067 fidl::encoding::DynamicFlags::empty(),
9068 )
9069 }
9070}
9071
9072#[must_use = "FIDL methods require a response to be sent"]
9073#[derive(Debug)]
9074pub struct StreamConfigGetPropertiesResponder {
9075 control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
9076 tx_id: u32,
9077}
9078
9079impl std::ops::Drop for StreamConfigGetPropertiesResponder {
9083 fn drop(&mut self) {
9084 self.control_handle.shutdown();
9085 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9087 }
9088}
9089
9090impl fidl::endpoints::Responder for StreamConfigGetPropertiesResponder {
9091 type ControlHandle = StreamConfigControlHandle;
9092
9093 fn control_handle(&self) -> &StreamConfigControlHandle {
9094 &self.control_handle
9095 }
9096
9097 fn drop_without_shutdown(mut self) {
9098 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9100 std::mem::forget(self);
9102 }
9103}
9104
9105impl StreamConfigGetPropertiesResponder {
9106 pub fn send(self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
9110 let _result = self.send_raw(properties);
9111 if _result.is_err() {
9112 self.control_handle.shutdown();
9113 }
9114 self.drop_without_shutdown();
9115 _result
9116 }
9117
9118 pub fn send_no_shutdown_on_err(
9120 self,
9121 mut properties: &StreamProperties,
9122 ) -> Result<(), fidl::Error> {
9123 let _result = self.send_raw(properties);
9124 self.drop_without_shutdown();
9125 _result
9126 }
9127
9128 fn send_raw(&self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
9129 self.control_handle.inner.send::<StreamConfigGetPropertiesResponse>(
9130 (properties,),
9131 self.tx_id,
9132 0x7d89c02f3e2d3c01,
9133 fidl::encoding::DynamicFlags::empty(),
9134 )
9135 }
9136}
9137
9138#[must_use = "FIDL methods require a response to be sent"]
9139#[derive(Debug)]
9140pub struct StreamConfigGetSupportedFormatsResponder {
9141 control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
9142 tx_id: u32,
9143}
9144
9145impl std::ops::Drop for StreamConfigGetSupportedFormatsResponder {
9149 fn drop(&mut self) {
9150 self.control_handle.shutdown();
9151 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9153 }
9154}
9155
9156impl fidl::endpoints::Responder for StreamConfigGetSupportedFormatsResponder {
9157 type ControlHandle = StreamConfigControlHandle;
9158
9159 fn control_handle(&self) -> &StreamConfigControlHandle {
9160 &self.control_handle
9161 }
9162
9163 fn drop_without_shutdown(mut self) {
9164 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9166 std::mem::forget(self);
9168 }
9169}
9170
9171impl StreamConfigGetSupportedFormatsResponder {
9172 pub fn send(self, mut supported_formats: &[SupportedFormats]) -> Result<(), fidl::Error> {
9176 let _result = self.send_raw(supported_formats);
9177 if _result.is_err() {
9178 self.control_handle.shutdown();
9179 }
9180 self.drop_without_shutdown();
9181 _result
9182 }
9183
9184 pub fn send_no_shutdown_on_err(
9186 self,
9187 mut supported_formats: &[SupportedFormats],
9188 ) -> Result<(), fidl::Error> {
9189 let _result = self.send_raw(supported_formats);
9190 self.drop_without_shutdown();
9191 _result
9192 }
9193
9194 fn send_raw(&self, mut supported_formats: &[SupportedFormats]) -> Result<(), fidl::Error> {
9195 self.control_handle.inner.send::<StreamConfigGetSupportedFormatsResponse>(
9196 (supported_formats,),
9197 self.tx_id,
9198 0x448efa7850cafe7e,
9199 fidl::encoding::DynamicFlags::empty(),
9200 )
9201 }
9202}
9203
9204#[must_use = "FIDL methods require a response to be sent"]
9205#[derive(Debug)]
9206pub struct StreamConfigWatchGainStateResponder {
9207 control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
9208 tx_id: u32,
9209}
9210
9211impl std::ops::Drop for StreamConfigWatchGainStateResponder {
9215 fn drop(&mut self) {
9216 self.control_handle.shutdown();
9217 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9219 }
9220}
9221
9222impl fidl::endpoints::Responder for StreamConfigWatchGainStateResponder {
9223 type ControlHandle = StreamConfigControlHandle;
9224
9225 fn control_handle(&self) -> &StreamConfigControlHandle {
9226 &self.control_handle
9227 }
9228
9229 fn drop_without_shutdown(mut self) {
9230 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9232 std::mem::forget(self);
9234 }
9235}
9236
9237impl StreamConfigWatchGainStateResponder {
9238 pub fn send(self, mut gain_state: &GainState) -> Result<(), fidl::Error> {
9242 let _result = self.send_raw(gain_state);
9243 if _result.is_err() {
9244 self.control_handle.shutdown();
9245 }
9246 self.drop_without_shutdown();
9247 _result
9248 }
9249
9250 pub fn send_no_shutdown_on_err(self, mut gain_state: &GainState) -> Result<(), fidl::Error> {
9252 let _result = self.send_raw(gain_state);
9253 self.drop_without_shutdown();
9254 _result
9255 }
9256
9257 fn send_raw(&self, mut gain_state: &GainState) -> Result<(), fidl::Error> {
9258 self.control_handle.inner.send::<StreamConfigWatchGainStateResponse>(
9259 (gain_state,),
9260 self.tx_id,
9261 0x4772506136ab65c1,
9262 fidl::encoding::DynamicFlags::empty(),
9263 )
9264 }
9265}
9266
9267#[must_use = "FIDL methods require a response to be sent"]
9268#[derive(Debug)]
9269pub struct StreamConfigWatchPlugStateResponder {
9270 control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
9271 tx_id: u32,
9272}
9273
9274impl std::ops::Drop for StreamConfigWatchPlugStateResponder {
9278 fn drop(&mut self) {
9279 self.control_handle.shutdown();
9280 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9282 }
9283}
9284
9285impl fidl::endpoints::Responder for StreamConfigWatchPlugStateResponder {
9286 type ControlHandle = StreamConfigControlHandle;
9287
9288 fn control_handle(&self) -> &StreamConfigControlHandle {
9289 &self.control_handle
9290 }
9291
9292 fn drop_without_shutdown(mut self) {
9293 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9295 std::mem::forget(self);
9297 }
9298}
9299
9300impl StreamConfigWatchPlugStateResponder {
9301 pub fn send(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
9305 let _result = self.send_raw(plug_state);
9306 if _result.is_err() {
9307 self.control_handle.shutdown();
9308 }
9309 self.drop_without_shutdown();
9310 _result
9311 }
9312
9313 pub fn send_no_shutdown_on_err(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
9315 let _result = self.send_raw(plug_state);
9316 self.drop_without_shutdown();
9317 _result
9318 }
9319
9320 fn send_raw(&self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
9321 self.control_handle.inner.send::<StreamConfigWatchPlugStateResponse>(
9322 (plug_state,),
9323 self.tx_id,
9324 0x497345a6f048b2a6,
9325 fidl::encoding::DynamicFlags::empty(),
9326 )
9327 }
9328}
9329
9330#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9331pub struct StreamConfigConnectorMarker;
9332
9333impl fidl::endpoints::ProtocolMarker for StreamConfigConnectorMarker {
9334 type Proxy = StreamConfigConnectorProxy;
9335 type RequestStream = StreamConfigConnectorRequestStream;
9336 #[cfg(target_os = "fuchsia")]
9337 type SynchronousProxy = StreamConfigConnectorSynchronousProxy;
9338
9339 const DEBUG_NAME: &'static str = "(anonymous) StreamConfigConnector";
9340}
9341
9342pub trait StreamConfigConnectorProxyInterface: Send + Sync {
9343 fn r#connect(
9344 &self,
9345 protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
9346 ) -> Result<(), fidl::Error>;
9347}
9348#[derive(Debug)]
9349#[cfg(target_os = "fuchsia")]
9350pub struct StreamConfigConnectorSynchronousProxy {
9351 client: fidl::client::sync::Client,
9352}
9353
9354#[cfg(target_os = "fuchsia")]
9355impl fidl::endpoints::SynchronousProxy for StreamConfigConnectorSynchronousProxy {
9356 type Proxy = StreamConfigConnectorProxy;
9357 type Protocol = StreamConfigConnectorMarker;
9358
9359 fn from_channel(inner: fidl::Channel) -> Self {
9360 Self::new(inner)
9361 }
9362
9363 fn into_channel(self) -> fidl::Channel {
9364 self.client.into_channel()
9365 }
9366
9367 fn as_channel(&self) -> &fidl::Channel {
9368 self.client.as_channel()
9369 }
9370}
9371
9372#[cfg(target_os = "fuchsia")]
9373impl StreamConfigConnectorSynchronousProxy {
9374 pub fn new(channel: fidl::Channel) -> Self {
9375 let protocol_name =
9376 <StreamConfigConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9377 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9378 }
9379
9380 pub fn into_channel(self) -> fidl::Channel {
9381 self.client.into_channel()
9382 }
9383
9384 pub fn wait_for_event(
9387 &self,
9388 deadline: zx::MonotonicInstant,
9389 ) -> Result<StreamConfigConnectorEvent, fidl::Error> {
9390 StreamConfigConnectorEvent::decode(self.client.wait_for_event(deadline)?)
9391 }
9392
9393 pub fn r#connect(
9396 &self,
9397 mut protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
9398 ) -> Result<(), fidl::Error> {
9399 self.client.send::<StreamConfigConnectorConnectRequest>(
9400 (protocol,),
9401 0x22051ff3021eafec,
9402 fidl::encoding::DynamicFlags::empty(),
9403 )
9404 }
9405}
9406
9407#[cfg(target_os = "fuchsia")]
9408impl From<StreamConfigConnectorSynchronousProxy> for zx::Handle {
9409 fn from(value: StreamConfigConnectorSynchronousProxy) -> Self {
9410 value.into_channel().into()
9411 }
9412}
9413
9414#[cfg(target_os = "fuchsia")]
9415impl From<fidl::Channel> for StreamConfigConnectorSynchronousProxy {
9416 fn from(value: fidl::Channel) -> Self {
9417 Self::new(value)
9418 }
9419}
9420
9421#[derive(Debug, Clone)]
9422pub struct StreamConfigConnectorProxy {
9423 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9424}
9425
9426impl fidl::endpoints::Proxy for StreamConfigConnectorProxy {
9427 type Protocol = StreamConfigConnectorMarker;
9428
9429 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9430 Self::new(inner)
9431 }
9432
9433 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9434 self.client.into_channel().map_err(|client| Self { client })
9435 }
9436
9437 fn as_channel(&self) -> &::fidl::AsyncChannel {
9438 self.client.as_channel()
9439 }
9440}
9441
9442impl StreamConfigConnectorProxy {
9443 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9445 let protocol_name =
9446 <StreamConfigConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9447 Self { client: fidl::client::Client::new(channel, protocol_name) }
9448 }
9449
9450 pub fn take_event_stream(&self) -> StreamConfigConnectorEventStream {
9456 StreamConfigConnectorEventStream { event_receiver: self.client.take_event_receiver() }
9457 }
9458
9459 pub fn r#connect(
9462 &self,
9463 mut protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
9464 ) -> Result<(), fidl::Error> {
9465 StreamConfigConnectorProxyInterface::r#connect(self, protocol)
9466 }
9467}
9468
9469impl StreamConfigConnectorProxyInterface for StreamConfigConnectorProxy {
9470 fn r#connect(
9471 &self,
9472 mut protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
9473 ) -> Result<(), fidl::Error> {
9474 self.client.send::<StreamConfigConnectorConnectRequest>(
9475 (protocol,),
9476 0x22051ff3021eafec,
9477 fidl::encoding::DynamicFlags::empty(),
9478 )
9479 }
9480}
9481
9482pub struct StreamConfigConnectorEventStream {
9483 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9484}
9485
9486impl std::marker::Unpin for StreamConfigConnectorEventStream {}
9487
9488impl futures::stream::FusedStream for StreamConfigConnectorEventStream {
9489 fn is_terminated(&self) -> bool {
9490 self.event_receiver.is_terminated()
9491 }
9492}
9493
9494impl futures::Stream for StreamConfigConnectorEventStream {
9495 type Item = Result<StreamConfigConnectorEvent, fidl::Error>;
9496
9497 fn poll_next(
9498 mut self: std::pin::Pin<&mut Self>,
9499 cx: &mut std::task::Context<'_>,
9500 ) -> std::task::Poll<Option<Self::Item>> {
9501 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9502 &mut self.event_receiver,
9503 cx
9504 )?) {
9505 Some(buf) => std::task::Poll::Ready(Some(StreamConfigConnectorEvent::decode(buf))),
9506 None => std::task::Poll::Ready(None),
9507 }
9508 }
9509}
9510
9511#[derive(Debug)]
9512pub enum StreamConfigConnectorEvent {}
9513
9514impl StreamConfigConnectorEvent {
9515 fn decode(
9517 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9518 ) -> Result<StreamConfigConnectorEvent, fidl::Error> {
9519 let (bytes, _handles) = buf.split_mut();
9520 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9521 debug_assert_eq!(tx_header.tx_id, 0);
9522 match tx_header.ordinal {
9523 _ => Err(fidl::Error::UnknownOrdinal {
9524 ordinal: tx_header.ordinal,
9525 protocol_name:
9526 <StreamConfigConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9527 }),
9528 }
9529 }
9530}
9531
9532pub struct StreamConfigConnectorRequestStream {
9534 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9535 is_terminated: bool,
9536}
9537
9538impl std::marker::Unpin for StreamConfigConnectorRequestStream {}
9539
9540impl futures::stream::FusedStream for StreamConfigConnectorRequestStream {
9541 fn is_terminated(&self) -> bool {
9542 self.is_terminated
9543 }
9544}
9545
9546impl fidl::endpoints::RequestStream for StreamConfigConnectorRequestStream {
9547 type Protocol = StreamConfigConnectorMarker;
9548 type ControlHandle = StreamConfigConnectorControlHandle;
9549
9550 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9551 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9552 }
9553
9554 fn control_handle(&self) -> Self::ControlHandle {
9555 StreamConfigConnectorControlHandle { inner: self.inner.clone() }
9556 }
9557
9558 fn into_inner(
9559 self,
9560 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9561 {
9562 (self.inner, self.is_terminated)
9563 }
9564
9565 fn from_inner(
9566 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9567 is_terminated: bool,
9568 ) -> Self {
9569 Self { inner, is_terminated }
9570 }
9571}
9572
9573impl futures::Stream for StreamConfigConnectorRequestStream {
9574 type Item = Result<StreamConfigConnectorRequest, fidl::Error>;
9575
9576 fn poll_next(
9577 mut self: std::pin::Pin<&mut Self>,
9578 cx: &mut std::task::Context<'_>,
9579 ) -> std::task::Poll<Option<Self::Item>> {
9580 let this = &mut *self;
9581 if this.inner.check_shutdown(cx) {
9582 this.is_terminated = true;
9583 return std::task::Poll::Ready(None);
9584 }
9585 if this.is_terminated {
9586 panic!("polled StreamConfigConnectorRequestStream after completion");
9587 }
9588 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9589 |bytes, handles| {
9590 match this.inner.channel().read_etc(cx, bytes, handles) {
9591 std::task::Poll::Ready(Ok(())) => {}
9592 std::task::Poll::Pending => return std::task::Poll::Pending,
9593 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9594 this.is_terminated = true;
9595 return std::task::Poll::Ready(None);
9596 }
9597 std::task::Poll::Ready(Err(e)) => {
9598 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9599 e.into(),
9600 ))))
9601 }
9602 }
9603
9604 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9606
9607 std::task::Poll::Ready(Some(match header.ordinal {
9608 0x22051ff3021eafec => {
9609 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9610 let mut req = fidl::new_empty!(StreamConfigConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9611 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamConfigConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
9612 let control_handle = StreamConfigConnectorControlHandle {
9613 inner: this.inner.clone(),
9614 };
9615 Ok(StreamConfigConnectorRequest::Connect {protocol: req.protocol,
9616
9617 control_handle,
9618 })
9619 }
9620 _ => Err(fidl::Error::UnknownOrdinal {
9621 ordinal: header.ordinal,
9622 protocol_name: <StreamConfigConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9623 }),
9624 }))
9625 },
9626 )
9627 }
9628}
9629
9630#[derive(Debug)]
9639pub enum StreamConfigConnectorRequest {
9640 Connect {
9643 protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
9644 control_handle: StreamConfigConnectorControlHandle,
9645 },
9646}
9647
9648impl StreamConfigConnectorRequest {
9649 #[allow(irrefutable_let_patterns)]
9650 pub fn into_connect(
9651 self,
9652 ) -> Option<(fidl::endpoints::ServerEnd<StreamConfigMarker>, StreamConfigConnectorControlHandle)>
9653 {
9654 if let StreamConfigConnectorRequest::Connect { protocol, control_handle } = self {
9655 Some((protocol, control_handle))
9656 } else {
9657 None
9658 }
9659 }
9660
9661 pub fn method_name(&self) -> &'static str {
9663 match *self {
9664 StreamConfigConnectorRequest::Connect { .. } => "connect",
9665 }
9666 }
9667}
9668
9669#[derive(Debug, Clone)]
9670pub struct StreamConfigConnectorControlHandle {
9671 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9672}
9673
9674impl fidl::endpoints::ControlHandle for StreamConfigConnectorControlHandle {
9675 fn shutdown(&self) {
9676 self.inner.shutdown()
9677 }
9678 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9679 self.inner.shutdown_with_epitaph(status)
9680 }
9681
9682 fn is_closed(&self) -> bool {
9683 self.inner.channel().is_closed()
9684 }
9685 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9686 self.inner.channel().on_closed()
9687 }
9688
9689 #[cfg(target_os = "fuchsia")]
9690 fn signal_peer(
9691 &self,
9692 clear_mask: zx::Signals,
9693 set_mask: zx::Signals,
9694 ) -> Result<(), zx_status::Status> {
9695 use fidl::Peered;
9696 self.inner.channel().signal_peer(clear_mask, set_mask)
9697 }
9698}
9699
9700impl StreamConfigConnectorControlHandle {}
9701
9702#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9703pub struct CodecConnectorServiceMarker;
9704
9705#[cfg(target_os = "fuchsia")]
9706impl fidl::endpoints::ServiceMarker for CodecConnectorServiceMarker {
9707 type Proxy = CodecConnectorServiceProxy;
9708 type Request = CodecConnectorServiceRequest;
9709 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.CodecConnectorService";
9710}
9711
9712#[cfg(target_os = "fuchsia")]
9721pub enum CodecConnectorServiceRequest {
9722 CodecConnector(CodecConnectorRequestStream),
9723}
9724
9725#[cfg(target_os = "fuchsia")]
9726impl fidl::endpoints::ServiceRequest for CodecConnectorServiceRequest {
9727 type Service = CodecConnectorServiceMarker;
9728
9729 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
9730 match name {
9731 "codec_connector" => Self::CodecConnector(
9732 <CodecConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
9733 _channel,
9734 ),
9735 ),
9736 _ => panic!("no such member protocol name for service CodecConnectorService"),
9737 }
9738 }
9739
9740 fn member_names() -> &'static [&'static str] {
9741 &["codec_connector"]
9742 }
9743}
9744#[cfg(target_os = "fuchsia")]
9751pub struct CodecConnectorServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
9752
9753#[cfg(target_os = "fuchsia")]
9754impl fidl::endpoints::ServiceProxy for CodecConnectorServiceProxy {
9755 type Service = CodecConnectorServiceMarker;
9756
9757 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
9758 Self(opener)
9759 }
9760}
9761
9762#[cfg(target_os = "fuchsia")]
9763impl CodecConnectorServiceProxy {
9764 pub fn connect_to_codec_connector(&self) -> Result<CodecConnectorProxy, fidl::Error> {
9765 let (proxy, server_end) = fidl::endpoints::create_proxy::<CodecConnectorMarker>();
9766 self.connect_channel_to_codec_connector(server_end)?;
9767 Ok(proxy)
9768 }
9769
9770 pub fn connect_to_codec_connector_sync(
9773 &self,
9774 ) -> Result<CodecConnectorSynchronousProxy, fidl::Error> {
9775 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CodecConnectorMarker>();
9776 self.connect_channel_to_codec_connector(server_end)?;
9777 Ok(proxy)
9778 }
9779
9780 pub fn connect_channel_to_codec_connector(
9783 &self,
9784 server_end: fidl::endpoints::ServerEnd<CodecConnectorMarker>,
9785 ) -> Result<(), fidl::Error> {
9786 self.0.open_member("codec_connector", server_end.into_channel())
9787 }
9788
9789 pub fn instance_name(&self) -> &str {
9790 self.0.instance_name()
9791 }
9792}
9793
9794#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9795pub struct CodecServiceMarker;
9796
9797#[cfg(target_os = "fuchsia")]
9798impl fidl::endpoints::ServiceMarker for CodecServiceMarker {
9799 type Proxy = CodecServiceProxy;
9800 type Request = CodecServiceRequest;
9801 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.CodecService";
9802}
9803
9804#[cfg(target_os = "fuchsia")]
9813pub enum CodecServiceRequest {
9814 Codec(CodecRequestStream),
9815}
9816
9817#[cfg(target_os = "fuchsia")]
9818impl fidl::endpoints::ServiceRequest for CodecServiceRequest {
9819 type Service = CodecServiceMarker;
9820
9821 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
9822 match name {
9823 "codec" => Self::Codec(
9824 <CodecRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
9825 ),
9826 _ => panic!("no such member protocol name for service CodecService"),
9827 }
9828 }
9829
9830 fn member_names() -> &'static [&'static str] {
9831 &["codec"]
9832 }
9833}
9834#[cfg(target_os = "fuchsia")]
9841pub struct CodecServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
9842
9843#[cfg(target_os = "fuchsia")]
9844impl fidl::endpoints::ServiceProxy for CodecServiceProxy {
9845 type Service = CodecServiceMarker;
9846
9847 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
9848 Self(opener)
9849 }
9850}
9851
9852#[cfg(target_os = "fuchsia")]
9853impl CodecServiceProxy {
9854 pub fn connect_to_codec(&self) -> Result<CodecProxy, fidl::Error> {
9855 let (proxy, server_end) = fidl::endpoints::create_proxy::<CodecMarker>();
9856 self.connect_channel_to_codec(server_end)?;
9857 Ok(proxy)
9858 }
9859
9860 pub fn connect_to_codec_sync(&self) -> Result<CodecSynchronousProxy, fidl::Error> {
9863 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CodecMarker>();
9864 self.connect_channel_to_codec(server_end)?;
9865 Ok(proxy)
9866 }
9867
9868 pub fn connect_channel_to_codec(
9871 &self,
9872 server_end: fidl::endpoints::ServerEnd<CodecMarker>,
9873 ) -> Result<(), fidl::Error> {
9874 self.0.open_member("codec", server_end.into_channel())
9875 }
9876
9877 pub fn instance_name(&self) -> &str {
9878 self.0.instance_name()
9879 }
9880}
9881
9882#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9883pub struct CompositeConnectorServiceMarker;
9884
9885#[cfg(target_os = "fuchsia")]
9886impl fidl::endpoints::ServiceMarker for CompositeConnectorServiceMarker {
9887 type Proxy = CompositeConnectorServiceProxy;
9888 type Request = CompositeConnectorServiceRequest;
9889 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.CompositeConnectorService";
9890}
9891
9892#[cfg(target_os = "fuchsia")]
9895pub enum CompositeConnectorServiceRequest {
9896 CompositeConnector(CompositeConnectorRequestStream),
9897}
9898
9899#[cfg(target_os = "fuchsia")]
9900impl fidl::endpoints::ServiceRequest for CompositeConnectorServiceRequest {
9901 type Service = CompositeConnectorServiceMarker;
9902
9903 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
9904 match name {
9905 "composite_connector" => Self::CompositeConnector(
9906 <CompositeConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
9907 _channel,
9908 ),
9909 ),
9910 _ => panic!("no such member protocol name for service CompositeConnectorService"),
9911 }
9912 }
9913
9914 fn member_names() -> &'static [&'static str] {
9915 &["composite_connector"]
9916 }
9917}
9918#[cfg(target_os = "fuchsia")]
9919pub struct CompositeConnectorServiceProxy(
9920 #[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
9921);
9922
9923#[cfg(target_os = "fuchsia")]
9924impl fidl::endpoints::ServiceProxy for CompositeConnectorServiceProxy {
9925 type Service = CompositeConnectorServiceMarker;
9926
9927 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
9928 Self(opener)
9929 }
9930}
9931
9932#[cfg(target_os = "fuchsia")]
9933impl CompositeConnectorServiceProxy {
9934 pub fn connect_to_composite_connector(&self) -> Result<CompositeConnectorProxy, fidl::Error> {
9935 let (proxy, server_end) = fidl::endpoints::create_proxy::<CompositeConnectorMarker>();
9936 self.connect_channel_to_composite_connector(server_end)?;
9937 Ok(proxy)
9938 }
9939
9940 pub fn connect_to_composite_connector_sync(
9943 &self,
9944 ) -> Result<CompositeConnectorSynchronousProxy, fidl::Error> {
9945 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CompositeConnectorMarker>();
9946 self.connect_channel_to_composite_connector(server_end)?;
9947 Ok(proxy)
9948 }
9949
9950 pub fn connect_channel_to_composite_connector(
9953 &self,
9954 server_end: fidl::endpoints::ServerEnd<CompositeConnectorMarker>,
9955 ) -> Result<(), fidl::Error> {
9956 self.0.open_member("composite_connector", server_end.into_channel())
9957 }
9958
9959 pub fn instance_name(&self) -> &str {
9960 self.0.instance_name()
9961 }
9962}
9963
9964#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9965pub struct DaiConnectorServiceMarker;
9966
9967#[cfg(target_os = "fuchsia")]
9968impl fidl::endpoints::ServiceMarker for DaiConnectorServiceMarker {
9969 type Proxy = DaiConnectorServiceProxy;
9970 type Request = DaiConnectorServiceRequest;
9971 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.DaiConnectorService";
9972}
9973
9974#[cfg(target_os = "fuchsia")]
9983pub enum DaiConnectorServiceRequest {
9984 DaiConnector(DaiConnectorRequestStream),
9985}
9986
9987#[cfg(target_os = "fuchsia")]
9988impl fidl::endpoints::ServiceRequest for DaiConnectorServiceRequest {
9989 type Service = DaiConnectorServiceMarker;
9990
9991 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
9992 match name {
9993 "dai_connector" => Self::DaiConnector(
9994 <DaiConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
9995 _channel,
9996 ),
9997 ),
9998 _ => panic!("no such member protocol name for service DaiConnectorService"),
9999 }
10000 }
10001
10002 fn member_names() -> &'static [&'static str] {
10003 &["dai_connector"]
10004 }
10005}
10006#[cfg(target_os = "fuchsia")]
10013pub struct DaiConnectorServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
10014
10015#[cfg(target_os = "fuchsia")]
10016impl fidl::endpoints::ServiceProxy for DaiConnectorServiceProxy {
10017 type Service = DaiConnectorServiceMarker;
10018
10019 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
10020 Self(opener)
10021 }
10022}
10023
10024#[cfg(target_os = "fuchsia")]
10025impl DaiConnectorServiceProxy {
10026 pub fn connect_to_dai_connector(&self) -> Result<DaiConnectorProxy, fidl::Error> {
10027 let (proxy, server_end) = fidl::endpoints::create_proxy::<DaiConnectorMarker>();
10028 self.connect_channel_to_dai_connector(server_end)?;
10029 Ok(proxy)
10030 }
10031
10032 pub fn connect_to_dai_connector_sync(
10035 &self,
10036 ) -> Result<DaiConnectorSynchronousProxy, fidl::Error> {
10037 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DaiConnectorMarker>();
10038 self.connect_channel_to_dai_connector(server_end)?;
10039 Ok(proxy)
10040 }
10041
10042 pub fn connect_channel_to_dai_connector(
10045 &self,
10046 server_end: fidl::endpoints::ServerEnd<DaiConnectorMarker>,
10047 ) -> Result<(), fidl::Error> {
10048 self.0.open_member("dai_connector", server_end.into_channel())
10049 }
10050
10051 pub fn instance_name(&self) -> &str {
10052 self.0.instance_name()
10053 }
10054}
10055
10056#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10057pub struct DaiServiceMarker;
10058
10059#[cfg(target_os = "fuchsia")]
10060impl fidl::endpoints::ServiceMarker for DaiServiceMarker {
10061 type Proxy = DaiServiceProxy;
10062 type Request = DaiServiceRequest;
10063 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.DaiService";
10064}
10065
10066#[cfg(target_os = "fuchsia")]
10075pub enum DaiServiceRequest {
10076 Dai(DaiRequestStream),
10077}
10078
10079#[cfg(target_os = "fuchsia")]
10080impl fidl::endpoints::ServiceRequest for DaiServiceRequest {
10081 type Service = DaiServiceMarker;
10082
10083 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
10084 match name {
10085 "dai" => Self::Dai(<DaiRequestStream as fidl::endpoints::RequestStream>::from_channel(
10086 _channel,
10087 )),
10088 _ => panic!("no such member protocol name for service DaiService"),
10089 }
10090 }
10091
10092 fn member_names() -> &'static [&'static str] {
10093 &["dai"]
10094 }
10095}
10096#[cfg(target_os = "fuchsia")]
10103pub struct DaiServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
10104
10105#[cfg(target_os = "fuchsia")]
10106impl fidl::endpoints::ServiceProxy for DaiServiceProxy {
10107 type Service = DaiServiceMarker;
10108
10109 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
10110 Self(opener)
10111 }
10112}
10113
10114#[cfg(target_os = "fuchsia")]
10115impl DaiServiceProxy {
10116 pub fn connect_to_dai(&self) -> Result<DaiProxy, fidl::Error> {
10117 let (proxy, server_end) = fidl::endpoints::create_proxy::<DaiMarker>();
10118 self.connect_channel_to_dai(server_end)?;
10119 Ok(proxy)
10120 }
10121
10122 pub fn connect_to_dai_sync(&self) -> Result<DaiSynchronousProxy, fidl::Error> {
10125 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DaiMarker>();
10126 self.connect_channel_to_dai(server_end)?;
10127 Ok(proxy)
10128 }
10129
10130 pub fn connect_channel_to_dai(
10133 &self,
10134 server_end: fidl::endpoints::ServerEnd<DaiMarker>,
10135 ) -> Result<(), fidl::Error> {
10136 self.0.open_member("dai", server_end.into_channel())
10137 }
10138
10139 pub fn instance_name(&self) -> &str {
10140 self.0.instance_name()
10141 }
10142}
10143
10144#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10145pub struct DeviceServiceMarker;
10146
10147#[cfg(target_os = "fuchsia")]
10148impl fidl::endpoints::ServiceMarker for DeviceServiceMarker {
10149 type Proxy = DeviceServiceProxy;
10150 type Request = DeviceServiceRequest;
10151 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.DeviceService";
10152}
10153
10154#[cfg(target_os = "fuchsia")]
10157pub enum DeviceServiceRequest {
10158 Device(CompositeRequestStream),
10159}
10160
10161#[cfg(target_os = "fuchsia")]
10162impl fidl::endpoints::ServiceRequest for DeviceServiceRequest {
10163 type Service = DeviceServiceMarker;
10164
10165 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
10166 match name {
10167 "device" => Self::Device(
10168 <CompositeRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
10169 ),
10170 _ => panic!("no such member protocol name for service DeviceService"),
10171 }
10172 }
10173
10174 fn member_names() -> &'static [&'static str] {
10175 &["device"]
10176 }
10177}
10178#[cfg(target_os = "fuchsia")]
10179pub struct DeviceServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
10180
10181#[cfg(target_os = "fuchsia")]
10182impl fidl::endpoints::ServiceProxy for DeviceServiceProxy {
10183 type Service = DeviceServiceMarker;
10184
10185 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
10186 Self(opener)
10187 }
10188}
10189
10190#[cfg(target_os = "fuchsia")]
10191impl DeviceServiceProxy {
10192 pub fn connect_to_device(&self) -> Result<CompositeProxy, fidl::Error> {
10193 let (proxy, server_end) = fidl::endpoints::create_proxy::<CompositeMarker>();
10194 self.connect_channel_to_device(server_end)?;
10195 Ok(proxy)
10196 }
10197
10198 pub fn connect_to_device_sync(&self) -> Result<CompositeSynchronousProxy, fidl::Error> {
10201 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CompositeMarker>();
10202 self.connect_channel_to_device(server_end)?;
10203 Ok(proxy)
10204 }
10205
10206 pub fn connect_channel_to_device(
10209 &self,
10210 server_end: fidl::endpoints::ServerEnd<CompositeMarker>,
10211 ) -> Result<(), fidl::Error> {
10212 self.0.open_member("device", server_end.into_channel())
10213 }
10214
10215 pub fn instance_name(&self) -> &str {
10216 self.0.instance_name()
10217 }
10218}
10219
10220#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10221pub struct StreamConfigConnectorInputServiceMarker;
10222
10223#[cfg(target_os = "fuchsia")]
10224impl fidl::endpoints::ServiceMarker for StreamConfigConnectorInputServiceMarker {
10225 type Proxy = StreamConfigConnectorInputServiceProxy;
10226 type Request = StreamConfigConnectorInputServiceRequest;
10227 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.StreamConfigConnectorInputService";
10228}
10229
10230#[cfg(target_os = "fuchsia")]
10233pub enum StreamConfigConnectorInputServiceRequest {
10234 StreamConfigConnector(StreamConfigConnectorRequestStream),
10235}
10236
10237#[cfg(target_os = "fuchsia")]
10238impl fidl::endpoints::ServiceRequest for StreamConfigConnectorInputServiceRequest {
10239 type Service = StreamConfigConnectorInputServiceMarker;
10240
10241 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
10242 match name {
10243 "stream_config_connector" => Self::StreamConfigConnector(
10244 <StreamConfigConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
10245 ),
10246 _ => panic!("no such member protocol name for service StreamConfigConnectorInputService"),
10247 }
10248 }
10249
10250 fn member_names() -> &'static [&'static str] {
10251 &["stream_config_connector"]
10252 }
10253}
10254#[cfg(target_os = "fuchsia")]
10255pub struct StreamConfigConnectorInputServiceProxy(
10256 #[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
10257);
10258
10259#[cfg(target_os = "fuchsia")]
10260impl fidl::endpoints::ServiceProxy for StreamConfigConnectorInputServiceProxy {
10261 type Service = StreamConfigConnectorInputServiceMarker;
10262
10263 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
10264 Self(opener)
10265 }
10266}
10267
10268#[cfg(target_os = "fuchsia")]
10269impl StreamConfigConnectorInputServiceProxy {
10270 pub fn connect_to_stream_config_connector(
10271 &self,
10272 ) -> Result<StreamConfigConnectorProxy, fidl::Error> {
10273 let (proxy, server_end) = fidl::endpoints::create_proxy::<StreamConfigConnectorMarker>();
10274 self.connect_channel_to_stream_config_connector(server_end)?;
10275 Ok(proxy)
10276 }
10277
10278 pub fn connect_to_stream_config_connector_sync(
10281 &self,
10282 ) -> Result<StreamConfigConnectorSynchronousProxy, fidl::Error> {
10283 let (proxy, server_end) =
10284 fidl::endpoints::create_sync_proxy::<StreamConfigConnectorMarker>();
10285 self.connect_channel_to_stream_config_connector(server_end)?;
10286 Ok(proxy)
10287 }
10288
10289 pub fn connect_channel_to_stream_config_connector(
10292 &self,
10293 server_end: fidl::endpoints::ServerEnd<StreamConfigConnectorMarker>,
10294 ) -> Result<(), fidl::Error> {
10295 self.0.open_member("stream_config_connector", server_end.into_channel())
10296 }
10297
10298 pub fn instance_name(&self) -> &str {
10299 self.0.instance_name()
10300 }
10301}
10302
10303#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10304pub struct StreamConfigConnectorOutputServiceMarker;
10305
10306#[cfg(target_os = "fuchsia")]
10307impl fidl::endpoints::ServiceMarker for StreamConfigConnectorOutputServiceMarker {
10308 type Proxy = StreamConfigConnectorOutputServiceProxy;
10309 type Request = StreamConfigConnectorOutputServiceRequest;
10310 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.StreamConfigConnectorOutputService";
10311}
10312
10313#[cfg(target_os = "fuchsia")]
10316pub enum StreamConfigConnectorOutputServiceRequest {
10317 StreamConfigConnector(StreamConfigConnectorRequestStream),
10318}
10319
10320#[cfg(target_os = "fuchsia")]
10321impl fidl::endpoints::ServiceRequest for StreamConfigConnectorOutputServiceRequest {
10322 type Service = StreamConfigConnectorOutputServiceMarker;
10323
10324 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
10325 match name {
10326 "stream_config_connector" => Self::StreamConfigConnector(
10327 <StreamConfigConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
10328 ),
10329 _ => panic!("no such member protocol name for service StreamConfigConnectorOutputService"),
10330 }
10331 }
10332
10333 fn member_names() -> &'static [&'static str] {
10334 &["stream_config_connector"]
10335 }
10336}
10337#[cfg(target_os = "fuchsia")]
10338pub struct StreamConfigConnectorOutputServiceProxy(
10339 #[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
10340);
10341
10342#[cfg(target_os = "fuchsia")]
10343impl fidl::endpoints::ServiceProxy for StreamConfigConnectorOutputServiceProxy {
10344 type Service = StreamConfigConnectorOutputServiceMarker;
10345
10346 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
10347 Self(opener)
10348 }
10349}
10350
10351#[cfg(target_os = "fuchsia")]
10352impl StreamConfigConnectorOutputServiceProxy {
10353 pub fn connect_to_stream_config_connector(
10354 &self,
10355 ) -> Result<StreamConfigConnectorProxy, fidl::Error> {
10356 let (proxy, server_end) = fidl::endpoints::create_proxy::<StreamConfigConnectorMarker>();
10357 self.connect_channel_to_stream_config_connector(server_end)?;
10358 Ok(proxy)
10359 }
10360
10361 pub fn connect_to_stream_config_connector_sync(
10364 &self,
10365 ) -> Result<StreamConfigConnectorSynchronousProxy, fidl::Error> {
10366 let (proxy, server_end) =
10367 fidl::endpoints::create_sync_proxy::<StreamConfigConnectorMarker>();
10368 self.connect_channel_to_stream_config_connector(server_end)?;
10369 Ok(proxy)
10370 }
10371
10372 pub fn connect_channel_to_stream_config_connector(
10375 &self,
10376 server_end: fidl::endpoints::ServerEnd<StreamConfigConnectorMarker>,
10377 ) -> Result<(), fidl::Error> {
10378 self.0.open_member("stream_config_connector", server_end.into_channel())
10379 }
10380
10381 pub fn instance_name(&self) -> &str {
10382 self.0.instance_name()
10383 }
10384}
10385
10386#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10387pub struct StreamConfigConnectorServiceMarker;
10388
10389#[cfg(target_os = "fuchsia")]
10390impl fidl::endpoints::ServiceMarker for StreamConfigConnectorServiceMarker {
10391 type Proxy = StreamConfigConnectorServiceProxy;
10392 type Request = StreamConfigConnectorServiceRequest;
10393 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.StreamConfigConnectorService";
10394}
10395
10396#[cfg(target_os = "fuchsia")]
10405pub enum StreamConfigConnectorServiceRequest {
10406 StreamConfigConnector(StreamConfigConnectorRequestStream),
10407}
10408
10409#[cfg(target_os = "fuchsia")]
10410impl fidl::endpoints::ServiceRequest for StreamConfigConnectorServiceRequest {
10411 type Service = StreamConfigConnectorServiceMarker;
10412
10413 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
10414 match name {
10415 "stream_config_connector" => Self::StreamConfigConnector(
10416 <StreamConfigConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
10417 ),
10418 _ => panic!("no such member protocol name for service StreamConfigConnectorService"),
10419 }
10420 }
10421
10422 fn member_names() -> &'static [&'static str] {
10423 &["stream_config_connector"]
10424 }
10425}
10426#[cfg(target_os = "fuchsia")]
10433pub struct StreamConfigConnectorServiceProxy(
10434 #[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
10435);
10436
10437#[cfg(target_os = "fuchsia")]
10438impl fidl::endpoints::ServiceProxy for StreamConfigConnectorServiceProxy {
10439 type Service = StreamConfigConnectorServiceMarker;
10440
10441 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
10442 Self(opener)
10443 }
10444}
10445
10446#[cfg(target_os = "fuchsia")]
10447impl StreamConfigConnectorServiceProxy {
10448 pub fn connect_to_stream_config_connector(
10449 &self,
10450 ) -> Result<StreamConfigConnectorProxy, fidl::Error> {
10451 let (proxy, server_end) = fidl::endpoints::create_proxy::<StreamConfigConnectorMarker>();
10452 self.connect_channel_to_stream_config_connector(server_end)?;
10453 Ok(proxy)
10454 }
10455
10456 pub fn connect_to_stream_config_connector_sync(
10459 &self,
10460 ) -> Result<StreamConfigConnectorSynchronousProxy, fidl::Error> {
10461 let (proxy, server_end) =
10462 fidl::endpoints::create_sync_proxy::<StreamConfigConnectorMarker>();
10463 self.connect_channel_to_stream_config_connector(server_end)?;
10464 Ok(proxy)
10465 }
10466
10467 pub fn connect_channel_to_stream_config_connector(
10470 &self,
10471 server_end: fidl::endpoints::ServerEnd<StreamConfigConnectorMarker>,
10472 ) -> Result<(), fidl::Error> {
10473 self.0.open_member("stream_config_connector", server_end.into_channel())
10474 }
10475
10476 pub fn instance_name(&self) -> &str {
10477 self.0.instance_name()
10478 }
10479}
10480
10481#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10482pub struct StreamConfigServiceMarker;
10483
10484#[cfg(target_os = "fuchsia")]
10485impl fidl::endpoints::ServiceMarker for StreamConfigServiceMarker {
10486 type Proxy = StreamConfigServiceProxy;
10487 type Request = StreamConfigServiceRequest;
10488 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.StreamConfigService";
10489}
10490
10491#[cfg(target_os = "fuchsia")]
10500pub enum StreamConfigServiceRequest {
10501 StreamConfig(StreamConfigRequestStream),
10502}
10503
10504#[cfg(target_os = "fuchsia")]
10505impl fidl::endpoints::ServiceRequest for StreamConfigServiceRequest {
10506 type Service = StreamConfigServiceMarker;
10507
10508 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
10509 match name {
10510 "stream_config" => Self::StreamConfig(
10511 <StreamConfigRequestStream as fidl::endpoints::RequestStream>::from_channel(
10512 _channel,
10513 ),
10514 ),
10515 _ => panic!("no such member protocol name for service StreamConfigService"),
10516 }
10517 }
10518
10519 fn member_names() -> &'static [&'static str] {
10520 &["stream_config"]
10521 }
10522}
10523#[cfg(target_os = "fuchsia")]
10530pub struct StreamConfigServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
10531
10532#[cfg(target_os = "fuchsia")]
10533impl fidl::endpoints::ServiceProxy for StreamConfigServiceProxy {
10534 type Service = StreamConfigServiceMarker;
10535
10536 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
10537 Self(opener)
10538 }
10539}
10540
10541#[cfg(target_os = "fuchsia")]
10542impl StreamConfigServiceProxy {
10543 pub fn connect_to_stream_config(&self) -> Result<StreamConfigProxy, fidl::Error> {
10544 let (proxy, server_end) = fidl::endpoints::create_proxy::<StreamConfigMarker>();
10545 self.connect_channel_to_stream_config(server_end)?;
10546 Ok(proxy)
10547 }
10548
10549 pub fn connect_to_stream_config_sync(
10552 &self,
10553 ) -> Result<StreamConfigSynchronousProxy, fidl::Error> {
10554 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<StreamConfigMarker>();
10555 self.connect_channel_to_stream_config(server_end)?;
10556 Ok(proxy)
10557 }
10558
10559 pub fn connect_channel_to_stream_config(
10562 &self,
10563 server_end: fidl::endpoints::ServerEnd<StreamConfigMarker>,
10564 ) -> Result<(), fidl::Error> {
10565 self.0.open_member("stream_config", server_end.into_channel())
10566 }
10567
10568 pub fn instance_name(&self) -> &str {
10569 self.0.instance_name()
10570 }
10571}
10572
10573mod internal {
10574 use super::*;
10575
10576 impl fidl::encoding::ResourceTypeMarker for CodecConnectorConnectRequest {
10577 type Borrowed<'a> = &'a mut Self;
10578 fn take_or_borrow<'a>(
10579 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10580 ) -> Self::Borrowed<'a> {
10581 value
10582 }
10583 }
10584
10585 unsafe impl fidl::encoding::TypeMarker for CodecConnectorConnectRequest {
10586 type Owned = Self;
10587
10588 #[inline(always)]
10589 fn inline_align(_context: fidl::encoding::Context) -> usize {
10590 4
10591 }
10592
10593 #[inline(always)]
10594 fn inline_size(_context: fidl::encoding::Context) -> usize {
10595 4
10596 }
10597 }
10598
10599 unsafe impl
10600 fidl::encoding::Encode<
10601 CodecConnectorConnectRequest,
10602 fidl::encoding::DefaultFuchsiaResourceDialect,
10603 > for &mut CodecConnectorConnectRequest
10604 {
10605 #[inline]
10606 unsafe fn encode(
10607 self,
10608 encoder: &mut fidl::encoding::Encoder<
10609 '_,
10610 fidl::encoding::DefaultFuchsiaResourceDialect,
10611 >,
10612 offset: usize,
10613 _depth: fidl::encoding::Depth,
10614 ) -> fidl::Result<()> {
10615 encoder.debug_check_bounds::<CodecConnectorConnectRequest>(offset);
10616 fidl::encoding::Encode::<CodecConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10618 (
10619 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CodecMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.codec_protocol),
10620 ),
10621 encoder, offset, _depth
10622 )
10623 }
10624 }
10625 unsafe impl<
10626 T0: fidl::encoding::Encode<
10627 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CodecMarker>>,
10628 fidl::encoding::DefaultFuchsiaResourceDialect,
10629 >,
10630 >
10631 fidl::encoding::Encode<
10632 CodecConnectorConnectRequest,
10633 fidl::encoding::DefaultFuchsiaResourceDialect,
10634 > for (T0,)
10635 {
10636 #[inline]
10637 unsafe fn encode(
10638 self,
10639 encoder: &mut fidl::encoding::Encoder<
10640 '_,
10641 fidl::encoding::DefaultFuchsiaResourceDialect,
10642 >,
10643 offset: usize,
10644 depth: fidl::encoding::Depth,
10645 ) -> fidl::Result<()> {
10646 encoder.debug_check_bounds::<CodecConnectorConnectRequest>(offset);
10647 self.0.encode(encoder, offset + 0, depth)?;
10651 Ok(())
10652 }
10653 }
10654
10655 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10656 for CodecConnectorConnectRequest
10657 {
10658 #[inline(always)]
10659 fn new_empty() -> Self {
10660 Self {
10661 codec_protocol: fidl::new_empty!(
10662 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CodecMarker>>,
10663 fidl::encoding::DefaultFuchsiaResourceDialect
10664 ),
10665 }
10666 }
10667
10668 #[inline]
10669 unsafe fn decode(
10670 &mut self,
10671 decoder: &mut fidl::encoding::Decoder<
10672 '_,
10673 fidl::encoding::DefaultFuchsiaResourceDialect,
10674 >,
10675 offset: usize,
10676 _depth: fidl::encoding::Depth,
10677 ) -> fidl::Result<()> {
10678 decoder.debug_check_bounds::<Self>(offset);
10679 fidl::decode!(
10681 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CodecMarker>>,
10682 fidl::encoding::DefaultFuchsiaResourceDialect,
10683 &mut self.codec_protocol,
10684 decoder,
10685 offset + 0,
10686 _depth
10687 )?;
10688 Ok(())
10689 }
10690 }
10691
10692 impl fidl::encoding::ResourceTypeMarker for CompositeConnectorConnectRequest {
10693 type Borrowed<'a> = &'a mut Self;
10694 fn take_or_borrow<'a>(
10695 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10696 ) -> Self::Borrowed<'a> {
10697 value
10698 }
10699 }
10700
10701 unsafe impl fidl::encoding::TypeMarker for CompositeConnectorConnectRequest {
10702 type Owned = Self;
10703
10704 #[inline(always)]
10705 fn inline_align(_context: fidl::encoding::Context) -> usize {
10706 4
10707 }
10708
10709 #[inline(always)]
10710 fn inline_size(_context: fidl::encoding::Context) -> usize {
10711 4
10712 }
10713 }
10714
10715 unsafe impl
10716 fidl::encoding::Encode<
10717 CompositeConnectorConnectRequest,
10718 fidl::encoding::DefaultFuchsiaResourceDialect,
10719 > for &mut CompositeConnectorConnectRequest
10720 {
10721 #[inline]
10722 unsafe fn encode(
10723 self,
10724 encoder: &mut fidl::encoding::Encoder<
10725 '_,
10726 fidl::encoding::DefaultFuchsiaResourceDialect,
10727 >,
10728 offset: usize,
10729 _depth: fidl::encoding::Depth,
10730 ) -> fidl::Result<()> {
10731 encoder.debug_check_bounds::<CompositeConnectorConnectRequest>(offset);
10732 fidl::encoding::Encode::<CompositeConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10734 (
10735 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.composite_protocol),
10736 ),
10737 encoder, offset, _depth
10738 )
10739 }
10740 }
10741 unsafe impl<
10742 T0: fidl::encoding::Encode<
10743 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeMarker>>,
10744 fidl::encoding::DefaultFuchsiaResourceDialect,
10745 >,
10746 >
10747 fidl::encoding::Encode<
10748 CompositeConnectorConnectRequest,
10749 fidl::encoding::DefaultFuchsiaResourceDialect,
10750 > for (T0,)
10751 {
10752 #[inline]
10753 unsafe fn encode(
10754 self,
10755 encoder: &mut fidl::encoding::Encoder<
10756 '_,
10757 fidl::encoding::DefaultFuchsiaResourceDialect,
10758 >,
10759 offset: usize,
10760 depth: fidl::encoding::Depth,
10761 ) -> fidl::Result<()> {
10762 encoder.debug_check_bounds::<CompositeConnectorConnectRequest>(offset);
10763 self.0.encode(encoder, offset + 0, depth)?;
10767 Ok(())
10768 }
10769 }
10770
10771 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10772 for CompositeConnectorConnectRequest
10773 {
10774 #[inline(always)]
10775 fn new_empty() -> Self {
10776 Self {
10777 composite_protocol: fidl::new_empty!(
10778 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeMarker>>,
10779 fidl::encoding::DefaultFuchsiaResourceDialect
10780 ),
10781 }
10782 }
10783
10784 #[inline]
10785 unsafe fn decode(
10786 &mut self,
10787 decoder: &mut fidl::encoding::Decoder<
10788 '_,
10789 fidl::encoding::DefaultFuchsiaResourceDialect,
10790 >,
10791 offset: usize,
10792 _depth: fidl::encoding::Depth,
10793 ) -> fidl::Result<()> {
10794 decoder.debug_check_bounds::<Self>(offset);
10795 fidl::decode!(
10797 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeMarker>>,
10798 fidl::encoding::DefaultFuchsiaResourceDialect,
10799 &mut self.composite_protocol,
10800 decoder,
10801 offset + 0,
10802 _depth
10803 )?;
10804 Ok(())
10805 }
10806 }
10807
10808 impl fidl::encoding::ResourceTypeMarker for CompositeCreateRingBufferRequest {
10809 type Borrowed<'a> = &'a mut Self;
10810 fn take_or_borrow<'a>(
10811 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10812 ) -> Self::Borrowed<'a> {
10813 value
10814 }
10815 }
10816
10817 unsafe impl fidl::encoding::TypeMarker for CompositeCreateRingBufferRequest {
10818 type Owned = Self;
10819
10820 #[inline(always)]
10821 fn inline_align(_context: fidl::encoding::Context) -> usize {
10822 8
10823 }
10824
10825 #[inline(always)]
10826 fn inline_size(_context: fidl::encoding::Context) -> usize {
10827 32
10828 }
10829 }
10830
10831 unsafe impl
10832 fidl::encoding::Encode<
10833 CompositeCreateRingBufferRequest,
10834 fidl::encoding::DefaultFuchsiaResourceDialect,
10835 > for &mut CompositeCreateRingBufferRequest
10836 {
10837 #[inline]
10838 unsafe fn encode(
10839 self,
10840 encoder: &mut fidl::encoding::Encoder<
10841 '_,
10842 fidl::encoding::DefaultFuchsiaResourceDialect,
10843 >,
10844 offset: usize,
10845 _depth: fidl::encoding::Depth,
10846 ) -> fidl::Result<()> {
10847 encoder.debug_check_bounds::<CompositeCreateRingBufferRequest>(offset);
10848 fidl::encoding::Encode::<CompositeCreateRingBufferRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10850 (
10851 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.processing_element_id),
10852 <Format as fidl::encoding::ValueTypeMarker>::borrow(&self.format),
10853 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.ring_buffer),
10854 ),
10855 encoder, offset, _depth
10856 )
10857 }
10858 }
10859 unsafe impl<
10860 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10861 T1: fidl::encoding::Encode<Format, fidl::encoding::DefaultFuchsiaResourceDialect>,
10862 T2: fidl::encoding::Encode<
10863 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
10864 fidl::encoding::DefaultFuchsiaResourceDialect,
10865 >,
10866 >
10867 fidl::encoding::Encode<
10868 CompositeCreateRingBufferRequest,
10869 fidl::encoding::DefaultFuchsiaResourceDialect,
10870 > for (T0, T1, T2)
10871 {
10872 #[inline]
10873 unsafe fn encode(
10874 self,
10875 encoder: &mut fidl::encoding::Encoder<
10876 '_,
10877 fidl::encoding::DefaultFuchsiaResourceDialect,
10878 >,
10879 offset: usize,
10880 depth: fidl::encoding::Depth,
10881 ) -> fidl::Result<()> {
10882 encoder.debug_check_bounds::<CompositeCreateRingBufferRequest>(offset);
10883 unsafe {
10886 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10887 (ptr as *mut u64).write_unaligned(0);
10888 }
10889 self.0.encode(encoder, offset + 0, depth)?;
10891 self.1.encode(encoder, offset + 8, depth)?;
10892 self.2.encode(encoder, offset + 24, depth)?;
10893 Ok(())
10894 }
10895 }
10896
10897 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10898 for CompositeCreateRingBufferRequest
10899 {
10900 #[inline(always)]
10901 fn new_empty() -> Self {
10902 Self {
10903 processing_element_id: fidl::new_empty!(
10904 u64,
10905 fidl::encoding::DefaultFuchsiaResourceDialect
10906 ),
10907 format: fidl::new_empty!(Format, fidl::encoding::DefaultFuchsiaResourceDialect),
10908 ring_buffer: fidl::new_empty!(
10909 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
10910 fidl::encoding::DefaultFuchsiaResourceDialect
10911 ),
10912 }
10913 }
10914
10915 #[inline]
10916 unsafe fn decode(
10917 &mut self,
10918 decoder: &mut fidl::encoding::Decoder<
10919 '_,
10920 fidl::encoding::DefaultFuchsiaResourceDialect,
10921 >,
10922 offset: usize,
10923 _depth: fidl::encoding::Depth,
10924 ) -> fidl::Result<()> {
10925 decoder.debug_check_bounds::<Self>(offset);
10926 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10928 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10929 let mask = 0xffffffff00000000u64;
10930 let maskedval = padval & mask;
10931 if maskedval != 0 {
10932 return Err(fidl::Error::NonZeroPadding {
10933 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10934 });
10935 }
10936 fidl::decode!(
10937 u64,
10938 fidl::encoding::DefaultFuchsiaResourceDialect,
10939 &mut self.processing_element_id,
10940 decoder,
10941 offset + 0,
10942 _depth
10943 )?;
10944 fidl::decode!(
10945 Format,
10946 fidl::encoding::DefaultFuchsiaResourceDialect,
10947 &mut self.format,
10948 decoder,
10949 offset + 8,
10950 _depth
10951 )?;
10952 fidl::decode!(
10953 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
10954 fidl::encoding::DefaultFuchsiaResourceDialect,
10955 &mut self.ring_buffer,
10956 decoder,
10957 offset + 24,
10958 _depth
10959 )?;
10960 Ok(())
10961 }
10962 }
10963
10964 impl fidl::encoding::ResourceTypeMarker for DaiConnectorConnectRequest {
10965 type Borrowed<'a> = &'a mut Self;
10966 fn take_or_borrow<'a>(
10967 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10968 ) -> Self::Borrowed<'a> {
10969 value
10970 }
10971 }
10972
10973 unsafe impl fidl::encoding::TypeMarker for DaiConnectorConnectRequest {
10974 type Owned = Self;
10975
10976 #[inline(always)]
10977 fn inline_align(_context: fidl::encoding::Context) -> usize {
10978 4
10979 }
10980
10981 #[inline(always)]
10982 fn inline_size(_context: fidl::encoding::Context) -> usize {
10983 4
10984 }
10985 }
10986
10987 unsafe impl
10988 fidl::encoding::Encode<
10989 DaiConnectorConnectRequest,
10990 fidl::encoding::DefaultFuchsiaResourceDialect,
10991 > for &mut DaiConnectorConnectRequest
10992 {
10993 #[inline]
10994 unsafe fn encode(
10995 self,
10996 encoder: &mut fidl::encoding::Encoder<
10997 '_,
10998 fidl::encoding::DefaultFuchsiaResourceDialect,
10999 >,
11000 offset: usize,
11001 _depth: fidl::encoding::Depth,
11002 ) -> fidl::Result<()> {
11003 encoder.debug_check_bounds::<DaiConnectorConnectRequest>(offset);
11004 fidl::encoding::Encode::<DaiConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11006 (
11007 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DaiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dai_protocol),
11008 ),
11009 encoder, offset, _depth
11010 )
11011 }
11012 }
11013 unsafe impl<
11014 T0: fidl::encoding::Encode<
11015 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DaiMarker>>,
11016 fidl::encoding::DefaultFuchsiaResourceDialect,
11017 >,
11018 >
11019 fidl::encoding::Encode<
11020 DaiConnectorConnectRequest,
11021 fidl::encoding::DefaultFuchsiaResourceDialect,
11022 > for (T0,)
11023 {
11024 #[inline]
11025 unsafe fn encode(
11026 self,
11027 encoder: &mut fidl::encoding::Encoder<
11028 '_,
11029 fidl::encoding::DefaultFuchsiaResourceDialect,
11030 >,
11031 offset: usize,
11032 depth: fidl::encoding::Depth,
11033 ) -> fidl::Result<()> {
11034 encoder.debug_check_bounds::<DaiConnectorConnectRequest>(offset);
11035 self.0.encode(encoder, offset + 0, depth)?;
11039 Ok(())
11040 }
11041 }
11042
11043 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11044 for DaiConnectorConnectRequest
11045 {
11046 #[inline(always)]
11047 fn new_empty() -> Self {
11048 Self {
11049 dai_protocol: fidl::new_empty!(
11050 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DaiMarker>>,
11051 fidl::encoding::DefaultFuchsiaResourceDialect
11052 ),
11053 }
11054 }
11055
11056 #[inline]
11057 unsafe fn decode(
11058 &mut self,
11059 decoder: &mut fidl::encoding::Decoder<
11060 '_,
11061 fidl::encoding::DefaultFuchsiaResourceDialect,
11062 >,
11063 offset: usize,
11064 _depth: fidl::encoding::Depth,
11065 ) -> fidl::Result<()> {
11066 decoder.debug_check_bounds::<Self>(offset);
11067 fidl::decode!(
11069 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DaiMarker>>,
11070 fidl::encoding::DefaultFuchsiaResourceDialect,
11071 &mut self.dai_protocol,
11072 decoder,
11073 offset + 0,
11074 _depth
11075 )?;
11076 Ok(())
11077 }
11078 }
11079
11080 impl fidl::encoding::ResourceTypeMarker for DaiCreateRingBufferRequest {
11081 type Borrowed<'a> = &'a mut Self;
11082 fn take_or_borrow<'a>(
11083 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11084 ) -> Self::Borrowed<'a> {
11085 value
11086 }
11087 }
11088
11089 unsafe impl fidl::encoding::TypeMarker for DaiCreateRingBufferRequest {
11090 type Owned = Self;
11091
11092 #[inline(always)]
11093 fn inline_align(_context: fidl::encoding::Context) -> usize {
11094 8
11095 }
11096
11097 #[inline(always)]
11098 fn inline_size(_context: fidl::encoding::Context) -> usize {
11099 72
11100 }
11101 }
11102
11103 unsafe impl
11104 fidl::encoding::Encode<
11105 DaiCreateRingBufferRequest,
11106 fidl::encoding::DefaultFuchsiaResourceDialect,
11107 > for &mut DaiCreateRingBufferRequest
11108 {
11109 #[inline]
11110 unsafe fn encode(
11111 self,
11112 encoder: &mut fidl::encoding::Encoder<
11113 '_,
11114 fidl::encoding::DefaultFuchsiaResourceDialect,
11115 >,
11116 offset: usize,
11117 _depth: fidl::encoding::Depth,
11118 ) -> fidl::Result<()> {
11119 encoder.debug_check_bounds::<DaiCreateRingBufferRequest>(offset);
11120 fidl::encoding::Encode::<DaiCreateRingBufferRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11122 (
11123 <DaiFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.dai_format),
11124 <Format as fidl::encoding::ValueTypeMarker>::borrow(&self.ring_buffer_format),
11125 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.ring_buffer),
11126 ),
11127 encoder, offset, _depth
11128 )
11129 }
11130 }
11131 unsafe impl<
11132 T0: fidl::encoding::Encode<DaiFormat, fidl::encoding::DefaultFuchsiaResourceDialect>,
11133 T1: fidl::encoding::Encode<Format, fidl::encoding::DefaultFuchsiaResourceDialect>,
11134 T2: fidl::encoding::Encode<
11135 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
11136 fidl::encoding::DefaultFuchsiaResourceDialect,
11137 >,
11138 >
11139 fidl::encoding::Encode<
11140 DaiCreateRingBufferRequest,
11141 fidl::encoding::DefaultFuchsiaResourceDialect,
11142 > for (T0, T1, T2)
11143 {
11144 #[inline]
11145 unsafe fn encode(
11146 self,
11147 encoder: &mut fidl::encoding::Encoder<
11148 '_,
11149 fidl::encoding::DefaultFuchsiaResourceDialect,
11150 >,
11151 offset: usize,
11152 depth: fidl::encoding::Depth,
11153 ) -> fidl::Result<()> {
11154 encoder.debug_check_bounds::<DaiCreateRingBufferRequest>(offset);
11155 unsafe {
11158 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
11159 (ptr as *mut u64).write_unaligned(0);
11160 }
11161 self.0.encode(encoder, offset + 0, depth)?;
11163 self.1.encode(encoder, offset + 48, depth)?;
11164 self.2.encode(encoder, offset + 64, depth)?;
11165 Ok(())
11166 }
11167 }
11168
11169 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11170 for DaiCreateRingBufferRequest
11171 {
11172 #[inline(always)]
11173 fn new_empty() -> Self {
11174 Self {
11175 dai_format: fidl::new_empty!(
11176 DaiFormat,
11177 fidl::encoding::DefaultFuchsiaResourceDialect
11178 ),
11179 ring_buffer_format: fidl::new_empty!(
11180 Format,
11181 fidl::encoding::DefaultFuchsiaResourceDialect
11182 ),
11183 ring_buffer: fidl::new_empty!(
11184 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
11185 fidl::encoding::DefaultFuchsiaResourceDialect
11186 ),
11187 }
11188 }
11189
11190 #[inline]
11191 unsafe fn decode(
11192 &mut self,
11193 decoder: &mut fidl::encoding::Decoder<
11194 '_,
11195 fidl::encoding::DefaultFuchsiaResourceDialect,
11196 >,
11197 offset: usize,
11198 _depth: fidl::encoding::Depth,
11199 ) -> fidl::Result<()> {
11200 decoder.debug_check_bounds::<Self>(offset);
11201 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
11203 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11204 let mask = 0xffffffff00000000u64;
11205 let maskedval = padval & mask;
11206 if maskedval != 0 {
11207 return Err(fidl::Error::NonZeroPadding {
11208 padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
11209 });
11210 }
11211 fidl::decode!(
11212 DaiFormat,
11213 fidl::encoding::DefaultFuchsiaResourceDialect,
11214 &mut self.dai_format,
11215 decoder,
11216 offset + 0,
11217 _depth
11218 )?;
11219 fidl::decode!(
11220 Format,
11221 fidl::encoding::DefaultFuchsiaResourceDialect,
11222 &mut self.ring_buffer_format,
11223 decoder,
11224 offset + 48,
11225 _depth
11226 )?;
11227 fidl::decode!(
11228 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
11229 fidl::encoding::DefaultFuchsiaResourceDialect,
11230 &mut self.ring_buffer,
11231 decoder,
11232 offset + 64,
11233 _depth
11234 )?;
11235 Ok(())
11236 }
11237 }
11238
11239 impl fidl::encoding::ResourceTypeMarker for RingBufferGetVmoResponse {
11240 type Borrowed<'a> = &'a mut Self;
11241 fn take_or_borrow<'a>(
11242 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11243 ) -> Self::Borrowed<'a> {
11244 value
11245 }
11246 }
11247
11248 unsafe impl fidl::encoding::TypeMarker for RingBufferGetVmoResponse {
11249 type Owned = Self;
11250
11251 #[inline(always)]
11252 fn inline_align(_context: fidl::encoding::Context) -> usize {
11253 4
11254 }
11255
11256 #[inline(always)]
11257 fn inline_size(_context: fidl::encoding::Context) -> usize {
11258 8
11259 }
11260 }
11261
11262 unsafe impl
11263 fidl::encoding::Encode<
11264 RingBufferGetVmoResponse,
11265 fidl::encoding::DefaultFuchsiaResourceDialect,
11266 > for &mut RingBufferGetVmoResponse
11267 {
11268 #[inline]
11269 unsafe fn encode(
11270 self,
11271 encoder: &mut fidl::encoding::Encoder<
11272 '_,
11273 fidl::encoding::DefaultFuchsiaResourceDialect,
11274 >,
11275 offset: usize,
11276 _depth: fidl::encoding::Depth,
11277 ) -> fidl::Result<()> {
11278 encoder.debug_check_bounds::<RingBufferGetVmoResponse>(offset);
11279 fidl::encoding::Encode::<
11281 RingBufferGetVmoResponse,
11282 fidl::encoding::DefaultFuchsiaResourceDialect,
11283 >::encode(
11284 (
11285 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.num_frames),
11286 <fidl::encoding::HandleType<
11287 fidl::Vmo,
11288 { fidl::ObjectType::VMO.into_raw() },
11289 2147483648,
11290 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11291 &mut self.ring_buffer
11292 ),
11293 ),
11294 encoder,
11295 offset,
11296 _depth,
11297 )
11298 }
11299 }
11300 unsafe impl<
11301 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
11302 T1: fidl::encoding::Encode<
11303 fidl::encoding::HandleType<
11304 fidl::Vmo,
11305 { fidl::ObjectType::VMO.into_raw() },
11306 2147483648,
11307 >,
11308 fidl::encoding::DefaultFuchsiaResourceDialect,
11309 >,
11310 >
11311 fidl::encoding::Encode<
11312 RingBufferGetVmoResponse,
11313 fidl::encoding::DefaultFuchsiaResourceDialect,
11314 > for (T0, T1)
11315 {
11316 #[inline]
11317 unsafe fn encode(
11318 self,
11319 encoder: &mut fidl::encoding::Encoder<
11320 '_,
11321 fidl::encoding::DefaultFuchsiaResourceDialect,
11322 >,
11323 offset: usize,
11324 depth: fidl::encoding::Depth,
11325 ) -> fidl::Result<()> {
11326 encoder.debug_check_bounds::<RingBufferGetVmoResponse>(offset);
11327 self.0.encode(encoder, offset + 0, depth)?;
11331 self.1.encode(encoder, offset + 4, depth)?;
11332 Ok(())
11333 }
11334 }
11335
11336 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11337 for RingBufferGetVmoResponse
11338 {
11339 #[inline(always)]
11340 fn new_empty() -> Self {
11341 Self {
11342 num_frames: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
11343 ring_buffer: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11344 }
11345 }
11346
11347 #[inline]
11348 unsafe fn decode(
11349 &mut self,
11350 decoder: &mut fidl::encoding::Decoder<
11351 '_,
11352 fidl::encoding::DefaultFuchsiaResourceDialect,
11353 >,
11354 offset: usize,
11355 _depth: fidl::encoding::Depth,
11356 ) -> fidl::Result<()> {
11357 decoder.debug_check_bounds::<Self>(offset);
11358 fidl::decode!(
11360 u32,
11361 fidl::encoding::DefaultFuchsiaResourceDialect,
11362 &mut self.num_frames,
11363 decoder,
11364 offset + 0,
11365 _depth
11366 )?;
11367 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.ring_buffer, decoder, offset + 4, _depth)?;
11368 Ok(())
11369 }
11370 }
11371
11372 impl fidl::encoding::ResourceTypeMarker for StreamConfigConnectorConnectRequest {
11373 type Borrowed<'a> = &'a mut Self;
11374 fn take_or_borrow<'a>(
11375 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11376 ) -> Self::Borrowed<'a> {
11377 value
11378 }
11379 }
11380
11381 unsafe impl fidl::encoding::TypeMarker for StreamConfigConnectorConnectRequest {
11382 type Owned = Self;
11383
11384 #[inline(always)]
11385 fn inline_align(_context: fidl::encoding::Context) -> usize {
11386 4
11387 }
11388
11389 #[inline(always)]
11390 fn inline_size(_context: fidl::encoding::Context) -> usize {
11391 4
11392 }
11393 }
11394
11395 unsafe impl
11396 fidl::encoding::Encode<
11397 StreamConfigConnectorConnectRequest,
11398 fidl::encoding::DefaultFuchsiaResourceDialect,
11399 > for &mut StreamConfigConnectorConnectRequest
11400 {
11401 #[inline]
11402 unsafe fn encode(
11403 self,
11404 encoder: &mut fidl::encoding::Encoder<
11405 '_,
11406 fidl::encoding::DefaultFuchsiaResourceDialect,
11407 >,
11408 offset: usize,
11409 _depth: fidl::encoding::Depth,
11410 ) -> fidl::Result<()> {
11411 encoder.debug_check_bounds::<StreamConfigConnectorConnectRequest>(offset);
11412 fidl::encoding::Encode::<StreamConfigConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11414 (
11415 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StreamConfigMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.protocol),
11416 ),
11417 encoder, offset, _depth
11418 )
11419 }
11420 }
11421 unsafe impl<
11422 T0: fidl::encoding::Encode<
11423 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StreamConfigMarker>>,
11424 fidl::encoding::DefaultFuchsiaResourceDialect,
11425 >,
11426 >
11427 fidl::encoding::Encode<
11428 StreamConfigConnectorConnectRequest,
11429 fidl::encoding::DefaultFuchsiaResourceDialect,
11430 > for (T0,)
11431 {
11432 #[inline]
11433 unsafe fn encode(
11434 self,
11435 encoder: &mut fidl::encoding::Encoder<
11436 '_,
11437 fidl::encoding::DefaultFuchsiaResourceDialect,
11438 >,
11439 offset: usize,
11440 depth: fidl::encoding::Depth,
11441 ) -> fidl::Result<()> {
11442 encoder.debug_check_bounds::<StreamConfigConnectorConnectRequest>(offset);
11443 self.0.encode(encoder, offset + 0, depth)?;
11447 Ok(())
11448 }
11449 }
11450
11451 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11452 for StreamConfigConnectorConnectRequest
11453 {
11454 #[inline(always)]
11455 fn new_empty() -> Self {
11456 Self {
11457 protocol: fidl::new_empty!(
11458 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StreamConfigMarker>>,
11459 fidl::encoding::DefaultFuchsiaResourceDialect
11460 ),
11461 }
11462 }
11463
11464 #[inline]
11465 unsafe fn decode(
11466 &mut self,
11467 decoder: &mut fidl::encoding::Decoder<
11468 '_,
11469 fidl::encoding::DefaultFuchsiaResourceDialect,
11470 >,
11471 offset: usize,
11472 _depth: fidl::encoding::Depth,
11473 ) -> fidl::Result<()> {
11474 decoder.debug_check_bounds::<Self>(offset);
11475 fidl::decode!(
11477 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StreamConfigMarker>>,
11478 fidl::encoding::DefaultFuchsiaResourceDialect,
11479 &mut self.protocol,
11480 decoder,
11481 offset + 0,
11482 _depth
11483 )?;
11484 Ok(())
11485 }
11486 }
11487
11488 impl fidl::encoding::ResourceTypeMarker for StreamConfigCreateRingBufferRequest {
11489 type Borrowed<'a> = &'a mut Self;
11490 fn take_or_borrow<'a>(
11491 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11492 ) -> Self::Borrowed<'a> {
11493 value
11494 }
11495 }
11496
11497 unsafe impl fidl::encoding::TypeMarker for StreamConfigCreateRingBufferRequest {
11498 type Owned = Self;
11499
11500 #[inline(always)]
11501 fn inline_align(_context: fidl::encoding::Context) -> usize {
11502 8
11503 }
11504
11505 #[inline(always)]
11506 fn inline_size(_context: fidl::encoding::Context) -> usize {
11507 24
11508 }
11509 }
11510
11511 unsafe impl
11512 fidl::encoding::Encode<
11513 StreamConfigCreateRingBufferRequest,
11514 fidl::encoding::DefaultFuchsiaResourceDialect,
11515 > for &mut StreamConfigCreateRingBufferRequest
11516 {
11517 #[inline]
11518 unsafe fn encode(
11519 self,
11520 encoder: &mut fidl::encoding::Encoder<
11521 '_,
11522 fidl::encoding::DefaultFuchsiaResourceDialect,
11523 >,
11524 offset: usize,
11525 _depth: fidl::encoding::Depth,
11526 ) -> fidl::Result<()> {
11527 encoder.debug_check_bounds::<StreamConfigCreateRingBufferRequest>(offset);
11528 fidl::encoding::Encode::<StreamConfigCreateRingBufferRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11530 (
11531 <Format as fidl::encoding::ValueTypeMarker>::borrow(&self.format),
11532 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.ring_buffer),
11533 ),
11534 encoder, offset, _depth
11535 )
11536 }
11537 }
11538 unsafe impl<
11539 T0: fidl::encoding::Encode<Format, fidl::encoding::DefaultFuchsiaResourceDialect>,
11540 T1: fidl::encoding::Encode<
11541 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
11542 fidl::encoding::DefaultFuchsiaResourceDialect,
11543 >,
11544 >
11545 fidl::encoding::Encode<
11546 StreamConfigCreateRingBufferRequest,
11547 fidl::encoding::DefaultFuchsiaResourceDialect,
11548 > for (T0, T1)
11549 {
11550 #[inline]
11551 unsafe fn encode(
11552 self,
11553 encoder: &mut fidl::encoding::Encoder<
11554 '_,
11555 fidl::encoding::DefaultFuchsiaResourceDialect,
11556 >,
11557 offset: usize,
11558 depth: fidl::encoding::Depth,
11559 ) -> fidl::Result<()> {
11560 encoder.debug_check_bounds::<StreamConfigCreateRingBufferRequest>(offset);
11561 unsafe {
11564 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11565 (ptr as *mut u64).write_unaligned(0);
11566 }
11567 self.0.encode(encoder, offset + 0, depth)?;
11569 self.1.encode(encoder, offset + 16, depth)?;
11570 Ok(())
11571 }
11572 }
11573
11574 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11575 for StreamConfigCreateRingBufferRequest
11576 {
11577 #[inline(always)]
11578 fn new_empty() -> Self {
11579 Self {
11580 format: fidl::new_empty!(Format, fidl::encoding::DefaultFuchsiaResourceDialect),
11581 ring_buffer: fidl::new_empty!(
11582 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
11583 fidl::encoding::DefaultFuchsiaResourceDialect
11584 ),
11585 }
11586 }
11587
11588 #[inline]
11589 unsafe fn decode(
11590 &mut self,
11591 decoder: &mut fidl::encoding::Decoder<
11592 '_,
11593 fidl::encoding::DefaultFuchsiaResourceDialect,
11594 >,
11595 offset: usize,
11596 _depth: fidl::encoding::Depth,
11597 ) -> fidl::Result<()> {
11598 decoder.debug_check_bounds::<Self>(offset);
11599 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11601 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11602 let mask = 0xffffffff00000000u64;
11603 let maskedval = padval & mask;
11604 if maskedval != 0 {
11605 return Err(fidl::Error::NonZeroPadding {
11606 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11607 });
11608 }
11609 fidl::decode!(
11610 Format,
11611 fidl::encoding::DefaultFuchsiaResourceDialect,
11612 &mut self.format,
11613 decoder,
11614 offset + 0,
11615 _depth
11616 )?;
11617 fidl::decode!(
11618 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
11619 fidl::encoding::DefaultFuchsiaResourceDialect,
11620 &mut self.ring_buffer,
11621 decoder,
11622 offset + 16,
11623 _depth
11624 )?;
11625 Ok(())
11626 }
11627 }
11628}