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 Self { client: fidl::client::sync::Client::new(channel) }
70 }
71
72 pub fn into_channel(self) -> fidl::Channel {
73 self.client.into_channel()
74 }
75
76 pub fn wait_for_event(
79 &self,
80 deadline: zx::MonotonicInstant,
81 ) -> Result<ConnectorEvent, fidl::Error> {
82 ConnectorEvent::decode(self.client.wait_for_event::<ConnectorMarker>(deadline)?)
83 }
84
85 pub fn r#signal_processing_connect(
97 &self,
98 mut protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
99 ) -> Result<(), fidl::Error> {
100 self.client.send::<ConnectorSignalProcessingConnectRequest>(
101 (protocol,),
102 0xa81907ce6066295,
103 fidl::encoding::DynamicFlags::empty(),
104 )
105 }
106}
107
108#[cfg(target_os = "fuchsia")]
109impl From<ConnectorSynchronousProxy> for zx::NullableHandle {
110 fn from(value: ConnectorSynchronousProxy) -> Self {
111 value.into_channel().into()
112 }
113}
114
115#[cfg(target_os = "fuchsia")]
116impl From<fidl::Channel> for ConnectorSynchronousProxy {
117 fn from(value: fidl::Channel) -> Self {
118 Self::new(value)
119 }
120}
121
122#[cfg(target_os = "fuchsia")]
123impl fidl::endpoints::FromClient for ConnectorSynchronousProxy {
124 type Protocol = ConnectorMarker;
125
126 fn from_client(value: fidl::endpoints::ClientEnd<ConnectorMarker>) -> Self {
127 Self::new(value.into_channel())
128 }
129}
130
131#[derive(Debug, Clone)]
132pub struct ConnectorProxy {
133 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
134}
135
136impl fidl::endpoints::Proxy for ConnectorProxy {
137 type Protocol = ConnectorMarker;
138
139 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
140 Self::new(inner)
141 }
142
143 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
144 self.client.into_channel().map_err(|client| Self { client })
145 }
146
147 fn as_channel(&self) -> &::fidl::AsyncChannel {
148 self.client.as_channel()
149 }
150}
151
152impl ConnectorProxy {
153 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
155 let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
156 Self { client: fidl::client::Client::new(channel, protocol_name) }
157 }
158
159 pub fn take_event_stream(&self) -> ConnectorEventStream {
165 ConnectorEventStream { event_receiver: self.client.take_event_receiver() }
166 }
167
168 pub fn r#signal_processing_connect(
180 &self,
181 mut protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
182 ) -> Result<(), fidl::Error> {
183 ConnectorProxyInterface::r#signal_processing_connect(self, protocol)
184 }
185}
186
187impl ConnectorProxyInterface for ConnectorProxy {
188 fn r#signal_processing_connect(
189 &self,
190 mut protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
191 ) -> Result<(), fidl::Error> {
192 self.client.send::<ConnectorSignalProcessingConnectRequest>(
193 (protocol,),
194 0xa81907ce6066295,
195 fidl::encoding::DynamicFlags::empty(),
196 )
197 }
198}
199
200pub struct ConnectorEventStream {
201 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
202}
203
204impl std::marker::Unpin for ConnectorEventStream {}
205
206impl futures::stream::FusedStream for ConnectorEventStream {
207 fn is_terminated(&self) -> bool {
208 self.event_receiver.is_terminated()
209 }
210}
211
212impl futures::Stream for ConnectorEventStream {
213 type Item = Result<ConnectorEvent, fidl::Error>;
214
215 fn poll_next(
216 mut self: std::pin::Pin<&mut Self>,
217 cx: &mut std::task::Context<'_>,
218 ) -> std::task::Poll<Option<Self::Item>> {
219 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
220 &mut self.event_receiver,
221 cx
222 )?) {
223 Some(buf) => std::task::Poll::Ready(Some(ConnectorEvent::decode(buf))),
224 None => std::task::Poll::Ready(None),
225 }
226 }
227}
228
229#[derive(Debug)]
230pub enum ConnectorEvent {}
231
232impl ConnectorEvent {
233 fn decode(
235 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
236 ) -> Result<ConnectorEvent, fidl::Error> {
237 let (bytes, _handles) = buf.split_mut();
238 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
239 debug_assert_eq!(tx_header.tx_id, 0);
240 match tx_header.ordinal {
241 _ => Err(fidl::Error::UnknownOrdinal {
242 ordinal: tx_header.ordinal,
243 protocol_name: <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
244 }),
245 }
246 }
247}
248
249pub struct ConnectorRequestStream {
251 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
252 is_terminated: bool,
253}
254
255impl std::marker::Unpin for ConnectorRequestStream {}
256
257impl futures::stream::FusedStream for ConnectorRequestStream {
258 fn is_terminated(&self) -> bool {
259 self.is_terminated
260 }
261}
262
263impl fidl::endpoints::RequestStream for ConnectorRequestStream {
264 type Protocol = ConnectorMarker;
265 type ControlHandle = ConnectorControlHandle;
266
267 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
268 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
269 }
270
271 fn control_handle(&self) -> Self::ControlHandle {
272 ConnectorControlHandle { inner: self.inner.clone() }
273 }
274
275 fn into_inner(
276 self,
277 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
278 {
279 (self.inner, self.is_terminated)
280 }
281
282 fn from_inner(
283 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
284 is_terminated: bool,
285 ) -> Self {
286 Self { inner, is_terminated }
287 }
288}
289
290impl futures::Stream for ConnectorRequestStream {
291 type Item = Result<ConnectorRequest, fidl::Error>;
292
293 fn poll_next(
294 mut self: std::pin::Pin<&mut Self>,
295 cx: &mut std::task::Context<'_>,
296 ) -> std::task::Poll<Option<Self::Item>> {
297 let this = &mut *self;
298 if this.inner.check_shutdown(cx) {
299 this.is_terminated = true;
300 return std::task::Poll::Ready(None);
301 }
302 if this.is_terminated {
303 panic!("polled ConnectorRequestStream after completion");
304 }
305 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
306 |bytes, handles| {
307 match this.inner.channel().read_etc(cx, bytes, handles) {
308 std::task::Poll::Ready(Ok(())) => {}
309 std::task::Poll::Pending => return std::task::Poll::Pending,
310 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
311 this.is_terminated = true;
312 return std::task::Poll::Ready(None);
313 }
314 std::task::Poll::Ready(Err(e)) => {
315 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
316 e.into(),
317 ))));
318 }
319 }
320
321 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
323
324 std::task::Poll::Ready(Some(match header.ordinal {
325 0xa81907ce6066295 => {
326 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
327 let mut req = fidl::new_empty!(
328 ConnectorSignalProcessingConnectRequest,
329 fidl::encoding::DefaultFuchsiaResourceDialect
330 );
331 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
332 let control_handle = ConnectorControlHandle { inner: this.inner.clone() };
333 Ok(ConnectorRequest::SignalProcessingConnect {
334 protocol: req.protocol,
335
336 control_handle,
337 })
338 }
339 _ => Err(fidl::Error::UnknownOrdinal {
340 ordinal: header.ordinal,
341 protocol_name:
342 <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
343 }),
344 }))
345 },
346 )
347 }
348}
349
350#[derive(Debug)]
353pub enum ConnectorRequest {
354 SignalProcessingConnect {
366 protocol: fidl::endpoints::ServerEnd<SignalProcessingMarker>,
367 control_handle: ConnectorControlHandle,
368 },
369}
370
371impl ConnectorRequest {
372 #[allow(irrefutable_let_patterns)]
373 pub fn into_signal_processing_connect(
374 self,
375 ) -> Option<(fidl::endpoints::ServerEnd<SignalProcessingMarker>, ConnectorControlHandle)> {
376 if let ConnectorRequest::SignalProcessingConnect { protocol, control_handle } = self {
377 Some((protocol, control_handle))
378 } else {
379 None
380 }
381 }
382
383 pub fn method_name(&self) -> &'static str {
385 match *self {
386 ConnectorRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
387 }
388 }
389}
390
391#[derive(Debug, Clone)]
392pub struct ConnectorControlHandle {
393 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
394}
395
396impl ConnectorControlHandle {
397 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
398 self.inner.shutdown_with_epitaph(status.into())
399 }
400}
401
402impl fidl::endpoints::ControlHandle for ConnectorControlHandle {
403 fn shutdown(&self) {
404 self.inner.shutdown()
405 }
406
407 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
408 self.inner.shutdown_with_epitaph(status)
409 }
410
411 fn is_closed(&self) -> bool {
412 self.inner.channel().is_closed()
413 }
414 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
415 self.inner.channel().on_closed()
416 }
417
418 #[cfg(target_os = "fuchsia")]
419 fn signal_peer(
420 &self,
421 clear_mask: zx::Signals,
422 set_mask: zx::Signals,
423 ) -> Result<(), zx_status::Status> {
424 use fidl::Peered;
425 self.inner.channel().signal_peer(clear_mask, set_mask)
426 }
427}
428
429impl ConnectorControlHandle {}
430
431#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
432pub struct ReaderMarker;
433
434impl fidl::endpoints::ProtocolMarker for ReaderMarker {
435 type Proxy = ReaderProxy;
436 type RequestStream = ReaderRequestStream;
437 #[cfg(target_os = "fuchsia")]
438 type SynchronousProxy = ReaderSynchronousProxy;
439
440 const DEBUG_NAME: &'static str = "(anonymous) Reader";
441}
442pub type ReaderGetElementsResult = Result<Vec<Element>, i32>;
443pub type ReaderGetTopologiesResult = Result<Vec<Topology>, i32>;
444
445pub trait ReaderProxyInterface: Send + Sync {
446 type GetElementsResponseFut: std::future::Future<Output = Result<ReaderGetElementsResult, fidl::Error>>
447 + Send;
448 fn r#get_elements(&self) -> Self::GetElementsResponseFut;
449 type WatchElementStateResponseFut: std::future::Future<Output = Result<ElementState, fidl::Error>>
450 + Send;
451 fn r#watch_element_state(
452 &self,
453 processing_element_id: u64,
454 ) -> Self::WatchElementStateResponseFut;
455 type GetTopologiesResponseFut: std::future::Future<Output = Result<ReaderGetTopologiesResult, fidl::Error>>
456 + Send;
457 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut;
458 type WatchTopologyResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
459 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut;
460}
461#[derive(Debug)]
462#[cfg(target_os = "fuchsia")]
463pub struct ReaderSynchronousProxy {
464 client: fidl::client::sync::Client,
465}
466
467#[cfg(target_os = "fuchsia")]
468impl fidl::endpoints::SynchronousProxy for ReaderSynchronousProxy {
469 type Proxy = ReaderProxy;
470 type Protocol = ReaderMarker;
471
472 fn from_channel(inner: fidl::Channel) -> Self {
473 Self::new(inner)
474 }
475
476 fn into_channel(self) -> fidl::Channel {
477 self.client.into_channel()
478 }
479
480 fn as_channel(&self) -> &fidl::Channel {
481 self.client.as_channel()
482 }
483}
484
485#[cfg(target_os = "fuchsia")]
486impl ReaderSynchronousProxy {
487 pub fn new(channel: fidl::Channel) -> Self {
488 Self { client: fidl::client::sync::Client::new(channel) }
489 }
490
491 pub fn into_channel(self) -> fidl::Channel {
492 self.client.into_channel()
493 }
494
495 pub fn wait_for_event(
498 &self,
499 deadline: zx::MonotonicInstant,
500 ) -> Result<ReaderEvent, fidl::Error> {
501 ReaderEvent::decode(self.client.wait_for_event::<ReaderMarker>(deadline)?)
502 }
503
504 pub fn r#get_elements(
507 &self,
508 ___deadline: zx::MonotonicInstant,
509 ) -> Result<ReaderGetElementsResult, fidl::Error> {
510 let _response = self.client.send_query::<
511 fidl::encoding::EmptyPayload,
512 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
513 ReaderMarker,
514 >(
515 (),
516 0x1b14ff4adf5dc6f8,
517 fidl::encoding::DynamicFlags::empty(),
518 ___deadline,
519 )?;
520 Ok(_response.map(|x| x.processing_elements))
521 }
522
523 pub fn r#watch_element_state(
536 &self,
537 mut processing_element_id: u64,
538 ___deadline: zx::MonotonicInstant,
539 ) -> Result<ElementState, fidl::Error> {
540 let _response = self.client.send_query::<
541 ReaderWatchElementStateRequest,
542 ReaderWatchElementStateResponse,
543 ReaderMarker,
544 >(
545 (processing_element_id,),
546 0x524da8772a69056f,
547 fidl::encoding::DynamicFlags::empty(),
548 ___deadline,
549 )?;
550 Ok(_response.state)
551 }
552
553 pub fn r#get_topologies(
562 &self,
563 ___deadline: zx::MonotonicInstant,
564 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
565 let _response = self.client.send_query::<
566 fidl::encoding::EmptyPayload,
567 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
568 ReaderMarker,
569 >(
570 (),
571 0x73ffb73af24d30b6,
572 fidl::encoding::DynamicFlags::empty(),
573 ___deadline,
574 )?;
575 Ok(_response.map(|x| x.topologies))
576 }
577
578 pub fn r#watch_topology(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
586 let _response = self.client.send_query::<
587 fidl::encoding::EmptyPayload,
588 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
589 ReaderMarker,
590 >(
591 (),
592 0x66d172acdb36a729,
593 fidl::encoding::DynamicFlags::FLEXIBLE,
594 ___deadline,
595 )?
596 .into_result::<ReaderMarker>("watch_topology")?;
597 Ok(_response.topology_id)
598 }
599}
600
601#[cfg(target_os = "fuchsia")]
602impl From<ReaderSynchronousProxy> for zx::NullableHandle {
603 fn from(value: ReaderSynchronousProxy) -> Self {
604 value.into_channel().into()
605 }
606}
607
608#[cfg(target_os = "fuchsia")]
609impl From<fidl::Channel> for ReaderSynchronousProxy {
610 fn from(value: fidl::Channel) -> Self {
611 Self::new(value)
612 }
613}
614
615#[cfg(target_os = "fuchsia")]
616impl fidl::endpoints::FromClient for ReaderSynchronousProxy {
617 type Protocol = ReaderMarker;
618
619 fn from_client(value: fidl::endpoints::ClientEnd<ReaderMarker>) -> Self {
620 Self::new(value.into_channel())
621 }
622}
623
624#[derive(Debug, Clone)]
625pub struct ReaderProxy {
626 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
627}
628
629impl fidl::endpoints::Proxy for ReaderProxy {
630 type Protocol = ReaderMarker;
631
632 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
633 Self::new(inner)
634 }
635
636 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
637 self.client.into_channel().map_err(|client| Self { client })
638 }
639
640 fn as_channel(&self) -> &::fidl::AsyncChannel {
641 self.client.as_channel()
642 }
643}
644
645impl ReaderProxy {
646 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
648 let protocol_name = <ReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
649 Self { client: fidl::client::Client::new(channel, protocol_name) }
650 }
651
652 pub fn take_event_stream(&self) -> ReaderEventStream {
658 ReaderEventStream { event_receiver: self.client.take_event_receiver() }
659 }
660
661 pub fn r#get_elements(
664 &self,
665 ) -> fidl::client::QueryResponseFut<
666 ReaderGetElementsResult,
667 fidl::encoding::DefaultFuchsiaResourceDialect,
668 > {
669 ReaderProxyInterface::r#get_elements(self)
670 }
671
672 pub fn r#watch_element_state(
685 &self,
686 mut processing_element_id: u64,
687 ) -> fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>
688 {
689 ReaderProxyInterface::r#watch_element_state(self, processing_element_id)
690 }
691
692 pub fn r#get_topologies(
701 &self,
702 ) -> fidl::client::QueryResponseFut<
703 ReaderGetTopologiesResult,
704 fidl::encoding::DefaultFuchsiaResourceDialect,
705 > {
706 ReaderProxyInterface::r#get_topologies(self)
707 }
708
709 pub fn r#watch_topology(
717 &self,
718 ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
719 ReaderProxyInterface::r#watch_topology(self)
720 }
721}
722
723impl ReaderProxyInterface for ReaderProxy {
724 type GetElementsResponseFut = fidl::client::QueryResponseFut<
725 ReaderGetElementsResult,
726 fidl::encoding::DefaultFuchsiaResourceDialect,
727 >;
728 fn r#get_elements(&self) -> Self::GetElementsResponseFut {
729 fn _decode(
730 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
731 ) -> Result<ReaderGetElementsResult, fidl::Error> {
732 let _response = fidl::client::decode_transaction_body::<
733 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
734 fidl::encoding::DefaultFuchsiaResourceDialect,
735 0x1b14ff4adf5dc6f8,
736 >(_buf?)?;
737 Ok(_response.map(|x| x.processing_elements))
738 }
739 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetElementsResult>(
740 (),
741 0x1b14ff4adf5dc6f8,
742 fidl::encoding::DynamicFlags::empty(),
743 _decode,
744 )
745 }
746
747 type WatchElementStateResponseFut =
748 fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>;
749 fn r#watch_element_state(
750 &self,
751 mut processing_element_id: u64,
752 ) -> Self::WatchElementStateResponseFut {
753 fn _decode(
754 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
755 ) -> Result<ElementState, fidl::Error> {
756 let _response = fidl::client::decode_transaction_body::<
757 ReaderWatchElementStateResponse,
758 fidl::encoding::DefaultFuchsiaResourceDialect,
759 0x524da8772a69056f,
760 >(_buf?)?;
761 Ok(_response.state)
762 }
763 self.client.send_query_and_decode::<ReaderWatchElementStateRequest, ElementState>(
764 (processing_element_id,),
765 0x524da8772a69056f,
766 fidl::encoding::DynamicFlags::empty(),
767 _decode,
768 )
769 }
770
771 type GetTopologiesResponseFut = fidl::client::QueryResponseFut<
772 ReaderGetTopologiesResult,
773 fidl::encoding::DefaultFuchsiaResourceDialect,
774 >;
775 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut {
776 fn _decode(
777 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
778 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
779 let _response = fidl::client::decode_transaction_body::<
780 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
781 fidl::encoding::DefaultFuchsiaResourceDialect,
782 0x73ffb73af24d30b6,
783 >(_buf?)?;
784 Ok(_response.map(|x| x.topologies))
785 }
786 self.client
787 .send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetTopologiesResult>(
788 (),
789 0x73ffb73af24d30b6,
790 fidl::encoding::DynamicFlags::empty(),
791 _decode,
792 )
793 }
794
795 type WatchTopologyResponseFut =
796 fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
797 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut {
798 fn _decode(
799 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
800 ) -> Result<u64, fidl::Error> {
801 let _response = fidl::client::decode_transaction_body::<
802 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
803 fidl::encoding::DefaultFuchsiaResourceDialect,
804 0x66d172acdb36a729,
805 >(_buf?)?
806 .into_result::<ReaderMarker>("watch_topology")?;
807 Ok(_response.topology_id)
808 }
809 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
810 (),
811 0x66d172acdb36a729,
812 fidl::encoding::DynamicFlags::FLEXIBLE,
813 _decode,
814 )
815 }
816}
817
818pub struct ReaderEventStream {
819 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
820}
821
822impl std::marker::Unpin for ReaderEventStream {}
823
824impl futures::stream::FusedStream for ReaderEventStream {
825 fn is_terminated(&self) -> bool {
826 self.event_receiver.is_terminated()
827 }
828}
829
830impl futures::Stream for ReaderEventStream {
831 type Item = Result<ReaderEvent, fidl::Error>;
832
833 fn poll_next(
834 mut self: std::pin::Pin<&mut Self>,
835 cx: &mut std::task::Context<'_>,
836 ) -> std::task::Poll<Option<Self::Item>> {
837 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
838 &mut self.event_receiver,
839 cx
840 )?) {
841 Some(buf) => std::task::Poll::Ready(Some(ReaderEvent::decode(buf))),
842 None => std::task::Poll::Ready(None),
843 }
844 }
845}
846
847#[derive(Debug)]
848pub enum ReaderEvent {
849 #[non_exhaustive]
850 _UnknownEvent {
851 ordinal: u64,
853 },
854}
855
856impl ReaderEvent {
857 fn decode(
859 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
860 ) -> Result<ReaderEvent, fidl::Error> {
861 let (bytes, _handles) = buf.split_mut();
862 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
863 debug_assert_eq!(tx_header.tx_id, 0);
864 match tx_header.ordinal {
865 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
866 Ok(ReaderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
867 }
868 _ => Err(fidl::Error::UnknownOrdinal {
869 ordinal: tx_header.ordinal,
870 protocol_name: <ReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
871 }),
872 }
873 }
874}
875
876pub struct ReaderRequestStream {
878 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
879 is_terminated: bool,
880}
881
882impl std::marker::Unpin for ReaderRequestStream {}
883
884impl futures::stream::FusedStream for ReaderRequestStream {
885 fn is_terminated(&self) -> bool {
886 self.is_terminated
887 }
888}
889
890impl fidl::endpoints::RequestStream for ReaderRequestStream {
891 type Protocol = ReaderMarker;
892 type ControlHandle = ReaderControlHandle;
893
894 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
895 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
896 }
897
898 fn control_handle(&self) -> Self::ControlHandle {
899 ReaderControlHandle { inner: self.inner.clone() }
900 }
901
902 fn into_inner(
903 self,
904 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
905 {
906 (self.inner, self.is_terminated)
907 }
908
909 fn from_inner(
910 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
911 is_terminated: bool,
912 ) -> Self {
913 Self { inner, is_terminated }
914 }
915}
916
917impl futures::Stream for ReaderRequestStream {
918 type Item = Result<ReaderRequest, fidl::Error>;
919
920 fn poll_next(
921 mut self: std::pin::Pin<&mut Self>,
922 cx: &mut std::task::Context<'_>,
923 ) -> std::task::Poll<Option<Self::Item>> {
924 let this = &mut *self;
925 if this.inner.check_shutdown(cx) {
926 this.is_terminated = true;
927 return std::task::Poll::Ready(None);
928 }
929 if this.is_terminated {
930 panic!("polled ReaderRequestStream after completion");
931 }
932 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
933 |bytes, handles| {
934 match this.inner.channel().read_etc(cx, bytes, handles) {
935 std::task::Poll::Ready(Ok(())) => {}
936 std::task::Poll::Pending => return std::task::Poll::Pending,
937 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
938 this.is_terminated = true;
939 return std::task::Poll::Ready(None);
940 }
941 std::task::Poll::Ready(Err(e)) => {
942 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
943 e.into(),
944 ))));
945 }
946 }
947
948 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
950
951 std::task::Poll::Ready(Some(match header.ordinal {
952 0x1b14ff4adf5dc6f8 => {
953 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
954 let mut req = fidl::new_empty!(
955 fidl::encoding::EmptyPayload,
956 fidl::encoding::DefaultFuchsiaResourceDialect
957 );
958 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
959 let control_handle = ReaderControlHandle { inner: this.inner.clone() };
960 Ok(ReaderRequest::GetElements {
961 responder: ReaderGetElementsResponder {
962 control_handle: std::mem::ManuallyDrop::new(control_handle),
963 tx_id: header.tx_id,
964 },
965 })
966 }
967 0x524da8772a69056f => {
968 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
969 let mut req = fidl::new_empty!(
970 ReaderWatchElementStateRequest,
971 fidl::encoding::DefaultFuchsiaResourceDialect
972 );
973 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReaderWatchElementStateRequest>(&header, _body_bytes, handles, &mut req)?;
974 let control_handle = ReaderControlHandle { inner: this.inner.clone() };
975 Ok(ReaderRequest::WatchElementState {
976 processing_element_id: req.processing_element_id,
977
978 responder: ReaderWatchElementStateResponder {
979 control_handle: std::mem::ManuallyDrop::new(control_handle),
980 tx_id: header.tx_id,
981 },
982 })
983 }
984 0x73ffb73af24d30b6 => {
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 = ReaderControlHandle { inner: this.inner.clone() };
992 Ok(ReaderRequest::GetTopologies {
993 responder: ReaderGetTopologiesResponder {
994 control_handle: std::mem::ManuallyDrop::new(control_handle),
995 tx_id: header.tx_id,
996 },
997 })
998 }
999 0x66d172acdb36a729 => {
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 = ReaderControlHandle { inner: this.inner.clone() };
1007 Ok(ReaderRequest::WatchTopology {
1008 responder: ReaderWatchTopologyResponder {
1009 control_handle: std::mem::ManuallyDrop::new(control_handle),
1010 tx_id: header.tx_id,
1011 },
1012 })
1013 }
1014 _ if header.tx_id == 0
1015 && header
1016 .dynamic_flags()
1017 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1018 {
1019 Ok(ReaderRequest::_UnknownMethod {
1020 ordinal: header.ordinal,
1021 control_handle: ReaderControlHandle { inner: this.inner.clone() },
1022 method_type: fidl::MethodType::OneWay,
1023 })
1024 }
1025 _ if header
1026 .dynamic_flags()
1027 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1028 {
1029 this.inner.send_framework_err(
1030 fidl::encoding::FrameworkErr::UnknownMethod,
1031 header.tx_id,
1032 header.ordinal,
1033 header.dynamic_flags(),
1034 (bytes, handles),
1035 )?;
1036 Ok(ReaderRequest::_UnknownMethod {
1037 ordinal: header.ordinal,
1038 control_handle: ReaderControlHandle { inner: this.inner.clone() },
1039 method_type: fidl::MethodType::TwoWay,
1040 })
1041 }
1042 _ => Err(fidl::Error::UnknownOrdinal {
1043 ordinal: header.ordinal,
1044 protocol_name:
1045 <ReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1046 }),
1047 }))
1048 },
1049 )
1050 }
1051}
1052
1053#[derive(Debug)]
1059pub enum ReaderRequest {
1060 GetElements { responder: ReaderGetElementsResponder },
1063 WatchElementState { processing_element_id: u64, responder: ReaderWatchElementStateResponder },
1076 GetTopologies { responder: ReaderGetTopologiesResponder },
1085 WatchTopology { responder: ReaderWatchTopologyResponder },
1093 #[non_exhaustive]
1095 _UnknownMethod {
1096 ordinal: u64,
1098 control_handle: ReaderControlHandle,
1099 method_type: fidl::MethodType,
1100 },
1101}
1102
1103impl ReaderRequest {
1104 #[allow(irrefutable_let_patterns)]
1105 pub fn into_get_elements(self) -> Option<(ReaderGetElementsResponder)> {
1106 if let ReaderRequest::GetElements { responder } = self { Some((responder)) } else { None }
1107 }
1108
1109 #[allow(irrefutable_let_patterns)]
1110 pub fn into_watch_element_state(self) -> Option<(u64, ReaderWatchElementStateResponder)> {
1111 if let ReaderRequest::WatchElementState { processing_element_id, responder } = self {
1112 Some((processing_element_id, responder))
1113 } else {
1114 None
1115 }
1116 }
1117
1118 #[allow(irrefutable_let_patterns)]
1119 pub fn into_get_topologies(self) -> Option<(ReaderGetTopologiesResponder)> {
1120 if let ReaderRequest::GetTopologies { responder } = self { Some((responder)) } else { None }
1121 }
1122
1123 #[allow(irrefutable_let_patterns)]
1124 pub fn into_watch_topology(self) -> Option<(ReaderWatchTopologyResponder)> {
1125 if let ReaderRequest::WatchTopology { responder } = self { Some((responder)) } else { None }
1126 }
1127
1128 pub fn method_name(&self) -> &'static str {
1130 match *self {
1131 ReaderRequest::GetElements { .. } => "get_elements",
1132 ReaderRequest::WatchElementState { .. } => "watch_element_state",
1133 ReaderRequest::GetTopologies { .. } => "get_topologies",
1134 ReaderRequest::WatchTopology { .. } => "watch_topology",
1135 ReaderRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1136 "unknown one-way method"
1137 }
1138 ReaderRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1139 "unknown two-way method"
1140 }
1141 }
1142 }
1143}
1144
1145#[derive(Debug, Clone)]
1146pub struct ReaderControlHandle {
1147 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1148}
1149
1150impl ReaderControlHandle {
1151 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1152 self.inner.shutdown_with_epitaph(status.into())
1153 }
1154}
1155
1156impl fidl::endpoints::ControlHandle for ReaderControlHandle {
1157 fn shutdown(&self) {
1158 self.inner.shutdown()
1159 }
1160
1161 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1162 self.inner.shutdown_with_epitaph(status)
1163 }
1164
1165 fn is_closed(&self) -> bool {
1166 self.inner.channel().is_closed()
1167 }
1168 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1169 self.inner.channel().on_closed()
1170 }
1171
1172 #[cfg(target_os = "fuchsia")]
1173 fn signal_peer(
1174 &self,
1175 clear_mask: zx::Signals,
1176 set_mask: zx::Signals,
1177 ) -> Result<(), zx_status::Status> {
1178 use fidl::Peered;
1179 self.inner.channel().signal_peer(clear_mask, set_mask)
1180 }
1181}
1182
1183impl ReaderControlHandle {}
1184
1185#[must_use = "FIDL methods require a response to be sent"]
1186#[derive(Debug)]
1187pub struct ReaderGetElementsResponder {
1188 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1189 tx_id: u32,
1190}
1191
1192impl std::ops::Drop for ReaderGetElementsResponder {
1196 fn drop(&mut self) {
1197 self.control_handle.shutdown();
1198 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1200 }
1201}
1202
1203impl fidl::endpoints::Responder for ReaderGetElementsResponder {
1204 type ControlHandle = ReaderControlHandle;
1205
1206 fn control_handle(&self) -> &ReaderControlHandle {
1207 &self.control_handle
1208 }
1209
1210 fn drop_without_shutdown(mut self) {
1211 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1213 std::mem::forget(self);
1215 }
1216}
1217
1218impl ReaderGetElementsResponder {
1219 pub fn send(self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
1223 let _result = self.send_raw(result);
1224 if _result.is_err() {
1225 self.control_handle.shutdown();
1226 }
1227 self.drop_without_shutdown();
1228 _result
1229 }
1230
1231 pub fn send_no_shutdown_on_err(
1233 self,
1234 mut result: Result<&[Element], i32>,
1235 ) -> Result<(), fidl::Error> {
1236 let _result = self.send_raw(result);
1237 self.drop_without_shutdown();
1238 _result
1239 }
1240
1241 fn send_raw(&self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
1242 self.control_handle
1243 .inner
1244 .send::<fidl::encoding::ResultType<ReaderGetElementsResponse, i32>>(
1245 result.map(|processing_elements| (processing_elements,)),
1246 self.tx_id,
1247 0x1b14ff4adf5dc6f8,
1248 fidl::encoding::DynamicFlags::empty(),
1249 )
1250 }
1251}
1252
1253#[must_use = "FIDL methods require a response to be sent"]
1254#[derive(Debug)]
1255pub struct ReaderWatchElementStateResponder {
1256 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1257 tx_id: u32,
1258}
1259
1260impl std::ops::Drop for ReaderWatchElementStateResponder {
1264 fn drop(&mut self) {
1265 self.control_handle.shutdown();
1266 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1268 }
1269}
1270
1271impl fidl::endpoints::Responder for ReaderWatchElementStateResponder {
1272 type ControlHandle = ReaderControlHandle;
1273
1274 fn control_handle(&self) -> &ReaderControlHandle {
1275 &self.control_handle
1276 }
1277
1278 fn drop_without_shutdown(mut self) {
1279 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1281 std::mem::forget(self);
1283 }
1284}
1285
1286impl ReaderWatchElementStateResponder {
1287 pub fn send(self, mut state: &ElementState) -> Result<(), fidl::Error> {
1291 let _result = self.send_raw(state);
1292 if _result.is_err() {
1293 self.control_handle.shutdown();
1294 }
1295 self.drop_without_shutdown();
1296 _result
1297 }
1298
1299 pub fn send_no_shutdown_on_err(self, mut state: &ElementState) -> Result<(), fidl::Error> {
1301 let _result = self.send_raw(state);
1302 self.drop_without_shutdown();
1303 _result
1304 }
1305
1306 fn send_raw(&self, mut state: &ElementState) -> Result<(), fidl::Error> {
1307 self.control_handle.inner.send::<ReaderWatchElementStateResponse>(
1308 (state,),
1309 self.tx_id,
1310 0x524da8772a69056f,
1311 fidl::encoding::DynamicFlags::empty(),
1312 )
1313 }
1314}
1315
1316#[must_use = "FIDL methods require a response to be sent"]
1317#[derive(Debug)]
1318pub struct ReaderGetTopologiesResponder {
1319 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1320 tx_id: u32,
1321}
1322
1323impl std::ops::Drop for ReaderGetTopologiesResponder {
1327 fn drop(&mut self) {
1328 self.control_handle.shutdown();
1329 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1331 }
1332}
1333
1334impl fidl::endpoints::Responder for ReaderGetTopologiesResponder {
1335 type ControlHandle = ReaderControlHandle;
1336
1337 fn control_handle(&self) -> &ReaderControlHandle {
1338 &self.control_handle
1339 }
1340
1341 fn drop_without_shutdown(mut self) {
1342 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1344 std::mem::forget(self);
1346 }
1347}
1348
1349impl ReaderGetTopologiesResponder {
1350 pub fn send(self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
1354 let _result = self.send_raw(result);
1355 if _result.is_err() {
1356 self.control_handle.shutdown();
1357 }
1358 self.drop_without_shutdown();
1359 _result
1360 }
1361
1362 pub fn send_no_shutdown_on_err(
1364 self,
1365 mut result: Result<&[Topology], i32>,
1366 ) -> Result<(), fidl::Error> {
1367 let _result = self.send_raw(result);
1368 self.drop_without_shutdown();
1369 _result
1370 }
1371
1372 fn send_raw(&self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
1373 self.control_handle
1374 .inner
1375 .send::<fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>>(
1376 result.map(|topologies| (topologies,)),
1377 self.tx_id,
1378 0x73ffb73af24d30b6,
1379 fidl::encoding::DynamicFlags::empty(),
1380 )
1381 }
1382}
1383
1384#[must_use = "FIDL methods require a response to be sent"]
1385#[derive(Debug)]
1386pub struct ReaderWatchTopologyResponder {
1387 control_handle: std::mem::ManuallyDrop<ReaderControlHandle>,
1388 tx_id: u32,
1389}
1390
1391impl std::ops::Drop for ReaderWatchTopologyResponder {
1395 fn drop(&mut self) {
1396 self.control_handle.shutdown();
1397 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1399 }
1400}
1401
1402impl fidl::endpoints::Responder for ReaderWatchTopologyResponder {
1403 type ControlHandle = ReaderControlHandle;
1404
1405 fn control_handle(&self) -> &ReaderControlHandle {
1406 &self.control_handle
1407 }
1408
1409 fn drop_without_shutdown(mut self) {
1410 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1412 std::mem::forget(self);
1414 }
1415}
1416
1417impl ReaderWatchTopologyResponder {
1418 pub fn send(self, mut topology_id: u64) -> Result<(), fidl::Error> {
1422 let _result = self.send_raw(topology_id);
1423 if _result.is_err() {
1424 self.control_handle.shutdown();
1425 }
1426 self.drop_without_shutdown();
1427 _result
1428 }
1429
1430 pub fn send_no_shutdown_on_err(self, mut topology_id: u64) -> Result<(), fidl::Error> {
1432 let _result = self.send_raw(topology_id);
1433 self.drop_without_shutdown();
1434 _result
1435 }
1436
1437 fn send_raw(&self, mut topology_id: u64) -> Result<(), fidl::Error> {
1438 self.control_handle.inner.send::<fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>>(
1439 fidl::encoding::Flexible::new((topology_id,)),
1440 self.tx_id,
1441 0x66d172acdb36a729,
1442 fidl::encoding::DynamicFlags::FLEXIBLE,
1443 )
1444 }
1445}
1446
1447#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1448pub struct SignalProcessingMarker;
1449
1450impl fidl::endpoints::ProtocolMarker for SignalProcessingMarker {
1451 type Proxy = SignalProcessingProxy;
1452 type RequestStream = SignalProcessingRequestStream;
1453 #[cfg(target_os = "fuchsia")]
1454 type SynchronousProxy = SignalProcessingSynchronousProxy;
1455
1456 const DEBUG_NAME: &'static str = "(anonymous) SignalProcessing";
1457}
1458pub type SignalProcessingSetTopologyResult = Result<(), i32>;
1459pub type SignalProcessingSetElementStateResult = Result<(), i32>;
1460
1461pub trait SignalProcessingProxyInterface: Send + Sync {
1462 type GetElementsResponseFut: std::future::Future<Output = Result<ReaderGetElementsResult, fidl::Error>>
1463 + Send;
1464 fn r#get_elements(&self) -> Self::GetElementsResponseFut;
1465 type WatchElementStateResponseFut: std::future::Future<Output = Result<ElementState, fidl::Error>>
1466 + Send;
1467 fn r#watch_element_state(
1468 &self,
1469 processing_element_id: u64,
1470 ) -> Self::WatchElementStateResponseFut;
1471 type GetTopologiesResponseFut: std::future::Future<Output = Result<ReaderGetTopologiesResult, fidl::Error>>
1472 + Send;
1473 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut;
1474 type WatchTopologyResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
1475 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut;
1476 type SetTopologyResponseFut: std::future::Future<Output = Result<SignalProcessingSetTopologyResult, fidl::Error>>
1477 + Send;
1478 fn r#set_topology(&self, topology_id: u64) -> Self::SetTopologyResponseFut;
1479 type SetElementStateResponseFut: std::future::Future<Output = Result<SignalProcessingSetElementStateResult, fidl::Error>>
1480 + Send;
1481 fn r#set_element_state(
1482 &self,
1483 processing_element_id: u64,
1484 state: &SettableElementState,
1485 ) -> Self::SetElementStateResponseFut;
1486}
1487#[derive(Debug)]
1488#[cfg(target_os = "fuchsia")]
1489pub struct SignalProcessingSynchronousProxy {
1490 client: fidl::client::sync::Client,
1491}
1492
1493#[cfg(target_os = "fuchsia")]
1494impl fidl::endpoints::SynchronousProxy for SignalProcessingSynchronousProxy {
1495 type Proxy = SignalProcessingProxy;
1496 type Protocol = SignalProcessingMarker;
1497
1498 fn from_channel(inner: fidl::Channel) -> Self {
1499 Self::new(inner)
1500 }
1501
1502 fn into_channel(self) -> fidl::Channel {
1503 self.client.into_channel()
1504 }
1505
1506 fn as_channel(&self) -> &fidl::Channel {
1507 self.client.as_channel()
1508 }
1509}
1510
1511#[cfg(target_os = "fuchsia")]
1512impl SignalProcessingSynchronousProxy {
1513 pub fn new(channel: fidl::Channel) -> Self {
1514 Self { client: fidl::client::sync::Client::new(channel) }
1515 }
1516
1517 pub fn into_channel(self) -> fidl::Channel {
1518 self.client.into_channel()
1519 }
1520
1521 pub fn wait_for_event(
1524 &self,
1525 deadline: zx::MonotonicInstant,
1526 ) -> Result<SignalProcessingEvent, fidl::Error> {
1527 SignalProcessingEvent::decode(
1528 self.client.wait_for_event::<SignalProcessingMarker>(deadline)?,
1529 )
1530 }
1531
1532 pub fn r#get_elements(
1535 &self,
1536 ___deadline: zx::MonotonicInstant,
1537 ) -> Result<ReaderGetElementsResult, fidl::Error> {
1538 let _response = self.client.send_query::<
1539 fidl::encoding::EmptyPayload,
1540 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
1541 SignalProcessingMarker,
1542 >(
1543 (),
1544 0x1b14ff4adf5dc6f8,
1545 fidl::encoding::DynamicFlags::empty(),
1546 ___deadline,
1547 )?;
1548 Ok(_response.map(|x| x.processing_elements))
1549 }
1550
1551 pub fn r#watch_element_state(
1564 &self,
1565 mut processing_element_id: u64,
1566 ___deadline: zx::MonotonicInstant,
1567 ) -> Result<ElementState, fidl::Error> {
1568 let _response = self.client.send_query::<
1569 ReaderWatchElementStateRequest,
1570 ReaderWatchElementStateResponse,
1571 SignalProcessingMarker,
1572 >(
1573 (processing_element_id,),
1574 0x524da8772a69056f,
1575 fidl::encoding::DynamicFlags::empty(),
1576 ___deadline,
1577 )?;
1578 Ok(_response.state)
1579 }
1580
1581 pub fn r#get_topologies(
1590 &self,
1591 ___deadline: zx::MonotonicInstant,
1592 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
1593 let _response = self.client.send_query::<
1594 fidl::encoding::EmptyPayload,
1595 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
1596 SignalProcessingMarker,
1597 >(
1598 (),
1599 0x73ffb73af24d30b6,
1600 fidl::encoding::DynamicFlags::empty(),
1601 ___deadline,
1602 )?;
1603 Ok(_response.map(|x| x.topologies))
1604 }
1605
1606 pub fn r#watch_topology(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
1614 let _response = self.client.send_query::<
1615 fidl::encoding::EmptyPayload,
1616 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
1617 SignalProcessingMarker,
1618 >(
1619 (),
1620 0x66d172acdb36a729,
1621 fidl::encoding::DynamicFlags::FLEXIBLE,
1622 ___deadline,
1623 )?
1624 .into_result::<SignalProcessingMarker>("watch_topology")?;
1625 Ok(_response.topology_id)
1626 }
1627
1628 pub fn r#set_topology(
1643 &self,
1644 mut topology_id: u64,
1645 ___deadline: zx::MonotonicInstant,
1646 ) -> Result<SignalProcessingSetTopologyResult, fidl::Error> {
1647 let _response = self.client.send_query::<
1648 SignalProcessingSetTopologyRequest,
1649 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1650 SignalProcessingMarker,
1651 >(
1652 (topology_id,),
1653 0x1d9a7f9b8fee790c,
1654 fidl::encoding::DynamicFlags::empty(),
1655 ___deadline,
1656 )?;
1657 Ok(_response.map(|x| x))
1658 }
1659
1660 pub fn r#set_element_state(
1698 &self,
1699 mut processing_element_id: u64,
1700 mut state: &SettableElementState,
1701 ___deadline: zx::MonotonicInstant,
1702 ) -> Result<SignalProcessingSetElementStateResult, fidl::Error> {
1703 let _response = self.client.send_query::<
1704 SignalProcessingSetElementStateRequest,
1705 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1706 SignalProcessingMarker,
1707 >(
1708 (processing_element_id, state,),
1709 0x38c3b2d4bae698f4,
1710 fidl::encoding::DynamicFlags::empty(),
1711 ___deadline,
1712 )?;
1713 Ok(_response.map(|x| x))
1714 }
1715}
1716
1717#[cfg(target_os = "fuchsia")]
1718impl From<SignalProcessingSynchronousProxy> for zx::NullableHandle {
1719 fn from(value: SignalProcessingSynchronousProxy) -> Self {
1720 value.into_channel().into()
1721 }
1722}
1723
1724#[cfg(target_os = "fuchsia")]
1725impl From<fidl::Channel> for SignalProcessingSynchronousProxy {
1726 fn from(value: fidl::Channel) -> Self {
1727 Self::new(value)
1728 }
1729}
1730
1731#[cfg(target_os = "fuchsia")]
1732impl fidl::endpoints::FromClient for SignalProcessingSynchronousProxy {
1733 type Protocol = SignalProcessingMarker;
1734
1735 fn from_client(value: fidl::endpoints::ClientEnd<SignalProcessingMarker>) -> Self {
1736 Self::new(value.into_channel())
1737 }
1738}
1739
1740#[derive(Debug, Clone)]
1741pub struct SignalProcessingProxy {
1742 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1743}
1744
1745impl fidl::endpoints::Proxy for SignalProcessingProxy {
1746 type Protocol = SignalProcessingMarker;
1747
1748 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1749 Self::new(inner)
1750 }
1751
1752 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1753 self.client.into_channel().map_err(|client| Self { client })
1754 }
1755
1756 fn as_channel(&self) -> &::fidl::AsyncChannel {
1757 self.client.as_channel()
1758 }
1759}
1760
1761impl SignalProcessingProxy {
1762 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1764 let protocol_name = <SignalProcessingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1765 Self { client: fidl::client::Client::new(channel, protocol_name) }
1766 }
1767
1768 pub fn take_event_stream(&self) -> SignalProcessingEventStream {
1774 SignalProcessingEventStream { event_receiver: self.client.take_event_receiver() }
1775 }
1776
1777 pub fn r#get_elements(
1780 &self,
1781 ) -> fidl::client::QueryResponseFut<
1782 ReaderGetElementsResult,
1783 fidl::encoding::DefaultFuchsiaResourceDialect,
1784 > {
1785 SignalProcessingProxyInterface::r#get_elements(self)
1786 }
1787
1788 pub fn r#watch_element_state(
1801 &self,
1802 mut processing_element_id: u64,
1803 ) -> fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>
1804 {
1805 SignalProcessingProxyInterface::r#watch_element_state(self, processing_element_id)
1806 }
1807
1808 pub fn r#get_topologies(
1817 &self,
1818 ) -> fidl::client::QueryResponseFut<
1819 ReaderGetTopologiesResult,
1820 fidl::encoding::DefaultFuchsiaResourceDialect,
1821 > {
1822 SignalProcessingProxyInterface::r#get_topologies(self)
1823 }
1824
1825 pub fn r#watch_topology(
1833 &self,
1834 ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
1835 SignalProcessingProxyInterface::r#watch_topology(self)
1836 }
1837
1838 pub fn r#set_topology(
1853 &self,
1854 mut topology_id: u64,
1855 ) -> fidl::client::QueryResponseFut<
1856 SignalProcessingSetTopologyResult,
1857 fidl::encoding::DefaultFuchsiaResourceDialect,
1858 > {
1859 SignalProcessingProxyInterface::r#set_topology(self, topology_id)
1860 }
1861
1862 pub fn r#set_element_state(
1900 &self,
1901 mut processing_element_id: u64,
1902 mut state: &SettableElementState,
1903 ) -> fidl::client::QueryResponseFut<
1904 SignalProcessingSetElementStateResult,
1905 fidl::encoding::DefaultFuchsiaResourceDialect,
1906 > {
1907 SignalProcessingProxyInterface::r#set_element_state(self, processing_element_id, state)
1908 }
1909}
1910
1911impl SignalProcessingProxyInterface for SignalProcessingProxy {
1912 type GetElementsResponseFut = fidl::client::QueryResponseFut<
1913 ReaderGetElementsResult,
1914 fidl::encoding::DefaultFuchsiaResourceDialect,
1915 >;
1916 fn r#get_elements(&self) -> Self::GetElementsResponseFut {
1917 fn _decode(
1918 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1919 ) -> Result<ReaderGetElementsResult, fidl::Error> {
1920 let _response = fidl::client::decode_transaction_body::<
1921 fidl::encoding::ResultType<ReaderGetElementsResponse, i32>,
1922 fidl::encoding::DefaultFuchsiaResourceDialect,
1923 0x1b14ff4adf5dc6f8,
1924 >(_buf?)?;
1925 Ok(_response.map(|x| x.processing_elements))
1926 }
1927 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetElementsResult>(
1928 (),
1929 0x1b14ff4adf5dc6f8,
1930 fidl::encoding::DynamicFlags::empty(),
1931 _decode,
1932 )
1933 }
1934
1935 type WatchElementStateResponseFut =
1936 fidl::client::QueryResponseFut<ElementState, fidl::encoding::DefaultFuchsiaResourceDialect>;
1937 fn r#watch_element_state(
1938 &self,
1939 mut processing_element_id: u64,
1940 ) -> Self::WatchElementStateResponseFut {
1941 fn _decode(
1942 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1943 ) -> Result<ElementState, fidl::Error> {
1944 let _response = fidl::client::decode_transaction_body::<
1945 ReaderWatchElementStateResponse,
1946 fidl::encoding::DefaultFuchsiaResourceDialect,
1947 0x524da8772a69056f,
1948 >(_buf?)?;
1949 Ok(_response.state)
1950 }
1951 self.client.send_query_and_decode::<ReaderWatchElementStateRequest, ElementState>(
1952 (processing_element_id,),
1953 0x524da8772a69056f,
1954 fidl::encoding::DynamicFlags::empty(),
1955 _decode,
1956 )
1957 }
1958
1959 type GetTopologiesResponseFut = fidl::client::QueryResponseFut<
1960 ReaderGetTopologiesResult,
1961 fidl::encoding::DefaultFuchsiaResourceDialect,
1962 >;
1963 fn r#get_topologies(&self) -> Self::GetTopologiesResponseFut {
1964 fn _decode(
1965 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1966 ) -> Result<ReaderGetTopologiesResult, fidl::Error> {
1967 let _response = fidl::client::decode_transaction_body::<
1968 fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>,
1969 fidl::encoding::DefaultFuchsiaResourceDialect,
1970 0x73ffb73af24d30b6,
1971 >(_buf?)?;
1972 Ok(_response.map(|x| x.topologies))
1973 }
1974 self.client
1975 .send_query_and_decode::<fidl::encoding::EmptyPayload, ReaderGetTopologiesResult>(
1976 (),
1977 0x73ffb73af24d30b6,
1978 fidl::encoding::DynamicFlags::empty(),
1979 _decode,
1980 )
1981 }
1982
1983 type WatchTopologyResponseFut =
1984 fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
1985 fn r#watch_topology(&self) -> Self::WatchTopologyResponseFut {
1986 fn _decode(
1987 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1988 ) -> Result<u64, fidl::Error> {
1989 let _response = fidl::client::decode_transaction_body::<
1990 fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>,
1991 fidl::encoding::DefaultFuchsiaResourceDialect,
1992 0x66d172acdb36a729,
1993 >(_buf?)?
1994 .into_result::<SignalProcessingMarker>("watch_topology")?;
1995 Ok(_response.topology_id)
1996 }
1997 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
1998 (),
1999 0x66d172acdb36a729,
2000 fidl::encoding::DynamicFlags::FLEXIBLE,
2001 _decode,
2002 )
2003 }
2004
2005 type SetTopologyResponseFut = fidl::client::QueryResponseFut<
2006 SignalProcessingSetTopologyResult,
2007 fidl::encoding::DefaultFuchsiaResourceDialect,
2008 >;
2009 fn r#set_topology(&self, mut topology_id: u64) -> Self::SetTopologyResponseFut {
2010 fn _decode(
2011 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2012 ) -> Result<SignalProcessingSetTopologyResult, fidl::Error> {
2013 let _response = fidl::client::decode_transaction_body::<
2014 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2015 fidl::encoding::DefaultFuchsiaResourceDialect,
2016 0x1d9a7f9b8fee790c,
2017 >(_buf?)?;
2018 Ok(_response.map(|x| x))
2019 }
2020 self.client.send_query_and_decode::<
2021 SignalProcessingSetTopologyRequest,
2022 SignalProcessingSetTopologyResult,
2023 >(
2024 (topology_id,),
2025 0x1d9a7f9b8fee790c,
2026 fidl::encoding::DynamicFlags::empty(),
2027 _decode,
2028 )
2029 }
2030
2031 type SetElementStateResponseFut = fidl::client::QueryResponseFut<
2032 SignalProcessingSetElementStateResult,
2033 fidl::encoding::DefaultFuchsiaResourceDialect,
2034 >;
2035 fn r#set_element_state(
2036 &self,
2037 mut processing_element_id: u64,
2038 mut state: &SettableElementState,
2039 ) -> Self::SetElementStateResponseFut {
2040 fn _decode(
2041 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2042 ) -> Result<SignalProcessingSetElementStateResult, fidl::Error> {
2043 let _response = fidl::client::decode_transaction_body::<
2044 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2045 fidl::encoding::DefaultFuchsiaResourceDialect,
2046 0x38c3b2d4bae698f4,
2047 >(_buf?)?;
2048 Ok(_response.map(|x| x))
2049 }
2050 self.client.send_query_and_decode::<
2051 SignalProcessingSetElementStateRequest,
2052 SignalProcessingSetElementStateResult,
2053 >(
2054 (processing_element_id, state,),
2055 0x38c3b2d4bae698f4,
2056 fidl::encoding::DynamicFlags::empty(),
2057 _decode,
2058 )
2059 }
2060}
2061
2062pub struct SignalProcessingEventStream {
2063 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2064}
2065
2066impl std::marker::Unpin for SignalProcessingEventStream {}
2067
2068impl futures::stream::FusedStream for SignalProcessingEventStream {
2069 fn is_terminated(&self) -> bool {
2070 self.event_receiver.is_terminated()
2071 }
2072}
2073
2074impl futures::Stream for SignalProcessingEventStream {
2075 type Item = Result<SignalProcessingEvent, 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(SignalProcessingEvent::decode(buf))),
2086 None => std::task::Poll::Ready(None),
2087 }
2088 }
2089}
2090
2091#[derive(Debug)]
2092pub enum SignalProcessingEvent {
2093 #[non_exhaustive]
2094 _UnknownEvent {
2095 ordinal: u64,
2097 },
2098}
2099
2100impl SignalProcessingEvent {
2101 fn decode(
2103 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2104 ) -> Result<SignalProcessingEvent, fidl::Error> {
2105 let (bytes, _handles) = buf.split_mut();
2106 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2107 debug_assert_eq!(tx_header.tx_id, 0);
2108 match tx_header.ordinal {
2109 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2110 Ok(SignalProcessingEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2111 }
2112 _ => Err(fidl::Error::UnknownOrdinal {
2113 ordinal: tx_header.ordinal,
2114 protocol_name:
2115 <SignalProcessingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2116 }),
2117 }
2118 }
2119}
2120
2121pub struct SignalProcessingRequestStream {
2123 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2124 is_terminated: bool,
2125}
2126
2127impl std::marker::Unpin for SignalProcessingRequestStream {}
2128
2129impl futures::stream::FusedStream for SignalProcessingRequestStream {
2130 fn is_terminated(&self) -> bool {
2131 self.is_terminated
2132 }
2133}
2134
2135impl fidl::endpoints::RequestStream for SignalProcessingRequestStream {
2136 type Protocol = SignalProcessingMarker;
2137 type ControlHandle = SignalProcessingControlHandle;
2138
2139 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2140 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2141 }
2142
2143 fn control_handle(&self) -> Self::ControlHandle {
2144 SignalProcessingControlHandle { inner: self.inner.clone() }
2145 }
2146
2147 fn into_inner(
2148 self,
2149 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2150 {
2151 (self.inner, self.is_terminated)
2152 }
2153
2154 fn from_inner(
2155 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2156 is_terminated: bool,
2157 ) -> Self {
2158 Self { inner, is_terminated }
2159 }
2160}
2161
2162impl futures::Stream for SignalProcessingRequestStream {
2163 type Item = Result<SignalProcessingRequest, fidl::Error>;
2164
2165 fn poll_next(
2166 mut self: std::pin::Pin<&mut Self>,
2167 cx: &mut std::task::Context<'_>,
2168 ) -> std::task::Poll<Option<Self::Item>> {
2169 let this = &mut *self;
2170 if this.inner.check_shutdown(cx) {
2171 this.is_terminated = true;
2172 return std::task::Poll::Ready(None);
2173 }
2174 if this.is_terminated {
2175 panic!("polled SignalProcessingRequestStream after completion");
2176 }
2177 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2178 |bytes, handles| {
2179 match this.inner.channel().read_etc(cx, bytes, handles) {
2180 std::task::Poll::Ready(Ok(())) => {}
2181 std::task::Poll::Pending => return std::task::Poll::Pending,
2182 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2183 this.is_terminated = true;
2184 return std::task::Poll::Ready(None);
2185 }
2186 std::task::Poll::Ready(Err(e)) => {
2187 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2188 e.into(),
2189 ))));
2190 }
2191 }
2192
2193 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2195
2196 std::task::Poll::Ready(Some(match header.ordinal {
2197 0x1b14ff4adf5dc6f8 => {
2198 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2199 let mut req = fidl::new_empty!(
2200 fidl::encoding::EmptyPayload,
2201 fidl::encoding::DefaultFuchsiaResourceDialect
2202 );
2203 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2204 let control_handle =
2205 SignalProcessingControlHandle { inner: this.inner.clone() };
2206 Ok(SignalProcessingRequest::GetElements {
2207 responder: SignalProcessingGetElementsResponder {
2208 control_handle: std::mem::ManuallyDrop::new(control_handle),
2209 tx_id: header.tx_id,
2210 },
2211 })
2212 }
2213 0x524da8772a69056f => {
2214 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2215 let mut req = fidl::new_empty!(
2216 ReaderWatchElementStateRequest,
2217 fidl::encoding::DefaultFuchsiaResourceDialect
2218 );
2219 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReaderWatchElementStateRequest>(&header, _body_bytes, handles, &mut req)?;
2220 let control_handle =
2221 SignalProcessingControlHandle { inner: this.inner.clone() };
2222 Ok(SignalProcessingRequest::WatchElementState {
2223 processing_element_id: req.processing_element_id,
2224
2225 responder: SignalProcessingWatchElementStateResponder {
2226 control_handle: std::mem::ManuallyDrop::new(control_handle),
2227 tx_id: header.tx_id,
2228 },
2229 })
2230 }
2231 0x73ffb73af24d30b6 => {
2232 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2233 let mut req = fidl::new_empty!(
2234 fidl::encoding::EmptyPayload,
2235 fidl::encoding::DefaultFuchsiaResourceDialect
2236 );
2237 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2238 let control_handle =
2239 SignalProcessingControlHandle { inner: this.inner.clone() };
2240 Ok(SignalProcessingRequest::GetTopologies {
2241 responder: SignalProcessingGetTopologiesResponder {
2242 control_handle: std::mem::ManuallyDrop::new(control_handle),
2243 tx_id: header.tx_id,
2244 },
2245 })
2246 }
2247 0x66d172acdb36a729 => {
2248 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2249 let mut req = fidl::new_empty!(
2250 fidl::encoding::EmptyPayload,
2251 fidl::encoding::DefaultFuchsiaResourceDialect
2252 );
2253 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2254 let control_handle =
2255 SignalProcessingControlHandle { inner: this.inner.clone() };
2256 Ok(SignalProcessingRequest::WatchTopology {
2257 responder: SignalProcessingWatchTopologyResponder {
2258 control_handle: std::mem::ManuallyDrop::new(control_handle),
2259 tx_id: header.tx_id,
2260 },
2261 })
2262 }
2263 0x1d9a7f9b8fee790c => {
2264 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2265 let mut req = fidl::new_empty!(
2266 SignalProcessingSetTopologyRequest,
2267 fidl::encoding::DefaultFuchsiaResourceDialect
2268 );
2269 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SignalProcessingSetTopologyRequest>(&header, _body_bytes, handles, &mut req)?;
2270 let control_handle =
2271 SignalProcessingControlHandle { inner: this.inner.clone() };
2272 Ok(SignalProcessingRequest::SetTopology {
2273 topology_id: req.topology_id,
2274
2275 responder: SignalProcessingSetTopologyResponder {
2276 control_handle: std::mem::ManuallyDrop::new(control_handle),
2277 tx_id: header.tx_id,
2278 },
2279 })
2280 }
2281 0x38c3b2d4bae698f4 => {
2282 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2283 let mut req = fidl::new_empty!(
2284 SignalProcessingSetElementStateRequest,
2285 fidl::encoding::DefaultFuchsiaResourceDialect
2286 );
2287 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SignalProcessingSetElementStateRequest>(&header, _body_bytes, handles, &mut req)?;
2288 let control_handle =
2289 SignalProcessingControlHandle { inner: this.inner.clone() };
2290 Ok(SignalProcessingRequest::SetElementState {
2291 processing_element_id: req.processing_element_id,
2292 state: req.state,
2293
2294 responder: SignalProcessingSetElementStateResponder {
2295 control_handle: std::mem::ManuallyDrop::new(control_handle),
2296 tx_id: header.tx_id,
2297 },
2298 })
2299 }
2300 _ if header.tx_id == 0
2301 && header
2302 .dynamic_flags()
2303 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2304 {
2305 Ok(SignalProcessingRequest::_UnknownMethod {
2306 ordinal: header.ordinal,
2307 control_handle: SignalProcessingControlHandle {
2308 inner: this.inner.clone(),
2309 },
2310 method_type: fidl::MethodType::OneWay,
2311 })
2312 }
2313 _ if header
2314 .dynamic_flags()
2315 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2316 {
2317 this.inner.send_framework_err(
2318 fidl::encoding::FrameworkErr::UnknownMethod,
2319 header.tx_id,
2320 header.ordinal,
2321 header.dynamic_flags(),
2322 (bytes, handles),
2323 )?;
2324 Ok(SignalProcessingRequest::_UnknownMethod {
2325 ordinal: header.ordinal,
2326 control_handle: SignalProcessingControlHandle {
2327 inner: this.inner.clone(),
2328 },
2329 method_type: fidl::MethodType::TwoWay,
2330 })
2331 }
2332 _ => Err(fidl::Error::UnknownOrdinal {
2333 ordinal: header.ordinal,
2334 protocol_name:
2335 <SignalProcessingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2336 }),
2337 }))
2338 },
2339 )
2340 }
2341}
2342
2343#[derive(Debug)]
2349pub enum SignalProcessingRequest {
2350 GetElements { responder: SignalProcessingGetElementsResponder },
2353 WatchElementState {
2366 processing_element_id: u64,
2367 responder: SignalProcessingWatchElementStateResponder,
2368 },
2369 GetTopologies { responder: SignalProcessingGetTopologiesResponder },
2378 WatchTopology { responder: SignalProcessingWatchTopologyResponder },
2386 SetTopology { topology_id: u64, responder: SignalProcessingSetTopologyResponder },
2401 SetElementState {
2439 processing_element_id: u64,
2440 state: SettableElementState,
2441 responder: SignalProcessingSetElementStateResponder,
2442 },
2443 #[non_exhaustive]
2445 _UnknownMethod {
2446 ordinal: u64,
2448 control_handle: SignalProcessingControlHandle,
2449 method_type: fidl::MethodType,
2450 },
2451}
2452
2453impl SignalProcessingRequest {
2454 #[allow(irrefutable_let_patterns)]
2455 pub fn into_get_elements(self) -> Option<(SignalProcessingGetElementsResponder)> {
2456 if let SignalProcessingRequest::GetElements { responder } = self {
2457 Some((responder))
2458 } else {
2459 None
2460 }
2461 }
2462
2463 #[allow(irrefutable_let_patterns)]
2464 pub fn into_watch_element_state(
2465 self,
2466 ) -> Option<(u64, SignalProcessingWatchElementStateResponder)> {
2467 if let SignalProcessingRequest::WatchElementState { processing_element_id, responder } =
2468 self
2469 {
2470 Some((processing_element_id, responder))
2471 } else {
2472 None
2473 }
2474 }
2475
2476 #[allow(irrefutable_let_patterns)]
2477 pub fn into_get_topologies(self) -> Option<(SignalProcessingGetTopologiesResponder)> {
2478 if let SignalProcessingRequest::GetTopologies { responder } = self {
2479 Some((responder))
2480 } else {
2481 None
2482 }
2483 }
2484
2485 #[allow(irrefutable_let_patterns)]
2486 pub fn into_watch_topology(self) -> Option<(SignalProcessingWatchTopologyResponder)> {
2487 if let SignalProcessingRequest::WatchTopology { responder } = self {
2488 Some((responder))
2489 } else {
2490 None
2491 }
2492 }
2493
2494 #[allow(irrefutable_let_patterns)]
2495 pub fn into_set_topology(self) -> Option<(u64, SignalProcessingSetTopologyResponder)> {
2496 if let SignalProcessingRequest::SetTopology { topology_id, responder } = self {
2497 Some((topology_id, responder))
2498 } else {
2499 None
2500 }
2501 }
2502
2503 #[allow(irrefutable_let_patterns)]
2504 pub fn into_set_element_state(
2505 self,
2506 ) -> Option<(u64, SettableElementState, SignalProcessingSetElementStateResponder)> {
2507 if let SignalProcessingRequest::SetElementState {
2508 processing_element_id,
2509 state,
2510 responder,
2511 } = self
2512 {
2513 Some((processing_element_id, state, responder))
2514 } else {
2515 None
2516 }
2517 }
2518
2519 pub fn method_name(&self) -> &'static str {
2521 match *self {
2522 SignalProcessingRequest::GetElements { .. } => "get_elements",
2523 SignalProcessingRequest::WatchElementState { .. } => "watch_element_state",
2524 SignalProcessingRequest::GetTopologies { .. } => "get_topologies",
2525 SignalProcessingRequest::WatchTopology { .. } => "watch_topology",
2526 SignalProcessingRequest::SetTopology { .. } => "set_topology",
2527 SignalProcessingRequest::SetElementState { .. } => "set_element_state",
2528 SignalProcessingRequest::_UnknownMethod {
2529 method_type: fidl::MethodType::OneWay,
2530 ..
2531 } => "unknown one-way method",
2532 SignalProcessingRequest::_UnknownMethod {
2533 method_type: fidl::MethodType::TwoWay,
2534 ..
2535 } => "unknown two-way method",
2536 }
2537 }
2538}
2539
2540#[derive(Debug, Clone)]
2541pub struct SignalProcessingControlHandle {
2542 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2543}
2544
2545impl SignalProcessingControlHandle {
2546 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2547 self.inner.shutdown_with_epitaph(status.into())
2548 }
2549}
2550
2551impl fidl::endpoints::ControlHandle for SignalProcessingControlHandle {
2552 fn shutdown(&self) {
2553 self.inner.shutdown()
2554 }
2555
2556 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2557 self.inner.shutdown_with_epitaph(status)
2558 }
2559
2560 fn is_closed(&self) -> bool {
2561 self.inner.channel().is_closed()
2562 }
2563 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2564 self.inner.channel().on_closed()
2565 }
2566
2567 #[cfg(target_os = "fuchsia")]
2568 fn signal_peer(
2569 &self,
2570 clear_mask: zx::Signals,
2571 set_mask: zx::Signals,
2572 ) -> Result<(), zx_status::Status> {
2573 use fidl::Peered;
2574 self.inner.channel().signal_peer(clear_mask, set_mask)
2575 }
2576}
2577
2578impl SignalProcessingControlHandle {}
2579
2580#[must_use = "FIDL methods require a response to be sent"]
2581#[derive(Debug)]
2582pub struct SignalProcessingGetElementsResponder {
2583 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2584 tx_id: u32,
2585}
2586
2587impl std::ops::Drop for SignalProcessingGetElementsResponder {
2591 fn drop(&mut self) {
2592 self.control_handle.shutdown();
2593 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2595 }
2596}
2597
2598impl fidl::endpoints::Responder for SignalProcessingGetElementsResponder {
2599 type ControlHandle = SignalProcessingControlHandle;
2600
2601 fn control_handle(&self) -> &SignalProcessingControlHandle {
2602 &self.control_handle
2603 }
2604
2605 fn drop_without_shutdown(mut self) {
2606 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2608 std::mem::forget(self);
2610 }
2611}
2612
2613impl SignalProcessingGetElementsResponder {
2614 pub fn send(self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
2618 let _result = self.send_raw(result);
2619 if _result.is_err() {
2620 self.control_handle.shutdown();
2621 }
2622 self.drop_without_shutdown();
2623 _result
2624 }
2625
2626 pub fn send_no_shutdown_on_err(
2628 self,
2629 mut result: Result<&[Element], i32>,
2630 ) -> Result<(), fidl::Error> {
2631 let _result = self.send_raw(result);
2632 self.drop_without_shutdown();
2633 _result
2634 }
2635
2636 fn send_raw(&self, mut result: Result<&[Element], i32>) -> Result<(), fidl::Error> {
2637 self.control_handle
2638 .inner
2639 .send::<fidl::encoding::ResultType<ReaderGetElementsResponse, i32>>(
2640 result.map(|processing_elements| (processing_elements,)),
2641 self.tx_id,
2642 0x1b14ff4adf5dc6f8,
2643 fidl::encoding::DynamicFlags::empty(),
2644 )
2645 }
2646}
2647
2648#[must_use = "FIDL methods require a response to be sent"]
2649#[derive(Debug)]
2650pub struct SignalProcessingWatchElementStateResponder {
2651 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2652 tx_id: u32,
2653}
2654
2655impl std::ops::Drop for SignalProcessingWatchElementStateResponder {
2659 fn drop(&mut self) {
2660 self.control_handle.shutdown();
2661 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2663 }
2664}
2665
2666impl fidl::endpoints::Responder for SignalProcessingWatchElementStateResponder {
2667 type ControlHandle = SignalProcessingControlHandle;
2668
2669 fn control_handle(&self) -> &SignalProcessingControlHandle {
2670 &self.control_handle
2671 }
2672
2673 fn drop_without_shutdown(mut self) {
2674 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2676 std::mem::forget(self);
2678 }
2679}
2680
2681impl SignalProcessingWatchElementStateResponder {
2682 pub fn send(self, mut state: &ElementState) -> Result<(), fidl::Error> {
2686 let _result = self.send_raw(state);
2687 if _result.is_err() {
2688 self.control_handle.shutdown();
2689 }
2690 self.drop_without_shutdown();
2691 _result
2692 }
2693
2694 pub fn send_no_shutdown_on_err(self, mut state: &ElementState) -> Result<(), fidl::Error> {
2696 let _result = self.send_raw(state);
2697 self.drop_without_shutdown();
2698 _result
2699 }
2700
2701 fn send_raw(&self, mut state: &ElementState) -> Result<(), fidl::Error> {
2702 self.control_handle.inner.send::<ReaderWatchElementStateResponse>(
2703 (state,),
2704 self.tx_id,
2705 0x524da8772a69056f,
2706 fidl::encoding::DynamicFlags::empty(),
2707 )
2708 }
2709}
2710
2711#[must_use = "FIDL methods require a response to be sent"]
2712#[derive(Debug)]
2713pub struct SignalProcessingGetTopologiesResponder {
2714 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2715 tx_id: u32,
2716}
2717
2718impl std::ops::Drop for SignalProcessingGetTopologiesResponder {
2722 fn drop(&mut self) {
2723 self.control_handle.shutdown();
2724 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2726 }
2727}
2728
2729impl fidl::endpoints::Responder for SignalProcessingGetTopologiesResponder {
2730 type ControlHandle = SignalProcessingControlHandle;
2731
2732 fn control_handle(&self) -> &SignalProcessingControlHandle {
2733 &self.control_handle
2734 }
2735
2736 fn drop_without_shutdown(mut self) {
2737 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2739 std::mem::forget(self);
2741 }
2742}
2743
2744impl SignalProcessingGetTopologiesResponder {
2745 pub fn send(self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
2749 let _result = self.send_raw(result);
2750 if _result.is_err() {
2751 self.control_handle.shutdown();
2752 }
2753 self.drop_without_shutdown();
2754 _result
2755 }
2756
2757 pub fn send_no_shutdown_on_err(
2759 self,
2760 mut result: Result<&[Topology], i32>,
2761 ) -> Result<(), fidl::Error> {
2762 let _result = self.send_raw(result);
2763 self.drop_without_shutdown();
2764 _result
2765 }
2766
2767 fn send_raw(&self, mut result: Result<&[Topology], i32>) -> Result<(), fidl::Error> {
2768 self.control_handle
2769 .inner
2770 .send::<fidl::encoding::ResultType<ReaderGetTopologiesResponse, i32>>(
2771 result.map(|topologies| (topologies,)),
2772 self.tx_id,
2773 0x73ffb73af24d30b6,
2774 fidl::encoding::DynamicFlags::empty(),
2775 )
2776 }
2777}
2778
2779#[must_use = "FIDL methods require a response to be sent"]
2780#[derive(Debug)]
2781pub struct SignalProcessingWatchTopologyResponder {
2782 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2783 tx_id: u32,
2784}
2785
2786impl std::ops::Drop for SignalProcessingWatchTopologyResponder {
2790 fn drop(&mut self) {
2791 self.control_handle.shutdown();
2792 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2794 }
2795}
2796
2797impl fidl::endpoints::Responder for SignalProcessingWatchTopologyResponder {
2798 type ControlHandle = SignalProcessingControlHandle;
2799
2800 fn control_handle(&self) -> &SignalProcessingControlHandle {
2801 &self.control_handle
2802 }
2803
2804 fn drop_without_shutdown(mut self) {
2805 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2807 std::mem::forget(self);
2809 }
2810}
2811
2812impl SignalProcessingWatchTopologyResponder {
2813 pub fn send(self, mut topology_id: u64) -> Result<(), fidl::Error> {
2817 let _result = self.send_raw(topology_id);
2818 if _result.is_err() {
2819 self.control_handle.shutdown();
2820 }
2821 self.drop_without_shutdown();
2822 _result
2823 }
2824
2825 pub fn send_no_shutdown_on_err(self, mut topology_id: u64) -> Result<(), fidl::Error> {
2827 let _result = self.send_raw(topology_id);
2828 self.drop_without_shutdown();
2829 _result
2830 }
2831
2832 fn send_raw(&self, mut topology_id: u64) -> Result<(), fidl::Error> {
2833 self.control_handle.inner.send::<fidl::encoding::FlexibleType<ReaderWatchTopologyResponse>>(
2834 fidl::encoding::Flexible::new((topology_id,)),
2835 self.tx_id,
2836 0x66d172acdb36a729,
2837 fidl::encoding::DynamicFlags::FLEXIBLE,
2838 )
2839 }
2840}
2841
2842#[must_use = "FIDL methods require a response to be sent"]
2843#[derive(Debug)]
2844pub struct SignalProcessingSetTopologyResponder {
2845 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2846 tx_id: u32,
2847}
2848
2849impl std::ops::Drop for SignalProcessingSetTopologyResponder {
2853 fn drop(&mut self) {
2854 self.control_handle.shutdown();
2855 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2857 }
2858}
2859
2860impl fidl::endpoints::Responder for SignalProcessingSetTopologyResponder {
2861 type ControlHandle = SignalProcessingControlHandle;
2862
2863 fn control_handle(&self) -> &SignalProcessingControlHandle {
2864 &self.control_handle
2865 }
2866
2867 fn drop_without_shutdown(mut self) {
2868 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2870 std::mem::forget(self);
2872 }
2873}
2874
2875impl SignalProcessingSetTopologyResponder {
2876 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2880 let _result = self.send_raw(result);
2881 if _result.is_err() {
2882 self.control_handle.shutdown();
2883 }
2884 self.drop_without_shutdown();
2885 _result
2886 }
2887
2888 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2890 let _result = self.send_raw(result);
2891 self.drop_without_shutdown();
2892 _result
2893 }
2894
2895 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2896 self.control_handle
2897 .inner
2898 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2899 result,
2900 self.tx_id,
2901 0x1d9a7f9b8fee790c,
2902 fidl::encoding::DynamicFlags::empty(),
2903 )
2904 }
2905}
2906
2907#[must_use = "FIDL methods require a response to be sent"]
2908#[derive(Debug)]
2909pub struct SignalProcessingSetElementStateResponder {
2910 control_handle: std::mem::ManuallyDrop<SignalProcessingControlHandle>,
2911 tx_id: u32,
2912}
2913
2914impl std::ops::Drop for SignalProcessingSetElementStateResponder {
2918 fn drop(&mut self) {
2919 self.control_handle.shutdown();
2920 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2922 }
2923}
2924
2925impl fidl::endpoints::Responder for SignalProcessingSetElementStateResponder {
2926 type ControlHandle = SignalProcessingControlHandle;
2927
2928 fn control_handle(&self) -> &SignalProcessingControlHandle {
2929 &self.control_handle
2930 }
2931
2932 fn drop_without_shutdown(mut self) {
2933 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2935 std::mem::forget(self);
2937 }
2938}
2939
2940impl SignalProcessingSetElementStateResponder {
2941 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2945 let _result = self.send_raw(result);
2946 if _result.is_err() {
2947 self.control_handle.shutdown();
2948 }
2949 self.drop_without_shutdown();
2950 _result
2951 }
2952
2953 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2955 let _result = self.send_raw(result);
2956 self.drop_without_shutdown();
2957 _result
2958 }
2959
2960 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2961 self.control_handle
2962 .inner
2963 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2964 result,
2965 self.tx_id,
2966 0x38c3b2d4bae698f4,
2967 fidl::encoding::DynamicFlags::empty(),
2968 )
2969 }
2970}
2971
2972#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2973pub struct ConnectorServiceMarker;
2974
2975#[cfg(target_os = "fuchsia")]
2976impl fidl::endpoints::ServiceMarker for ConnectorServiceMarker {
2977 type Proxy = ConnectorServiceProxy;
2978 type Request = ConnectorServiceRequest;
2979 const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.signalprocessing.ConnectorService";
2980}
2981
2982#[cfg(target_os = "fuchsia")]
2985pub enum ConnectorServiceRequest {
2986 Connector(ConnectorRequestStream),
2987}
2988
2989#[cfg(target_os = "fuchsia")]
2990impl fidl::endpoints::ServiceRequest for ConnectorServiceRequest {
2991 type Service = ConnectorServiceMarker;
2992
2993 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
2994 match name {
2995 "connector" => Self::Connector(
2996 <ConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
2997 ),
2998 _ => panic!("no such member protocol name for service ConnectorService"),
2999 }
3000 }
3001
3002 fn member_names() -> &'static [&'static str] {
3003 &["connector"]
3004 }
3005}
3006#[cfg(target_os = "fuchsia")]
3007pub struct ConnectorServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3008
3009#[cfg(target_os = "fuchsia")]
3010impl fidl::endpoints::ServiceProxy for ConnectorServiceProxy {
3011 type Service = ConnectorServiceMarker;
3012
3013 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3014 Self(opener)
3015 }
3016}
3017
3018#[cfg(target_os = "fuchsia")]
3019impl ConnectorServiceProxy {
3020 pub fn connect_to_connector(&self) -> Result<ConnectorProxy, fidl::Error> {
3021 let (proxy, server_end) = fidl::endpoints::create_proxy::<ConnectorMarker>();
3022 self.connect_channel_to_connector(server_end)?;
3023 Ok(proxy)
3024 }
3025
3026 pub fn connect_to_connector_sync(&self) -> Result<ConnectorSynchronousProxy, fidl::Error> {
3029 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ConnectorMarker>();
3030 self.connect_channel_to_connector(server_end)?;
3031 Ok(proxy)
3032 }
3033
3034 pub fn connect_channel_to_connector(
3037 &self,
3038 server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
3039 ) -> Result<(), fidl::Error> {
3040 self.0.open_member("connector", server_end.into_channel())
3041 }
3042
3043 pub fn instance_name(&self) -> &str {
3044 self.0.instance_name()
3045 }
3046}
3047
3048mod internal {
3049 use super::*;
3050
3051 impl fidl::encoding::ResourceTypeMarker for ConnectorSignalProcessingConnectRequest {
3052 type Borrowed<'a> = &'a mut Self;
3053 fn take_or_borrow<'a>(
3054 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3055 ) -> Self::Borrowed<'a> {
3056 value
3057 }
3058 }
3059
3060 unsafe impl fidl::encoding::TypeMarker for ConnectorSignalProcessingConnectRequest {
3061 type Owned = Self;
3062
3063 #[inline(always)]
3064 fn inline_align(_context: fidl::encoding::Context) -> usize {
3065 4
3066 }
3067
3068 #[inline(always)]
3069 fn inline_size(_context: fidl::encoding::Context) -> usize {
3070 4
3071 }
3072 }
3073
3074 unsafe impl
3075 fidl::encoding::Encode<
3076 ConnectorSignalProcessingConnectRequest,
3077 fidl::encoding::DefaultFuchsiaResourceDialect,
3078 > for &mut ConnectorSignalProcessingConnectRequest
3079 {
3080 #[inline]
3081 unsafe fn encode(
3082 self,
3083 encoder: &mut fidl::encoding::Encoder<
3084 '_,
3085 fidl::encoding::DefaultFuchsiaResourceDialect,
3086 >,
3087 offset: usize,
3088 _depth: fidl::encoding::Depth,
3089 ) -> fidl::Result<()> {
3090 encoder.debug_check_bounds::<ConnectorSignalProcessingConnectRequest>(offset);
3091 fidl::encoding::Encode::<ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3093 (
3094 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.protocol),
3095 ),
3096 encoder, offset, _depth
3097 )
3098 }
3099 }
3100 unsafe impl<
3101 T0: fidl::encoding::Encode<
3102 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>>,
3103 fidl::encoding::DefaultFuchsiaResourceDialect,
3104 >,
3105 >
3106 fidl::encoding::Encode<
3107 ConnectorSignalProcessingConnectRequest,
3108 fidl::encoding::DefaultFuchsiaResourceDialect,
3109 > for (T0,)
3110 {
3111 #[inline]
3112 unsafe fn encode(
3113 self,
3114 encoder: &mut fidl::encoding::Encoder<
3115 '_,
3116 fidl::encoding::DefaultFuchsiaResourceDialect,
3117 >,
3118 offset: usize,
3119 depth: fidl::encoding::Depth,
3120 ) -> fidl::Result<()> {
3121 encoder.debug_check_bounds::<ConnectorSignalProcessingConnectRequest>(offset);
3122 self.0.encode(encoder, offset + 0, depth)?;
3126 Ok(())
3127 }
3128 }
3129
3130 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3131 for ConnectorSignalProcessingConnectRequest
3132 {
3133 #[inline(always)]
3134 fn new_empty() -> Self {
3135 Self {
3136 protocol: fidl::new_empty!(
3137 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>>,
3138 fidl::encoding::DefaultFuchsiaResourceDialect
3139 ),
3140 }
3141 }
3142
3143 #[inline]
3144 unsafe fn decode(
3145 &mut self,
3146 decoder: &mut fidl::encoding::Decoder<
3147 '_,
3148 fidl::encoding::DefaultFuchsiaResourceDialect,
3149 >,
3150 offset: usize,
3151 _depth: fidl::encoding::Depth,
3152 ) -> fidl::Result<()> {
3153 decoder.debug_check_bounds::<Self>(offset);
3154 fidl::decode!(
3156 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SignalProcessingMarker>>,
3157 fidl::encoding::DefaultFuchsiaResourceDialect,
3158 &mut self.protocol,
3159 decoder,
3160 offset + 0,
3161 _depth
3162 )?;
3163 Ok(())
3164 }
3165 }
3166}