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_lowpan_thread_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct CapabilitiesConnectorConnectRequest {
16 pub name: String,
17 pub server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for CapabilitiesConnectorConnectRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct DatasetConnectorConnectRequest {
27 pub name: String,
28 pub server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32 for DatasetConnectorConnectRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct FeatureConnectorConnectRequest {
38 pub name: String,
39 pub server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for FeatureConnectorConnectRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct MeshcopConnectorConnectRequest {
49 pub name: String,
50 pub server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
54 for MeshcopConnectorConnectRequest
55{
56}
57
58#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
59pub struct CapabilitiesConnectorMarker;
60
61impl fidl::endpoints::ProtocolMarker for CapabilitiesConnectorMarker {
62 type Proxy = CapabilitiesConnectorProxy;
63 type RequestStream = CapabilitiesConnectorRequestStream;
64 #[cfg(target_os = "fuchsia")]
65 type SynchronousProxy = CapabilitiesConnectorSynchronousProxy;
66
67 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.CapabilitiesConnector";
68}
69impl fidl::endpoints::DiscoverableProtocolMarker for CapabilitiesConnectorMarker {}
70
71pub trait CapabilitiesConnectorProxyInterface: Send + Sync {
72 fn r#connect(
73 &self,
74 name: &str,
75 server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
76 ) -> Result<(), fidl::Error>;
77}
78#[derive(Debug)]
79#[cfg(target_os = "fuchsia")]
80pub struct CapabilitiesConnectorSynchronousProxy {
81 client: fidl::client::sync::Client,
82}
83
84#[cfg(target_os = "fuchsia")]
85impl fidl::endpoints::SynchronousProxy for CapabilitiesConnectorSynchronousProxy {
86 type Proxy = CapabilitiesConnectorProxy;
87 type Protocol = CapabilitiesConnectorMarker;
88
89 fn from_channel(inner: fidl::Channel) -> Self {
90 Self::new(inner)
91 }
92
93 fn into_channel(self) -> fidl::Channel {
94 self.client.into_channel()
95 }
96
97 fn as_channel(&self) -> &fidl::Channel {
98 self.client.as_channel()
99 }
100}
101
102#[cfg(target_os = "fuchsia")]
103impl CapabilitiesConnectorSynchronousProxy {
104 pub fn new(channel: fidl::Channel) -> Self {
105 let protocol_name =
106 <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
107 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
108 }
109
110 pub fn into_channel(self) -> fidl::Channel {
111 self.client.into_channel()
112 }
113
114 pub fn wait_for_event(
117 &self,
118 deadline: zx::MonotonicInstant,
119 ) -> Result<CapabilitiesConnectorEvent, fidl::Error> {
120 CapabilitiesConnectorEvent::decode(self.client.wait_for_event(deadline)?)
121 }
122
123 pub fn r#connect(
140 &self,
141 mut name: &str,
142 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
143 ) -> Result<(), fidl::Error> {
144 self.client.send::<CapabilitiesConnectorConnectRequest>(
145 (name, server_end),
146 0x1dadd551ecacd85,
147 fidl::encoding::DynamicFlags::empty(),
148 )
149 }
150}
151
152#[cfg(target_os = "fuchsia")]
153impl From<CapabilitiesConnectorSynchronousProxy> for zx::Handle {
154 fn from(value: CapabilitiesConnectorSynchronousProxy) -> Self {
155 value.into_channel().into()
156 }
157}
158
159#[cfg(target_os = "fuchsia")]
160impl From<fidl::Channel> for CapabilitiesConnectorSynchronousProxy {
161 fn from(value: fidl::Channel) -> Self {
162 Self::new(value)
163 }
164}
165
166#[derive(Debug, Clone)]
167pub struct CapabilitiesConnectorProxy {
168 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
169}
170
171impl fidl::endpoints::Proxy for CapabilitiesConnectorProxy {
172 type Protocol = CapabilitiesConnectorMarker;
173
174 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
175 Self::new(inner)
176 }
177
178 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
179 self.client.into_channel().map_err(|client| Self { client })
180 }
181
182 fn as_channel(&self) -> &::fidl::AsyncChannel {
183 self.client.as_channel()
184 }
185}
186
187impl CapabilitiesConnectorProxy {
188 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
190 let protocol_name =
191 <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
192 Self { client: fidl::client::Client::new(channel, protocol_name) }
193 }
194
195 pub fn take_event_stream(&self) -> CapabilitiesConnectorEventStream {
201 CapabilitiesConnectorEventStream { event_receiver: self.client.take_event_receiver() }
202 }
203
204 pub fn r#connect(
221 &self,
222 mut name: &str,
223 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
224 ) -> Result<(), fidl::Error> {
225 CapabilitiesConnectorProxyInterface::r#connect(self, name, server_end)
226 }
227}
228
229impl CapabilitiesConnectorProxyInterface for CapabilitiesConnectorProxy {
230 fn r#connect(
231 &self,
232 mut name: &str,
233 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
234 ) -> Result<(), fidl::Error> {
235 self.client.send::<CapabilitiesConnectorConnectRequest>(
236 (name, server_end),
237 0x1dadd551ecacd85,
238 fidl::encoding::DynamicFlags::empty(),
239 )
240 }
241}
242
243pub struct CapabilitiesConnectorEventStream {
244 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
245}
246
247impl std::marker::Unpin for CapabilitiesConnectorEventStream {}
248
249impl futures::stream::FusedStream for CapabilitiesConnectorEventStream {
250 fn is_terminated(&self) -> bool {
251 self.event_receiver.is_terminated()
252 }
253}
254
255impl futures::Stream for CapabilitiesConnectorEventStream {
256 type Item = Result<CapabilitiesConnectorEvent, fidl::Error>;
257
258 fn poll_next(
259 mut self: std::pin::Pin<&mut Self>,
260 cx: &mut std::task::Context<'_>,
261 ) -> std::task::Poll<Option<Self::Item>> {
262 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
263 &mut self.event_receiver,
264 cx
265 )?) {
266 Some(buf) => std::task::Poll::Ready(Some(CapabilitiesConnectorEvent::decode(buf))),
267 None => std::task::Poll::Ready(None),
268 }
269 }
270}
271
272#[derive(Debug)]
273pub enum CapabilitiesConnectorEvent {}
274
275impl CapabilitiesConnectorEvent {
276 fn decode(
278 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
279 ) -> Result<CapabilitiesConnectorEvent, fidl::Error> {
280 let (bytes, _handles) = buf.split_mut();
281 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
282 debug_assert_eq!(tx_header.tx_id, 0);
283 match tx_header.ordinal {
284 _ => Err(fidl::Error::UnknownOrdinal {
285 ordinal: tx_header.ordinal,
286 protocol_name:
287 <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
288 }),
289 }
290 }
291}
292
293pub struct CapabilitiesConnectorRequestStream {
295 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
296 is_terminated: bool,
297}
298
299impl std::marker::Unpin for CapabilitiesConnectorRequestStream {}
300
301impl futures::stream::FusedStream for CapabilitiesConnectorRequestStream {
302 fn is_terminated(&self) -> bool {
303 self.is_terminated
304 }
305}
306
307impl fidl::endpoints::RequestStream for CapabilitiesConnectorRequestStream {
308 type Protocol = CapabilitiesConnectorMarker;
309 type ControlHandle = CapabilitiesConnectorControlHandle;
310
311 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
312 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
313 }
314
315 fn control_handle(&self) -> Self::ControlHandle {
316 CapabilitiesConnectorControlHandle { inner: self.inner.clone() }
317 }
318
319 fn into_inner(
320 self,
321 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
322 {
323 (self.inner, self.is_terminated)
324 }
325
326 fn from_inner(
327 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
328 is_terminated: bool,
329 ) -> Self {
330 Self { inner, is_terminated }
331 }
332}
333
334impl futures::Stream for CapabilitiesConnectorRequestStream {
335 type Item = Result<CapabilitiesConnectorRequest, fidl::Error>;
336
337 fn poll_next(
338 mut self: std::pin::Pin<&mut Self>,
339 cx: &mut std::task::Context<'_>,
340 ) -> std::task::Poll<Option<Self::Item>> {
341 let this = &mut *self;
342 if this.inner.check_shutdown(cx) {
343 this.is_terminated = true;
344 return std::task::Poll::Ready(None);
345 }
346 if this.is_terminated {
347 panic!("polled CapabilitiesConnectorRequestStream after completion");
348 }
349 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
350 |bytes, handles| {
351 match this.inner.channel().read_etc(cx, bytes, handles) {
352 std::task::Poll::Ready(Ok(())) => {}
353 std::task::Poll::Pending => return std::task::Poll::Pending,
354 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
355 this.is_terminated = true;
356 return std::task::Poll::Ready(None);
357 }
358 std::task::Poll::Ready(Err(e)) => {
359 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
360 e.into(),
361 ))))
362 }
363 }
364
365 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
367
368 std::task::Poll::Ready(Some(match header.ordinal {
369 0x1dadd551ecacd85 => {
370 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
371 let mut req = fidl::new_empty!(CapabilitiesConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
372 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
373 let control_handle = CapabilitiesConnectorControlHandle {
374 inner: this.inner.clone(),
375 };
376 Ok(CapabilitiesConnectorRequest::Connect {name: req.name,
377server_end: req.server_end,
378
379 control_handle,
380 })
381 }
382 _ => Err(fidl::Error::UnknownOrdinal {
383 ordinal: header.ordinal,
384 protocol_name: <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
385 }),
386 }))
387 },
388 )
389 }
390}
391
392#[derive(Debug)]
394pub enum CapabilitiesConnectorRequest {
395 Connect {
412 name: String,
413 server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
414 control_handle: CapabilitiesConnectorControlHandle,
415 },
416}
417
418impl CapabilitiesConnectorRequest {
419 #[allow(irrefutable_let_patterns)]
420 pub fn into_connect(
421 self,
422 ) -> Option<(
423 String,
424 fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
425 CapabilitiesConnectorControlHandle,
426 )> {
427 if let CapabilitiesConnectorRequest::Connect { name, server_end, control_handle } = self {
428 Some((name, server_end, control_handle))
429 } else {
430 None
431 }
432 }
433
434 pub fn method_name(&self) -> &'static str {
436 match *self {
437 CapabilitiesConnectorRequest::Connect { .. } => "connect",
438 }
439 }
440}
441
442#[derive(Debug, Clone)]
443pub struct CapabilitiesConnectorControlHandle {
444 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
445}
446
447impl fidl::endpoints::ControlHandle for CapabilitiesConnectorControlHandle {
448 fn shutdown(&self) {
449 self.inner.shutdown()
450 }
451 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
452 self.inner.shutdown_with_epitaph(status)
453 }
454
455 fn is_closed(&self) -> bool {
456 self.inner.channel().is_closed()
457 }
458 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
459 self.inner.channel().on_closed()
460 }
461
462 #[cfg(target_os = "fuchsia")]
463 fn signal_peer(
464 &self,
465 clear_mask: zx::Signals,
466 set_mask: zx::Signals,
467 ) -> Result<(), zx_status::Status> {
468 use fidl::Peered;
469 self.inner.channel().signal_peer(clear_mask, set_mask)
470 }
471}
472
473impl CapabilitiesConnectorControlHandle {}
474
475#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
476pub struct DatasetMarker;
477
478impl fidl::endpoints::ProtocolMarker for DatasetMarker {
479 type Proxy = DatasetProxy;
480 type RequestStream = DatasetRequestStream;
481 #[cfg(target_os = "fuchsia")]
482 type SynchronousProxy = DatasetSynchronousProxy;
483
484 const DEBUG_NAME: &'static str = "(anonymous) Dataset";
485}
486
487pub trait DatasetProxyInterface: Send + Sync {
488 type GetActiveTlvsResponseFut: std::future::Future<Output = Result<Option<Vec<u8>>, fidl::Error>>
489 + Send;
490 fn r#get_active_tlvs(&self) -> Self::GetActiveTlvsResponseFut;
491 type SetActiveTlvsResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
492 fn r#set_active_tlvs(&self, dataset: &[u8]) -> Self::SetActiveTlvsResponseFut;
493 type AttachAllNodesToResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
494 fn r#attach_all_nodes_to(&self, dataset: &[u8]) -> Self::AttachAllNodesToResponseFut;
495}
496#[derive(Debug)]
497#[cfg(target_os = "fuchsia")]
498pub struct DatasetSynchronousProxy {
499 client: fidl::client::sync::Client,
500}
501
502#[cfg(target_os = "fuchsia")]
503impl fidl::endpoints::SynchronousProxy for DatasetSynchronousProxy {
504 type Proxy = DatasetProxy;
505 type Protocol = DatasetMarker;
506
507 fn from_channel(inner: fidl::Channel) -> Self {
508 Self::new(inner)
509 }
510
511 fn into_channel(self) -> fidl::Channel {
512 self.client.into_channel()
513 }
514
515 fn as_channel(&self) -> &fidl::Channel {
516 self.client.as_channel()
517 }
518}
519
520#[cfg(target_os = "fuchsia")]
521impl DatasetSynchronousProxy {
522 pub fn new(channel: fidl::Channel) -> Self {
523 let protocol_name = <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
524 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
525 }
526
527 pub fn into_channel(self) -> fidl::Channel {
528 self.client.into_channel()
529 }
530
531 pub fn wait_for_event(
534 &self,
535 deadline: zx::MonotonicInstant,
536 ) -> Result<DatasetEvent, fidl::Error> {
537 DatasetEvent::decode(self.client.wait_for_event(deadline)?)
538 }
539
540 pub fn r#get_active_tlvs(
551 &self,
552 ___deadline: zx::MonotonicInstant,
553 ) -> Result<Option<Vec<u8>>, fidl::Error> {
554 let _response =
555 self.client.send_query::<fidl::encoding::EmptyPayload, DatasetGetActiveTlvsResponse>(
556 (),
557 0x3004d50d9fb69b92,
558 fidl::encoding::DynamicFlags::empty(),
559 ___deadline,
560 )?;
561 Ok(_response.dataset)
562 }
563
564 pub fn r#set_active_tlvs(
574 &self,
575 mut dataset: &[u8],
576 ___deadline: zx::MonotonicInstant,
577 ) -> Result<(), fidl::Error> {
578 let _response =
579 self.client.send_query::<DatasetSetActiveTlvsRequest, fidl::encoding::EmptyPayload>(
580 (dataset,),
581 0x5a8dc1d4e3b578e7,
582 fidl::encoding::DynamicFlags::empty(),
583 ___deadline,
584 )?;
585 Ok(_response)
586 }
587
588 pub fn r#attach_all_nodes_to(
608 &self,
609 mut dataset: &[u8],
610 ___deadline: zx::MonotonicInstant,
611 ) -> Result<i64, fidl::Error> {
612 let _response = self
613 .client
614 .send_query::<DatasetAttachAllNodesToRequest, DatasetAttachAllNodesToResponse>(
615 (dataset,),
616 0x6057e8b429c4aefe,
617 fidl::encoding::DynamicFlags::empty(),
618 ___deadline,
619 )?;
620 Ok(_response.delay_ms)
621 }
622}
623
624#[cfg(target_os = "fuchsia")]
625impl From<DatasetSynchronousProxy> for zx::Handle {
626 fn from(value: DatasetSynchronousProxy) -> Self {
627 value.into_channel().into()
628 }
629}
630
631#[cfg(target_os = "fuchsia")]
632impl From<fidl::Channel> for DatasetSynchronousProxy {
633 fn from(value: fidl::Channel) -> Self {
634 Self::new(value)
635 }
636}
637
638#[derive(Debug, Clone)]
639pub struct DatasetProxy {
640 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
641}
642
643impl fidl::endpoints::Proxy for DatasetProxy {
644 type Protocol = DatasetMarker;
645
646 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
647 Self::new(inner)
648 }
649
650 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
651 self.client.into_channel().map_err(|client| Self { client })
652 }
653
654 fn as_channel(&self) -> &::fidl::AsyncChannel {
655 self.client.as_channel()
656 }
657}
658
659impl DatasetProxy {
660 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
662 let protocol_name = <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
663 Self { client: fidl::client::Client::new(channel, protocol_name) }
664 }
665
666 pub fn take_event_stream(&self) -> DatasetEventStream {
672 DatasetEventStream { event_receiver: self.client.take_event_receiver() }
673 }
674
675 pub fn r#get_active_tlvs(
686 &self,
687 ) -> fidl::client::QueryResponseFut<
688 Option<Vec<u8>>,
689 fidl::encoding::DefaultFuchsiaResourceDialect,
690 > {
691 DatasetProxyInterface::r#get_active_tlvs(self)
692 }
693
694 pub fn r#set_active_tlvs(
704 &self,
705 mut dataset: &[u8],
706 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
707 DatasetProxyInterface::r#set_active_tlvs(self, dataset)
708 }
709
710 pub fn r#attach_all_nodes_to(
730 &self,
731 mut dataset: &[u8],
732 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
733 DatasetProxyInterface::r#attach_all_nodes_to(self, dataset)
734 }
735}
736
737impl DatasetProxyInterface for DatasetProxy {
738 type GetActiveTlvsResponseFut = fidl::client::QueryResponseFut<
739 Option<Vec<u8>>,
740 fidl::encoding::DefaultFuchsiaResourceDialect,
741 >;
742 fn r#get_active_tlvs(&self) -> Self::GetActiveTlvsResponseFut {
743 fn _decode(
744 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
745 ) -> Result<Option<Vec<u8>>, fidl::Error> {
746 let _response = fidl::client::decode_transaction_body::<
747 DatasetGetActiveTlvsResponse,
748 fidl::encoding::DefaultFuchsiaResourceDialect,
749 0x3004d50d9fb69b92,
750 >(_buf?)?;
751 Ok(_response.dataset)
752 }
753 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Option<Vec<u8>>>(
754 (),
755 0x3004d50d9fb69b92,
756 fidl::encoding::DynamicFlags::empty(),
757 _decode,
758 )
759 }
760
761 type SetActiveTlvsResponseFut =
762 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
763 fn r#set_active_tlvs(&self, mut dataset: &[u8]) -> Self::SetActiveTlvsResponseFut {
764 fn _decode(
765 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
766 ) -> Result<(), fidl::Error> {
767 let _response = fidl::client::decode_transaction_body::<
768 fidl::encoding::EmptyPayload,
769 fidl::encoding::DefaultFuchsiaResourceDialect,
770 0x5a8dc1d4e3b578e7,
771 >(_buf?)?;
772 Ok(_response)
773 }
774 self.client.send_query_and_decode::<DatasetSetActiveTlvsRequest, ()>(
775 (dataset,),
776 0x5a8dc1d4e3b578e7,
777 fidl::encoding::DynamicFlags::empty(),
778 _decode,
779 )
780 }
781
782 type AttachAllNodesToResponseFut =
783 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
784 fn r#attach_all_nodes_to(&self, mut dataset: &[u8]) -> Self::AttachAllNodesToResponseFut {
785 fn _decode(
786 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
787 ) -> Result<i64, fidl::Error> {
788 let _response = fidl::client::decode_transaction_body::<
789 DatasetAttachAllNodesToResponse,
790 fidl::encoding::DefaultFuchsiaResourceDialect,
791 0x6057e8b429c4aefe,
792 >(_buf?)?;
793 Ok(_response.delay_ms)
794 }
795 self.client.send_query_and_decode::<DatasetAttachAllNodesToRequest, i64>(
796 (dataset,),
797 0x6057e8b429c4aefe,
798 fidl::encoding::DynamicFlags::empty(),
799 _decode,
800 )
801 }
802}
803
804pub struct DatasetEventStream {
805 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
806}
807
808impl std::marker::Unpin for DatasetEventStream {}
809
810impl futures::stream::FusedStream for DatasetEventStream {
811 fn is_terminated(&self) -> bool {
812 self.event_receiver.is_terminated()
813 }
814}
815
816impl futures::Stream for DatasetEventStream {
817 type Item = Result<DatasetEvent, fidl::Error>;
818
819 fn poll_next(
820 mut self: std::pin::Pin<&mut Self>,
821 cx: &mut std::task::Context<'_>,
822 ) -> std::task::Poll<Option<Self::Item>> {
823 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
824 &mut self.event_receiver,
825 cx
826 )?) {
827 Some(buf) => std::task::Poll::Ready(Some(DatasetEvent::decode(buf))),
828 None => std::task::Poll::Ready(None),
829 }
830 }
831}
832
833#[derive(Debug)]
834pub enum DatasetEvent {}
835
836impl DatasetEvent {
837 fn decode(
839 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
840 ) -> Result<DatasetEvent, fidl::Error> {
841 let (bytes, _handles) = buf.split_mut();
842 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
843 debug_assert_eq!(tx_header.tx_id, 0);
844 match tx_header.ordinal {
845 _ => Err(fidl::Error::UnknownOrdinal {
846 ordinal: tx_header.ordinal,
847 protocol_name: <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
848 }),
849 }
850 }
851}
852
853pub struct DatasetRequestStream {
855 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
856 is_terminated: bool,
857}
858
859impl std::marker::Unpin for DatasetRequestStream {}
860
861impl futures::stream::FusedStream for DatasetRequestStream {
862 fn is_terminated(&self) -> bool {
863 self.is_terminated
864 }
865}
866
867impl fidl::endpoints::RequestStream for DatasetRequestStream {
868 type Protocol = DatasetMarker;
869 type ControlHandle = DatasetControlHandle;
870
871 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
872 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
873 }
874
875 fn control_handle(&self) -> Self::ControlHandle {
876 DatasetControlHandle { inner: self.inner.clone() }
877 }
878
879 fn into_inner(
880 self,
881 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
882 {
883 (self.inner, self.is_terminated)
884 }
885
886 fn from_inner(
887 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
888 is_terminated: bool,
889 ) -> Self {
890 Self { inner, is_terminated }
891 }
892}
893
894impl futures::Stream for DatasetRequestStream {
895 type Item = Result<DatasetRequest, fidl::Error>;
896
897 fn poll_next(
898 mut self: std::pin::Pin<&mut Self>,
899 cx: &mut std::task::Context<'_>,
900 ) -> std::task::Poll<Option<Self::Item>> {
901 let this = &mut *self;
902 if this.inner.check_shutdown(cx) {
903 this.is_terminated = true;
904 return std::task::Poll::Ready(None);
905 }
906 if this.is_terminated {
907 panic!("polled DatasetRequestStream after completion");
908 }
909 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
910 |bytes, handles| {
911 match this.inner.channel().read_etc(cx, bytes, handles) {
912 std::task::Poll::Ready(Ok(())) => {}
913 std::task::Poll::Pending => return std::task::Poll::Pending,
914 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
915 this.is_terminated = true;
916 return std::task::Poll::Ready(None);
917 }
918 std::task::Poll::Ready(Err(e)) => {
919 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
920 e.into(),
921 ))))
922 }
923 }
924
925 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
927
928 std::task::Poll::Ready(Some(match header.ordinal {
929 0x3004d50d9fb69b92 => {
930 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
931 let mut req = fidl::new_empty!(
932 fidl::encoding::EmptyPayload,
933 fidl::encoding::DefaultFuchsiaResourceDialect
934 );
935 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
936 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
937 Ok(DatasetRequest::GetActiveTlvs {
938 responder: DatasetGetActiveTlvsResponder {
939 control_handle: std::mem::ManuallyDrop::new(control_handle),
940 tx_id: header.tx_id,
941 },
942 })
943 }
944 0x5a8dc1d4e3b578e7 => {
945 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
946 let mut req = fidl::new_empty!(
947 DatasetSetActiveTlvsRequest,
948 fidl::encoding::DefaultFuchsiaResourceDialect
949 );
950 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetSetActiveTlvsRequest>(&header, _body_bytes, handles, &mut req)?;
951 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
952 Ok(DatasetRequest::SetActiveTlvs {
953 dataset: req.dataset,
954
955 responder: DatasetSetActiveTlvsResponder {
956 control_handle: std::mem::ManuallyDrop::new(control_handle),
957 tx_id: header.tx_id,
958 },
959 })
960 }
961 0x6057e8b429c4aefe => {
962 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
963 let mut req = fidl::new_empty!(
964 DatasetAttachAllNodesToRequest,
965 fidl::encoding::DefaultFuchsiaResourceDialect
966 );
967 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetAttachAllNodesToRequest>(&header, _body_bytes, handles, &mut req)?;
968 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
969 Ok(DatasetRequest::AttachAllNodesTo {
970 dataset: req.dataset,
971
972 responder: DatasetAttachAllNodesToResponder {
973 control_handle: std::mem::ManuallyDrop::new(control_handle),
974 tx_id: header.tx_id,
975 },
976 })
977 }
978 _ => Err(fidl::Error::UnknownOrdinal {
979 ordinal: header.ordinal,
980 protocol_name:
981 <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
982 }),
983 }))
984 },
985 )
986 }
987}
988
989#[derive(Debug)]
996pub enum DatasetRequest {
997 GetActiveTlvs { responder: DatasetGetActiveTlvsResponder },
1008 SetActiveTlvs { dataset: Vec<u8>, responder: DatasetSetActiveTlvsResponder },
1018 AttachAllNodesTo { dataset: Vec<u8>, responder: DatasetAttachAllNodesToResponder },
1038}
1039
1040impl DatasetRequest {
1041 #[allow(irrefutable_let_patterns)]
1042 pub fn into_get_active_tlvs(self) -> Option<(DatasetGetActiveTlvsResponder)> {
1043 if let DatasetRequest::GetActiveTlvs { responder } = self {
1044 Some((responder))
1045 } else {
1046 None
1047 }
1048 }
1049
1050 #[allow(irrefutable_let_patterns)]
1051 pub fn into_set_active_tlvs(self) -> Option<(Vec<u8>, DatasetSetActiveTlvsResponder)> {
1052 if let DatasetRequest::SetActiveTlvs { dataset, responder } = self {
1053 Some((dataset, responder))
1054 } else {
1055 None
1056 }
1057 }
1058
1059 #[allow(irrefutable_let_patterns)]
1060 pub fn into_attach_all_nodes_to(self) -> Option<(Vec<u8>, DatasetAttachAllNodesToResponder)> {
1061 if let DatasetRequest::AttachAllNodesTo { dataset, responder } = self {
1062 Some((dataset, responder))
1063 } else {
1064 None
1065 }
1066 }
1067
1068 pub fn method_name(&self) -> &'static str {
1070 match *self {
1071 DatasetRequest::GetActiveTlvs { .. } => "get_active_tlvs",
1072 DatasetRequest::SetActiveTlvs { .. } => "set_active_tlvs",
1073 DatasetRequest::AttachAllNodesTo { .. } => "attach_all_nodes_to",
1074 }
1075 }
1076}
1077
1078#[derive(Debug, Clone)]
1079pub struct DatasetControlHandle {
1080 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1081}
1082
1083impl fidl::endpoints::ControlHandle for DatasetControlHandle {
1084 fn shutdown(&self) {
1085 self.inner.shutdown()
1086 }
1087 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1088 self.inner.shutdown_with_epitaph(status)
1089 }
1090
1091 fn is_closed(&self) -> bool {
1092 self.inner.channel().is_closed()
1093 }
1094 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1095 self.inner.channel().on_closed()
1096 }
1097
1098 #[cfg(target_os = "fuchsia")]
1099 fn signal_peer(
1100 &self,
1101 clear_mask: zx::Signals,
1102 set_mask: zx::Signals,
1103 ) -> Result<(), zx_status::Status> {
1104 use fidl::Peered;
1105 self.inner.channel().signal_peer(clear_mask, set_mask)
1106 }
1107}
1108
1109impl DatasetControlHandle {}
1110
1111#[must_use = "FIDL methods require a response to be sent"]
1112#[derive(Debug)]
1113pub struct DatasetGetActiveTlvsResponder {
1114 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1115 tx_id: u32,
1116}
1117
1118impl std::ops::Drop for DatasetGetActiveTlvsResponder {
1122 fn drop(&mut self) {
1123 self.control_handle.shutdown();
1124 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1126 }
1127}
1128
1129impl fidl::endpoints::Responder for DatasetGetActiveTlvsResponder {
1130 type ControlHandle = DatasetControlHandle;
1131
1132 fn control_handle(&self) -> &DatasetControlHandle {
1133 &self.control_handle
1134 }
1135
1136 fn drop_without_shutdown(mut self) {
1137 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1139 std::mem::forget(self);
1141 }
1142}
1143
1144impl DatasetGetActiveTlvsResponder {
1145 pub fn send(self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1149 let _result = self.send_raw(dataset);
1150 if _result.is_err() {
1151 self.control_handle.shutdown();
1152 }
1153 self.drop_without_shutdown();
1154 _result
1155 }
1156
1157 pub fn send_no_shutdown_on_err(self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1159 let _result = self.send_raw(dataset);
1160 self.drop_without_shutdown();
1161 _result
1162 }
1163
1164 fn send_raw(&self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1165 self.control_handle.inner.send::<DatasetGetActiveTlvsResponse>(
1166 (dataset,),
1167 self.tx_id,
1168 0x3004d50d9fb69b92,
1169 fidl::encoding::DynamicFlags::empty(),
1170 )
1171 }
1172}
1173
1174#[must_use = "FIDL methods require a response to be sent"]
1175#[derive(Debug)]
1176pub struct DatasetSetActiveTlvsResponder {
1177 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1178 tx_id: u32,
1179}
1180
1181impl std::ops::Drop for DatasetSetActiveTlvsResponder {
1185 fn drop(&mut self) {
1186 self.control_handle.shutdown();
1187 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1189 }
1190}
1191
1192impl fidl::endpoints::Responder for DatasetSetActiveTlvsResponder {
1193 type ControlHandle = DatasetControlHandle;
1194
1195 fn control_handle(&self) -> &DatasetControlHandle {
1196 &self.control_handle
1197 }
1198
1199 fn drop_without_shutdown(mut self) {
1200 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1202 std::mem::forget(self);
1204 }
1205}
1206
1207impl DatasetSetActiveTlvsResponder {
1208 pub fn send(self) -> Result<(), fidl::Error> {
1212 let _result = self.send_raw();
1213 if _result.is_err() {
1214 self.control_handle.shutdown();
1215 }
1216 self.drop_without_shutdown();
1217 _result
1218 }
1219
1220 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1222 let _result = self.send_raw();
1223 self.drop_without_shutdown();
1224 _result
1225 }
1226
1227 fn send_raw(&self) -> Result<(), fidl::Error> {
1228 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1229 (),
1230 self.tx_id,
1231 0x5a8dc1d4e3b578e7,
1232 fidl::encoding::DynamicFlags::empty(),
1233 )
1234 }
1235}
1236
1237#[must_use = "FIDL methods require a response to be sent"]
1238#[derive(Debug)]
1239pub struct DatasetAttachAllNodesToResponder {
1240 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1241 tx_id: u32,
1242}
1243
1244impl std::ops::Drop for DatasetAttachAllNodesToResponder {
1248 fn drop(&mut self) {
1249 self.control_handle.shutdown();
1250 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1252 }
1253}
1254
1255impl fidl::endpoints::Responder for DatasetAttachAllNodesToResponder {
1256 type ControlHandle = DatasetControlHandle;
1257
1258 fn control_handle(&self) -> &DatasetControlHandle {
1259 &self.control_handle
1260 }
1261
1262 fn drop_without_shutdown(mut self) {
1263 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1265 std::mem::forget(self);
1267 }
1268}
1269
1270impl DatasetAttachAllNodesToResponder {
1271 pub fn send(self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1275 let _result = self.send_raw(delay_ms);
1276 if _result.is_err() {
1277 self.control_handle.shutdown();
1278 }
1279 self.drop_without_shutdown();
1280 _result
1281 }
1282
1283 pub fn send_no_shutdown_on_err(self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1285 let _result = self.send_raw(delay_ms);
1286 self.drop_without_shutdown();
1287 _result
1288 }
1289
1290 fn send_raw(&self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1291 self.control_handle.inner.send::<DatasetAttachAllNodesToResponse>(
1292 (delay_ms,),
1293 self.tx_id,
1294 0x6057e8b429c4aefe,
1295 fidl::encoding::DynamicFlags::empty(),
1296 )
1297 }
1298}
1299
1300#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1301pub struct DatasetConnectorMarker;
1302
1303impl fidl::endpoints::ProtocolMarker for DatasetConnectorMarker {
1304 type Proxy = DatasetConnectorProxy;
1305 type RequestStream = DatasetConnectorRequestStream;
1306 #[cfg(target_os = "fuchsia")]
1307 type SynchronousProxy = DatasetConnectorSynchronousProxy;
1308
1309 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.DatasetConnector";
1310}
1311impl fidl::endpoints::DiscoverableProtocolMarker for DatasetConnectorMarker {}
1312
1313pub trait DatasetConnectorProxyInterface: Send + Sync {
1314 fn r#connect(
1315 &self,
1316 name: &str,
1317 server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1318 ) -> Result<(), fidl::Error>;
1319}
1320#[derive(Debug)]
1321#[cfg(target_os = "fuchsia")]
1322pub struct DatasetConnectorSynchronousProxy {
1323 client: fidl::client::sync::Client,
1324}
1325
1326#[cfg(target_os = "fuchsia")]
1327impl fidl::endpoints::SynchronousProxy for DatasetConnectorSynchronousProxy {
1328 type Proxy = DatasetConnectorProxy;
1329 type Protocol = DatasetConnectorMarker;
1330
1331 fn from_channel(inner: fidl::Channel) -> Self {
1332 Self::new(inner)
1333 }
1334
1335 fn into_channel(self) -> fidl::Channel {
1336 self.client.into_channel()
1337 }
1338
1339 fn as_channel(&self) -> &fidl::Channel {
1340 self.client.as_channel()
1341 }
1342}
1343
1344#[cfg(target_os = "fuchsia")]
1345impl DatasetConnectorSynchronousProxy {
1346 pub fn new(channel: fidl::Channel) -> Self {
1347 let protocol_name = <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1348 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1349 }
1350
1351 pub fn into_channel(self) -> fidl::Channel {
1352 self.client.into_channel()
1353 }
1354
1355 pub fn wait_for_event(
1358 &self,
1359 deadline: zx::MonotonicInstant,
1360 ) -> Result<DatasetConnectorEvent, fidl::Error> {
1361 DatasetConnectorEvent::decode(self.client.wait_for_event(deadline)?)
1362 }
1363
1364 pub fn r#connect(
1381 &self,
1382 mut name: &str,
1383 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1384 ) -> Result<(), fidl::Error> {
1385 self.client.send::<DatasetConnectorConnectRequest>(
1386 (name, server_end),
1387 0x24dff5d2c0cee02b,
1388 fidl::encoding::DynamicFlags::empty(),
1389 )
1390 }
1391}
1392
1393#[cfg(target_os = "fuchsia")]
1394impl From<DatasetConnectorSynchronousProxy> for zx::Handle {
1395 fn from(value: DatasetConnectorSynchronousProxy) -> Self {
1396 value.into_channel().into()
1397 }
1398}
1399
1400#[cfg(target_os = "fuchsia")]
1401impl From<fidl::Channel> for DatasetConnectorSynchronousProxy {
1402 fn from(value: fidl::Channel) -> Self {
1403 Self::new(value)
1404 }
1405}
1406
1407#[derive(Debug, Clone)]
1408pub struct DatasetConnectorProxy {
1409 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1410}
1411
1412impl fidl::endpoints::Proxy for DatasetConnectorProxy {
1413 type Protocol = DatasetConnectorMarker;
1414
1415 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1416 Self::new(inner)
1417 }
1418
1419 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1420 self.client.into_channel().map_err(|client| Self { client })
1421 }
1422
1423 fn as_channel(&self) -> &::fidl::AsyncChannel {
1424 self.client.as_channel()
1425 }
1426}
1427
1428impl DatasetConnectorProxy {
1429 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1431 let protocol_name = <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1432 Self { client: fidl::client::Client::new(channel, protocol_name) }
1433 }
1434
1435 pub fn take_event_stream(&self) -> DatasetConnectorEventStream {
1441 DatasetConnectorEventStream { event_receiver: self.client.take_event_receiver() }
1442 }
1443
1444 pub fn r#connect(
1461 &self,
1462 mut name: &str,
1463 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1464 ) -> Result<(), fidl::Error> {
1465 DatasetConnectorProxyInterface::r#connect(self, name, server_end)
1466 }
1467}
1468
1469impl DatasetConnectorProxyInterface for DatasetConnectorProxy {
1470 fn r#connect(
1471 &self,
1472 mut name: &str,
1473 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1474 ) -> Result<(), fidl::Error> {
1475 self.client.send::<DatasetConnectorConnectRequest>(
1476 (name, server_end),
1477 0x24dff5d2c0cee02b,
1478 fidl::encoding::DynamicFlags::empty(),
1479 )
1480 }
1481}
1482
1483pub struct DatasetConnectorEventStream {
1484 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1485}
1486
1487impl std::marker::Unpin for DatasetConnectorEventStream {}
1488
1489impl futures::stream::FusedStream for DatasetConnectorEventStream {
1490 fn is_terminated(&self) -> bool {
1491 self.event_receiver.is_terminated()
1492 }
1493}
1494
1495impl futures::Stream for DatasetConnectorEventStream {
1496 type Item = Result<DatasetConnectorEvent, fidl::Error>;
1497
1498 fn poll_next(
1499 mut self: std::pin::Pin<&mut Self>,
1500 cx: &mut std::task::Context<'_>,
1501 ) -> std::task::Poll<Option<Self::Item>> {
1502 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1503 &mut self.event_receiver,
1504 cx
1505 )?) {
1506 Some(buf) => std::task::Poll::Ready(Some(DatasetConnectorEvent::decode(buf))),
1507 None => std::task::Poll::Ready(None),
1508 }
1509 }
1510}
1511
1512#[derive(Debug)]
1513pub enum DatasetConnectorEvent {}
1514
1515impl DatasetConnectorEvent {
1516 fn decode(
1518 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1519 ) -> Result<DatasetConnectorEvent, fidl::Error> {
1520 let (bytes, _handles) = buf.split_mut();
1521 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1522 debug_assert_eq!(tx_header.tx_id, 0);
1523 match tx_header.ordinal {
1524 _ => Err(fidl::Error::UnknownOrdinal {
1525 ordinal: tx_header.ordinal,
1526 protocol_name:
1527 <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1528 }),
1529 }
1530 }
1531}
1532
1533pub struct DatasetConnectorRequestStream {
1535 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1536 is_terminated: bool,
1537}
1538
1539impl std::marker::Unpin for DatasetConnectorRequestStream {}
1540
1541impl futures::stream::FusedStream for DatasetConnectorRequestStream {
1542 fn is_terminated(&self) -> bool {
1543 self.is_terminated
1544 }
1545}
1546
1547impl fidl::endpoints::RequestStream for DatasetConnectorRequestStream {
1548 type Protocol = DatasetConnectorMarker;
1549 type ControlHandle = DatasetConnectorControlHandle;
1550
1551 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1552 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1553 }
1554
1555 fn control_handle(&self) -> Self::ControlHandle {
1556 DatasetConnectorControlHandle { inner: self.inner.clone() }
1557 }
1558
1559 fn into_inner(
1560 self,
1561 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1562 {
1563 (self.inner, self.is_terminated)
1564 }
1565
1566 fn from_inner(
1567 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1568 is_terminated: bool,
1569 ) -> Self {
1570 Self { inner, is_terminated }
1571 }
1572}
1573
1574impl futures::Stream for DatasetConnectorRequestStream {
1575 type Item = Result<DatasetConnectorRequest, fidl::Error>;
1576
1577 fn poll_next(
1578 mut self: std::pin::Pin<&mut Self>,
1579 cx: &mut std::task::Context<'_>,
1580 ) -> std::task::Poll<Option<Self::Item>> {
1581 let this = &mut *self;
1582 if this.inner.check_shutdown(cx) {
1583 this.is_terminated = true;
1584 return std::task::Poll::Ready(None);
1585 }
1586 if this.is_terminated {
1587 panic!("polled DatasetConnectorRequestStream after completion");
1588 }
1589 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1590 |bytes, handles| {
1591 match this.inner.channel().read_etc(cx, bytes, handles) {
1592 std::task::Poll::Ready(Ok(())) => {}
1593 std::task::Poll::Pending => return std::task::Poll::Pending,
1594 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1595 this.is_terminated = true;
1596 return std::task::Poll::Ready(None);
1597 }
1598 std::task::Poll::Ready(Err(e)) => {
1599 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1600 e.into(),
1601 ))))
1602 }
1603 }
1604
1605 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1607
1608 std::task::Poll::Ready(Some(match header.ordinal {
1609 0x24dff5d2c0cee02b => {
1610 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1611 let mut req = fidl::new_empty!(
1612 DatasetConnectorConnectRequest,
1613 fidl::encoding::DefaultFuchsiaResourceDialect
1614 );
1615 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
1616 let control_handle =
1617 DatasetConnectorControlHandle { inner: this.inner.clone() };
1618 Ok(DatasetConnectorRequest::Connect {
1619 name: req.name,
1620 server_end: req.server_end,
1621
1622 control_handle,
1623 })
1624 }
1625 _ => Err(fidl::Error::UnknownOrdinal {
1626 ordinal: header.ordinal,
1627 protocol_name:
1628 <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1629 }),
1630 }))
1631 },
1632 )
1633 }
1634}
1635
1636#[derive(Debug)]
1638pub enum DatasetConnectorRequest {
1639 Connect {
1656 name: String,
1657 server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1658 control_handle: DatasetConnectorControlHandle,
1659 },
1660}
1661
1662impl DatasetConnectorRequest {
1663 #[allow(irrefutable_let_patterns)]
1664 pub fn into_connect(
1665 self,
1666 ) -> Option<(String, fidl::endpoints::ServerEnd<DatasetMarker>, DatasetConnectorControlHandle)>
1667 {
1668 if let DatasetConnectorRequest::Connect { name, server_end, control_handle } = self {
1669 Some((name, server_end, control_handle))
1670 } else {
1671 None
1672 }
1673 }
1674
1675 pub fn method_name(&self) -> &'static str {
1677 match *self {
1678 DatasetConnectorRequest::Connect { .. } => "connect",
1679 }
1680 }
1681}
1682
1683#[derive(Debug, Clone)]
1684pub struct DatasetConnectorControlHandle {
1685 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1686}
1687
1688impl fidl::endpoints::ControlHandle for DatasetConnectorControlHandle {
1689 fn shutdown(&self) {
1690 self.inner.shutdown()
1691 }
1692 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1693 self.inner.shutdown_with_epitaph(status)
1694 }
1695
1696 fn is_closed(&self) -> bool {
1697 self.inner.channel().is_closed()
1698 }
1699 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1700 self.inner.channel().on_closed()
1701 }
1702
1703 #[cfg(target_os = "fuchsia")]
1704 fn signal_peer(
1705 &self,
1706 clear_mask: zx::Signals,
1707 set_mask: zx::Signals,
1708 ) -> Result<(), zx_status::Status> {
1709 use fidl::Peered;
1710 self.inner.channel().signal_peer(clear_mask, set_mask)
1711 }
1712}
1713
1714impl DatasetConnectorControlHandle {}
1715
1716#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1717pub struct FeatureMarker;
1718
1719impl fidl::endpoints::ProtocolMarker for FeatureMarker {
1720 type Proxy = FeatureProxy;
1721 type RequestStream = FeatureRequestStream;
1722 #[cfg(target_os = "fuchsia")]
1723 type SynchronousProxy = FeatureSynchronousProxy;
1724
1725 const DEBUG_NAME: &'static str = "(anonymous) Feature";
1726}
1727
1728pub trait FeatureProxyInterface: Send + Sync {
1729 type UpdateFeatureConfigResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1730 + Send;
1731 fn r#update_feature_config(
1732 &self,
1733 config: &FeatureConfig,
1734 ) -> Self::UpdateFeatureConfigResponseFut;
1735 type GetFeatureConfigResponseFut: std::future::Future<Output = Result<FeatureConfig, fidl::Error>>
1736 + Send;
1737 fn r#get_feature_config(&self) -> Self::GetFeatureConfigResponseFut;
1738}
1739#[derive(Debug)]
1740#[cfg(target_os = "fuchsia")]
1741pub struct FeatureSynchronousProxy {
1742 client: fidl::client::sync::Client,
1743}
1744
1745#[cfg(target_os = "fuchsia")]
1746impl fidl::endpoints::SynchronousProxy for FeatureSynchronousProxy {
1747 type Proxy = FeatureProxy;
1748 type Protocol = FeatureMarker;
1749
1750 fn from_channel(inner: fidl::Channel) -> Self {
1751 Self::new(inner)
1752 }
1753
1754 fn into_channel(self) -> fidl::Channel {
1755 self.client.into_channel()
1756 }
1757
1758 fn as_channel(&self) -> &fidl::Channel {
1759 self.client.as_channel()
1760 }
1761}
1762
1763#[cfg(target_os = "fuchsia")]
1764impl FeatureSynchronousProxy {
1765 pub fn new(channel: fidl::Channel) -> Self {
1766 let protocol_name = <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1767 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1768 }
1769
1770 pub fn into_channel(self) -> fidl::Channel {
1771 self.client.into_channel()
1772 }
1773
1774 pub fn wait_for_event(
1777 &self,
1778 deadline: zx::MonotonicInstant,
1779 ) -> Result<FeatureEvent, fidl::Error> {
1780 FeatureEvent::decode(self.client.wait_for_event(deadline)?)
1781 }
1782
1783 pub fn r#update_feature_config(
1788 &self,
1789 mut config: &FeatureConfig,
1790 ___deadline: zx::MonotonicInstant,
1791 ) -> Result<(), fidl::Error> {
1792 let _response = self
1793 .client
1794 .send_query::<FeatureUpdateFeatureConfigRequest, fidl::encoding::EmptyPayload>(
1795 (config,),
1796 0x2d24a706e8730410,
1797 fidl::encoding::DynamicFlags::empty(),
1798 ___deadline,
1799 )?;
1800 Ok(_response)
1801 }
1802
1803 pub fn r#get_feature_config(
1809 &self,
1810 ___deadline: zx::MonotonicInstant,
1811 ) -> Result<FeatureConfig, fidl::Error> {
1812 let _response = self
1813 .client
1814 .send_query::<fidl::encoding::EmptyPayload, FeatureGetFeatureConfigResponse>(
1815 (),
1816 0x2ab1896aea843611,
1817 fidl::encoding::DynamicFlags::empty(),
1818 ___deadline,
1819 )?;
1820 Ok(_response.config)
1821 }
1822}
1823
1824#[cfg(target_os = "fuchsia")]
1825impl From<FeatureSynchronousProxy> for zx::Handle {
1826 fn from(value: FeatureSynchronousProxy) -> Self {
1827 value.into_channel().into()
1828 }
1829}
1830
1831#[cfg(target_os = "fuchsia")]
1832impl From<fidl::Channel> for FeatureSynchronousProxy {
1833 fn from(value: fidl::Channel) -> Self {
1834 Self::new(value)
1835 }
1836}
1837
1838#[derive(Debug, Clone)]
1839pub struct FeatureProxy {
1840 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1841}
1842
1843impl fidl::endpoints::Proxy for FeatureProxy {
1844 type Protocol = FeatureMarker;
1845
1846 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1847 Self::new(inner)
1848 }
1849
1850 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1851 self.client.into_channel().map_err(|client| Self { client })
1852 }
1853
1854 fn as_channel(&self) -> &::fidl::AsyncChannel {
1855 self.client.as_channel()
1856 }
1857}
1858
1859impl FeatureProxy {
1860 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1862 let protocol_name = <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1863 Self { client: fidl::client::Client::new(channel, protocol_name) }
1864 }
1865
1866 pub fn take_event_stream(&self) -> FeatureEventStream {
1872 FeatureEventStream { event_receiver: self.client.take_event_receiver() }
1873 }
1874
1875 pub fn r#update_feature_config(
1880 &self,
1881 mut config: &FeatureConfig,
1882 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1883 FeatureProxyInterface::r#update_feature_config(self, config)
1884 }
1885
1886 pub fn r#get_feature_config(
1892 &self,
1893 ) -> fidl::client::QueryResponseFut<FeatureConfig, fidl::encoding::DefaultFuchsiaResourceDialect>
1894 {
1895 FeatureProxyInterface::r#get_feature_config(self)
1896 }
1897}
1898
1899impl FeatureProxyInterface for FeatureProxy {
1900 type UpdateFeatureConfigResponseFut =
1901 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1902 fn r#update_feature_config(
1903 &self,
1904 mut config: &FeatureConfig,
1905 ) -> Self::UpdateFeatureConfigResponseFut {
1906 fn _decode(
1907 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1908 ) -> Result<(), fidl::Error> {
1909 let _response = fidl::client::decode_transaction_body::<
1910 fidl::encoding::EmptyPayload,
1911 fidl::encoding::DefaultFuchsiaResourceDialect,
1912 0x2d24a706e8730410,
1913 >(_buf?)?;
1914 Ok(_response)
1915 }
1916 self.client.send_query_and_decode::<FeatureUpdateFeatureConfigRequest, ()>(
1917 (config,),
1918 0x2d24a706e8730410,
1919 fidl::encoding::DynamicFlags::empty(),
1920 _decode,
1921 )
1922 }
1923
1924 type GetFeatureConfigResponseFut = fidl::client::QueryResponseFut<
1925 FeatureConfig,
1926 fidl::encoding::DefaultFuchsiaResourceDialect,
1927 >;
1928 fn r#get_feature_config(&self) -> Self::GetFeatureConfigResponseFut {
1929 fn _decode(
1930 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1931 ) -> Result<FeatureConfig, fidl::Error> {
1932 let _response = fidl::client::decode_transaction_body::<
1933 FeatureGetFeatureConfigResponse,
1934 fidl::encoding::DefaultFuchsiaResourceDialect,
1935 0x2ab1896aea843611,
1936 >(_buf?)?;
1937 Ok(_response.config)
1938 }
1939 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FeatureConfig>(
1940 (),
1941 0x2ab1896aea843611,
1942 fidl::encoding::DynamicFlags::empty(),
1943 _decode,
1944 )
1945 }
1946}
1947
1948pub struct FeatureEventStream {
1949 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1950}
1951
1952impl std::marker::Unpin for FeatureEventStream {}
1953
1954impl futures::stream::FusedStream for FeatureEventStream {
1955 fn is_terminated(&self) -> bool {
1956 self.event_receiver.is_terminated()
1957 }
1958}
1959
1960impl futures::Stream for FeatureEventStream {
1961 type Item = Result<FeatureEvent, fidl::Error>;
1962
1963 fn poll_next(
1964 mut self: std::pin::Pin<&mut Self>,
1965 cx: &mut std::task::Context<'_>,
1966 ) -> std::task::Poll<Option<Self::Item>> {
1967 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1968 &mut self.event_receiver,
1969 cx
1970 )?) {
1971 Some(buf) => std::task::Poll::Ready(Some(FeatureEvent::decode(buf))),
1972 None => std::task::Poll::Ready(None),
1973 }
1974 }
1975}
1976
1977#[derive(Debug)]
1978pub enum FeatureEvent {}
1979
1980impl FeatureEvent {
1981 fn decode(
1983 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1984 ) -> Result<FeatureEvent, fidl::Error> {
1985 let (bytes, _handles) = buf.split_mut();
1986 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1987 debug_assert_eq!(tx_header.tx_id, 0);
1988 match tx_header.ordinal {
1989 _ => Err(fidl::Error::UnknownOrdinal {
1990 ordinal: tx_header.ordinal,
1991 protocol_name: <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1992 }),
1993 }
1994 }
1995}
1996
1997pub struct FeatureRequestStream {
1999 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2000 is_terminated: bool,
2001}
2002
2003impl std::marker::Unpin for FeatureRequestStream {}
2004
2005impl futures::stream::FusedStream for FeatureRequestStream {
2006 fn is_terminated(&self) -> bool {
2007 self.is_terminated
2008 }
2009}
2010
2011impl fidl::endpoints::RequestStream for FeatureRequestStream {
2012 type Protocol = FeatureMarker;
2013 type ControlHandle = FeatureControlHandle;
2014
2015 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2016 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2017 }
2018
2019 fn control_handle(&self) -> Self::ControlHandle {
2020 FeatureControlHandle { inner: self.inner.clone() }
2021 }
2022
2023 fn into_inner(
2024 self,
2025 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2026 {
2027 (self.inner, self.is_terminated)
2028 }
2029
2030 fn from_inner(
2031 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2032 is_terminated: bool,
2033 ) -> Self {
2034 Self { inner, is_terminated }
2035 }
2036}
2037
2038impl futures::Stream for FeatureRequestStream {
2039 type Item = Result<FeatureRequest, fidl::Error>;
2040
2041 fn poll_next(
2042 mut self: std::pin::Pin<&mut Self>,
2043 cx: &mut std::task::Context<'_>,
2044 ) -> std::task::Poll<Option<Self::Item>> {
2045 let this = &mut *self;
2046 if this.inner.check_shutdown(cx) {
2047 this.is_terminated = true;
2048 return std::task::Poll::Ready(None);
2049 }
2050 if this.is_terminated {
2051 panic!("polled FeatureRequestStream after completion");
2052 }
2053 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2054 |bytes, handles| {
2055 match this.inner.channel().read_etc(cx, bytes, handles) {
2056 std::task::Poll::Ready(Ok(())) => {}
2057 std::task::Poll::Pending => return std::task::Poll::Pending,
2058 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2059 this.is_terminated = true;
2060 return std::task::Poll::Ready(None);
2061 }
2062 std::task::Poll::Ready(Err(e)) => {
2063 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2064 e.into(),
2065 ))))
2066 }
2067 }
2068
2069 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2071
2072 std::task::Poll::Ready(Some(match header.ordinal {
2073 0x2d24a706e8730410 => {
2074 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2075 let mut req = fidl::new_empty!(
2076 FeatureUpdateFeatureConfigRequest,
2077 fidl::encoding::DefaultFuchsiaResourceDialect
2078 );
2079 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FeatureUpdateFeatureConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2080 let control_handle = FeatureControlHandle { inner: this.inner.clone() };
2081 Ok(FeatureRequest::UpdateFeatureConfig {
2082 config: req.config,
2083
2084 responder: FeatureUpdateFeatureConfigResponder {
2085 control_handle: std::mem::ManuallyDrop::new(control_handle),
2086 tx_id: header.tx_id,
2087 },
2088 })
2089 }
2090 0x2ab1896aea843611 => {
2091 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2092 let mut req = fidl::new_empty!(
2093 fidl::encoding::EmptyPayload,
2094 fidl::encoding::DefaultFuchsiaResourceDialect
2095 );
2096 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2097 let control_handle = FeatureControlHandle { inner: this.inner.clone() };
2098 Ok(FeatureRequest::GetFeatureConfig {
2099 responder: FeatureGetFeatureConfigResponder {
2100 control_handle: std::mem::ManuallyDrop::new(control_handle),
2101 tx_id: header.tx_id,
2102 },
2103 })
2104 }
2105 _ => Err(fidl::Error::UnknownOrdinal {
2106 ordinal: header.ordinal,
2107 protocol_name:
2108 <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2109 }),
2110 }))
2111 },
2112 )
2113 }
2114}
2115
2116#[derive(Debug)]
2119pub enum FeatureRequest {
2120 UpdateFeatureConfig { config: FeatureConfig, responder: FeatureUpdateFeatureConfigResponder },
2125 GetFeatureConfig { responder: FeatureGetFeatureConfigResponder },
2131}
2132
2133impl FeatureRequest {
2134 #[allow(irrefutable_let_patterns)]
2135 pub fn into_update_feature_config(
2136 self,
2137 ) -> Option<(FeatureConfig, FeatureUpdateFeatureConfigResponder)> {
2138 if let FeatureRequest::UpdateFeatureConfig { config, responder } = self {
2139 Some((config, responder))
2140 } else {
2141 None
2142 }
2143 }
2144
2145 #[allow(irrefutable_let_patterns)]
2146 pub fn into_get_feature_config(self) -> Option<(FeatureGetFeatureConfigResponder)> {
2147 if let FeatureRequest::GetFeatureConfig { responder } = self {
2148 Some((responder))
2149 } else {
2150 None
2151 }
2152 }
2153
2154 pub fn method_name(&self) -> &'static str {
2156 match *self {
2157 FeatureRequest::UpdateFeatureConfig { .. } => "update_feature_config",
2158 FeatureRequest::GetFeatureConfig { .. } => "get_feature_config",
2159 }
2160 }
2161}
2162
2163#[derive(Debug, Clone)]
2164pub struct FeatureControlHandle {
2165 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2166}
2167
2168impl fidl::endpoints::ControlHandle for FeatureControlHandle {
2169 fn shutdown(&self) {
2170 self.inner.shutdown()
2171 }
2172 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2173 self.inner.shutdown_with_epitaph(status)
2174 }
2175
2176 fn is_closed(&self) -> bool {
2177 self.inner.channel().is_closed()
2178 }
2179 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2180 self.inner.channel().on_closed()
2181 }
2182
2183 #[cfg(target_os = "fuchsia")]
2184 fn signal_peer(
2185 &self,
2186 clear_mask: zx::Signals,
2187 set_mask: zx::Signals,
2188 ) -> Result<(), zx_status::Status> {
2189 use fidl::Peered;
2190 self.inner.channel().signal_peer(clear_mask, set_mask)
2191 }
2192}
2193
2194impl FeatureControlHandle {}
2195
2196#[must_use = "FIDL methods require a response to be sent"]
2197#[derive(Debug)]
2198pub struct FeatureUpdateFeatureConfigResponder {
2199 control_handle: std::mem::ManuallyDrop<FeatureControlHandle>,
2200 tx_id: u32,
2201}
2202
2203impl std::ops::Drop for FeatureUpdateFeatureConfigResponder {
2207 fn drop(&mut self) {
2208 self.control_handle.shutdown();
2209 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2211 }
2212}
2213
2214impl fidl::endpoints::Responder for FeatureUpdateFeatureConfigResponder {
2215 type ControlHandle = FeatureControlHandle;
2216
2217 fn control_handle(&self) -> &FeatureControlHandle {
2218 &self.control_handle
2219 }
2220
2221 fn drop_without_shutdown(mut self) {
2222 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2224 std::mem::forget(self);
2226 }
2227}
2228
2229impl FeatureUpdateFeatureConfigResponder {
2230 pub fn send(self) -> Result<(), fidl::Error> {
2234 let _result = self.send_raw();
2235 if _result.is_err() {
2236 self.control_handle.shutdown();
2237 }
2238 self.drop_without_shutdown();
2239 _result
2240 }
2241
2242 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2244 let _result = self.send_raw();
2245 self.drop_without_shutdown();
2246 _result
2247 }
2248
2249 fn send_raw(&self) -> Result<(), fidl::Error> {
2250 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2251 (),
2252 self.tx_id,
2253 0x2d24a706e8730410,
2254 fidl::encoding::DynamicFlags::empty(),
2255 )
2256 }
2257}
2258
2259#[must_use = "FIDL methods require a response to be sent"]
2260#[derive(Debug)]
2261pub struct FeatureGetFeatureConfigResponder {
2262 control_handle: std::mem::ManuallyDrop<FeatureControlHandle>,
2263 tx_id: u32,
2264}
2265
2266impl std::ops::Drop for FeatureGetFeatureConfigResponder {
2270 fn drop(&mut self) {
2271 self.control_handle.shutdown();
2272 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2274 }
2275}
2276
2277impl fidl::endpoints::Responder for FeatureGetFeatureConfigResponder {
2278 type ControlHandle = FeatureControlHandle;
2279
2280 fn control_handle(&self) -> &FeatureControlHandle {
2281 &self.control_handle
2282 }
2283
2284 fn drop_without_shutdown(mut self) {
2285 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2287 std::mem::forget(self);
2289 }
2290}
2291
2292impl FeatureGetFeatureConfigResponder {
2293 pub fn send(self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
2297 let _result = self.send_raw(config);
2298 if _result.is_err() {
2299 self.control_handle.shutdown();
2300 }
2301 self.drop_without_shutdown();
2302 _result
2303 }
2304
2305 pub fn send_no_shutdown_on_err(self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
2307 let _result = self.send_raw(config);
2308 self.drop_without_shutdown();
2309 _result
2310 }
2311
2312 fn send_raw(&self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
2313 self.control_handle.inner.send::<FeatureGetFeatureConfigResponse>(
2314 (config,),
2315 self.tx_id,
2316 0x2ab1896aea843611,
2317 fidl::encoding::DynamicFlags::empty(),
2318 )
2319 }
2320}
2321
2322#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2323pub struct FeatureConnectorMarker;
2324
2325impl fidl::endpoints::ProtocolMarker for FeatureConnectorMarker {
2326 type Proxy = FeatureConnectorProxy;
2327 type RequestStream = FeatureConnectorRequestStream;
2328 #[cfg(target_os = "fuchsia")]
2329 type SynchronousProxy = FeatureConnectorSynchronousProxy;
2330
2331 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.FeatureConnector";
2332}
2333impl fidl::endpoints::DiscoverableProtocolMarker for FeatureConnectorMarker {}
2334
2335pub trait FeatureConnectorProxyInterface: Send + Sync {
2336 fn r#connect(
2337 &self,
2338 name: &str,
2339 server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2340 ) -> Result<(), fidl::Error>;
2341}
2342#[derive(Debug)]
2343#[cfg(target_os = "fuchsia")]
2344pub struct FeatureConnectorSynchronousProxy {
2345 client: fidl::client::sync::Client,
2346}
2347
2348#[cfg(target_os = "fuchsia")]
2349impl fidl::endpoints::SynchronousProxy for FeatureConnectorSynchronousProxy {
2350 type Proxy = FeatureConnectorProxy;
2351 type Protocol = FeatureConnectorMarker;
2352
2353 fn from_channel(inner: fidl::Channel) -> Self {
2354 Self::new(inner)
2355 }
2356
2357 fn into_channel(self) -> fidl::Channel {
2358 self.client.into_channel()
2359 }
2360
2361 fn as_channel(&self) -> &fidl::Channel {
2362 self.client.as_channel()
2363 }
2364}
2365
2366#[cfg(target_os = "fuchsia")]
2367impl FeatureConnectorSynchronousProxy {
2368 pub fn new(channel: fidl::Channel) -> Self {
2369 let protocol_name = <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2370 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2371 }
2372
2373 pub fn into_channel(self) -> fidl::Channel {
2374 self.client.into_channel()
2375 }
2376
2377 pub fn wait_for_event(
2380 &self,
2381 deadline: zx::MonotonicInstant,
2382 ) -> Result<FeatureConnectorEvent, fidl::Error> {
2383 FeatureConnectorEvent::decode(self.client.wait_for_event(deadline)?)
2384 }
2385
2386 pub fn r#connect(
2403 &self,
2404 mut name: &str,
2405 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2406 ) -> Result<(), fidl::Error> {
2407 self.client.send::<FeatureConnectorConnectRequest>(
2408 (name, server_end),
2409 0x470f006d630987a5,
2410 fidl::encoding::DynamicFlags::empty(),
2411 )
2412 }
2413}
2414
2415#[cfg(target_os = "fuchsia")]
2416impl From<FeatureConnectorSynchronousProxy> for zx::Handle {
2417 fn from(value: FeatureConnectorSynchronousProxy) -> Self {
2418 value.into_channel().into()
2419 }
2420}
2421
2422#[cfg(target_os = "fuchsia")]
2423impl From<fidl::Channel> for FeatureConnectorSynchronousProxy {
2424 fn from(value: fidl::Channel) -> Self {
2425 Self::new(value)
2426 }
2427}
2428
2429#[derive(Debug, Clone)]
2430pub struct FeatureConnectorProxy {
2431 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2432}
2433
2434impl fidl::endpoints::Proxy for FeatureConnectorProxy {
2435 type Protocol = FeatureConnectorMarker;
2436
2437 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2438 Self::new(inner)
2439 }
2440
2441 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2442 self.client.into_channel().map_err(|client| Self { client })
2443 }
2444
2445 fn as_channel(&self) -> &::fidl::AsyncChannel {
2446 self.client.as_channel()
2447 }
2448}
2449
2450impl FeatureConnectorProxy {
2451 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2453 let protocol_name = <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2454 Self { client: fidl::client::Client::new(channel, protocol_name) }
2455 }
2456
2457 pub fn take_event_stream(&self) -> FeatureConnectorEventStream {
2463 FeatureConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2464 }
2465
2466 pub fn r#connect(
2483 &self,
2484 mut name: &str,
2485 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2486 ) -> Result<(), fidl::Error> {
2487 FeatureConnectorProxyInterface::r#connect(self, name, server_end)
2488 }
2489}
2490
2491impl FeatureConnectorProxyInterface for FeatureConnectorProxy {
2492 fn r#connect(
2493 &self,
2494 mut name: &str,
2495 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2496 ) -> Result<(), fidl::Error> {
2497 self.client.send::<FeatureConnectorConnectRequest>(
2498 (name, server_end),
2499 0x470f006d630987a5,
2500 fidl::encoding::DynamicFlags::empty(),
2501 )
2502 }
2503}
2504
2505pub struct FeatureConnectorEventStream {
2506 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2507}
2508
2509impl std::marker::Unpin for FeatureConnectorEventStream {}
2510
2511impl futures::stream::FusedStream for FeatureConnectorEventStream {
2512 fn is_terminated(&self) -> bool {
2513 self.event_receiver.is_terminated()
2514 }
2515}
2516
2517impl futures::Stream for FeatureConnectorEventStream {
2518 type Item = Result<FeatureConnectorEvent, fidl::Error>;
2519
2520 fn poll_next(
2521 mut self: std::pin::Pin<&mut Self>,
2522 cx: &mut std::task::Context<'_>,
2523 ) -> std::task::Poll<Option<Self::Item>> {
2524 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2525 &mut self.event_receiver,
2526 cx
2527 )?) {
2528 Some(buf) => std::task::Poll::Ready(Some(FeatureConnectorEvent::decode(buf))),
2529 None => std::task::Poll::Ready(None),
2530 }
2531 }
2532}
2533
2534#[derive(Debug)]
2535pub enum FeatureConnectorEvent {}
2536
2537impl FeatureConnectorEvent {
2538 fn decode(
2540 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2541 ) -> Result<FeatureConnectorEvent, fidl::Error> {
2542 let (bytes, _handles) = buf.split_mut();
2543 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2544 debug_assert_eq!(tx_header.tx_id, 0);
2545 match tx_header.ordinal {
2546 _ => Err(fidl::Error::UnknownOrdinal {
2547 ordinal: tx_header.ordinal,
2548 protocol_name:
2549 <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2550 }),
2551 }
2552 }
2553}
2554
2555pub struct FeatureConnectorRequestStream {
2557 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2558 is_terminated: bool,
2559}
2560
2561impl std::marker::Unpin for FeatureConnectorRequestStream {}
2562
2563impl futures::stream::FusedStream for FeatureConnectorRequestStream {
2564 fn is_terminated(&self) -> bool {
2565 self.is_terminated
2566 }
2567}
2568
2569impl fidl::endpoints::RequestStream for FeatureConnectorRequestStream {
2570 type Protocol = FeatureConnectorMarker;
2571 type ControlHandle = FeatureConnectorControlHandle;
2572
2573 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2574 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2575 }
2576
2577 fn control_handle(&self) -> Self::ControlHandle {
2578 FeatureConnectorControlHandle { inner: self.inner.clone() }
2579 }
2580
2581 fn into_inner(
2582 self,
2583 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2584 {
2585 (self.inner, self.is_terminated)
2586 }
2587
2588 fn from_inner(
2589 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2590 is_terminated: bool,
2591 ) -> Self {
2592 Self { inner, is_terminated }
2593 }
2594}
2595
2596impl futures::Stream for FeatureConnectorRequestStream {
2597 type Item = Result<FeatureConnectorRequest, fidl::Error>;
2598
2599 fn poll_next(
2600 mut self: std::pin::Pin<&mut Self>,
2601 cx: &mut std::task::Context<'_>,
2602 ) -> std::task::Poll<Option<Self::Item>> {
2603 let this = &mut *self;
2604 if this.inner.check_shutdown(cx) {
2605 this.is_terminated = true;
2606 return std::task::Poll::Ready(None);
2607 }
2608 if this.is_terminated {
2609 panic!("polled FeatureConnectorRequestStream after completion");
2610 }
2611 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2612 |bytes, handles| {
2613 match this.inner.channel().read_etc(cx, bytes, handles) {
2614 std::task::Poll::Ready(Ok(())) => {}
2615 std::task::Poll::Pending => return std::task::Poll::Pending,
2616 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2617 this.is_terminated = true;
2618 return std::task::Poll::Ready(None);
2619 }
2620 std::task::Poll::Ready(Err(e)) => {
2621 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2622 e.into(),
2623 ))))
2624 }
2625 }
2626
2627 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2629
2630 std::task::Poll::Ready(Some(match header.ordinal {
2631 0x470f006d630987a5 => {
2632 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2633 let mut req = fidl::new_empty!(
2634 FeatureConnectorConnectRequest,
2635 fidl::encoding::DefaultFuchsiaResourceDialect
2636 );
2637 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FeatureConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2638 let control_handle =
2639 FeatureConnectorControlHandle { inner: this.inner.clone() };
2640 Ok(FeatureConnectorRequest::Connect {
2641 name: req.name,
2642 server_end: req.server_end,
2643
2644 control_handle,
2645 })
2646 }
2647 _ => Err(fidl::Error::UnknownOrdinal {
2648 ordinal: header.ordinal,
2649 protocol_name:
2650 <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2651 }),
2652 }))
2653 },
2654 )
2655 }
2656}
2657
2658#[derive(Debug)]
2660pub enum FeatureConnectorRequest {
2661 Connect {
2678 name: String,
2679 server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2680 control_handle: FeatureConnectorControlHandle,
2681 },
2682}
2683
2684impl FeatureConnectorRequest {
2685 #[allow(irrefutable_let_patterns)]
2686 pub fn into_connect(
2687 self,
2688 ) -> Option<(String, fidl::endpoints::ServerEnd<FeatureMarker>, FeatureConnectorControlHandle)>
2689 {
2690 if let FeatureConnectorRequest::Connect { name, server_end, control_handle } = self {
2691 Some((name, server_end, control_handle))
2692 } else {
2693 None
2694 }
2695 }
2696
2697 pub fn method_name(&self) -> &'static str {
2699 match *self {
2700 FeatureConnectorRequest::Connect { .. } => "connect",
2701 }
2702 }
2703}
2704
2705#[derive(Debug, Clone)]
2706pub struct FeatureConnectorControlHandle {
2707 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2708}
2709
2710impl fidl::endpoints::ControlHandle for FeatureConnectorControlHandle {
2711 fn shutdown(&self) {
2712 self.inner.shutdown()
2713 }
2714 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2715 self.inner.shutdown_with_epitaph(status)
2716 }
2717
2718 fn is_closed(&self) -> bool {
2719 self.inner.channel().is_closed()
2720 }
2721 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2722 self.inner.channel().on_closed()
2723 }
2724
2725 #[cfg(target_os = "fuchsia")]
2726 fn signal_peer(
2727 &self,
2728 clear_mask: zx::Signals,
2729 set_mask: zx::Signals,
2730 ) -> Result<(), zx_status::Status> {
2731 use fidl::Peered;
2732 self.inner.channel().signal_peer(clear_mask, set_mask)
2733 }
2734}
2735
2736impl FeatureConnectorControlHandle {}
2737
2738#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2739pub struct MeshcopMarker;
2740
2741impl fidl::endpoints::ProtocolMarker for MeshcopMarker {
2742 type Proxy = MeshcopProxy;
2743 type RequestStream = MeshcopRequestStream;
2744 #[cfg(target_os = "fuchsia")]
2745 type SynchronousProxy = MeshcopSynchronousProxy;
2746
2747 const DEBUG_NAME: &'static str = "(anonymous) Meshcop";
2748}
2749
2750pub trait MeshcopProxyInterface: Send + Sync {
2751 type UpdateTxtEntriesResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2752 fn r#update_txt_entries(&self, txt_entries: &[TxtEntries])
2753 -> Self::UpdateTxtEntriesResponseFut;
2754}
2755#[derive(Debug)]
2756#[cfg(target_os = "fuchsia")]
2757pub struct MeshcopSynchronousProxy {
2758 client: fidl::client::sync::Client,
2759}
2760
2761#[cfg(target_os = "fuchsia")]
2762impl fidl::endpoints::SynchronousProxy for MeshcopSynchronousProxy {
2763 type Proxy = MeshcopProxy;
2764 type Protocol = MeshcopMarker;
2765
2766 fn from_channel(inner: fidl::Channel) -> Self {
2767 Self::new(inner)
2768 }
2769
2770 fn into_channel(self) -> fidl::Channel {
2771 self.client.into_channel()
2772 }
2773
2774 fn as_channel(&self) -> &fidl::Channel {
2775 self.client.as_channel()
2776 }
2777}
2778
2779#[cfg(target_os = "fuchsia")]
2780impl MeshcopSynchronousProxy {
2781 pub fn new(channel: fidl::Channel) -> Self {
2782 let protocol_name = <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2783 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2784 }
2785
2786 pub fn into_channel(self) -> fidl::Channel {
2787 self.client.into_channel()
2788 }
2789
2790 pub fn wait_for_event(
2793 &self,
2794 deadline: zx::MonotonicInstant,
2795 ) -> Result<MeshcopEvent, fidl::Error> {
2796 MeshcopEvent::decode(self.client.wait_for_event(deadline)?)
2797 }
2798
2799 pub fn r#update_txt_entries(
2823 &self,
2824 mut txt_entries: &[TxtEntries],
2825 ___deadline: zx::MonotonicInstant,
2826 ) -> Result<(), fidl::Error> {
2827 let _response = self
2828 .client
2829 .send_query::<MeshcopUpdateTxtEntriesRequest, fidl::encoding::EmptyPayload>(
2830 (txt_entries,),
2831 0x358d4d9593140bed,
2832 fidl::encoding::DynamicFlags::empty(),
2833 ___deadline,
2834 )?;
2835 Ok(_response)
2836 }
2837}
2838
2839#[cfg(target_os = "fuchsia")]
2840impl From<MeshcopSynchronousProxy> for zx::Handle {
2841 fn from(value: MeshcopSynchronousProxy) -> Self {
2842 value.into_channel().into()
2843 }
2844}
2845
2846#[cfg(target_os = "fuchsia")]
2847impl From<fidl::Channel> for MeshcopSynchronousProxy {
2848 fn from(value: fidl::Channel) -> Self {
2849 Self::new(value)
2850 }
2851}
2852
2853#[derive(Debug, Clone)]
2854pub struct MeshcopProxy {
2855 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2856}
2857
2858impl fidl::endpoints::Proxy for MeshcopProxy {
2859 type Protocol = MeshcopMarker;
2860
2861 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2862 Self::new(inner)
2863 }
2864
2865 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2866 self.client.into_channel().map_err(|client| Self { client })
2867 }
2868
2869 fn as_channel(&self) -> &::fidl::AsyncChannel {
2870 self.client.as_channel()
2871 }
2872}
2873
2874impl MeshcopProxy {
2875 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2877 let protocol_name = <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2878 Self { client: fidl::client::Client::new(channel, protocol_name) }
2879 }
2880
2881 pub fn take_event_stream(&self) -> MeshcopEventStream {
2887 MeshcopEventStream { event_receiver: self.client.take_event_receiver() }
2888 }
2889
2890 pub fn r#update_txt_entries(
2914 &self,
2915 mut txt_entries: &[TxtEntries],
2916 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2917 MeshcopProxyInterface::r#update_txt_entries(self, txt_entries)
2918 }
2919}
2920
2921impl MeshcopProxyInterface for MeshcopProxy {
2922 type UpdateTxtEntriesResponseFut =
2923 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2924 fn r#update_txt_entries(
2925 &self,
2926 mut txt_entries: &[TxtEntries],
2927 ) -> Self::UpdateTxtEntriesResponseFut {
2928 fn _decode(
2929 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2930 ) -> Result<(), fidl::Error> {
2931 let _response = fidl::client::decode_transaction_body::<
2932 fidl::encoding::EmptyPayload,
2933 fidl::encoding::DefaultFuchsiaResourceDialect,
2934 0x358d4d9593140bed,
2935 >(_buf?)?;
2936 Ok(_response)
2937 }
2938 self.client.send_query_and_decode::<MeshcopUpdateTxtEntriesRequest, ()>(
2939 (txt_entries,),
2940 0x358d4d9593140bed,
2941 fidl::encoding::DynamicFlags::empty(),
2942 _decode,
2943 )
2944 }
2945}
2946
2947pub struct MeshcopEventStream {
2948 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2949}
2950
2951impl std::marker::Unpin for MeshcopEventStream {}
2952
2953impl futures::stream::FusedStream for MeshcopEventStream {
2954 fn is_terminated(&self) -> bool {
2955 self.event_receiver.is_terminated()
2956 }
2957}
2958
2959impl futures::Stream for MeshcopEventStream {
2960 type Item = Result<MeshcopEvent, fidl::Error>;
2961
2962 fn poll_next(
2963 mut self: std::pin::Pin<&mut Self>,
2964 cx: &mut std::task::Context<'_>,
2965 ) -> std::task::Poll<Option<Self::Item>> {
2966 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2967 &mut self.event_receiver,
2968 cx
2969 )?) {
2970 Some(buf) => std::task::Poll::Ready(Some(MeshcopEvent::decode(buf))),
2971 None => std::task::Poll::Ready(None),
2972 }
2973 }
2974}
2975
2976#[derive(Debug)]
2977pub enum MeshcopEvent {}
2978
2979impl MeshcopEvent {
2980 fn decode(
2982 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2983 ) -> Result<MeshcopEvent, fidl::Error> {
2984 let (bytes, _handles) = buf.split_mut();
2985 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2986 debug_assert_eq!(tx_header.tx_id, 0);
2987 match tx_header.ordinal {
2988 _ => Err(fidl::Error::UnknownOrdinal {
2989 ordinal: tx_header.ordinal,
2990 protocol_name: <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2991 }),
2992 }
2993 }
2994}
2995
2996pub struct MeshcopRequestStream {
2998 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2999 is_terminated: bool,
3000}
3001
3002impl std::marker::Unpin for MeshcopRequestStream {}
3003
3004impl futures::stream::FusedStream for MeshcopRequestStream {
3005 fn is_terminated(&self) -> bool {
3006 self.is_terminated
3007 }
3008}
3009
3010impl fidl::endpoints::RequestStream for MeshcopRequestStream {
3011 type Protocol = MeshcopMarker;
3012 type ControlHandle = MeshcopControlHandle;
3013
3014 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3015 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3016 }
3017
3018 fn control_handle(&self) -> Self::ControlHandle {
3019 MeshcopControlHandle { inner: self.inner.clone() }
3020 }
3021
3022 fn into_inner(
3023 self,
3024 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3025 {
3026 (self.inner, self.is_terminated)
3027 }
3028
3029 fn from_inner(
3030 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3031 is_terminated: bool,
3032 ) -> Self {
3033 Self { inner, is_terminated }
3034 }
3035}
3036
3037impl futures::Stream for MeshcopRequestStream {
3038 type Item = Result<MeshcopRequest, fidl::Error>;
3039
3040 fn poll_next(
3041 mut self: std::pin::Pin<&mut Self>,
3042 cx: &mut std::task::Context<'_>,
3043 ) -> std::task::Poll<Option<Self::Item>> {
3044 let this = &mut *self;
3045 if this.inner.check_shutdown(cx) {
3046 this.is_terminated = true;
3047 return std::task::Poll::Ready(None);
3048 }
3049 if this.is_terminated {
3050 panic!("polled MeshcopRequestStream after completion");
3051 }
3052 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3053 |bytes, handles| {
3054 match this.inner.channel().read_etc(cx, bytes, handles) {
3055 std::task::Poll::Ready(Ok(())) => {}
3056 std::task::Poll::Pending => return std::task::Poll::Pending,
3057 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3058 this.is_terminated = true;
3059 return std::task::Poll::Ready(None);
3060 }
3061 std::task::Poll::Ready(Err(e)) => {
3062 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3063 e.into(),
3064 ))))
3065 }
3066 }
3067
3068 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3070
3071 std::task::Poll::Ready(Some(match header.ordinal {
3072 0x358d4d9593140bed => {
3073 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3074 let mut req = fidl::new_empty!(
3075 MeshcopUpdateTxtEntriesRequest,
3076 fidl::encoding::DefaultFuchsiaResourceDialect
3077 );
3078 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MeshcopUpdateTxtEntriesRequest>(&header, _body_bytes, handles, &mut req)?;
3079 let control_handle = MeshcopControlHandle { inner: this.inner.clone() };
3080 Ok(MeshcopRequest::UpdateTxtEntries {
3081 txt_entries: req.txt_entries,
3082
3083 responder: MeshcopUpdateTxtEntriesResponder {
3084 control_handle: std::mem::ManuallyDrop::new(control_handle),
3085 tx_id: header.tx_id,
3086 },
3087 })
3088 }
3089 _ => Err(fidl::Error::UnknownOrdinal {
3090 ordinal: header.ordinal,
3091 protocol_name:
3092 <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3093 }),
3094 }))
3095 },
3096 )
3097 }
3098}
3099
3100#[derive(Debug)]
3102pub enum MeshcopRequest {
3103 UpdateTxtEntries { txt_entries: Vec<TxtEntries>, responder: MeshcopUpdateTxtEntriesResponder },
3127}
3128
3129impl MeshcopRequest {
3130 #[allow(irrefutable_let_patterns)]
3131 pub fn into_update_txt_entries(
3132 self,
3133 ) -> Option<(Vec<TxtEntries>, MeshcopUpdateTxtEntriesResponder)> {
3134 if let MeshcopRequest::UpdateTxtEntries { txt_entries, responder } = self {
3135 Some((txt_entries, responder))
3136 } else {
3137 None
3138 }
3139 }
3140
3141 pub fn method_name(&self) -> &'static str {
3143 match *self {
3144 MeshcopRequest::UpdateTxtEntries { .. } => "update_txt_entries",
3145 }
3146 }
3147}
3148
3149#[derive(Debug, Clone)]
3150pub struct MeshcopControlHandle {
3151 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3152}
3153
3154impl fidl::endpoints::ControlHandle for MeshcopControlHandle {
3155 fn shutdown(&self) {
3156 self.inner.shutdown()
3157 }
3158 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3159 self.inner.shutdown_with_epitaph(status)
3160 }
3161
3162 fn is_closed(&self) -> bool {
3163 self.inner.channel().is_closed()
3164 }
3165 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3166 self.inner.channel().on_closed()
3167 }
3168
3169 #[cfg(target_os = "fuchsia")]
3170 fn signal_peer(
3171 &self,
3172 clear_mask: zx::Signals,
3173 set_mask: zx::Signals,
3174 ) -> Result<(), zx_status::Status> {
3175 use fidl::Peered;
3176 self.inner.channel().signal_peer(clear_mask, set_mask)
3177 }
3178}
3179
3180impl MeshcopControlHandle {}
3181
3182#[must_use = "FIDL methods require a response to be sent"]
3183#[derive(Debug)]
3184pub struct MeshcopUpdateTxtEntriesResponder {
3185 control_handle: std::mem::ManuallyDrop<MeshcopControlHandle>,
3186 tx_id: u32,
3187}
3188
3189impl std::ops::Drop for MeshcopUpdateTxtEntriesResponder {
3193 fn drop(&mut self) {
3194 self.control_handle.shutdown();
3195 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3197 }
3198}
3199
3200impl fidl::endpoints::Responder for MeshcopUpdateTxtEntriesResponder {
3201 type ControlHandle = MeshcopControlHandle;
3202
3203 fn control_handle(&self) -> &MeshcopControlHandle {
3204 &self.control_handle
3205 }
3206
3207 fn drop_without_shutdown(mut self) {
3208 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3210 std::mem::forget(self);
3212 }
3213}
3214
3215impl MeshcopUpdateTxtEntriesResponder {
3216 pub fn send(self) -> Result<(), fidl::Error> {
3220 let _result = self.send_raw();
3221 if _result.is_err() {
3222 self.control_handle.shutdown();
3223 }
3224 self.drop_without_shutdown();
3225 _result
3226 }
3227
3228 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3230 let _result = self.send_raw();
3231 self.drop_without_shutdown();
3232 _result
3233 }
3234
3235 fn send_raw(&self) -> Result<(), fidl::Error> {
3236 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3237 (),
3238 self.tx_id,
3239 0x358d4d9593140bed,
3240 fidl::encoding::DynamicFlags::empty(),
3241 )
3242 }
3243}
3244
3245#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3246pub struct MeshcopConnectorMarker;
3247
3248impl fidl::endpoints::ProtocolMarker for MeshcopConnectorMarker {
3249 type Proxy = MeshcopConnectorProxy;
3250 type RequestStream = MeshcopConnectorRequestStream;
3251 #[cfg(target_os = "fuchsia")]
3252 type SynchronousProxy = MeshcopConnectorSynchronousProxy;
3253
3254 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.MeshcopConnector";
3255}
3256impl fidl::endpoints::DiscoverableProtocolMarker for MeshcopConnectorMarker {}
3257
3258pub trait MeshcopConnectorProxyInterface: Send + Sync {
3259 fn r#connect(
3260 &self,
3261 name: &str,
3262 server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3263 ) -> Result<(), fidl::Error>;
3264}
3265#[derive(Debug)]
3266#[cfg(target_os = "fuchsia")]
3267pub struct MeshcopConnectorSynchronousProxy {
3268 client: fidl::client::sync::Client,
3269}
3270
3271#[cfg(target_os = "fuchsia")]
3272impl fidl::endpoints::SynchronousProxy for MeshcopConnectorSynchronousProxy {
3273 type Proxy = MeshcopConnectorProxy;
3274 type Protocol = MeshcopConnectorMarker;
3275
3276 fn from_channel(inner: fidl::Channel) -> Self {
3277 Self::new(inner)
3278 }
3279
3280 fn into_channel(self) -> fidl::Channel {
3281 self.client.into_channel()
3282 }
3283
3284 fn as_channel(&self) -> &fidl::Channel {
3285 self.client.as_channel()
3286 }
3287}
3288
3289#[cfg(target_os = "fuchsia")]
3290impl MeshcopConnectorSynchronousProxy {
3291 pub fn new(channel: fidl::Channel) -> Self {
3292 let protocol_name = <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3293 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3294 }
3295
3296 pub fn into_channel(self) -> fidl::Channel {
3297 self.client.into_channel()
3298 }
3299
3300 pub fn wait_for_event(
3303 &self,
3304 deadline: zx::MonotonicInstant,
3305 ) -> Result<MeshcopConnectorEvent, fidl::Error> {
3306 MeshcopConnectorEvent::decode(self.client.wait_for_event(deadline)?)
3307 }
3308
3309 pub fn r#connect(
3326 &self,
3327 mut name: &str,
3328 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3329 ) -> Result<(), fidl::Error> {
3330 self.client.send::<MeshcopConnectorConnectRequest>(
3331 (name, server_end),
3332 0x53f87536b40ad6fb,
3333 fidl::encoding::DynamicFlags::empty(),
3334 )
3335 }
3336}
3337
3338#[cfg(target_os = "fuchsia")]
3339impl From<MeshcopConnectorSynchronousProxy> for zx::Handle {
3340 fn from(value: MeshcopConnectorSynchronousProxy) -> Self {
3341 value.into_channel().into()
3342 }
3343}
3344
3345#[cfg(target_os = "fuchsia")]
3346impl From<fidl::Channel> for MeshcopConnectorSynchronousProxy {
3347 fn from(value: fidl::Channel) -> Self {
3348 Self::new(value)
3349 }
3350}
3351
3352#[derive(Debug, Clone)]
3353pub struct MeshcopConnectorProxy {
3354 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3355}
3356
3357impl fidl::endpoints::Proxy for MeshcopConnectorProxy {
3358 type Protocol = MeshcopConnectorMarker;
3359
3360 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3361 Self::new(inner)
3362 }
3363
3364 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3365 self.client.into_channel().map_err(|client| Self { client })
3366 }
3367
3368 fn as_channel(&self) -> &::fidl::AsyncChannel {
3369 self.client.as_channel()
3370 }
3371}
3372
3373impl MeshcopConnectorProxy {
3374 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3376 let protocol_name = <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3377 Self { client: fidl::client::Client::new(channel, protocol_name) }
3378 }
3379
3380 pub fn take_event_stream(&self) -> MeshcopConnectorEventStream {
3386 MeshcopConnectorEventStream { event_receiver: self.client.take_event_receiver() }
3387 }
3388
3389 pub fn r#connect(
3406 &self,
3407 mut name: &str,
3408 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3409 ) -> Result<(), fidl::Error> {
3410 MeshcopConnectorProxyInterface::r#connect(self, name, server_end)
3411 }
3412}
3413
3414impl MeshcopConnectorProxyInterface for MeshcopConnectorProxy {
3415 fn r#connect(
3416 &self,
3417 mut name: &str,
3418 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3419 ) -> Result<(), fidl::Error> {
3420 self.client.send::<MeshcopConnectorConnectRequest>(
3421 (name, server_end),
3422 0x53f87536b40ad6fb,
3423 fidl::encoding::DynamicFlags::empty(),
3424 )
3425 }
3426}
3427
3428pub struct MeshcopConnectorEventStream {
3429 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3430}
3431
3432impl std::marker::Unpin for MeshcopConnectorEventStream {}
3433
3434impl futures::stream::FusedStream for MeshcopConnectorEventStream {
3435 fn is_terminated(&self) -> bool {
3436 self.event_receiver.is_terminated()
3437 }
3438}
3439
3440impl futures::Stream for MeshcopConnectorEventStream {
3441 type Item = Result<MeshcopConnectorEvent, fidl::Error>;
3442
3443 fn poll_next(
3444 mut self: std::pin::Pin<&mut Self>,
3445 cx: &mut std::task::Context<'_>,
3446 ) -> std::task::Poll<Option<Self::Item>> {
3447 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3448 &mut self.event_receiver,
3449 cx
3450 )?) {
3451 Some(buf) => std::task::Poll::Ready(Some(MeshcopConnectorEvent::decode(buf))),
3452 None => std::task::Poll::Ready(None),
3453 }
3454 }
3455}
3456
3457#[derive(Debug)]
3458pub enum MeshcopConnectorEvent {}
3459
3460impl MeshcopConnectorEvent {
3461 fn decode(
3463 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3464 ) -> Result<MeshcopConnectorEvent, fidl::Error> {
3465 let (bytes, _handles) = buf.split_mut();
3466 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3467 debug_assert_eq!(tx_header.tx_id, 0);
3468 match tx_header.ordinal {
3469 _ => Err(fidl::Error::UnknownOrdinal {
3470 ordinal: tx_header.ordinal,
3471 protocol_name:
3472 <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3473 }),
3474 }
3475 }
3476}
3477
3478pub struct MeshcopConnectorRequestStream {
3480 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3481 is_terminated: bool,
3482}
3483
3484impl std::marker::Unpin for MeshcopConnectorRequestStream {}
3485
3486impl futures::stream::FusedStream for MeshcopConnectorRequestStream {
3487 fn is_terminated(&self) -> bool {
3488 self.is_terminated
3489 }
3490}
3491
3492impl fidl::endpoints::RequestStream for MeshcopConnectorRequestStream {
3493 type Protocol = MeshcopConnectorMarker;
3494 type ControlHandle = MeshcopConnectorControlHandle;
3495
3496 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3497 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3498 }
3499
3500 fn control_handle(&self) -> Self::ControlHandle {
3501 MeshcopConnectorControlHandle { inner: self.inner.clone() }
3502 }
3503
3504 fn into_inner(
3505 self,
3506 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3507 {
3508 (self.inner, self.is_terminated)
3509 }
3510
3511 fn from_inner(
3512 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3513 is_terminated: bool,
3514 ) -> Self {
3515 Self { inner, is_terminated }
3516 }
3517}
3518
3519impl futures::Stream for MeshcopConnectorRequestStream {
3520 type Item = Result<MeshcopConnectorRequest, fidl::Error>;
3521
3522 fn poll_next(
3523 mut self: std::pin::Pin<&mut Self>,
3524 cx: &mut std::task::Context<'_>,
3525 ) -> std::task::Poll<Option<Self::Item>> {
3526 let this = &mut *self;
3527 if this.inner.check_shutdown(cx) {
3528 this.is_terminated = true;
3529 return std::task::Poll::Ready(None);
3530 }
3531 if this.is_terminated {
3532 panic!("polled MeshcopConnectorRequestStream after completion");
3533 }
3534 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3535 |bytes, handles| {
3536 match this.inner.channel().read_etc(cx, bytes, handles) {
3537 std::task::Poll::Ready(Ok(())) => {}
3538 std::task::Poll::Pending => return std::task::Poll::Pending,
3539 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3540 this.is_terminated = true;
3541 return std::task::Poll::Ready(None);
3542 }
3543 std::task::Poll::Ready(Err(e)) => {
3544 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3545 e.into(),
3546 ))))
3547 }
3548 }
3549
3550 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3552
3553 std::task::Poll::Ready(Some(match header.ordinal {
3554 0x53f87536b40ad6fb => {
3555 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3556 let mut req = fidl::new_empty!(
3557 MeshcopConnectorConnectRequest,
3558 fidl::encoding::DefaultFuchsiaResourceDialect
3559 );
3560 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MeshcopConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
3561 let control_handle =
3562 MeshcopConnectorControlHandle { inner: this.inner.clone() };
3563 Ok(MeshcopConnectorRequest::Connect {
3564 name: req.name,
3565 server_end: req.server_end,
3566
3567 control_handle,
3568 })
3569 }
3570 _ => Err(fidl::Error::UnknownOrdinal {
3571 ordinal: header.ordinal,
3572 protocol_name:
3573 <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3574 }),
3575 }))
3576 },
3577 )
3578 }
3579}
3580
3581#[derive(Debug)]
3583pub enum MeshcopConnectorRequest {
3584 Connect {
3601 name: String,
3602 server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3603 control_handle: MeshcopConnectorControlHandle,
3604 },
3605}
3606
3607impl MeshcopConnectorRequest {
3608 #[allow(irrefutable_let_patterns)]
3609 pub fn into_connect(
3610 self,
3611 ) -> Option<(String, fidl::endpoints::ServerEnd<MeshcopMarker>, MeshcopConnectorControlHandle)>
3612 {
3613 if let MeshcopConnectorRequest::Connect { name, server_end, control_handle } = self {
3614 Some((name, server_end, control_handle))
3615 } else {
3616 None
3617 }
3618 }
3619
3620 pub fn method_name(&self) -> &'static str {
3622 match *self {
3623 MeshcopConnectorRequest::Connect { .. } => "connect",
3624 }
3625 }
3626}
3627
3628#[derive(Debug, Clone)]
3629pub struct MeshcopConnectorControlHandle {
3630 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3631}
3632
3633impl fidl::endpoints::ControlHandle for MeshcopConnectorControlHandle {
3634 fn shutdown(&self) {
3635 self.inner.shutdown()
3636 }
3637 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3638 self.inner.shutdown_with_epitaph(status)
3639 }
3640
3641 fn is_closed(&self) -> bool {
3642 self.inner.channel().is_closed()
3643 }
3644 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3645 self.inner.channel().on_closed()
3646 }
3647
3648 #[cfg(target_os = "fuchsia")]
3649 fn signal_peer(
3650 &self,
3651 clear_mask: zx::Signals,
3652 set_mask: zx::Signals,
3653 ) -> Result<(), zx_status::Status> {
3654 use fidl::Peered;
3655 self.inner.channel().signal_peer(clear_mask, set_mask)
3656 }
3657}
3658
3659impl MeshcopConnectorControlHandle {}
3660
3661#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3662pub struct ThreadCapabilitiesMarker;
3663
3664impl fidl::endpoints::ProtocolMarker for ThreadCapabilitiesMarker {
3665 type Proxy = ThreadCapabilitiesProxy;
3666 type RequestStream = ThreadCapabilitiesRequestStream;
3667 #[cfg(target_os = "fuchsia")]
3668 type SynchronousProxy = ThreadCapabilitiesSynchronousProxy;
3669
3670 const DEBUG_NAME: &'static str = "(anonymous) ThreadCapabilities";
3671}
3672
3673pub trait ThreadCapabilitiesProxyInterface: Send + Sync {
3674 type GetCapabilitiesResponseFut: std::future::Future<Output = Result<Capabilities, fidl::Error>>
3675 + Send;
3676 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
3677}
3678#[derive(Debug)]
3679#[cfg(target_os = "fuchsia")]
3680pub struct ThreadCapabilitiesSynchronousProxy {
3681 client: fidl::client::sync::Client,
3682}
3683
3684#[cfg(target_os = "fuchsia")]
3685impl fidl::endpoints::SynchronousProxy for ThreadCapabilitiesSynchronousProxy {
3686 type Proxy = ThreadCapabilitiesProxy;
3687 type Protocol = ThreadCapabilitiesMarker;
3688
3689 fn from_channel(inner: fidl::Channel) -> Self {
3690 Self::new(inner)
3691 }
3692
3693 fn into_channel(self) -> fidl::Channel {
3694 self.client.into_channel()
3695 }
3696
3697 fn as_channel(&self) -> &fidl::Channel {
3698 self.client.as_channel()
3699 }
3700}
3701
3702#[cfg(target_os = "fuchsia")]
3703impl ThreadCapabilitiesSynchronousProxy {
3704 pub fn new(channel: fidl::Channel) -> Self {
3705 let protocol_name =
3706 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3707 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3708 }
3709
3710 pub fn into_channel(self) -> fidl::Channel {
3711 self.client.into_channel()
3712 }
3713
3714 pub fn wait_for_event(
3717 &self,
3718 deadline: zx::MonotonicInstant,
3719 ) -> Result<ThreadCapabilitiesEvent, fidl::Error> {
3720 ThreadCapabilitiesEvent::decode(self.client.wait_for_event(deadline)?)
3721 }
3722
3723 pub fn r#get_capabilities(
3728 &self,
3729 ___deadline: zx::MonotonicInstant,
3730 ) -> Result<Capabilities, fidl::Error> {
3731 let _response = self
3732 .client
3733 .send_query::<fidl::encoding::EmptyPayload, ThreadCapabilitiesGetCapabilitiesResponse>(
3734 (),
3735 0x5a0823ac35f2d425,
3736 fidl::encoding::DynamicFlags::empty(),
3737 ___deadline,
3738 )?;
3739 Ok(_response.capabilities)
3740 }
3741}
3742
3743#[cfg(target_os = "fuchsia")]
3744impl From<ThreadCapabilitiesSynchronousProxy> for zx::Handle {
3745 fn from(value: ThreadCapabilitiesSynchronousProxy) -> Self {
3746 value.into_channel().into()
3747 }
3748}
3749
3750#[cfg(target_os = "fuchsia")]
3751impl From<fidl::Channel> for ThreadCapabilitiesSynchronousProxy {
3752 fn from(value: fidl::Channel) -> Self {
3753 Self::new(value)
3754 }
3755}
3756
3757#[derive(Debug, Clone)]
3758pub struct ThreadCapabilitiesProxy {
3759 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3760}
3761
3762impl fidl::endpoints::Proxy for ThreadCapabilitiesProxy {
3763 type Protocol = ThreadCapabilitiesMarker;
3764
3765 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3766 Self::new(inner)
3767 }
3768
3769 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3770 self.client.into_channel().map_err(|client| Self { client })
3771 }
3772
3773 fn as_channel(&self) -> &::fidl::AsyncChannel {
3774 self.client.as_channel()
3775 }
3776}
3777
3778impl ThreadCapabilitiesProxy {
3779 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3781 let protocol_name =
3782 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3783 Self { client: fidl::client::Client::new(channel, protocol_name) }
3784 }
3785
3786 pub fn take_event_stream(&self) -> ThreadCapabilitiesEventStream {
3792 ThreadCapabilitiesEventStream { event_receiver: self.client.take_event_receiver() }
3793 }
3794
3795 pub fn r#get_capabilities(
3800 &self,
3801 ) -> fidl::client::QueryResponseFut<Capabilities, fidl::encoding::DefaultFuchsiaResourceDialect>
3802 {
3803 ThreadCapabilitiesProxyInterface::r#get_capabilities(self)
3804 }
3805}
3806
3807impl ThreadCapabilitiesProxyInterface for ThreadCapabilitiesProxy {
3808 type GetCapabilitiesResponseFut =
3809 fidl::client::QueryResponseFut<Capabilities, fidl::encoding::DefaultFuchsiaResourceDialect>;
3810 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
3811 fn _decode(
3812 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3813 ) -> Result<Capabilities, fidl::Error> {
3814 let _response = fidl::client::decode_transaction_body::<
3815 ThreadCapabilitiesGetCapabilitiesResponse,
3816 fidl::encoding::DefaultFuchsiaResourceDialect,
3817 0x5a0823ac35f2d425,
3818 >(_buf?)?;
3819 Ok(_response.capabilities)
3820 }
3821 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Capabilities>(
3822 (),
3823 0x5a0823ac35f2d425,
3824 fidl::encoding::DynamicFlags::empty(),
3825 _decode,
3826 )
3827 }
3828}
3829
3830pub struct ThreadCapabilitiesEventStream {
3831 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3832}
3833
3834impl std::marker::Unpin for ThreadCapabilitiesEventStream {}
3835
3836impl futures::stream::FusedStream for ThreadCapabilitiesEventStream {
3837 fn is_terminated(&self) -> bool {
3838 self.event_receiver.is_terminated()
3839 }
3840}
3841
3842impl futures::Stream for ThreadCapabilitiesEventStream {
3843 type Item = Result<ThreadCapabilitiesEvent, fidl::Error>;
3844
3845 fn poll_next(
3846 mut self: std::pin::Pin<&mut Self>,
3847 cx: &mut std::task::Context<'_>,
3848 ) -> std::task::Poll<Option<Self::Item>> {
3849 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3850 &mut self.event_receiver,
3851 cx
3852 )?) {
3853 Some(buf) => std::task::Poll::Ready(Some(ThreadCapabilitiesEvent::decode(buf))),
3854 None => std::task::Poll::Ready(None),
3855 }
3856 }
3857}
3858
3859#[derive(Debug)]
3860pub enum ThreadCapabilitiesEvent {}
3861
3862impl ThreadCapabilitiesEvent {
3863 fn decode(
3865 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3866 ) -> Result<ThreadCapabilitiesEvent, fidl::Error> {
3867 let (bytes, _handles) = buf.split_mut();
3868 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3869 debug_assert_eq!(tx_header.tx_id, 0);
3870 match tx_header.ordinal {
3871 _ => Err(fidl::Error::UnknownOrdinal {
3872 ordinal: tx_header.ordinal,
3873 protocol_name:
3874 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3875 }),
3876 }
3877 }
3878}
3879
3880pub struct ThreadCapabilitiesRequestStream {
3882 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3883 is_terminated: bool,
3884}
3885
3886impl std::marker::Unpin for ThreadCapabilitiesRequestStream {}
3887
3888impl futures::stream::FusedStream for ThreadCapabilitiesRequestStream {
3889 fn is_terminated(&self) -> bool {
3890 self.is_terminated
3891 }
3892}
3893
3894impl fidl::endpoints::RequestStream for ThreadCapabilitiesRequestStream {
3895 type Protocol = ThreadCapabilitiesMarker;
3896 type ControlHandle = ThreadCapabilitiesControlHandle;
3897
3898 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3899 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3900 }
3901
3902 fn control_handle(&self) -> Self::ControlHandle {
3903 ThreadCapabilitiesControlHandle { inner: self.inner.clone() }
3904 }
3905
3906 fn into_inner(
3907 self,
3908 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3909 {
3910 (self.inner, self.is_terminated)
3911 }
3912
3913 fn from_inner(
3914 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3915 is_terminated: bool,
3916 ) -> Self {
3917 Self { inner, is_terminated }
3918 }
3919}
3920
3921impl futures::Stream for ThreadCapabilitiesRequestStream {
3922 type Item = Result<ThreadCapabilitiesRequest, fidl::Error>;
3923
3924 fn poll_next(
3925 mut self: std::pin::Pin<&mut Self>,
3926 cx: &mut std::task::Context<'_>,
3927 ) -> std::task::Poll<Option<Self::Item>> {
3928 let this = &mut *self;
3929 if this.inner.check_shutdown(cx) {
3930 this.is_terminated = true;
3931 return std::task::Poll::Ready(None);
3932 }
3933 if this.is_terminated {
3934 panic!("polled ThreadCapabilitiesRequestStream after completion");
3935 }
3936 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3937 |bytes, handles| {
3938 match this.inner.channel().read_etc(cx, bytes, handles) {
3939 std::task::Poll::Ready(Ok(())) => {}
3940 std::task::Poll::Pending => return std::task::Poll::Pending,
3941 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3942 this.is_terminated = true;
3943 return std::task::Poll::Ready(None);
3944 }
3945 std::task::Poll::Ready(Err(e)) => {
3946 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3947 e.into(),
3948 ))))
3949 }
3950 }
3951
3952 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3954
3955 std::task::Poll::Ready(Some(match header.ordinal {
3956 0x5a0823ac35f2d425 => {
3957 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3958 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3959 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3960 let control_handle = ThreadCapabilitiesControlHandle {
3961 inner: this.inner.clone(),
3962 };
3963 Ok(ThreadCapabilitiesRequest::GetCapabilities {
3964 responder: ThreadCapabilitiesGetCapabilitiesResponder {
3965 control_handle: std::mem::ManuallyDrop::new(control_handle),
3966 tx_id: header.tx_id,
3967 },
3968 })
3969 }
3970 _ => Err(fidl::Error::UnknownOrdinal {
3971 ordinal: header.ordinal,
3972 protocol_name: <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3973 }),
3974 }))
3975 },
3976 )
3977 }
3978}
3979
3980#[derive(Debug)]
3982pub enum ThreadCapabilitiesRequest {
3983 GetCapabilities { responder: ThreadCapabilitiesGetCapabilitiesResponder },
3988}
3989
3990impl ThreadCapabilitiesRequest {
3991 #[allow(irrefutable_let_patterns)]
3992 pub fn into_get_capabilities(self) -> Option<(ThreadCapabilitiesGetCapabilitiesResponder)> {
3993 if let ThreadCapabilitiesRequest::GetCapabilities { responder } = self {
3994 Some((responder))
3995 } else {
3996 None
3997 }
3998 }
3999
4000 pub fn method_name(&self) -> &'static str {
4002 match *self {
4003 ThreadCapabilitiesRequest::GetCapabilities { .. } => "get_capabilities",
4004 }
4005 }
4006}
4007
4008#[derive(Debug, Clone)]
4009pub struct ThreadCapabilitiesControlHandle {
4010 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4011}
4012
4013impl fidl::endpoints::ControlHandle for ThreadCapabilitiesControlHandle {
4014 fn shutdown(&self) {
4015 self.inner.shutdown()
4016 }
4017 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4018 self.inner.shutdown_with_epitaph(status)
4019 }
4020
4021 fn is_closed(&self) -> bool {
4022 self.inner.channel().is_closed()
4023 }
4024 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4025 self.inner.channel().on_closed()
4026 }
4027
4028 #[cfg(target_os = "fuchsia")]
4029 fn signal_peer(
4030 &self,
4031 clear_mask: zx::Signals,
4032 set_mask: zx::Signals,
4033 ) -> Result<(), zx_status::Status> {
4034 use fidl::Peered;
4035 self.inner.channel().signal_peer(clear_mask, set_mask)
4036 }
4037}
4038
4039impl ThreadCapabilitiesControlHandle {}
4040
4041#[must_use = "FIDL methods require a response to be sent"]
4042#[derive(Debug)]
4043pub struct ThreadCapabilitiesGetCapabilitiesResponder {
4044 control_handle: std::mem::ManuallyDrop<ThreadCapabilitiesControlHandle>,
4045 tx_id: u32,
4046}
4047
4048impl std::ops::Drop for ThreadCapabilitiesGetCapabilitiesResponder {
4052 fn drop(&mut self) {
4053 self.control_handle.shutdown();
4054 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4056 }
4057}
4058
4059impl fidl::endpoints::Responder for ThreadCapabilitiesGetCapabilitiesResponder {
4060 type ControlHandle = ThreadCapabilitiesControlHandle;
4061
4062 fn control_handle(&self) -> &ThreadCapabilitiesControlHandle {
4063 &self.control_handle
4064 }
4065
4066 fn drop_without_shutdown(mut self) {
4067 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4069 std::mem::forget(self);
4071 }
4072}
4073
4074impl ThreadCapabilitiesGetCapabilitiesResponder {
4075 pub fn send(self, mut capabilities: &Capabilities) -> Result<(), fidl::Error> {
4079 let _result = self.send_raw(capabilities);
4080 if _result.is_err() {
4081 self.control_handle.shutdown();
4082 }
4083 self.drop_without_shutdown();
4084 _result
4085 }
4086
4087 pub fn send_no_shutdown_on_err(
4089 self,
4090 mut capabilities: &Capabilities,
4091 ) -> Result<(), fidl::Error> {
4092 let _result = self.send_raw(capabilities);
4093 self.drop_without_shutdown();
4094 _result
4095 }
4096
4097 fn send_raw(&self, mut capabilities: &Capabilities) -> Result<(), fidl::Error> {
4098 self.control_handle.inner.send::<ThreadCapabilitiesGetCapabilitiesResponse>(
4099 (capabilities,),
4100 self.tx_id,
4101 0x5a0823ac35f2d425,
4102 fidl::encoding::DynamicFlags::empty(),
4103 )
4104 }
4105}
4106
4107mod internal {
4108 use super::*;
4109
4110 impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorConnectRequest {
4111 type Borrowed<'a> = &'a mut Self;
4112 fn take_or_borrow<'a>(
4113 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4114 ) -> Self::Borrowed<'a> {
4115 value
4116 }
4117 }
4118
4119 unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorConnectRequest {
4120 type Owned = Self;
4121
4122 #[inline(always)]
4123 fn inline_align(_context: fidl::encoding::Context) -> usize {
4124 8
4125 }
4126
4127 #[inline(always)]
4128 fn inline_size(_context: fidl::encoding::Context) -> usize {
4129 24
4130 }
4131 }
4132
4133 unsafe impl
4134 fidl::encoding::Encode<
4135 CapabilitiesConnectorConnectRequest,
4136 fidl::encoding::DefaultFuchsiaResourceDialect,
4137 > for &mut CapabilitiesConnectorConnectRequest
4138 {
4139 #[inline]
4140 unsafe fn encode(
4141 self,
4142 encoder: &mut fidl::encoding::Encoder<
4143 '_,
4144 fidl::encoding::DefaultFuchsiaResourceDialect,
4145 >,
4146 offset: usize,
4147 _depth: fidl::encoding::Depth,
4148 ) -> fidl::Result<()> {
4149 encoder.debug_check_bounds::<CapabilitiesConnectorConnectRequest>(offset);
4150 fidl::encoding::Encode::<CapabilitiesConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4152 (
4153 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4154 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4155 ),
4156 encoder, offset, _depth
4157 )
4158 }
4159 }
4160 unsafe impl<
4161 T0: fidl::encoding::Encode<
4162 fidl::encoding::BoundedString<32>,
4163 fidl::encoding::DefaultFuchsiaResourceDialect,
4164 >,
4165 T1: fidl::encoding::Encode<
4166 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
4167 fidl::encoding::DefaultFuchsiaResourceDialect,
4168 >,
4169 >
4170 fidl::encoding::Encode<
4171 CapabilitiesConnectorConnectRequest,
4172 fidl::encoding::DefaultFuchsiaResourceDialect,
4173 > for (T0, T1)
4174 {
4175 #[inline]
4176 unsafe fn encode(
4177 self,
4178 encoder: &mut fidl::encoding::Encoder<
4179 '_,
4180 fidl::encoding::DefaultFuchsiaResourceDialect,
4181 >,
4182 offset: usize,
4183 depth: fidl::encoding::Depth,
4184 ) -> fidl::Result<()> {
4185 encoder.debug_check_bounds::<CapabilitiesConnectorConnectRequest>(offset);
4186 unsafe {
4189 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4190 (ptr as *mut u64).write_unaligned(0);
4191 }
4192 self.0.encode(encoder, offset + 0, depth)?;
4194 self.1.encode(encoder, offset + 16, depth)?;
4195 Ok(())
4196 }
4197 }
4198
4199 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4200 for CapabilitiesConnectorConnectRequest
4201 {
4202 #[inline(always)]
4203 fn new_empty() -> Self {
4204 Self {
4205 name: fidl::new_empty!(
4206 fidl::encoding::BoundedString<32>,
4207 fidl::encoding::DefaultFuchsiaResourceDialect
4208 ),
4209 server_end: fidl::new_empty!(
4210 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
4211 fidl::encoding::DefaultFuchsiaResourceDialect
4212 ),
4213 }
4214 }
4215
4216 #[inline]
4217 unsafe fn decode(
4218 &mut self,
4219 decoder: &mut fidl::encoding::Decoder<
4220 '_,
4221 fidl::encoding::DefaultFuchsiaResourceDialect,
4222 >,
4223 offset: usize,
4224 _depth: fidl::encoding::Depth,
4225 ) -> fidl::Result<()> {
4226 decoder.debug_check_bounds::<Self>(offset);
4227 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4229 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4230 let mask = 0xffffffff00000000u64;
4231 let maskedval = padval & mask;
4232 if maskedval != 0 {
4233 return Err(fidl::Error::NonZeroPadding {
4234 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4235 });
4236 }
4237 fidl::decode!(
4238 fidl::encoding::BoundedString<32>,
4239 fidl::encoding::DefaultFuchsiaResourceDialect,
4240 &mut self.name,
4241 decoder,
4242 offset + 0,
4243 _depth
4244 )?;
4245 fidl::decode!(
4246 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
4247 fidl::encoding::DefaultFuchsiaResourceDialect,
4248 &mut self.server_end,
4249 decoder,
4250 offset + 16,
4251 _depth
4252 )?;
4253 Ok(())
4254 }
4255 }
4256
4257 impl fidl::encoding::ResourceTypeMarker for DatasetConnectorConnectRequest {
4258 type Borrowed<'a> = &'a mut Self;
4259 fn take_or_borrow<'a>(
4260 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4261 ) -> Self::Borrowed<'a> {
4262 value
4263 }
4264 }
4265
4266 unsafe impl fidl::encoding::TypeMarker for DatasetConnectorConnectRequest {
4267 type Owned = Self;
4268
4269 #[inline(always)]
4270 fn inline_align(_context: fidl::encoding::Context) -> usize {
4271 8
4272 }
4273
4274 #[inline(always)]
4275 fn inline_size(_context: fidl::encoding::Context) -> usize {
4276 24
4277 }
4278 }
4279
4280 unsafe impl
4281 fidl::encoding::Encode<
4282 DatasetConnectorConnectRequest,
4283 fidl::encoding::DefaultFuchsiaResourceDialect,
4284 > for &mut DatasetConnectorConnectRequest
4285 {
4286 #[inline]
4287 unsafe fn encode(
4288 self,
4289 encoder: &mut fidl::encoding::Encoder<
4290 '_,
4291 fidl::encoding::DefaultFuchsiaResourceDialect,
4292 >,
4293 offset: usize,
4294 _depth: fidl::encoding::Depth,
4295 ) -> fidl::Result<()> {
4296 encoder.debug_check_bounds::<DatasetConnectorConnectRequest>(offset);
4297 fidl::encoding::Encode::<DatasetConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4299 (
4300 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4301 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4302 ),
4303 encoder, offset, _depth
4304 )
4305 }
4306 }
4307 unsafe impl<
4308 T0: fidl::encoding::Encode<
4309 fidl::encoding::BoundedString<32>,
4310 fidl::encoding::DefaultFuchsiaResourceDialect,
4311 >,
4312 T1: fidl::encoding::Encode<
4313 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
4314 fidl::encoding::DefaultFuchsiaResourceDialect,
4315 >,
4316 >
4317 fidl::encoding::Encode<
4318 DatasetConnectorConnectRequest,
4319 fidl::encoding::DefaultFuchsiaResourceDialect,
4320 > for (T0, T1)
4321 {
4322 #[inline]
4323 unsafe fn encode(
4324 self,
4325 encoder: &mut fidl::encoding::Encoder<
4326 '_,
4327 fidl::encoding::DefaultFuchsiaResourceDialect,
4328 >,
4329 offset: usize,
4330 depth: fidl::encoding::Depth,
4331 ) -> fidl::Result<()> {
4332 encoder.debug_check_bounds::<DatasetConnectorConnectRequest>(offset);
4333 unsafe {
4336 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4337 (ptr as *mut u64).write_unaligned(0);
4338 }
4339 self.0.encode(encoder, offset + 0, depth)?;
4341 self.1.encode(encoder, offset + 16, depth)?;
4342 Ok(())
4343 }
4344 }
4345
4346 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4347 for DatasetConnectorConnectRequest
4348 {
4349 #[inline(always)]
4350 fn new_empty() -> Self {
4351 Self {
4352 name: fidl::new_empty!(
4353 fidl::encoding::BoundedString<32>,
4354 fidl::encoding::DefaultFuchsiaResourceDialect
4355 ),
4356 server_end: fidl::new_empty!(
4357 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
4358 fidl::encoding::DefaultFuchsiaResourceDialect
4359 ),
4360 }
4361 }
4362
4363 #[inline]
4364 unsafe fn decode(
4365 &mut self,
4366 decoder: &mut fidl::encoding::Decoder<
4367 '_,
4368 fidl::encoding::DefaultFuchsiaResourceDialect,
4369 >,
4370 offset: usize,
4371 _depth: fidl::encoding::Depth,
4372 ) -> fidl::Result<()> {
4373 decoder.debug_check_bounds::<Self>(offset);
4374 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4376 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4377 let mask = 0xffffffff00000000u64;
4378 let maskedval = padval & mask;
4379 if maskedval != 0 {
4380 return Err(fidl::Error::NonZeroPadding {
4381 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4382 });
4383 }
4384 fidl::decode!(
4385 fidl::encoding::BoundedString<32>,
4386 fidl::encoding::DefaultFuchsiaResourceDialect,
4387 &mut self.name,
4388 decoder,
4389 offset + 0,
4390 _depth
4391 )?;
4392 fidl::decode!(
4393 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
4394 fidl::encoding::DefaultFuchsiaResourceDialect,
4395 &mut self.server_end,
4396 decoder,
4397 offset + 16,
4398 _depth
4399 )?;
4400 Ok(())
4401 }
4402 }
4403
4404 impl fidl::encoding::ResourceTypeMarker for FeatureConnectorConnectRequest {
4405 type Borrowed<'a> = &'a mut Self;
4406 fn take_or_borrow<'a>(
4407 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4408 ) -> Self::Borrowed<'a> {
4409 value
4410 }
4411 }
4412
4413 unsafe impl fidl::encoding::TypeMarker for FeatureConnectorConnectRequest {
4414 type Owned = Self;
4415
4416 #[inline(always)]
4417 fn inline_align(_context: fidl::encoding::Context) -> usize {
4418 8
4419 }
4420
4421 #[inline(always)]
4422 fn inline_size(_context: fidl::encoding::Context) -> usize {
4423 24
4424 }
4425 }
4426
4427 unsafe impl
4428 fidl::encoding::Encode<
4429 FeatureConnectorConnectRequest,
4430 fidl::encoding::DefaultFuchsiaResourceDialect,
4431 > for &mut FeatureConnectorConnectRequest
4432 {
4433 #[inline]
4434 unsafe fn encode(
4435 self,
4436 encoder: &mut fidl::encoding::Encoder<
4437 '_,
4438 fidl::encoding::DefaultFuchsiaResourceDialect,
4439 >,
4440 offset: usize,
4441 _depth: fidl::encoding::Depth,
4442 ) -> fidl::Result<()> {
4443 encoder.debug_check_bounds::<FeatureConnectorConnectRequest>(offset);
4444 fidl::encoding::Encode::<FeatureConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4446 (
4447 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4448 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4449 ),
4450 encoder, offset, _depth
4451 )
4452 }
4453 }
4454 unsafe impl<
4455 T0: fidl::encoding::Encode<
4456 fidl::encoding::BoundedString<32>,
4457 fidl::encoding::DefaultFuchsiaResourceDialect,
4458 >,
4459 T1: fidl::encoding::Encode<
4460 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
4461 fidl::encoding::DefaultFuchsiaResourceDialect,
4462 >,
4463 >
4464 fidl::encoding::Encode<
4465 FeatureConnectorConnectRequest,
4466 fidl::encoding::DefaultFuchsiaResourceDialect,
4467 > for (T0, T1)
4468 {
4469 #[inline]
4470 unsafe fn encode(
4471 self,
4472 encoder: &mut fidl::encoding::Encoder<
4473 '_,
4474 fidl::encoding::DefaultFuchsiaResourceDialect,
4475 >,
4476 offset: usize,
4477 depth: fidl::encoding::Depth,
4478 ) -> fidl::Result<()> {
4479 encoder.debug_check_bounds::<FeatureConnectorConnectRequest>(offset);
4480 unsafe {
4483 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4484 (ptr as *mut u64).write_unaligned(0);
4485 }
4486 self.0.encode(encoder, offset + 0, depth)?;
4488 self.1.encode(encoder, offset + 16, depth)?;
4489 Ok(())
4490 }
4491 }
4492
4493 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4494 for FeatureConnectorConnectRequest
4495 {
4496 #[inline(always)]
4497 fn new_empty() -> Self {
4498 Self {
4499 name: fidl::new_empty!(
4500 fidl::encoding::BoundedString<32>,
4501 fidl::encoding::DefaultFuchsiaResourceDialect
4502 ),
4503 server_end: fidl::new_empty!(
4504 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
4505 fidl::encoding::DefaultFuchsiaResourceDialect
4506 ),
4507 }
4508 }
4509
4510 #[inline]
4511 unsafe fn decode(
4512 &mut self,
4513 decoder: &mut fidl::encoding::Decoder<
4514 '_,
4515 fidl::encoding::DefaultFuchsiaResourceDialect,
4516 >,
4517 offset: usize,
4518 _depth: fidl::encoding::Depth,
4519 ) -> fidl::Result<()> {
4520 decoder.debug_check_bounds::<Self>(offset);
4521 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4523 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4524 let mask = 0xffffffff00000000u64;
4525 let maskedval = padval & mask;
4526 if maskedval != 0 {
4527 return Err(fidl::Error::NonZeroPadding {
4528 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4529 });
4530 }
4531 fidl::decode!(
4532 fidl::encoding::BoundedString<32>,
4533 fidl::encoding::DefaultFuchsiaResourceDialect,
4534 &mut self.name,
4535 decoder,
4536 offset + 0,
4537 _depth
4538 )?;
4539 fidl::decode!(
4540 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
4541 fidl::encoding::DefaultFuchsiaResourceDialect,
4542 &mut self.server_end,
4543 decoder,
4544 offset + 16,
4545 _depth
4546 )?;
4547 Ok(())
4548 }
4549 }
4550
4551 impl fidl::encoding::ResourceTypeMarker for MeshcopConnectorConnectRequest {
4552 type Borrowed<'a> = &'a mut Self;
4553 fn take_or_borrow<'a>(
4554 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4555 ) -> Self::Borrowed<'a> {
4556 value
4557 }
4558 }
4559
4560 unsafe impl fidl::encoding::TypeMarker for MeshcopConnectorConnectRequest {
4561 type Owned = Self;
4562
4563 #[inline(always)]
4564 fn inline_align(_context: fidl::encoding::Context) -> usize {
4565 8
4566 }
4567
4568 #[inline(always)]
4569 fn inline_size(_context: fidl::encoding::Context) -> usize {
4570 24
4571 }
4572 }
4573
4574 unsafe impl
4575 fidl::encoding::Encode<
4576 MeshcopConnectorConnectRequest,
4577 fidl::encoding::DefaultFuchsiaResourceDialect,
4578 > for &mut MeshcopConnectorConnectRequest
4579 {
4580 #[inline]
4581 unsafe fn encode(
4582 self,
4583 encoder: &mut fidl::encoding::Encoder<
4584 '_,
4585 fidl::encoding::DefaultFuchsiaResourceDialect,
4586 >,
4587 offset: usize,
4588 _depth: fidl::encoding::Depth,
4589 ) -> fidl::Result<()> {
4590 encoder.debug_check_bounds::<MeshcopConnectorConnectRequest>(offset);
4591 fidl::encoding::Encode::<MeshcopConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4593 (
4594 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4595 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4596 ),
4597 encoder, offset, _depth
4598 )
4599 }
4600 }
4601 unsafe impl<
4602 T0: fidl::encoding::Encode<
4603 fidl::encoding::BoundedString<32>,
4604 fidl::encoding::DefaultFuchsiaResourceDialect,
4605 >,
4606 T1: fidl::encoding::Encode<
4607 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
4608 fidl::encoding::DefaultFuchsiaResourceDialect,
4609 >,
4610 >
4611 fidl::encoding::Encode<
4612 MeshcopConnectorConnectRequest,
4613 fidl::encoding::DefaultFuchsiaResourceDialect,
4614 > for (T0, T1)
4615 {
4616 #[inline]
4617 unsafe fn encode(
4618 self,
4619 encoder: &mut fidl::encoding::Encoder<
4620 '_,
4621 fidl::encoding::DefaultFuchsiaResourceDialect,
4622 >,
4623 offset: usize,
4624 depth: fidl::encoding::Depth,
4625 ) -> fidl::Result<()> {
4626 encoder.debug_check_bounds::<MeshcopConnectorConnectRequest>(offset);
4627 unsafe {
4630 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4631 (ptr as *mut u64).write_unaligned(0);
4632 }
4633 self.0.encode(encoder, offset + 0, depth)?;
4635 self.1.encode(encoder, offset + 16, depth)?;
4636 Ok(())
4637 }
4638 }
4639
4640 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4641 for MeshcopConnectorConnectRequest
4642 {
4643 #[inline(always)]
4644 fn new_empty() -> Self {
4645 Self {
4646 name: fidl::new_empty!(
4647 fidl::encoding::BoundedString<32>,
4648 fidl::encoding::DefaultFuchsiaResourceDialect
4649 ),
4650 server_end: fidl::new_empty!(
4651 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
4652 fidl::encoding::DefaultFuchsiaResourceDialect
4653 ),
4654 }
4655 }
4656
4657 #[inline]
4658 unsafe fn decode(
4659 &mut self,
4660 decoder: &mut fidl::encoding::Decoder<
4661 '_,
4662 fidl::encoding::DefaultFuchsiaResourceDialect,
4663 >,
4664 offset: usize,
4665 _depth: fidl::encoding::Depth,
4666 ) -> fidl::Result<()> {
4667 decoder.debug_check_bounds::<Self>(offset);
4668 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4670 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4671 let mask = 0xffffffff00000000u64;
4672 let maskedval = padval & mask;
4673 if maskedval != 0 {
4674 return Err(fidl::Error::NonZeroPadding {
4675 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4676 });
4677 }
4678 fidl::decode!(
4679 fidl::encoding::BoundedString<32>,
4680 fidl::encoding::DefaultFuchsiaResourceDialect,
4681 &mut self.name,
4682 decoder,
4683 offset + 0,
4684 _depth
4685 )?;
4686 fidl::decode!(
4687 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
4688 fidl::encoding::DefaultFuchsiaResourceDialect,
4689 &mut self.server_end,
4690 decoder,
4691 offset + 16,
4692 _depth
4693 )?;
4694 Ok(())
4695 }
4696 }
4697}