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_signalprocessing__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ConnectorSignalProcessingConnectRequest {
16 pub protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for ConnectorSignalProcessingConnectRequest
21{
22}
23
24#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
25pub struct ConnectorMarker;
26
27impl fidl::endpoints::ProtocolMarker for ConnectorMarker {
28 type Proxy = ConnectorProxy;
29 type RequestStream = ConnectorRequestStream;
30 #[cfg(target_os = "fuchsia")]
31 type SynchronousProxy = ConnectorSynchronousProxy;
32
33 const DEBUG_NAME: &'static str = "(anonymous) Connector";
34}
35
36pub trait ConnectorProxyInterface: Send + Sync {
37 fn r#signal_processing_connect(
38 &self,
39 protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
40 ) -> Result<(), fidl::Error>;
41}
42#[derive(Debug)]
43#[cfg(target_os = "fuchsia")]
44pub struct ConnectorSynchronousProxy {
45 client: fidl::client::sync::Client,
46}
47
48#[cfg(target_os = "fuchsia")]
49impl fidl::endpoints::SynchronousProxy for ConnectorSynchronousProxy {
50 type Proxy = ConnectorProxy;
51 type Protocol = ConnectorMarker;
52
53 fn from_channel(inner: fidl::Channel) -> Self {
54 Self::new(inner)
55 }
56
57 fn into_channel(self) -> fidl::Channel {
58 self.client.into_channel()
59 }
60
61 fn as_channel(&self) -> &fidl::Channel {
62 self.client.as_channel()
63 }
64}
65
66#[cfg(target_os = "fuchsia")]
67impl ConnectorSynchronousProxy {
68 pub fn new(channel: fidl::Channel) -> Self {
69 let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
70 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
71 }
72
73 pub fn into_channel(self) -> fidl::Channel {
74 self.client.into_channel()
75 }
76
77 pub fn wait_for_event(
80 &self,
81 deadline: zx::MonotonicInstant,
82 ) -> Result<ConnectorEvent, fidl::Error> {
83 ConnectorEvent::decode(self.client.wait_for_event(deadline)?)
84 }
85
86 pub fn r#signal_processing_connect(
98 &self,
99 mut protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
100 ) -> Result<(), fidl::Error> {
101 self.client.send::<ConnectorSignalProcessingConnectRequest>(
102 (protocol,),
103 0xa81907ce6066295,
104 fidl::encoding::DynamicFlags::empty(),
105 )
106 }
107}
108
109#[cfg(target_os = "fuchsia")]
110impl From<ConnectorSynchronousProxy> for zx::NullableHandle {
111 fn from(value: ConnectorSynchronousProxy) -> Self {
112 value.into_channel().into()
113 }
114}
115
116#[cfg(target_os = "fuchsia")]
117impl From<fidl::Channel> for ConnectorSynchronousProxy {
118 fn from(value: fidl::Channel) -> Self {
119 Self::new(value)
120 }
121}
122
123#[cfg(target_os = "fuchsia")]
124impl fidl::endpoints::FromClient for ConnectorSynchronousProxy {
125 type Protocol = ConnectorMarker;
126
127 fn from_client(value: fidl::endpoints::ClientEnd<ConnectorMarker>) -> Self {
128 Self::new(value.into_channel())
129 }
130}
131
132#[derive(Debug, Clone)]
133pub struct ConnectorProxy {
134 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
135}
136
137impl fidl::endpoints::Proxy for ConnectorProxy {
138 type Protocol = ConnectorMarker;
139
140 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
141 Self::new(inner)
142 }
143
144 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
145 self.client.into_channel().map_err(|client| Self { client })
146 }
147
148 fn as_channel(&self) -> &::fidl::AsyncChannel {
149 self.client.as_channel()
150 }
151}
152
153impl ConnectorProxy {
154 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
156 let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
157 Self { client: fidl::client::Client::new(channel, protocol_name) }
158 }
159
160 pub fn take_event_stream(&self) -> ConnectorEventStream {
166 ConnectorEventStream { event_receiver: self.client.take_event_receiver() }
167 }
168
169 pub fn r#signal_processing_connect(
181 &self,
182 mut protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
183 ) -> Result<(), fidl::Error> {
184 ConnectorProxyInterface::r#signal_processing_connect(self, protocol)
185 }
186}
187
188impl ConnectorProxyInterface for ConnectorProxy {
189 fn r#signal_processing_connect(
190 &self,
191 mut protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
192 ) -> Result<(), fidl::Error> {
193 self.client.send::<ConnectorSignalProcessingConnectRequest>(
194 (protocol,),
195 0xa81907ce6066295,
196 fidl::encoding::DynamicFlags::empty(),
197 )
198 }
199}
200
201pub struct ConnectorEventStream {
202 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
203}
204
205impl std::marker::Unpin for ConnectorEventStream {}
206
207impl futures::stream::FusedStream for ConnectorEventStream {
208 fn is_terminated(&self) -> bool {
209 self.event_receiver.is_terminated()
210 }
211}
212
213impl futures::Stream for ConnectorEventStream {
214 type Item = Result<ConnectorEvent, fidl::Error>;
215
216 fn poll_next(
217 mut self: std::pin::Pin<&mut Self>,
218 cx: &mut std::task::Context<'_>,
219 ) -> std::task::Poll<Option<Self::Item>> {
220 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
221 &mut self.event_receiver,
222 cx
223 )?) {
224 Some(buf) => std::task::Poll::Ready(Some(ConnectorEvent::decode(buf))),
225 None => std::task::Poll::Ready(None),
226 }
227 }
228}
229
230#[derive(Debug)]
231pub enum ConnectorEvent {}
232
233impl ConnectorEvent {
234 fn decode(
236 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
237 ) -> Result<ConnectorEvent, fidl::Error> {
238 let (bytes, _handles) = buf.split_mut();
239 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
240 debug_assert_eq!(tx_header.tx_id, 0);
241 match tx_header.ordinal {
242 _ => Err(fidl::Error::UnknownOrdinal {
243 ordinal: tx_header.ordinal,
244 protocol_name: <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
245 }),
246 }
247 }
248}
249
250pub struct ConnectorRequestStream {
252 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
253 is_terminated: bool,
254}
255
256impl std::marker::Unpin for ConnectorRequestStream {}
257
258impl futures::stream::FusedStream for ConnectorRequestStream {
259 fn is_terminated(&self) -> bool {
260 self.is_terminated
261 }
262}
263
264impl fidl::endpoints::RequestStream for ConnectorRequestStream {
265 type Protocol = ConnectorMarker;
266 type ControlHandle = ConnectorControlHandle;
267
268 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
269 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
270 }
271
272 fn control_handle(&self) -> Self::ControlHandle {
273 ConnectorControlHandle { inner: self.inner.clone() }
274 }
275
276 fn into_inner(
277 self,
278 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
279 {
280 (self.inner, self.is_terminated)
281 }
282
283 fn from_inner(
284 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
285 is_terminated: bool,
286 ) -> Self {
287 Self { inner, is_terminated }
288 }
289}
290
291impl futures::Stream for ConnectorRequestStream {
292 type Item = Result<ConnectorRequest, fidl::Error>;
293
294 fn poll_next(
295 mut self: std::pin::Pin<&mut Self>,
296 cx: &mut std::task::Context<'_>,
297 ) -> std::task::Poll<Option<Self::Item>> {
298 let this = &mut *self;
299 if this.inner.check_shutdown(cx) {
300 this.is_terminated = true;
301 return std::task::Poll::Ready(None);
302 }
303 if this.is_terminated {
304 panic!("polled ConnectorRequestStream after completion");
305 }
306 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
307 |bytes, handles| {
308 match this.inner.channel().read_etc(cx, bytes, handles) {
309 std::task::Poll::Ready(Ok(())) => {}
310 std::task::Poll::Pending => return std::task::Poll::Pending,
311 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
312 this.is_terminated = true;
313 return std::task::Poll::Ready(None);
314 }
315 std::task::Poll::Ready(Err(e)) => {
316 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
317 e.into(),
318 ))));
319 }
320 }
321
322 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
324
325 std::task::Poll::Ready(Some(match header.ordinal {
326 0xa81907ce6066295 => {
327 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
328 let mut req = fidl::new_empty!(
329 ConnectorSignalProcessingConnectRequest,
330 fidl::encoding::DefaultFuchsiaResourceDialect
331 );
332 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
333 let control_handle = ConnectorControlHandle { inner: this.inner.clone() };
334 Ok(ConnectorRequest::SignalProcessingConnect {
335 protocol: req.protocol,
336
337 control_handle,
338 })
339 }
340 _ => Err(fidl::Error::UnknownOrdinal {
341 ordinal: header.ordinal,
342 protocol_name:
343 <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
344 }),
345 }))
346 },
347 )
348 }
349}
350
351#[derive(Debug)]
354pub enum ConnectorRequest {
355 SignalProcessingConnect {
367 protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
368 control_handle: ConnectorControlHandle,
369 },
370}
371
372impl ConnectorRequest {
373 #[allow(irrefutable_let_patterns)]
374 pub fn into_signal_processing_connect(
375 self,
376 ) -> Option<(fidl::endpoints::ServerEnd<SignalProcessingMarker>, ConnectorControlHandle)> {
377 if let ConnectorRequest::SignalProcessingConnect { protocol, control_handle } = self {
378 Some((protocol, control_handle))
379 } else {
380 None
381 }
382 }
383
384 pub fn method_name(&self) -> &'static str {
386 match *self {
387 ConnectorRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
388 }
389 }
390}
391
392#[derive(Debug, Clone)]
393pub struct ConnectorControlHandle {
394 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
395}
396
397impl fidl::endpoints::ControlHandle for ConnectorControlHandle {
398 fn shutdown(&self) {
399 self.inner.shutdown()
400 }
401
402 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
403 self.inner.shutdown_with_epitaph(status)
404 }
405
406 fn is_closed(&self) -> bool {
407 self.inner.channel().is_closed()
408 }
409 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
410 self.inner.channel().on_closed()
411 }
412
413 #[cfg(target_os = "fuchsia")]
414 fn signal_peer(
415 &self,
416 clear_mask: zx::Signals,
417 set_mask: zx::Signals,
418 ) -> Result<(), zx_status::Status> {
419 use fidl::Peered;
420 self.inner.channel().signal_peer(clear_mask, set_mask)
421 }
422}
423
424impl ConnectorControlHandle {}
425
426#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
427pub struct ReaderMarker;
428
429impl fidl::endpoints::ProtocolMarker for ReaderMarker {
430 type Proxy = ReaderProxy;
431 type RequestStream = ReaderRequestStream;
432 #[cfg(target_os = "fuchsia")]
433 type SynchronousProxy = ReaderSynchronousProxy;
434
435 const DEBUG_NAME: &'static str = "(anonymous) Reader";
436}
437pub type ReaderGetElementsResult = Result<Vec<Element>, i32>;
438pub type ReaderGetTopologiesResult = Result<Vec<Topology>, i32>;
439
440pub trait ReaderProxyInterface: Send + Sync {
441 type GetElementsResponseFut: std::future::Future<Output = Result<ReaderGetElementsResult, fidl::Error>>
442 + Send;
443 fn r#get_elements(&self) -> Self::GetElementsResponseFut;
444 type WatchElementStateResponseFut: std::future::Future<Output = Result<ElementState, fidl::Error>>
445 + Send;
446 fn r#watch_element_state(
447 &self,
448 processing_element_id: u64,
449 ) -> Self::WatchElementStateResponseFut;
450 type GetTopologiesResponseFut: std::future::Future<Output = Result<ReaderGetTopologiesResult, fidl::Error>>
451 + Send;
452 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut;
453 type WatchTopologyResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
454 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut;
455}
456#[derive(Debug)]
457#[cfg(target_os = "fuchsia")]
458pub struct ReaderSynchronousProxy {
459 client: fidl::client::sync::Client,
460}
461
462#[cfg(target_os = "fuchsia")]
463impl fidl::endpoints::SynchronousProxy for ReaderSynchronousProxy {
464 type Proxy = ReaderProxy;
465 type Protocol = ReaderMarker;
466
467 fn from_channel(inner: fidl::Channel) -> Self {
468 Self::new(inner)
469 }
470
471 fn into_channel(self) -> fidl::Channel {
472 self.client.into_channel()
473 }
474
475 fn as_channel(&self) -> &fidl::Channel {
476 self.client.as_channel()
477 }
478}
479
480#[cfg(target_os = "fuchsia")]
481impl ReaderSynchronousProxy {
482 pub fn new(channel: fidl::Channel) -> Self {
483 let protocol_name = <ReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
484 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
485 }
486
487 pub fn into_channel(self) -> fidl::Channel {
488 self.client.into_channel()
489 }
490
491 pub fn wait_for_event(
494 &self,
495 deadline: zx::MonotonicInstant,
496 ) -> Result<ReaderEvent, fidl::Error> {
497 ReaderEvent::decode(self.client.wait_for_event(deadline)?)
498 }
499
500 pub fn r#get_elements(
503 &self,
504 ___deadline: zx::MonotonicInstant,
505 ) -> Result<ReaderGetElementsResult, fidl::Error> {
506 let _response = self.client.send_query::<
507 fidl::encoding::EmptyPayload,
508 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
509 >(
510 (),
511 0x1b14ff4adf5dc6f8,
512 fidl::encoding::DynamicFlags::empty(),
513 ___deadline,
514 )?;
515 Ok(_response.map(|x| x.processing_elements))
516 }
517
518 pub fn r#watch_element_state(
531 &self,
532 mut processing_element_id: u64,
533 ___deadline: zx::MonotonicInstant,
534 ) -> Result<ElementState, fidl::Error> {
535 let _response = self
536 .client
537 .send_query::<ReaderWatchElementStateRequest, ReaderWatchElementStateResponse>(
538 (processing_element_id,),
539 0x524da8772a69056f,
540 fidl::encoding::DynamicFlags::empty(),
541 ___deadline,
542 )?;
543 Ok(_response.state)
544 }
545
546 pub fn r#get_topologies(
555 &self,
556 ___deadline: zx::MonotonicInstant,
557 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
558 let _response = self.client.send_query::<
559 fidl::encoding::EmptyPayload,
560 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
561 >(
562 (),
563 0x73ffb73af24d30b6,
564 fidl::encoding::DynamicFlags::empty(),
565 ___deadline,
566 )?;
567 Ok(_response.map(|x| x.topologies))
568 }
569
570 pub fn r#watch_topology(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
578 let _response = self.client.send_query::<
579 fidl::encoding::EmptyPayload,
580 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
581 >(
582 (),
583 0x66d172acdb36a729,
584 fidl::encoding::DynamicFlags::FLEXIBLE,
585 ___deadline,
586 )?
587 .into_result::<ReaderMarker>("watch_topology")?;
588 Ok(_response.topology_id)
589 }
590}
591
592#[cfg(target_os = "fuchsia")]
593impl From<ReaderSynchronousProxy> for zx::NullableHandle {
594 fn from(value: ReaderSynchronousProxy) -> Self {
595 value.into_channel().into()
596 }
597}
598
599#[cfg(target_os = "fuchsia")]
600impl From<fidl::Channel> for ReaderSynchronousProxy {
601 fn from(value: fidl::Channel) -> Self {
602 Self::new(value)
603 }
604}
605
606#[cfg(target_os = "fuchsia")]
607impl fidl::endpoints::FromClient for ReaderSynchronousProxy {
608 type Protocol = ReaderMarker;
609
610 fn from_client(value: fidl::endpoints::ClientEnd<ReaderMarker>) -> Self {
611 Self::new(value.into_channel())
612 }
613}
614
615#[derive(Debug, Clone)]
616pub struct ReaderProxy {
617 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
618}
619
620impl fidl::endpoints::Proxy for ReaderProxy {
621 type Protocol = ReaderMarker;
622
623 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
624 Self::new(inner)
625 }
626
627 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
628 self.client.into_channel().map_err(|client| Self { client })
629 }
630
631 fn as_channel(&self) -> &::fidl::AsyncChannel {
632 self.client.as_channel()
633 }
634}
635
636impl ReaderProxy {
637 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
639 let protocol_name = <ReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
640 Self { client: fidl::client::Client::new(channel, protocol_name) }
641 }
642
643 pub fn take_event_stream(&self) -> ReaderEventStream {
649 ReaderEventStream { event_receiver: self.client.take_event_receiver() }
650 }
651
652 pub fn r#get_elements(
655 &self,
656 ) -> fidl::client::QueryResponseFut<
657 ReaderGetElementsResult,
658 fidl::encoding::DefaultFuchsiaResourceDialect,
659 > {
660 ReaderProxyInterface::r#get_elements(self)
661 }
662
663 pub fn r#watch_element_state(
676 &self,
677 mut processing_element_id: u64,
678 ) -> fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>
679 {
680 ReaderProxyInterface::r#watch_element_state(self, processing_element_id)
681 }
682
683 pub fn r#get_topologies(
692 &self,
693 ) -> fidl::client::QueryResponseFut<
694 ReaderGetTopologiesResult,
695 fidl::encoding::DefaultFuchsiaResourceDialect,
696 > {
697 ReaderProxyInterface::r#get_topologies(self)
698 }
699
700 pub fn r#watch_topology(
708 &self,
709 ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
710 ReaderProxyInterface::r#watch_topology(self)
711 }
712}
713
714impl ReaderProxyInterface for ReaderProxy {
715 type GetElementsResponseFut = fidl::client::QueryResponseFut<
716 ReaderGetElementsResult,
717 fidl::encoding::DefaultFuchsiaResourceDialect,
718 >;
719 fn r#get_elements(&self) -> Self::GetElementsResponseFut {
720 fn _decode(
721 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
722 ) -> Result<ReaderGetElementsResult, fidl::Error> {
723 let _response = fidl::client::decode_transaction_body::<
724 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
725 fidl::encoding::DefaultFuchsiaResourceDialect,
726 0x1b14ff4adf5dc6f8,
727 >(_buf?)?;
728 Ok(_response.map(|x| x.processing_elements))
729 }
730 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetElementsResult>(
731 (),
732 0x1b14ff4adf5dc6f8,
733 fidl::encoding::DynamicFlags::empty(),
734 _decode,
735 )
736 }
737
738 type WatchElementStateResponseFut =
739 fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>;
740 fn r#watch_element_state(
741 &self,
742 mut processing_element_id: u64,
743 ) -> Self::WatchElementStateResponseFut {
744 fn _decode(
745 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
746 ) -> Result<ElementState, fidl::Error> {
747 let _response = fidl::client::decode_transaction_body::<
748 ReaderWatchElementStateResponse,
749 fidl::encoding::DefaultFuchsiaResourceDialect,
750 0x524da8772a69056f,
751 >(_buf?)?;
752 Ok(_response.state)
753 }
754 self.client.send_query_and_decode::<ReaderWatchElementStateRequest, ElementState>(
755 (processing_element_id,),
756 0x524da8772a69056f,
757 fidl::encoding::DynamicFlags::empty(),
758 _decode,
759 )
760 }
761
762 type GetTopologiesResponseFut = fidl::client::QueryResponseFut<
763 ReaderGetTopologiesResult,
764 fidl::encoding::DefaultFuchsiaResourceDialect,
765 >;
766 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut {
767 fn _decode(
768 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
769 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
770 let _response = fidl::client::decode_transaction_body::<
771 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
772 fidl::encoding::DefaultFuchsiaResourceDialect,
773 0x73ffb73af24d30b6,
774 >(_buf?)?;
775 Ok(_response.map(|x| x.topologies))
776 }
777 self.client
778 .send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetTopologiesResult>(
779 (),
780 0x73ffb73af24d30b6,
781 fidl::encoding::DynamicFlags::empty(),
782 _decode,
783 )
784 }
785
786 type WatchTopologyResponseFut =
787 fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
788 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut {
789 fn _decode(
790 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
791 ) -> Result<u64, fidl::Error> {
792 let _response = fidl::client::decode_transaction_body::<
793 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
794 fidl::encoding::DefaultFuchsiaResourceDialect,
795 0x66d172acdb36a729,
796 >(_buf?)?
797 .into_result::<ReaderMarker>("watch_topology")?;
798 Ok(_response.topology_id)
799 }
800 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
801 (),
802 0x66d172acdb36a729,
803 fidl::encoding::DynamicFlags::FLEXIBLE,
804 _decode,
805 )
806 }
807}
808
809pub struct ReaderEventStream {
810 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
811}
812
813impl std::marker::Unpin for ReaderEventStream {}
814
815impl futures::stream::FusedStream for ReaderEventStream {
816 fn is_terminated(&self) -> bool {
817 self.event_receiver.is_terminated()
818 }
819}
820
821impl futures::Stream for ReaderEventStream {
822 type Item = Result<ReaderEvent, fidl::Error>;
823
824 fn poll_next(
825 mut self: std::pin::Pin<&mut Self>,
826 cx: &mut std::task::Context<'_>,
827 ) -> std::task::Poll<Option<Self::Item>> {
828 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
829 &mut self.event_receiver,
830 cx
831 )?) {
832 Some(buf) => std::task::Poll::Ready(Some(ReaderEvent::decode(buf))),
833 None => std::task::Poll::Ready(None),
834 }
835 }
836}
837
838#[derive(Debug)]
839pub enum ReaderEvent {
840 #[non_exhaustive]
841 _UnknownEvent {
842 ordinal: u64,
844 },
845}
846
847impl ReaderEvent {
848 fn decode(
850 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
851 ) -> Result<ReaderEvent, fidl::Error> {
852 let (bytes, _handles) = buf.split_mut();
853 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
854 debug_assert_eq!(tx_header.tx_id, 0);
855 match tx_header.ordinal {
856 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
857 Ok(ReaderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
858 }
859 _ => Err(fidl::Error::UnknownOrdinal {
860 ordinal: tx_header.ordinal,
861 protocol_name: <ReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
862 }),
863 }
864 }
865}
866
867pub struct ReaderRequestStream {
869 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
870 is_terminated: bool,
871}
872
873impl std::marker::Unpin for ReaderRequestStream {}
874
875impl futures::stream::FusedStream for ReaderRequestStream {
876 fn is_terminated(&self) -> bool {
877 self.is_terminated
878 }
879}
880
881impl fidl::endpoints::RequestStream for ReaderRequestStream {
882 type Protocol = ReaderMarker;
883 type ControlHandle = ReaderControlHandle;
884
885 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
886 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
887 }
888
889 fn control_handle(&self) -> Self::ControlHandle {
890 ReaderControlHandle { inner: self.inner.clone() }
891 }
892
893 fn into_inner(
894 self,
895 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
896 {
897 (self.inner, self.is_terminated)
898 }
899
900 fn from_inner(
901 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
902 is_terminated: bool,
903 ) -> Self {
904 Self { inner, is_terminated }
905 }
906}
907
908impl futures::Stream for ReaderRequestStream {
909 type Item = Result<ReaderRequest, fidl::Error>;
910
911 fn poll_next(
912 mut self: std::pin::Pin<&mut Self>,
913 cx: &mut std::task::Context<'_>,
914 ) -> std::task::Poll<Option<Self::Item>> {
915 let this = &mut *self;
916 if this.inner.check_shutdown(cx) {
917 this.is_terminated = true;
918 return std::task::Poll::Ready(None);
919 }
920 if this.is_terminated {
921 panic!("polled ReaderRequestStream after completion");
922 }
923 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
924 |bytes, handles| {
925 match this.inner.channel().read_etc(cx, bytes, handles) {
926 std::task::Poll::Ready(Ok(())) => {}
927 std::task::Poll::Pending => return std::task::Poll::Pending,
928 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
929 this.is_terminated = true;
930 return std::task::Poll::Ready(None);
931 }
932 std::task::Poll::Ready(Err(e)) => {
933 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
934 e.into(),
935 ))));
936 }
937 }
938
939 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
941
942 std::task::Poll::Ready(Some(match header.ordinal {
943 0x1b14ff4adf5dc6f8 => {
944 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
945 let mut req = fidl::new_empty!(
946 fidl::encoding::EmptyPayload,
947 fidl::encoding::DefaultFuchsiaResourceDialect
948 );
949 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
950 let control_handle = ReaderControlHandle { inner: this.inner.clone() };
951 Ok(ReaderRequest::GetElements {
952 responder: ReaderGetElementsResponder {
953 control_handle: std::mem::ManuallyDrop::new(control_handle),
954 tx_id: header.tx_id,
955 },
956 })
957 }
958 0x524da8772a69056f => {
959 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
960 let mut req = fidl::new_empty!(
961 ReaderWatchElementStateRequest,
962 fidl::encoding::DefaultFuchsiaResourceDialect
963 );
964 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReaderWatchElementStateRequest>(&header, _body_bytes, handles, &mut req)?;
965 let control_handle = ReaderControlHandle { inner: this.inner.clone() };
966 Ok(ReaderRequest::WatchElementState {
967 processing_element_id: req.processing_element_id,
968
969 responder: ReaderWatchElementStateResponder {
970 control_handle: std::mem::ManuallyDrop::new(control_handle),
971 tx_id: header.tx_id,
972 },
973 })
974 }
975 0x73ffb73af24d30b6 => {
976 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
977 let mut req = fidl::new_empty!(
978 fidl::encoding::EmptyPayload,
979 fidl::encoding::DefaultFuchsiaResourceDialect
980 );
981 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
982 let control_handle = ReaderControlHandle { inner: this.inner.clone() };
983 Ok(ReaderRequest::GetTopologies {
984 responder: ReaderGetTopologiesResponder {
985 control_handle: std::mem::ManuallyDrop::new(control_handle),
986 tx_id: header.tx_id,
987 },
988 })
989 }
990 0x66d172acdb36a729 => {
991 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
992 let mut req = fidl::new_empty!(
993 fidl::encoding::EmptyPayload,
994 fidl::encoding::DefaultFuchsiaResourceDialect
995 );
996 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
997 let control_handle = ReaderControlHandle { inner: this.inner.clone() };
998 Ok(ReaderRequest::WatchTopology {
999 responder: ReaderWatchTopologyResponder {
1000 control_handle: std::mem::ManuallyDrop::new(control_handle),
1001 tx_id: header.tx_id,
1002 },
1003 })
1004 }
1005 _ if header.tx_id == 0
1006 && header
1007 .dynamic_flags()
1008 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1009 {
1010 Ok(ReaderRequest::_UnknownMethod {
1011 ordinal: header.ordinal,
1012 control_handle: ReaderControlHandle { inner: this.inner.clone() },
1013 method_type: fidl::MethodType::OneWay,
1014 })
1015 }
1016 _ if header
1017 .dynamic_flags()
1018 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1019 {
1020 this.inner.send_framework_err(
1021 fidl::encoding::FrameworkErr::UnknownMethod,
1022 header.tx_id,
1023 header.ordinal,
1024 header.dynamic_flags(),
1025 (bytes, handles),
1026 )?;
1027 Ok(ReaderRequest::_UnknownMethod {
1028 ordinal: header.ordinal,
1029 control_handle: ReaderControlHandle { inner: this.inner.clone() },
1030 method_type: fidl::MethodType::TwoWay,
1031 })
1032 }
1033 _ => Err(fidl::Error::UnknownOrdinal {
1034 ordinal: header.ordinal,
1035 protocol_name:
1036 <ReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1037 }),
1038 }))
1039 },
1040 )
1041 }
1042}
1043
1044#[derive(Debug)]
1050pub enum ReaderRequest {
1051 GetElements { responder: ReaderGetElementsResponder },
1054 WatchElementState { processing_element_id: u64, responder: ReaderWatchElementStateResponder },
1067 GetTopologies { responder: ReaderGetTopologiesResponder },
1076 WatchTopology { responder: ReaderWatchTopologyResponder },
1084 #[non_exhaustive]
1086 _UnknownMethod {
1087 ordinal: u64,
1089 control_handle: ReaderControlHandle,
1090 method_type: fidl::MethodType,
1091 },
1092}
1093
1094impl ReaderRequest {
1095 #[allow(irrefutable_let_patterns)]
1096 pub fn into_get_elements(self) -> Option<(ReaderGetElementsResponder)> {
1097 if let ReaderRequest::GetElements { responder } = self { Some((responder)) } else { None }
1098 }
1099
1100 #[allow(irrefutable_let_patterns)]
1101 pub fn into_watch_element_state(self) -> Option<(u64, ReaderWatchElementStateResponder)> {
1102 if let ReaderRequest::WatchElementState { processing_element_id, responder } = self {
1103 Some((processing_element_id, responder))
1104 } else {
1105 None
1106 }
1107 }
1108
1109 #[allow(irrefutable_let_patterns)]
1110 pub fn into_get_topologies(self) -> Option<(ReaderGetTopologiesResponder)> {
1111 if let ReaderRequest::GetTopologies { responder } = self { Some((responder)) } else { None }
1112 }
1113
1114 #[allow(irrefutable_let_patterns)]
1115 pub fn into_watch_topology(self) -> Option<(ReaderWatchTopologyResponder)> {
1116 if let ReaderRequest::WatchTopology { responder } = self { Some((responder)) } else { None }
1117 }
1118
1119 pub fn method_name(&self) -> &'static str {
1121 match *self {
1122 ReaderRequest::GetElements { .. } => "get_elements",
1123 ReaderRequest::WatchElementState { .. } => "watch_element_state",
1124 ReaderRequest::GetTopologies { .. } => "get_topologies",
1125 ReaderRequest::WatchTopology { .. } => "watch_topology",
1126 ReaderRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1127 "unknown one-way method"
1128 }
1129 ReaderRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1130 "unknown two-way method"
1131 }
1132 }
1133 }
1134}
1135
1136#[derive(Debug, Clone)]
1137pub struct ReaderControlHandle {
1138 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1139}
1140
1141impl fidl::endpoints::ControlHandle for ReaderControlHandle {
1142 fn shutdown(&self) {
1143 self.inner.shutdown()
1144 }
1145
1146 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1147 self.inner.shutdown_with_epitaph(status)
1148 }
1149
1150 fn is_closed(&self) -> bool {
1151 self.inner.channel().is_closed()
1152 }
1153 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1154 self.inner.channel().on_closed()
1155 }
1156
1157 #[cfg(target_os = "fuchsia")]
1158 fn signal_peer(
1159 &self,
1160 clear_mask: zx::Signals,
1161 set_mask: zx::Signals,
1162 ) -> Result<(), zx_status::Status> {
1163 use fidl::Peered;
1164 self.inner.channel().signal_peer(clear_mask, set_mask)
1165 }
1166}
1167
1168impl ReaderControlHandle {}
1169
1170#[must_use = "FIDL methods require a response to be sent"]
1171#[derive(Debug)]
1172pub struct ReaderGetElementsResponder {
1173 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1174 tx_id: u32,
1175}
1176
1177impl std::ops::Drop for ReaderGetElementsResponder {
1181 fn drop(&mut self) {
1182 self.control_handle.shutdown();
1183 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1185 }
1186}
1187
1188impl fidl::endpoints::Responder for ReaderGetElementsResponder {
1189 type ControlHandle = ReaderControlHandle;
1190
1191 fn control_handle(&self) -> &ReaderControlHandle {
1192 &self.control_handle
1193 }
1194
1195 fn drop_without_shutdown(mut self) {
1196 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1198 std::mem::forget(self);
1200 }
1201}
1202
1203impl ReaderGetElementsResponder {
1204 pub fn send(self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
1208 let _result = self.send_raw(result);
1209 if _result.is_err() {
1210 self.control_handle.shutdown();
1211 }
1212 self.drop_without_shutdown();
1213 _result
1214 }
1215
1216 pub fn send_no_shutdown_on_err(
1218 self,
1219 mut result: Result<&[Element], i32>,
1220 ) -> Result<(), fidl::Error> {
1221 let _result = self.send_raw(result);
1222 self.drop_without_shutdown();
1223 _result
1224 }
1225
1226 fn send_raw(&self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
1227 self.control_handle
1228 .inner
1229 .send::<fidl::encoding::ResultType<ReaderGetElementsResponse, i32>>(
1230 result.map(|processing_elements| (processing_elements,)),
1231 self.tx_id,
1232 0x1b14ff4adf5dc6f8,
1233 fidl::encoding::DynamicFlags::empty(),
1234 )
1235 }
1236}
1237
1238#[must_use = "FIDL methods require a response to be sent"]
1239#[derive(Debug)]
1240pub struct ReaderWatchElementStateResponder {
1241 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1242 tx_id: u32,
1243}
1244
1245impl std::ops::Drop for ReaderWatchElementStateResponder {
1249 fn drop(&mut self) {
1250 self.control_handle.shutdown();
1251 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1253 }
1254}
1255
1256impl fidl::endpoints::Responder for ReaderWatchElementStateResponder {
1257 type ControlHandle = ReaderControlHandle;
1258
1259 fn control_handle(&self) -> &ReaderControlHandle {
1260 &self.control_handle
1261 }
1262
1263 fn drop_without_shutdown(mut self) {
1264 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1266 std::mem::forget(self);
1268 }
1269}
1270
1271impl ReaderWatchElementStateResponder {
1272 pub fn send(self, mut state: &ElementState) -> Result<(), fidl::Error> {
1276 let _result = self.send_raw(state);
1277 if _result.is_err() {
1278 self.control_handle.shutdown();
1279 }
1280 self.drop_without_shutdown();
1281 _result
1282 }
1283
1284 pub fn send_no_shutdown_on_err(self, mut state: &ElementState) -> Result<(), fidl::Error> {
1286 let _result = self.send_raw(state);
1287 self.drop_without_shutdown();
1288 _result
1289 }
1290
1291 fn send_raw(&self, mut state: &ElementState) -> Result<(), fidl::Error> {
1292 self.control_handle.inner.send::<ReaderWatchElementStateResponse>(
1293 (state,),
1294 self.tx_id,
1295 0x524da8772a69056f,
1296 fidl::encoding::DynamicFlags::empty(),
1297 )
1298 }
1299}
1300
1301#[must_use = "FIDL methods require a response to be sent"]
1302#[derive(Debug)]
1303pub struct ReaderGetTopologiesResponder {
1304 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1305 tx_id: u32,
1306}
1307
1308impl std::ops::Drop for ReaderGetTopologiesResponder {
1312 fn drop(&mut self) {
1313 self.control_handle.shutdown();
1314 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1316 }
1317}
1318
1319impl fidl::endpoints::Responder for ReaderGetTopologiesResponder {
1320 type ControlHandle = ReaderControlHandle;
1321
1322 fn control_handle(&self) -> &ReaderControlHandle {
1323 &self.control_handle
1324 }
1325
1326 fn drop_without_shutdown(mut self) {
1327 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1329 std::mem::forget(self);
1331 }
1332}
1333
1334impl ReaderGetTopologiesResponder {
1335 pub fn send(self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
1339 let _result = self.send_raw(result);
1340 if _result.is_err() {
1341 self.control_handle.shutdown();
1342 }
1343 self.drop_without_shutdown();
1344 _result
1345 }
1346
1347 pub fn send_no_shutdown_on_err(
1349 self,
1350 mut result: Result<&[Topology], i32>,
1351 ) -> Result<(), fidl::Error> {
1352 let _result = self.send_raw(result);
1353 self.drop_without_shutdown();
1354 _result
1355 }
1356
1357 fn send_raw(&self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
1358 self.control_handle
1359 .inner
1360 .send::<fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>>(
1361 result.map(|topologies| (topologies,)),
1362 self.tx_id,
1363 0x73ffb73af24d30b6,
1364 fidl::encoding::DynamicFlags::empty(),
1365 )
1366 }
1367}
1368
1369#[must_use = "FIDL methods require a response to be sent"]
1370#[derive(Debug)]
1371pub struct ReaderWatchTopologyResponder {
1372 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1373 tx_id: u32,
1374}
1375
1376impl std::ops::Drop for ReaderWatchTopologyResponder {
1380 fn drop(&mut self) {
1381 self.control_handle.shutdown();
1382 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1384 }
1385}
1386
1387impl fidl::endpoints::Responder for ReaderWatchTopologyResponder {
1388 type ControlHandle = ReaderControlHandle;
1389
1390 fn control_handle(&self) -> &ReaderControlHandle {
1391 &self.control_handle
1392 }
1393
1394 fn drop_without_shutdown(mut self) {
1395 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1397 std::mem::forget(self);
1399 }
1400}
1401
1402impl ReaderWatchTopologyResponder {
1403 pub fn send(self, mut topology_id: u64) -> Result<(), fidl::Error> {
1407 let _result = self.send_raw(topology_id);
1408 if _result.is_err() {
1409 self.control_handle.shutdown();
1410 }
1411 self.drop_without_shutdown();
1412 _result
1413 }
1414
1415 pub fn send_no_shutdown_on_err(self, mut topology_id: u64) -> Result<(), fidl::Error> {
1417 let _result = self.send_raw(topology_id);
1418 self.drop_without_shutdown();
1419 _result
1420 }
1421
1422 fn send_raw(&self, mut topology_id: u64) -> Result<(), fidl::Error> {
1423 self.control_handle.inner.send::<fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>>(
1424 fidl::encoding::Flexible::new((topology_id,)),
1425 self.tx_id,
1426 0x66d172acdb36a729,
1427 fidl::encoding::DynamicFlags::FLEXIBLE,
1428 )
1429 }
1430}
1431
1432#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1433pub struct SignalProcessingMarker;
1434
1435impl fidl::endpoints::ProtocolMarker for SignalProcessingMarker {
1436 type Proxy = SignalProcessingProxy;
1437 type RequestStream = SignalProcessingRequestStream;
1438 #[cfg(target_os = "fuchsia")]
1439 type SynchronousProxy = SignalProcessingSynchronousProxy;
1440
1441 const DEBUG_NAME: &'static str = "(anonymous) SignalProcessing";
1442}
1443pub type SignalProcessingSetTopologyResult = Result<(), i32>;
1444pub type SignalProcessingSetElementStateResult = Result<(), i32>;
1445
1446pub trait SignalProcessingProxyInterface: Send + Sync {
1447 type GetElementsResponseFut: std::future::Future<Output = Result<ReaderGetElementsResult, fidl::Error>>
1448 + Send;
1449 fn r#get_elements(&self) -> Self::GetElementsResponseFut;
1450 type WatchElementStateResponseFut: std::future::Future<Output = Result<ElementState, fidl::Error>>
1451 + Send;
1452 fn r#watch_element_state(
1453 &self,
1454 processing_element_id: u64,
1455 ) -> Self::WatchElementStateResponseFut;
1456 type GetTopologiesResponseFut: std::future::Future<Output = Result<ReaderGetTopologiesResult, fidl::Error>>
1457 + Send;
1458 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut;
1459 type WatchTopologyResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
1460 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut;
1461 type SetTopologyResponseFut: std::future::Future<Output = Result<SignalProcessingSetTopologyResult, fidl::Error>>
1462 + Send;
1463 fn r#set_topology(&self, topology_id: u64) -> Self::SetTopologyResponseFut;
1464 type SetElementStateResponseFut: std::future::Future<Output = Result<SignalProcessingSetElementStateResult, fidl::Error>>
1465 + Send;
1466 fn r#set_element_state(
1467 &self,
1468 processing_element_id: u64,
1469 state: &SettableElementState,
1470 ) -> Self::SetElementStateResponseFut;
1471}
1472#[derive(Debug)]
1473#[cfg(target_os = "fuchsia")]
1474pub struct SignalProcessingSynchronousProxy {
1475 client: fidl::client::sync::Client,
1476}
1477
1478#[cfg(target_os = "fuchsia")]
1479impl fidl::endpoints::SynchronousProxy for SignalProcessingSynchronousProxy {
1480 type Proxy = SignalProcessingProxy;
1481 type Protocol = SignalProcessingMarker;
1482
1483 fn from_channel(inner: fidl::Channel) -> Self {
1484 Self::new(inner)
1485 }
1486
1487 fn into_channel(self) -> fidl::Channel {
1488 self.client.into_channel()
1489 }
1490
1491 fn as_channel(&self) -> &fidl::Channel {
1492 self.client.as_channel()
1493 }
1494}
1495
1496#[cfg(target_os = "fuchsia")]
1497impl SignalProcessingSynchronousProxy {
1498 pub fn new(channel: fidl::Channel) -> Self {
1499 let protocol_name = <SignalProcessingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1500 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1501 }
1502
1503 pub fn into_channel(self) -> fidl::Channel {
1504 self.client.into_channel()
1505 }
1506
1507 pub fn wait_for_event(
1510 &self,
1511 deadline: zx::MonotonicInstant,
1512 ) -> Result<SignalProcessingEvent, fidl::Error> {
1513 SignalProcessingEvent::decode(self.client.wait_for_event(deadline)?)
1514 }
1515
1516 pub fn r#get_elements(
1519 &self,
1520 ___deadline: zx::MonotonicInstant,
1521 ) -> Result<ReaderGetElementsResult, fidl::Error> {
1522 let _response = self.client.send_query::<
1523 fidl::encoding::EmptyPayload,
1524 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
1525 >(
1526 (),
1527 0x1b14ff4adf5dc6f8,
1528 fidl::encoding::DynamicFlags::empty(),
1529 ___deadline,
1530 )?;
1531 Ok(_response.map(|x| x.processing_elements))
1532 }
1533
1534 pub fn r#watch_element_state(
1547 &self,
1548 mut processing_element_id: u64,
1549 ___deadline: zx::MonotonicInstant,
1550 ) -> Result<ElementState, fidl::Error> {
1551 let _response = self
1552 .client
1553 .send_query::<ReaderWatchElementStateRequest, ReaderWatchElementStateResponse>(
1554 (processing_element_id,),
1555 0x524da8772a69056f,
1556 fidl::encoding::DynamicFlags::empty(),
1557 ___deadline,
1558 )?;
1559 Ok(_response.state)
1560 }
1561
1562 pub fn r#get_topologies(
1571 &self,
1572 ___deadline: zx::MonotonicInstant,
1573 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
1574 let _response = self.client.send_query::<
1575 fidl::encoding::EmptyPayload,
1576 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
1577 >(
1578 (),
1579 0x73ffb73af24d30b6,
1580 fidl::encoding::DynamicFlags::empty(),
1581 ___deadline,
1582 )?;
1583 Ok(_response.map(|x| x.topologies))
1584 }
1585
1586 pub fn r#watch_topology(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
1594 let _response = self.client.send_query::<
1595 fidl::encoding::EmptyPayload,
1596 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
1597 >(
1598 (),
1599 0x66d172acdb36a729,
1600 fidl::encoding::DynamicFlags::FLEXIBLE,
1601 ___deadline,
1602 )?
1603 .into_result::<SignalProcessingMarker>("watch_topology")?;
1604 Ok(_response.topology_id)
1605 }
1606
1607 pub fn r#set_topology(
1622 &self,
1623 mut topology_id: u64,
1624 ___deadline: zx::MonotonicInstant,
1625 ) -> Result<SignalProcessingSetTopologyResult, fidl::Error> {
1626 let _response = self.client.send_query::<
1627 SignalProcessingSetTopologyRequest,
1628 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1629 >(
1630 (topology_id,),
1631 0x1d9a7f9b8fee790c,
1632 fidl::encoding::DynamicFlags::empty(),
1633 ___deadline,
1634 )?;
1635 Ok(_response.map(|x| x))
1636 }
1637
1638 pub fn r#set_element_state(
1676 &self,
1677 mut processing_element_id: u64,
1678 mut state: &SettableElementState,
1679 ___deadline: zx::MonotonicInstant,
1680 ) -> Result<SignalProcessingSetElementStateResult, fidl::Error> {
1681 let _response = self.client.send_query::<
1682 SignalProcessingSetElementStateRequest,
1683 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1684 >(
1685 (processing_element_id, state,),
1686 0x38c3b2d4bae698f4,
1687 fidl::encoding::DynamicFlags::empty(),
1688 ___deadline,
1689 )?;
1690 Ok(_response.map(|x| x))
1691 }
1692}
1693
1694#[cfg(target_os = "fuchsia")]
1695impl From<SignalProcessingSynchronousProxy> for zx::NullableHandle {
1696 fn from(value: SignalProcessingSynchronousProxy) -> Self {
1697 value.into_channel().into()
1698 }
1699}
1700
1701#[cfg(target_os = "fuchsia")]
1702impl From<fidl::Channel> for SignalProcessingSynchronousProxy {
1703 fn from(value: fidl::Channel) -> Self {
1704 Self::new(value)
1705 }
1706}
1707
1708#[cfg(target_os = "fuchsia")]
1709impl fidl::endpoints::FromClient for SignalProcessingSynchronousProxy {
1710 type Protocol = SignalProcessingMarker;
1711
1712 fn from_client(value: fidl::endpoints::ClientEnd<SignalProcessingMarker>) -> Self {
1713 Self::new(value.into_channel())
1714 }
1715}
1716
1717#[derive(Debug, Clone)]
1718pub struct SignalProcessingProxy {
1719 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1720}
1721
1722impl fidl::endpoints::Proxy for SignalProcessingProxy {
1723 type Protocol = SignalProcessingMarker;
1724
1725 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1726 Self::new(inner)
1727 }
1728
1729 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1730 self.client.into_channel().map_err(|client| Self { client })
1731 }
1732
1733 fn as_channel(&self) -> &::fidl::AsyncChannel {
1734 self.client.as_channel()
1735 }
1736}
1737
1738impl SignalProcessingProxy {
1739 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1741 let protocol_name = <SignalProcessingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1742 Self { client: fidl::client::Client::new(channel, protocol_name) }
1743 }
1744
1745 pub fn take_event_stream(&self) -> SignalProcessingEventStream {
1751 SignalProcessingEventStream { event_receiver: self.client.take_event_receiver() }
1752 }
1753
1754 pub fn r#get_elements(
1757 &self,
1758 ) -> fidl::client::QueryResponseFut<
1759 ReaderGetElementsResult,
1760 fidl::encoding::DefaultFuchsiaResourceDialect,
1761 > {
1762 SignalProcessingProxyInterface::r#get_elements(self)
1763 }
1764
1765 pub fn r#watch_element_state(
1778 &self,
1779 mut processing_element_id: u64,
1780 ) -> fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>
1781 {
1782 SignalProcessingProxyInterface::r#watch_element_state(self, processing_element_id)
1783 }
1784
1785 pub fn r#get_topologies(
1794 &self,
1795 ) -> fidl::client::QueryResponseFut<
1796 ReaderGetTopologiesResult,
1797 fidl::encoding::DefaultFuchsiaResourceDialect,
1798 > {
1799 SignalProcessingProxyInterface::r#get_topologies(self)
1800 }
1801
1802 pub fn r#watch_topology(
1810 &self,
1811 ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
1812 SignalProcessingProxyInterface::r#watch_topology(self)
1813 }
1814
1815 pub fn r#set_topology(
1830 &self,
1831 mut topology_id: u64,
1832 ) -> fidl::client::QueryResponseFut<
1833 SignalProcessingSetTopologyResult,
1834 fidl::encoding::DefaultFuchsiaResourceDialect,
1835 > {
1836 SignalProcessingProxyInterface::r#set_topology(self, topology_id)
1837 }
1838
1839 pub fn r#set_element_state(
1877 &self,
1878 mut processing_element_id: u64,
1879 mut state: &SettableElementState,
1880 ) -> fidl::client::QueryResponseFut<
1881 SignalProcessingSetElementStateResult,
1882 fidl::encoding::DefaultFuchsiaResourceDialect,
1883 > {
1884 SignalProcessingProxyInterface::r#set_element_state(self, processing_element_id, state)
1885 }
1886}
1887
1888impl SignalProcessingProxyInterface for SignalProcessingProxy {
1889 type GetElementsResponseFut = fidl::client::QueryResponseFut<
1890 ReaderGetElementsResult,
1891 fidl::encoding::DefaultFuchsiaResourceDialect,
1892 >;
1893 fn r#get_elements(&self) -> Self::GetElementsResponseFut {
1894 fn _decode(
1895 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1896 ) -> Result<ReaderGetElementsResult, fidl::Error> {
1897 let _response = fidl::client::decode_transaction_body::<
1898 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
1899 fidl::encoding::DefaultFuchsiaResourceDialect,
1900 0x1b14ff4adf5dc6f8,
1901 >(_buf?)?;
1902 Ok(_response.map(|x| x.processing_elements))
1903 }
1904 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetElementsResult>(
1905 (),
1906 0x1b14ff4adf5dc6f8,
1907 fidl::encoding::DynamicFlags::empty(),
1908 _decode,
1909 )
1910 }
1911
1912 type WatchElementStateResponseFut =
1913 fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>;
1914 fn r#watch_element_state(
1915 &self,
1916 mut processing_element_id: u64,
1917 ) -> Self::WatchElementStateResponseFut {
1918 fn _decode(
1919 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1920 ) -> Result<ElementState, fidl::Error> {
1921 let _response = fidl::client::decode_transaction_body::<
1922 ReaderWatchElementStateResponse,
1923 fidl::encoding::DefaultFuchsiaResourceDialect,
1924 0x524da8772a69056f,
1925 >(_buf?)?;
1926 Ok(_response.state)
1927 }
1928 self.client.send_query_and_decode::<ReaderWatchElementStateRequest, ElementState>(
1929 (processing_element_id,),
1930 0x524da8772a69056f,
1931 fidl::encoding::DynamicFlags::empty(),
1932 _decode,
1933 )
1934 }
1935
1936 type GetTopologiesResponseFut = fidl::client::QueryResponseFut<
1937 ReaderGetTopologiesResult,
1938 fidl::encoding::DefaultFuchsiaResourceDialect,
1939 >;
1940 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut {
1941 fn _decode(
1942 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1943 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
1944 let _response = fidl::client::decode_transaction_body::<
1945 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
1946 fidl::encoding::DefaultFuchsiaResourceDialect,
1947 0x73ffb73af24d30b6,
1948 >(_buf?)?;
1949 Ok(_response.map(|x| x.topologies))
1950 }
1951 self.client
1952 .send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetTopologiesResult>(
1953 (),
1954 0x73ffb73af24d30b6,
1955 fidl::encoding::DynamicFlags::empty(),
1956 _decode,
1957 )
1958 }
1959
1960 type WatchTopologyResponseFut =
1961 fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
1962 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut {
1963 fn _decode(
1964 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1965 ) -> Result<u64, fidl::Error> {
1966 let _response = fidl::client::decode_transaction_body::<
1967 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
1968 fidl::encoding::DefaultFuchsiaResourceDialect,
1969 0x66d172acdb36a729,
1970 >(_buf?)?
1971 .into_result::<SignalProcessingMarker>("watch_topology")?;
1972 Ok(_response.topology_id)
1973 }
1974 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
1975 (),
1976 0x66d172acdb36a729,
1977 fidl::encoding::DynamicFlags::FLEXIBLE,
1978 _decode,
1979 )
1980 }
1981
1982 type SetTopologyResponseFut = fidl::client::QueryResponseFut<
1983 SignalProcessingSetTopologyResult,
1984 fidl::encoding::DefaultFuchsiaResourceDialect,
1985 >;
1986 fn r#set_topology(&self, mut topology_id: u64) -> Self::SetTopologyResponseFut {
1987 fn _decode(
1988 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1989 ) -> Result<SignalProcessingSetTopologyResult, fidl::Error> {
1990 let _response = fidl::client::decode_transaction_body::<
1991 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1992 fidl::encoding::DefaultFuchsiaResourceDialect,
1993 0x1d9a7f9b8fee790c,
1994 >(_buf?)?;
1995 Ok(_response.map(|x| x))
1996 }
1997 self.client.send_query_and_decode::<
1998 SignalProcessingSetTopologyRequest,
1999 SignalProcessingSetTopologyResult,
2000 >(
2001 (topology_id,),
2002 0x1d9a7f9b8fee790c,
2003 fidl::encoding::DynamicFlags::empty(),
2004 _decode,
2005 )
2006 }
2007
2008 type SetElementStateResponseFut = fidl::client::QueryResponseFut<
2009 SignalProcessingSetElementStateResult,
2010 fidl::encoding::DefaultFuchsiaResourceDialect,
2011 >;
2012 fn r#set_element_state(
2013 &self,
2014 mut processing_element_id: u64,
2015 mut state: &SettableElementState,
2016 ) -> Self::SetElementStateResponseFut {
2017 fn _decode(
2018 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2019 ) -> Result<SignalProcessingSetElementStateResult, fidl::Error> {
2020 let _response = fidl::client::decode_transaction_body::<
2021 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2022 fidl::encoding::DefaultFuchsiaResourceDialect,
2023 0x38c3b2d4bae698f4,
2024 >(_buf?)?;
2025 Ok(_response.map(|x| x))
2026 }
2027 self.client.send_query_and_decode::<
2028 SignalProcessingSetElementStateRequest,
2029 SignalProcessingSetElementStateResult,
2030 >(
2031 (processing_element_id, state,),
2032 0x38c3b2d4bae698f4,
2033 fidl::encoding::DynamicFlags::empty(),
2034 _decode,
2035 )
2036 }
2037}
2038
2039pub struct SignalProcessingEventStream {
2040 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2041}
2042
2043impl std::marker::Unpin for SignalProcessingEventStream {}
2044
2045impl futures::stream::FusedStream for SignalProcessingEventStream {
2046 fn is_terminated(&self) -> bool {
2047 self.event_receiver.is_terminated()
2048 }
2049}
2050
2051impl futures::Stream for SignalProcessingEventStream {
2052 type Item = Result<SignalProcessingEvent, fidl::Error>;
2053
2054 fn poll_next(
2055 mut self: std::pin::Pin<&mut Self>,
2056 cx: &mut std::task::Context<'_>,
2057 ) -> std::task::Poll<Option<Self::Item>> {
2058 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2059 &mut self.event_receiver,
2060 cx
2061 )?) {
2062 Some(buf) => std::task::Poll::Ready(Some(SignalProcessingEvent::decode(buf))),
2063 None => std::task::Poll::Ready(None),
2064 }
2065 }
2066}
2067
2068#[derive(Debug)]
2069pub enum SignalProcessingEvent {
2070 #[non_exhaustive]
2071 _UnknownEvent {
2072 ordinal: u64,
2074 },
2075}
2076
2077impl SignalProcessingEvent {
2078 fn decode(
2080 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2081 ) -> Result<SignalProcessingEvent, fidl::Error> {
2082 let (bytes, _handles) = buf.split_mut();
2083 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2084 debug_assert_eq!(tx_header.tx_id, 0);
2085 match tx_header.ordinal {
2086 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2087 Ok(SignalProcessingEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2088 }
2089 _ => Err(fidl::Error::UnknownOrdinal {
2090 ordinal: tx_header.ordinal,
2091 protocol_name:
2092 <SignalProcessingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2093 }),
2094 }
2095 }
2096}
2097
2098pub struct SignalProcessingRequestStream {
2100 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2101 is_terminated: bool,
2102}
2103
2104impl std::marker::Unpin for SignalProcessingRequestStream {}
2105
2106impl futures::stream::FusedStream for SignalProcessingRequestStream {
2107 fn is_terminated(&self) -> bool {
2108 self.is_terminated
2109 }
2110}
2111
2112impl fidl::endpoints::RequestStream for SignalProcessingRequestStream {
2113 type Protocol = SignalProcessingMarker;
2114 type ControlHandle = SignalProcessingControlHandle;
2115
2116 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2117 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2118 }
2119
2120 fn control_handle(&self) -> Self::ControlHandle {
2121 SignalProcessingControlHandle { inner: self.inner.clone() }
2122 }
2123
2124 fn into_inner(
2125 self,
2126 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2127 {
2128 (self.inner, self.is_terminated)
2129 }
2130
2131 fn from_inner(
2132 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2133 is_terminated: bool,
2134 ) -> Self {
2135 Self { inner, is_terminated }
2136 }
2137}
2138
2139impl futures::Stream for SignalProcessingRequestStream {
2140 type Item = Result<SignalProcessingRequest, fidl::Error>;
2141
2142 fn poll_next(
2143 mut self: std::pin::Pin<&mut Self>,
2144 cx: &mut std::task::Context<'_>,
2145 ) -> std::task::Poll<Option<Self::Item>> {
2146 let this = &mut *self;
2147 if this.inner.check_shutdown(cx) {
2148 this.is_terminated = true;
2149 return std::task::Poll::Ready(None);
2150 }
2151 if this.is_terminated {
2152 panic!("polled SignalProcessingRequestStream after completion");
2153 }
2154 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2155 |bytes, handles| {
2156 match this.inner.channel().read_etc(cx, bytes, handles) {
2157 std::task::Poll::Ready(Ok(())) => {}
2158 std::task::Poll::Pending => return std::task::Poll::Pending,
2159 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2160 this.is_terminated = true;
2161 return std::task::Poll::Ready(None);
2162 }
2163 std::task::Poll::Ready(Err(e)) => {
2164 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2165 e.into(),
2166 ))));
2167 }
2168 }
2169
2170 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2172
2173 std::task::Poll::Ready(Some(match header.ordinal {
2174 0x1b14ff4adf5dc6f8 => {
2175 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2176 let mut req = fidl::new_empty!(
2177 fidl::encoding::EmptyPayload,
2178 fidl::encoding::DefaultFuchsiaResourceDialect
2179 );
2180 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2181 let control_handle =
2182 SignalProcessingControlHandle { inner: this.inner.clone() };
2183 Ok(SignalProcessingRequest::GetElements {
2184 responder: SignalProcessingGetElementsResponder {
2185 control_handle: std::mem::ManuallyDrop::new(control_handle),
2186 tx_id: header.tx_id,
2187 },
2188 })
2189 }
2190 0x524da8772a69056f => {
2191 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2192 let mut req = fidl::new_empty!(
2193 ReaderWatchElementStateRequest,
2194 fidl::encoding::DefaultFuchsiaResourceDialect
2195 );
2196 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReaderWatchElementStateRequest>(&header, _body_bytes, handles, &mut req)?;
2197 let control_handle =
2198 SignalProcessingControlHandle { inner: this.inner.clone() };
2199 Ok(SignalProcessingRequest::WatchElementState {
2200 processing_element_id: req.processing_element_id,
2201
2202 responder: SignalProcessingWatchElementStateResponder {
2203 control_handle: std::mem::ManuallyDrop::new(control_handle),
2204 tx_id: header.tx_id,
2205 },
2206 })
2207 }
2208 0x73ffb73af24d30b6 => {
2209 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2210 let mut req = fidl::new_empty!(
2211 fidl::encoding::EmptyPayload,
2212 fidl::encoding::DefaultFuchsiaResourceDialect
2213 );
2214 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2215 let control_handle =
2216 SignalProcessingControlHandle { inner: this.inner.clone() };
2217 Ok(SignalProcessingRequest::GetTopologies {
2218 responder: SignalProcessingGetTopologiesResponder {
2219 control_handle: std::mem::ManuallyDrop::new(control_handle),
2220 tx_id: header.tx_id,
2221 },
2222 })
2223 }
2224 0x66d172acdb36a729 => {
2225 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2226 let mut req = fidl::new_empty!(
2227 fidl::encoding::EmptyPayload,
2228 fidl::encoding::DefaultFuchsiaResourceDialect
2229 );
2230 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2231 let control_handle =
2232 SignalProcessingControlHandle { inner: this.inner.clone() };
2233 Ok(SignalProcessingRequest::WatchTopology {
2234 responder: SignalProcessingWatchTopologyResponder {
2235 control_handle: std::mem::ManuallyDrop::new(control_handle),
2236 tx_id: header.tx_id,
2237 },
2238 })
2239 }
2240 0x1d9a7f9b8fee790c => {
2241 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2242 let mut req = fidl::new_empty!(
2243 SignalProcessingSetTopologyRequest,
2244 fidl::encoding::DefaultFuchsiaResourceDialect
2245 );
2246 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SignalProcessingSetTopologyRequest>(&header, _body_bytes, handles, &mut req)?;
2247 let control_handle =
2248 SignalProcessingControlHandle { inner: this.inner.clone() };
2249 Ok(SignalProcessingRequest::SetTopology {
2250 topology_id: req.topology_id,
2251
2252 responder: SignalProcessingSetTopologyResponder {
2253 control_handle: std::mem::ManuallyDrop::new(control_handle),
2254 tx_id: header.tx_id,
2255 },
2256 })
2257 }
2258 0x38c3b2d4bae698f4 => {
2259 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2260 let mut req = fidl::new_empty!(
2261 SignalProcessingSetElementStateRequest,
2262 fidl::encoding::DefaultFuchsiaResourceDialect
2263 );
2264 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SignalProcessingSetElementStateRequest>(&header, _body_bytes, handles, &mut req)?;
2265 let control_handle =
2266 SignalProcessingControlHandle { inner: this.inner.clone() };
2267 Ok(SignalProcessingRequest::SetElementState {
2268 processing_element_id: req.processing_element_id,
2269 state: req.state,
2270
2271 responder: SignalProcessingSetElementStateResponder {
2272 control_handle: std::mem::ManuallyDrop::new(control_handle),
2273 tx_id: header.tx_id,
2274 },
2275 })
2276 }
2277 _ if header.tx_id == 0
2278 && header
2279 .dynamic_flags()
2280 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2281 {
2282 Ok(SignalProcessingRequest::_UnknownMethod {
2283 ordinal: header.ordinal,
2284 control_handle: SignalProcessingControlHandle {
2285 inner: this.inner.clone(),
2286 },
2287 method_type: fidl::MethodType::OneWay,
2288 })
2289 }
2290 _ if header
2291 .dynamic_flags()
2292 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2293 {
2294 this.inner.send_framework_err(
2295 fidl::encoding::FrameworkErr::UnknownMethod,
2296 header.tx_id,
2297 header.ordinal,
2298 header.dynamic_flags(),
2299 (bytes, handles),
2300 )?;
2301 Ok(SignalProcessingRequest::_UnknownMethod {
2302 ordinal: header.ordinal,
2303 control_handle: SignalProcessingControlHandle {
2304 inner: this.inner.clone(),
2305 },
2306 method_type: fidl::MethodType::TwoWay,
2307 })
2308 }
2309 _ => Err(fidl::Error::UnknownOrdinal {
2310 ordinal: header.ordinal,
2311 protocol_name:
2312 <SignalProcessingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2313 }),
2314 }))
2315 },
2316 )
2317 }
2318}
2319
2320#[derive(Debug)]
2326pub enum SignalProcessingRequest {
2327 GetElements { responder: SignalProcessingGetElementsResponder },
2330 WatchElementState {
2343 processing_element_id: u64,
2344 responder: SignalProcessingWatchElementStateResponder,
2345 },
2346 GetTopologies { responder: SignalProcessingGetTopologiesResponder },
2355 WatchTopology { responder: SignalProcessingWatchTopologyResponder },
2363 SetTopology { topology_id: u64, responder: SignalProcessingSetTopologyResponder },
2378 SetElementState {
2416 processing_element_id: u64,
2417 state: SettableElementState,
2418 responder: SignalProcessingSetElementStateResponder,
2419 },
2420 #[non_exhaustive]
2422 _UnknownMethod {
2423 ordinal: u64,
2425 control_handle: SignalProcessingControlHandle,
2426 method_type: fidl::MethodType,
2427 },
2428}
2429
2430impl SignalProcessingRequest {
2431 #[allow(irrefutable_let_patterns)]
2432 pub fn into_get_elements(self) -> Option<(SignalProcessingGetElementsResponder)> {
2433 if let SignalProcessingRequest::GetElements { responder } = self {
2434 Some((responder))
2435 } else {
2436 None
2437 }
2438 }
2439
2440 #[allow(irrefutable_let_patterns)]
2441 pub fn into_watch_element_state(
2442 self,
2443 ) -> Option<(u64, SignalProcessingWatchElementStateResponder)> {
2444 if let SignalProcessingRequest::WatchElementState { processing_element_id, responder } =
2445 self
2446 {
2447 Some((processing_element_id, responder))
2448 } else {
2449 None
2450 }
2451 }
2452
2453 #[allow(irrefutable_let_patterns)]
2454 pub fn into_get_topologies(self) -> Option<(SignalProcessingGetTopologiesResponder)> {
2455 if let SignalProcessingRequest::GetTopologies { responder } = self {
2456 Some((responder))
2457 } else {
2458 None
2459 }
2460 }
2461
2462 #[allow(irrefutable_let_patterns)]
2463 pub fn into_watch_topology(self) -> Option<(SignalProcessingWatchTopologyResponder)> {
2464 if let SignalProcessingRequest::WatchTopology { responder } = self {
2465 Some((responder))
2466 } else {
2467 None
2468 }
2469 }
2470
2471 #[allow(irrefutable_let_patterns)]
2472 pub fn into_set_topology(self) -> Option<(u64, SignalProcessingSetTopologyResponder)> {
2473 if let SignalProcessingRequest::SetTopology { topology_id, responder } = self {
2474 Some((topology_id, responder))
2475 } else {
2476 None
2477 }
2478 }
2479
2480 #[allow(irrefutable_let_patterns)]
2481 pub fn into_set_element_state(
2482 self,
2483 ) -> Option<(u64, SettableElementState, SignalProcessingSetElementStateResponder)> {
2484 if let SignalProcessingRequest::SetElementState {
2485 processing_element_id,
2486 state,
2487 responder,
2488 } = self
2489 {
2490 Some((processing_element_id, state, responder))
2491 } else {
2492 None
2493 }
2494 }
2495
2496 pub fn method_name(&self) -> &'static str {
2498 match *self {
2499 SignalProcessingRequest::GetElements { .. } => "get_elements",
2500 SignalProcessingRequest::WatchElementState { .. } => "watch_element_state",
2501 SignalProcessingRequest::GetTopologies { .. } => "get_topologies",
2502 SignalProcessingRequest::WatchTopology { .. } => "watch_topology",
2503 SignalProcessingRequest::SetTopology { .. } => "set_topology",
2504 SignalProcessingRequest::SetElementState { .. } => "set_element_state",
2505 SignalProcessingRequest::_UnknownMethod {
2506 method_type: fidl::MethodType::OneWay,
2507 ..
2508 } => "unknown one-way method",
2509 SignalProcessingRequest::_UnknownMethod {
2510 method_type: fidl::MethodType::TwoWay,
2511 ..
2512 } => "unknown two-way method",
2513 }
2514 }
2515}
2516
2517#[derive(Debug, Clone)]
2518pub struct SignalProcessingControlHandle {
2519 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2520}
2521
2522impl fidl::endpoints::ControlHandle for SignalProcessingControlHandle {
2523 fn shutdown(&self) {
2524 self.inner.shutdown()
2525 }
2526
2527 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2528 self.inner.shutdown_with_epitaph(status)
2529 }
2530
2531 fn is_closed(&self) -> bool {
2532 self.inner.channel().is_closed()
2533 }
2534 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2535 self.inner.channel().on_closed()
2536 }
2537
2538 #[cfg(target_os = "fuchsia")]
2539 fn signal_peer(
2540 &self,
2541 clear_mask: zx::Signals,
2542 set_mask: zx::Signals,
2543 ) -> Result<(), zx_status::Status> {
2544 use fidl::Peered;
2545 self.inner.channel().signal_peer(clear_mask, set_mask)
2546 }
2547}
2548
2549impl SignalProcessingControlHandle {}
2550
2551#[must_use = "FIDL methods require a response to be sent"]
2552#[derive(Debug)]
2553pub struct SignalProcessingGetElementsResponder {
2554 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2555 tx_id: u32,
2556}
2557
2558impl std::ops::Drop for SignalProcessingGetElementsResponder {
2562 fn drop(&mut self) {
2563 self.control_handle.shutdown();
2564 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2566 }
2567}
2568
2569impl fidl::endpoints::Responder for SignalProcessingGetElementsResponder {
2570 type ControlHandle = SignalProcessingControlHandle;
2571
2572 fn control_handle(&self) -> &SignalProcessingControlHandle {
2573 &self.control_handle
2574 }
2575
2576 fn drop_without_shutdown(mut self) {
2577 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2579 std::mem::forget(self);
2581 }
2582}
2583
2584impl SignalProcessingGetElementsResponder {
2585 pub fn send(self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
2589 let _result = self.send_raw(result);
2590 if _result.is_err() {
2591 self.control_handle.shutdown();
2592 }
2593 self.drop_without_shutdown();
2594 _result
2595 }
2596
2597 pub fn send_no_shutdown_on_err(
2599 self,
2600 mut result: Result<&[Element], i32>,
2601 ) -> Result<(), fidl::Error> {
2602 let _result = self.send_raw(result);
2603 self.drop_without_shutdown();
2604 _result
2605 }
2606
2607 fn send_raw(&self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
2608 self.control_handle
2609 .inner
2610 .send::<fidl::encoding::ResultType<ReaderGetElementsResponse, i32>>(
2611 result.map(|processing_elements| (processing_elements,)),
2612 self.tx_id,
2613 0x1b14ff4adf5dc6f8,
2614 fidl::encoding::DynamicFlags::empty(),
2615 )
2616 }
2617}
2618
2619#[must_use = "FIDL methods require a response to be sent"]
2620#[derive(Debug)]
2621pub struct SignalProcessingWatchElementStateResponder {
2622 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2623 tx_id: u32,
2624}
2625
2626impl std::ops::Drop for SignalProcessingWatchElementStateResponder {
2630 fn drop(&mut self) {
2631 self.control_handle.shutdown();
2632 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2634 }
2635}
2636
2637impl fidl::endpoints::Responder for SignalProcessingWatchElementStateResponder {
2638 type ControlHandle = SignalProcessingControlHandle;
2639
2640 fn control_handle(&self) -> &SignalProcessingControlHandle {
2641 &self.control_handle
2642 }
2643
2644 fn drop_without_shutdown(mut self) {
2645 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2647 std::mem::forget(self);
2649 }
2650}
2651
2652impl SignalProcessingWatchElementStateResponder {
2653 pub fn send(self, mut state: &ElementState) -> Result<(), fidl::Error> {
2657 let _result = self.send_raw(state);
2658 if _result.is_err() {
2659 self.control_handle.shutdown();
2660 }
2661 self.drop_without_shutdown();
2662 _result
2663 }
2664
2665 pub fn send_no_shutdown_on_err(self, mut state: &ElementState) -> Result<(), fidl::Error> {
2667 let _result = self.send_raw(state);
2668 self.drop_without_shutdown();
2669 _result
2670 }
2671
2672 fn send_raw(&self, mut state: &ElementState) -> Result<(), fidl::Error> {
2673 self.control_handle.inner.send::<ReaderWatchElementStateResponse>(
2674 (state,),
2675 self.tx_id,
2676 0x524da8772a69056f,
2677 fidl::encoding::DynamicFlags::empty(),
2678 )
2679 }
2680}
2681
2682#[must_use = "FIDL methods require a response to be sent"]
2683#[derive(Debug)]
2684pub struct SignalProcessingGetTopologiesResponder {
2685 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2686 tx_id: u32,
2687}
2688
2689impl std::ops::Drop for SignalProcessingGetTopologiesResponder {
2693 fn drop(&mut self) {
2694 self.control_handle.shutdown();
2695 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2697 }
2698}
2699
2700impl fidl::endpoints::Responder for SignalProcessingGetTopologiesResponder {
2701 type ControlHandle = SignalProcessingControlHandle;
2702
2703 fn control_handle(&self) -> &SignalProcessingControlHandle {
2704 &self.control_handle
2705 }
2706
2707 fn drop_without_shutdown(mut self) {
2708 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2710 std::mem::forget(self);
2712 }
2713}
2714
2715impl SignalProcessingGetTopologiesResponder {
2716 pub fn send(self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
2720 let _result = self.send_raw(result);
2721 if _result.is_err() {
2722 self.control_handle.shutdown();
2723 }
2724 self.drop_without_shutdown();
2725 _result
2726 }
2727
2728 pub fn send_no_shutdown_on_err(
2730 self,
2731 mut result: Result<&[Topology], i32>,
2732 ) -> Result<(), fidl::Error> {
2733 let _result = self.send_raw(result);
2734 self.drop_without_shutdown();
2735 _result
2736 }
2737
2738 fn send_raw(&self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
2739 self.control_handle
2740 .inner
2741 .send::<fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>>(
2742 result.map(|topologies| (topologies,)),
2743 self.tx_id,
2744 0x73ffb73af24d30b6,
2745 fidl::encoding::DynamicFlags::empty(),
2746 )
2747 }
2748}
2749
2750#[must_use = "FIDL methods require a response to be sent"]
2751#[derive(Debug)]
2752pub struct SignalProcessingWatchTopologyResponder {
2753 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2754 tx_id: u32,
2755}
2756
2757impl std::ops::Drop for SignalProcessingWatchTopologyResponder {
2761 fn drop(&mut self) {
2762 self.control_handle.shutdown();
2763 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2765 }
2766}
2767
2768impl fidl::endpoints::Responder for SignalProcessingWatchTopologyResponder {
2769 type ControlHandle = SignalProcessingControlHandle;
2770
2771 fn control_handle(&self) -> &SignalProcessingControlHandle {
2772 &self.control_handle
2773 }
2774
2775 fn drop_without_shutdown(mut self) {
2776 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2778 std::mem::forget(self);
2780 }
2781}
2782
2783impl SignalProcessingWatchTopologyResponder {
2784 pub fn send(self, mut topology_id: u64) -> Result<(), fidl::Error> {
2788 let _result = self.send_raw(topology_id);
2789 if _result.is_err() {
2790 self.control_handle.shutdown();
2791 }
2792 self.drop_without_shutdown();
2793 _result
2794 }
2795
2796 pub fn send_no_shutdown_on_err(self, mut topology_id: u64) -> Result<(), fidl::Error> {
2798 let _result = self.send_raw(topology_id);
2799 self.drop_without_shutdown();
2800 _result
2801 }
2802
2803 fn send_raw(&self, mut topology_id: u64) -> Result<(), fidl::Error> {
2804 self.control_handle.inner.send::<fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>>(
2805 fidl::encoding::Flexible::new((topology_id,)),
2806 self.tx_id,
2807 0x66d172acdb36a729,
2808 fidl::encoding::DynamicFlags::FLEXIBLE,
2809 )
2810 }
2811}
2812
2813#[must_use = "FIDL methods require a response to be sent"]
2814#[derive(Debug)]
2815pub struct SignalProcessingSetTopologyResponder {
2816 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2817 tx_id: u32,
2818}
2819
2820impl std::ops::Drop for SignalProcessingSetTopologyResponder {
2824 fn drop(&mut self) {
2825 self.control_handle.shutdown();
2826 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2828 }
2829}
2830
2831impl fidl::endpoints::Responder for SignalProcessingSetTopologyResponder {
2832 type ControlHandle = SignalProcessingControlHandle;
2833
2834 fn control_handle(&self) -> &SignalProcessingControlHandle {
2835 &self.control_handle
2836 }
2837
2838 fn drop_without_shutdown(mut self) {
2839 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2841 std::mem::forget(self);
2843 }
2844}
2845
2846impl SignalProcessingSetTopologyResponder {
2847 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2851 let _result = self.send_raw(result);
2852 if _result.is_err() {
2853 self.control_handle.shutdown();
2854 }
2855 self.drop_without_shutdown();
2856 _result
2857 }
2858
2859 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2861 let _result = self.send_raw(result);
2862 self.drop_without_shutdown();
2863 _result
2864 }
2865
2866 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2867 self.control_handle
2868 .inner
2869 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2870 result,
2871 self.tx_id,
2872 0x1d9a7f9b8fee790c,
2873 fidl::encoding::DynamicFlags::empty(),
2874 )
2875 }
2876}
2877
2878#[must_use = "FIDL methods require a response to be sent"]
2879#[derive(Debug)]
2880pub struct SignalProcessingSetElementStateResponder {
2881 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2882 tx_id: u32,
2883}
2884
2885impl std::ops::Drop for SignalProcessingSetElementStateResponder {
2889 fn drop(&mut self) {
2890 self.control_handle.shutdown();
2891 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2893 }
2894}
2895
2896impl fidl::endpoints::Responder for SignalProcessingSetElementStateResponder {
2897 type ControlHandle = SignalProcessingControlHandle;
2898
2899 fn control_handle(&self) -> &SignalProcessingControlHandle {
2900 &self.control_handle
2901 }
2902
2903 fn drop_without_shutdown(mut self) {
2904 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2906 std::mem::forget(self);
2908 }
2909}
2910
2911impl SignalProcessingSetElementStateResponder {
2912 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2916 let _result = self.send_raw(result);
2917 if _result.is_err() {
2918 self.control_handle.shutdown();
2919 }
2920 self.drop_without_shutdown();
2921 _result
2922 }
2923
2924 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2926 let _result = self.send_raw(result);
2927 self.drop_without_shutdown();
2928 _result
2929 }
2930
2931 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2932 self.control_handle
2933 .inner
2934 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2935 result,
2936 self.tx_id,
2937 0x38c3b2d4bae698f4,
2938 fidl::encoding::DynamicFlags::empty(),
2939 )
2940 }
2941}
2942
2943#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2944pub struct ConnectorServiceMarker;
2945
2946#[cfg(target_os = "fuchsia")]
2947impl fidl::endpoints::ServiceMarker for ConnectorServiceMarker {
2948 type Proxy = ConnectorServiceProxy;
2949 type Request = ConnectorServiceRequest;
2950 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.signalprocessing.ConnectorService";
2951}
2952
2953#[cfg(target_os = "fuchsia")]
2956pub enum ConnectorServiceRequest {
2957 Connector(ConnectorRequestStream),
2958}
2959
2960#[cfg(target_os = "fuchsia")]
2961impl fidl::endpoints::ServiceRequest for ConnectorServiceRequest {
2962 type Service = ConnectorServiceMarker;
2963
2964 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
2965 match name {
2966 "connector" => Self::Connector(
2967 <ConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
2968 ),
2969 _ => panic!("no such member protocol name for service ConnectorService"),
2970 }
2971 }
2972
2973 fn member_names() -> &'static [&'static str] {
2974 &["connector"]
2975 }
2976}
2977#[cfg(target_os = "fuchsia")]
2978pub struct ConnectorServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
2979
2980#[cfg(target_os = "fuchsia")]
2981impl fidl::endpoints::ServiceProxy for ConnectorServiceProxy {
2982 type Service = ConnectorServiceMarker;
2983
2984 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
2985 Self(opener)
2986 }
2987}
2988
2989#[cfg(target_os = "fuchsia")]
2990impl ConnectorServiceProxy {
2991 pub fn connect_to_connector(&self) -> Result<ConnectorProxy, fidl::Error> {
2992 let (proxy, server_end) = fidl::endpoints::create_proxy::<ConnectorMarker>();
2993 self.connect_channel_to_connector(server_end)?;
2994 Ok(proxy)
2995 }
2996
2997 pub fn connect_to_connector_sync(&self) -> Result<ConnectorSynchronousProxy, fidl::Error> {
3000 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ConnectorMarker>();
3001 self.connect_channel_to_connector(server_end)?;
3002 Ok(proxy)
3003 }
3004
3005 pub fn connect_channel_to_connector(
3008 &self,
3009 server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
3010 ) -> Result<(), fidl::Error> {
3011 self.0.open_member("connector", server_end.into_channel())
3012 }
3013
3014 pub fn instance_name(&self) -> &str {
3015 self.0.instance_name()
3016 }
3017}
3018
3019mod internal {
3020 use super::*;
3021
3022 impl fidl::encoding::ResourceTypeMarker for ConnectorSignalProcessingConnectRequest {
3023 type Borrowed<'a> = &'a mut Self;
3024 fn take_or_borrow<'a>(
3025 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3026 ) -> Self::Borrowed<'a> {
3027 value
3028 }
3029 }
3030
3031 unsafe impl fidl::encoding::TypeMarker for ConnectorSignalProcessingConnectRequest {
3032 type Owned = Self;
3033
3034 #[inline(always)]
3035 fn inline_align(_context: fidl::encoding::Context) -> usize {
3036 4
3037 }
3038
3039 #[inline(always)]
3040 fn inline_size(_context: fidl::encoding::Context) -> usize {
3041 4
3042 }
3043 }
3044
3045 unsafe impl
3046 fidl::encoding::Encode<
3047 ConnectorSignalProcessingConnectRequest,
3048 fidl::encoding::DefaultFuchsiaResourceDialect,
3049 > for &mut ConnectorSignalProcessingConnectRequest
3050 {
3051 #[inline]
3052 unsafe fn encode(
3053 self,
3054 encoder: &mut fidl::encoding::Encoder<
3055 '_,
3056 fidl::encoding::DefaultFuchsiaResourceDialect,
3057 >,
3058 offset: usize,
3059 _depth: fidl::encoding::Depth,
3060 ) -> fidl::Result<()> {
3061 encoder.debug_check_bounds::<ConnectorSignalProcessingConnectRequest>(offset);
3062 fidl::encoding::Encode::<ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3064 (
3065 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.protocol),
3066 ),
3067 encoder, offset, _depth
3068 )
3069 }
3070 }
3071 unsafe impl<
3072 T0: fidl::encoding::Encode<
3073 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>>,
3074 fidl::encoding::DefaultFuchsiaResourceDialect,
3075 >,
3076 >
3077 fidl::encoding::Encode<
3078 ConnectorSignalProcessingConnectRequest,
3079 fidl::encoding::DefaultFuchsiaResourceDialect,
3080 > for (T0,)
3081 {
3082 #[inline]
3083 unsafe fn encode(
3084 self,
3085 encoder: &mut fidl::encoding::Encoder<
3086 '_,
3087 fidl::encoding::DefaultFuchsiaResourceDialect,
3088 >,
3089 offset: usize,
3090 depth: fidl::encoding::Depth,
3091 ) -> fidl::Result<()> {
3092 encoder.debug_check_bounds::<ConnectorSignalProcessingConnectRequest>(offset);
3093 self.0.encode(encoder, offset + 0, depth)?;
3097 Ok(())
3098 }
3099 }
3100
3101 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3102 for ConnectorSignalProcessingConnectRequest
3103 {
3104 #[inline(always)]
3105 fn new_empty() -> Self {
3106 Self {
3107 protocol: fidl::new_empty!(
3108 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>>,
3109 fidl::encoding::DefaultFuchsiaResourceDialect
3110 ),
3111 }
3112 }
3113
3114 #[inline]
3115 unsafe fn decode(
3116 &mut self,
3117 decoder: &mut fidl::encoding::Decoder<
3118 '_,
3119 fidl::encoding::DefaultFuchsiaResourceDialect,
3120 >,
3121 offset: usize,
3122 _depth: fidl::encoding::Depth,
3123 ) -> fidl::Result<()> {
3124 decoder.debug_check_bounds::<Self>(offset);
3125 fidl::decode!(
3127 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>>,
3128 fidl::encoding::DefaultFuchsiaResourceDialect,
3129 &mut self.protocol,
3130 decoder,
3131 offset + 0,
3132 _depth
3133 )?;
3134 Ok(())
3135 }
3136 }
3137}