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#[cfg(target_os = "fuchsia")]
167impl fidl::endpoints::FromClient for CapabilitiesConnectorSynchronousProxy {
168 type Protocol = CapabilitiesConnectorMarker;
169
170 fn from_client(value: fidl::endpoints::ClientEnd<CapabilitiesConnectorMarker>) -> Self {
171 Self::new(value.into_channel())
172 }
173}
174
175#[derive(Debug, Clone)]
176pub struct CapabilitiesConnectorProxy {
177 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
178}
179
180impl fidl::endpoints::Proxy for CapabilitiesConnectorProxy {
181 type Protocol = CapabilitiesConnectorMarker;
182
183 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
184 Self::new(inner)
185 }
186
187 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
188 self.client.into_channel().map_err(|client| Self { client })
189 }
190
191 fn as_channel(&self) -> &::fidl::AsyncChannel {
192 self.client.as_channel()
193 }
194}
195
196impl CapabilitiesConnectorProxy {
197 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
199 let protocol_name =
200 <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
201 Self { client: fidl::client::Client::new(channel, protocol_name) }
202 }
203
204 pub fn take_event_stream(&self) -> CapabilitiesConnectorEventStream {
210 CapabilitiesConnectorEventStream { event_receiver: self.client.take_event_receiver() }
211 }
212
213 pub fn r#connect(
230 &self,
231 mut name: &str,
232 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
233 ) -> Result<(), fidl::Error> {
234 CapabilitiesConnectorProxyInterface::r#connect(self, name, server_end)
235 }
236}
237
238impl CapabilitiesConnectorProxyInterface for CapabilitiesConnectorProxy {
239 fn r#connect(
240 &self,
241 mut name: &str,
242 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
243 ) -> Result<(), fidl::Error> {
244 self.client.send::<CapabilitiesConnectorConnectRequest>(
245 (name, server_end),
246 0x1dadd551ecacd85,
247 fidl::encoding::DynamicFlags::empty(),
248 )
249 }
250}
251
252pub struct CapabilitiesConnectorEventStream {
253 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
254}
255
256impl std::marker::Unpin for CapabilitiesConnectorEventStream {}
257
258impl futures::stream::FusedStream for CapabilitiesConnectorEventStream {
259 fn is_terminated(&self) -> bool {
260 self.event_receiver.is_terminated()
261 }
262}
263
264impl futures::Stream for CapabilitiesConnectorEventStream {
265 type Item = Result<CapabilitiesConnectorEvent, fidl::Error>;
266
267 fn poll_next(
268 mut self: std::pin::Pin<&mut Self>,
269 cx: &mut std::task::Context<'_>,
270 ) -> std::task::Poll<Option<Self::Item>> {
271 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
272 &mut self.event_receiver,
273 cx
274 )?) {
275 Some(buf) => std::task::Poll::Ready(Some(CapabilitiesConnectorEvent::decode(buf))),
276 None => std::task::Poll::Ready(None),
277 }
278 }
279}
280
281#[derive(Debug)]
282pub enum CapabilitiesConnectorEvent {}
283
284impl CapabilitiesConnectorEvent {
285 fn decode(
287 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
288 ) -> Result<CapabilitiesConnectorEvent, fidl::Error> {
289 let (bytes, _handles) = buf.split_mut();
290 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
291 debug_assert_eq!(tx_header.tx_id, 0);
292 match tx_header.ordinal {
293 _ => Err(fidl::Error::UnknownOrdinal {
294 ordinal: tx_header.ordinal,
295 protocol_name:
296 <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
297 }),
298 }
299 }
300}
301
302pub struct CapabilitiesConnectorRequestStream {
304 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
305 is_terminated: bool,
306}
307
308impl std::marker::Unpin for CapabilitiesConnectorRequestStream {}
309
310impl futures::stream::FusedStream for CapabilitiesConnectorRequestStream {
311 fn is_terminated(&self) -> bool {
312 self.is_terminated
313 }
314}
315
316impl fidl::endpoints::RequestStream for CapabilitiesConnectorRequestStream {
317 type Protocol = CapabilitiesConnectorMarker;
318 type ControlHandle = CapabilitiesConnectorControlHandle;
319
320 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
321 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
322 }
323
324 fn control_handle(&self) -> Self::ControlHandle {
325 CapabilitiesConnectorControlHandle { inner: self.inner.clone() }
326 }
327
328 fn into_inner(
329 self,
330 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
331 {
332 (self.inner, self.is_terminated)
333 }
334
335 fn from_inner(
336 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
337 is_terminated: bool,
338 ) -> Self {
339 Self { inner, is_terminated }
340 }
341}
342
343impl futures::Stream for CapabilitiesConnectorRequestStream {
344 type Item = Result<CapabilitiesConnectorRequest, fidl::Error>;
345
346 fn poll_next(
347 mut self: std::pin::Pin<&mut Self>,
348 cx: &mut std::task::Context<'_>,
349 ) -> std::task::Poll<Option<Self::Item>> {
350 let this = &mut *self;
351 if this.inner.check_shutdown(cx) {
352 this.is_terminated = true;
353 return std::task::Poll::Ready(None);
354 }
355 if this.is_terminated {
356 panic!("polled CapabilitiesConnectorRequestStream after completion");
357 }
358 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
359 |bytes, handles| {
360 match this.inner.channel().read_etc(cx, bytes, handles) {
361 std::task::Poll::Ready(Ok(())) => {}
362 std::task::Poll::Pending => return std::task::Poll::Pending,
363 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
364 this.is_terminated = true;
365 return std::task::Poll::Ready(None);
366 }
367 std::task::Poll::Ready(Err(e)) => {
368 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
369 e.into(),
370 ))))
371 }
372 }
373
374 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
376
377 std::task::Poll::Ready(Some(match header.ordinal {
378 0x1dadd551ecacd85 => {
379 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
380 let mut req = fidl::new_empty!(CapabilitiesConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
381 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
382 let control_handle = CapabilitiesConnectorControlHandle {
383 inner: this.inner.clone(),
384 };
385 Ok(CapabilitiesConnectorRequest::Connect {name: req.name,
386server_end: req.server_end,
387
388 control_handle,
389 })
390 }
391 _ => Err(fidl::Error::UnknownOrdinal {
392 ordinal: header.ordinal,
393 protocol_name: <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
394 }),
395 }))
396 },
397 )
398 }
399}
400
401#[derive(Debug)]
403pub enum CapabilitiesConnectorRequest {
404 Connect {
421 name: String,
422 server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
423 control_handle: CapabilitiesConnectorControlHandle,
424 },
425}
426
427impl CapabilitiesConnectorRequest {
428 #[allow(irrefutable_let_patterns)]
429 pub fn into_connect(
430 self,
431 ) -> Option<(
432 String,
433 fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
434 CapabilitiesConnectorControlHandle,
435 )> {
436 if let CapabilitiesConnectorRequest::Connect { name, server_end, control_handle } = self {
437 Some((name, server_end, control_handle))
438 } else {
439 None
440 }
441 }
442
443 pub fn method_name(&self) -> &'static str {
445 match *self {
446 CapabilitiesConnectorRequest::Connect { .. } => "connect",
447 }
448 }
449}
450
451#[derive(Debug, Clone)]
452pub struct CapabilitiesConnectorControlHandle {
453 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
454}
455
456impl fidl::endpoints::ControlHandle for CapabilitiesConnectorControlHandle {
457 fn shutdown(&self) {
458 self.inner.shutdown()
459 }
460 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
461 self.inner.shutdown_with_epitaph(status)
462 }
463
464 fn is_closed(&self) -> bool {
465 self.inner.channel().is_closed()
466 }
467 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
468 self.inner.channel().on_closed()
469 }
470
471 #[cfg(target_os = "fuchsia")]
472 fn signal_peer(
473 &self,
474 clear_mask: zx::Signals,
475 set_mask: zx::Signals,
476 ) -> Result<(), zx_status::Status> {
477 use fidl::Peered;
478 self.inner.channel().signal_peer(clear_mask, set_mask)
479 }
480}
481
482impl CapabilitiesConnectorControlHandle {}
483
484#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
485pub struct DatasetMarker;
486
487impl fidl::endpoints::ProtocolMarker for DatasetMarker {
488 type Proxy = DatasetProxy;
489 type RequestStream = DatasetRequestStream;
490 #[cfg(target_os = "fuchsia")]
491 type SynchronousProxy = DatasetSynchronousProxy;
492
493 const DEBUG_NAME: &'static str = "(anonymous) Dataset";
494}
495
496pub trait DatasetProxyInterface: Send + Sync {
497 type GetActiveTlvsResponseFut: std::future::Future<Output = Result<Option<Vec<u8>>, fidl::Error>>
498 + Send;
499 fn r#get_active_tlvs(&self) -> Self::GetActiveTlvsResponseFut;
500 type SetActiveTlvsResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
501 fn r#set_active_tlvs(&self, dataset: &[u8]) -> Self::SetActiveTlvsResponseFut;
502 type AttachAllNodesToResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
503 fn r#attach_all_nodes_to(&self, dataset: &[u8]) -> Self::AttachAllNodesToResponseFut;
504}
505#[derive(Debug)]
506#[cfg(target_os = "fuchsia")]
507pub struct DatasetSynchronousProxy {
508 client: fidl::client::sync::Client,
509}
510
511#[cfg(target_os = "fuchsia")]
512impl fidl::endpoints::SynchronousProxy for DatasetSynchronousProxy {
513 type Proxy = DatasetProxy;
514 type Protocol = DatasetMarker;
515
516 fn from_channel(inner: fidl::Channel) -> Self {
517 Self::new(inner)
518 }
519
520 fn into_channel(self) -> fidl::Channel {
521 self.client.into_channel()
522 }
523
524 fn as_channel(&self) -> &fidl::Channel {
525 self.client.as_channel()
526 }
527}
528
529#[cfg(target_os = "fuchsia")]
530impl DatasetSynchronousProxy {
531 pub fn new(channel: fidl::Channel) -> Self {
532 let protocol_name = <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
533 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
534 }
535
536 pub fn into_channel(self) -> fidl::Channel {
537 self.client.into_channel()
538 }
539
540 pub fn wait_for_event(
543 &self,
544 deadline: zx::MonotonicInstant,
545 ) -> Result<DatasetEvent, fidl::Error> {
546 DatasetEvent::decode(self.client.wait_for_event(deadline)?)
547 }
548
549 pub fn r#get_active_tlvs(
560 &self,
561 ___deadline: zx::MonotonicInstant,
562 ) -> Result<Option<Vec<u8>>, fidl::Error> {
563 let _response =
564 self.client.send_query::<fidl::encoding::EmptyPayload, DatasetGetActiveTlvsResponse>(
565 (),
566 0x3004d50d9fb69b92,
567 fidl::encoding::DynamicFlags::empty(),
568 ___deadline,
569 )?;
570 Ok(_response.dataset)
571 }
572
573 pub fn r#set_active_tlvs(
583 &self,
584 mut dataset: &[u8],
585 ___deadline: zx::MonotonicInstant,
586 ) -> Result<(), fidl::Error> {
587 let _response =
588 self.client.send_query::<DatasetSetActiveTlvsRequest, fidl::encoding::EmptyPayload>(
589 (dataset,),
590 0x5a8dc1d4e3b578e7,
591 fidl::encoding::DynamicFlags::empty(),
592 ___deadline,
593 )?;
594 Ok(_response)
595 }
596
597 pub fn r#attach_all_nodes_to(
617 &self,
618 mut dataset: &[u8],
619 ___deadline: zx::MonotonicInstant,
620 ) -> Result<i64, fidl::Error> {
621 let _response = self
622 .client
623 .send_query::<DatasetAttachAllNodesToRequest, DatasetAttachAllNodesToResponse>(
624 (dataset,),
625 0x6057e8b429c4aefe,
626 fidl::encoding::DynamicFlags::empty(),
627 ___deadline,
628 )?;
629 Ok(_response.delay_ms)
630 }
631}
632
633#[cfg(target_os = "fuchsia")]
634impl From<DatasetSynchronousProxy> for zx::Handle {
635 fn from(value: DatasetSynchronousProxy) -> Self {
636 value.into_channel().into()
637 }
638}
639
640#[cfg(target_os = "fuchsia")]
641impl From<fidl::Channel> for DatasetSynchronousProxy {
642 fn from(value: fidl::Channel) -> Self {
643 Self::new(value)
644 }
645}
646
647#[cfg(target_os = "fuchsia")]
648impl fidl::endpoints::FromClient for DatasetSynchronousProxy {
649 type Protocol = DatasetMarker;
650
651 fn from_client(value: fidl::endpoints::ClientEnd<DatasetMarker>) -> Self {
652 Self::new(value.into_channel())
653 }
654}
655
656#[derive(Debug, Clone)]
657pub struct DatasetProxy {
658 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
659}
660
661impl fidl::endpoints::Proxy for DatasetProxy {
662 type Protocol = DatasetMarker;
663
664 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
665 Self::new(inner)
666 }
667
668 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
669 self.client.into_channel().map_err(|client| Self { client })
670 }
671
672 fn as_channel(&self) -> &::fidl::AsyncChannel {
673 self.client.as_channel()
674 }
675}
676
677impl DatasetProxy {
678 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
680 let protocol_name = <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
681 Self { client: fidl::client::Client::new(channel, protocol_name) }
682 }
683
684 pub fn take_event_stream(&self) -> DatasetEventStream {
690 DatasetEventStream { event_receiver: self.client.take_event_receiver() }
691 }
692
693 pub fn r#get_active_tlvs(
704 &self,
705 ) -> fidl::client::QueryResponseFut<
706 Option<Vec<u8>>,
707 fidl::encoding::DefaultFuchsiaResourceDialect,
708 > {
709 DatasetProxyInterface::r#get_active_tlvs(self)
710 }
711
712 pub fn r#set_active_tlvs(
722 &self,
723 mut dataset: &[u8],
724 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
725 DatasetProxyInterface::r#set_active_tlvs(self, dataset)
726 }
727
728 pub fn r#attach_all_nodes_to(
748 &self,
749 mut dataset: &[u8],
750 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
751 DatasetProxyInterface::r#attach_all_nodes_to(self, dataset)
752 }
753}
754
755impl DatasetProxyInterface for DatasetProxy {
756 type GetActiveTlvsResponseFut = fidl::client::QueryResponseFut<
757 Option<Vec<u8>>,
758 fidl::encoding::DefaultFuchsiaResourceDialect,
759 >;
760 fn r#get_active_tlvs(&self) -> Self::GetActiveTlvsResponseFut {
761 fn _decode(
762 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
763 ) -> Result<Option<Vec<u8>>, fidl::Error> {
764 let _response = fidl::client::decode_transaction_body::<
765 DatasetGetActiveTlvsResponse,
766 fidl::encoding::DefaultFuchsiaResourceDialect,
767 0x3004d50d9fb69b92,
768 >(_buf?)?;
769 Ok(_response.dataset)
770 }
771 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Option<Vec<u8>>>(
772 (),
773 0x3004d50d9fb69b92,
774 fidl::encoding::DynamicFlags::empty(),
775 _decode,
776 )
777 }
778
779 type SetActiveTlvsResponseFut =
780 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
781 fn r#set_active_tlvs(&self, mut dataset: &[u8]) -> Self::SetActiveTlvsResponseFut {
782 fn _decode(
783 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
784 ) -> Result<(), fidl::Error> {
785 let _response = fidl::client::decode_transaction_body::<
786 fidl::encoding::EmptyPayload,
787 fidl::encoding::DefaultFuchsiaResourceDialect,
788 0x5a8dc1d4e3b578e7,
789 >(_buf?)?;
790 Ok(_response)
791 }
792 self.client.send_query_and_decode::<DatasetSetActiveTlvsRequest, ()>(
793 (dataset,),
794 0x5a8dc1d4e3b578e7,
795 fidl::encoding::DynamicFlags::empty(),
796 _decode,
797 )
798 }
799
800 type AttachAllNodesToResponseFut =
801 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
802 fn r#attach_all_nodes_to(&self, mut dataset: &[u8]) -> Self::AttachAllNodesToResponseFut {
803 fn _decode(
804 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
805 ) -> Result<i64, fidl::Error> {
806 let _response = fidl::client::decode_transaction_body::<
807 DatasetAttachAllNodesToResponse,
808 fidl::encoding::DefaultFuchsiaResourceDialect,
809 0x6057e8b429c4aefe,
810 >(_buf?)?;
811 Ok(_response.delay_ms)
812 }
813 self.client.send_query_and_decode::<DatasetAttachAllNodesToRequest, i64>(
814 (dataset,),
815 0x6057e8b429c4aefe,
816 fidl::encoding::DynamicFlags::empty(),
817 _decode,
818 )
819 }
820}
821
822pub struct DatasetEventStream {
823 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
824}
825
826impl std::marker::Unpin for DatasetEventStream {}
827
828impl futures::stream::FusedStream for DatasetEventStream {
829 fn is_terminated(&self) -> bool {
830 self.event_receiver.is_terminated()
831 }
832}
833
834impl futures::Stream for DatasetEventStream {
835 type Item = Result<DatasetEvent, fidl::Error>;
836
837 fn poll_next(
838 mut self: std::pin::Pin<&mut Self>,
839 cx: &mut std::task::Context<'_>,
840 ) -> std::task::Poll<Option<Self::Item>> {
841 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
842 &mut self.event_receiver,
843 cx
844 )?) {
845 Some(buf) => std::task::Poll::Ready(Some(DatasetEvent::decode(buf))),
846 None => std::task::Poll::Ready(None),
847 }
848 }
849}
850
851#[derive(Debug)]
852pub enum DatasetEvent {}
853
854impl DatasetEvent {
855 fn decode(
857 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
858 ) -> Result<DatasetEvent, fidl::Error> {
859 let (bytes, _handles) = buf.split_mut();
860 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
861 debug_assert_eq!(tx_header.tx_id, 0);
862 match tx_header.ordinal {
863 _ => Err(fidl::Error::UnknownOrdinal {
864 ordinal: tx_header.ordinal,
865 protocol_name: <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
866 }),
867 }
868 }
869}
870
871pub struct DatasetRequestStream {
873 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
874 is_terminated: bool,
875}
876
877impl std::marker::Unpin for DatasetRequestStream {}
878
879impl futures::stream::FusedStream for DatasetRequestStream {
880 fn is_terminated(&self) -> bool {
881 self.is_terminated
882 }
883}
884
885impl fidl::endpoints::RequestStream for DatasetRequestStream {
886 type Protocol = DatasetMarker;
887 type ControlHandle = DatasetControlHandle;
888
889 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
890 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
891 }
892
893 fn control_handle(&self) -> Self::ControlHandle {
894 DatasetControlHandle { inner: self.inner.clone() }
895 }
896
897 fn into_inner(
898 self,
899 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
900 {
901 (self.inner, self.is_terminated)
902 }
903
904 fn from_inner(
905 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
906 is_terminated: bool,
907 ) -> Self {
908 Self { inner, is_terminated }
909 }
910}
911
912impl futures::Stream for DatasetRequestStream {
913 type Item = Result<DatasetRequest, fidl::Error>;
914
915 fn poll_next(
916 mut self: std::pin::Pin<&mut Self>,
917 cx: &mut std::task::Context<'_>,
918 ) -> std::task::Poll<Option<Self::Item>> {
919 let this = &mut *self;
920 if this.inner.check_shutdown(cx) {
921 this.is_terminated = true;
922 return std::task::Poll::Ready(None);
923 }
924 if this.is_terminated {
925 panic!("polled DatasetRequestStream after completion");
926 }
927 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
928 |bytes, handles| {
929 match this.inner.channel().read_etc(cx, bytes, handles) {
930 std::task::Poll::Ready(Ok(())) => {}
931 std::task::Poll::Pending => return std::task::Poll::Pending,
932 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
933 this.is_terminated = true;
934 return std::task::Poll::Ready(None);
935 }
936 std::task::Poll::Ready(Err(e)) => {
937 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
938 e.into(),
939 ))))
940 }
941 }
942
943 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
945
946 std::task::Poll::Ready(Some(match header.ordinal {
947 0x3004d50d9fb69b92 => {
948 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
949 let mut req = fidl::new_empty!(
950 fidl::encoding::EmptyPayload,
951 fidl::encoding::DefaultFuchsiaResourceDialect
952 );
953 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
954 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
955 Ok(DatasetRequest::GetActiveTlvs {
956 responder: DatasetGetActiveTlvsResponder {
957 control_handle: std::mem::ManuallyDrop::new(control_handle),
958 tx_id: header.tx_id,
959 },
960 })
961 }
962 0x5a8dc1d4e3b578e7 => {
963 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
964 let mut req = fidl::new_empty!(
965 DatasetSetActiveTlvsRequest,
966 fidl::encoding::DefaultFuchsiaResourceDialect
967 );
968 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetSetActiveTlvsRequest>(&header, _body_bytes, handles, &mut req)?;
969 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
970 Ok(DatasetRequest::SetActiveTlvs {
971 dataset: req.dataset,
972
973 responder: DatasetSetActiveTlvsResponder {
974 control_handle: std::mem::ManuallyDrop::new(control_handle),
975 tx_id: header.tx_id,
976 },
977 })
978 }
979 0x6057e8b429c4aefe => {
980 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
981 let mut req = fidl::new_empty!(
982 DatasetAttachAllNodesToRequest,
983 fidl::encoding::DefaultFuchsiaResourceDialect
984 );
985 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetAttachAllNodesToRequest>(&header, _body_bytes, handles, &mut req)?;
986 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
987 Ok(DatasetRequest::AttachAllNodesTo {
988 dataset: req.dataset,
989
990 responder: DatasetAttachAllNodesToResponder {
991 control_handle: std::mem::ManuallyDrop::new(control_handle),
992 tx_id: header.tx_id,
993 },
994 })
995 }
996 _ => Err(fidl::Error::UnknownOrdinal {
997 ordinal: header.ordinal,
998 protocol_name:
999 <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1000 }),
1001 }))
1002 },
1003 )
1004 }
1005}
1006
1007#[derive(Debug)]
1014pub enum DatasetRequest {
1015 GetActiveTlvs { responder: DatasetGetActiveTlvsResponder },
1026 SetActiveTlvs { dataset: Vec<u8>, responder: DatasetSetActiveTlvsResponder },
1036 AttachAllNodesTo { dataset: Vec<u8>, responder: DatasetAttachAllNodesToResponder },
1056}
1057
1058impl DatasetRequest {
1059 #[allow(irrefutable_let_patterns)]
1060 pub fn into_get_active_tlvs(self) -> Option<(DatasetGetActiveTlvsResponder)> {
1061 if let DatasetRequest::GetActiveTlvs { responder } = self {
1062 Some((responder))
1063 } else {
1064 None
1065 }
1066 }
1067
1068 #[allow(irrefutable_let_patterns)]
1069 pub fn into_set_active_tlvs(self) -> Option<(Vec<u8>, DatasetSetActiveTlvsResponder)> {
1070 if let DatasetRequest::SetActiveTlvs { dataset, responder } = self {
1071 Some((dataset, responder))
1072 } else {
1073 None
1074 }
1075 }
1076
1077 #[allow(irrefutable_let_patterns)]
1078 pub fn into_attach_all_nodes_to(self) -> Option<(Vec<u8>, DatasetAttachAllNodesToResponder)> {
1079 if let DatasetRequest::AttachAllNodesTo { dataset, responder } = self {
1080 Some((dataset, responder))
1081 } else {
1082 None
1083 }
1084 }
1085
1086 pub fn method_name(&self) -> &'static str {
1088 match *self {
1089 DatasetRequest::GetActiveTlvs { .. } => "get_active_tlvs",
1090 DatasetRequest::SetActiveTlvs { .. } => "set_active_tlvs",
1091 DatasetRequest::AttachAllNodesTo { .. } => "attach_all_nodes_to",
1092 }
1093 }
1094}
1095
1096#[derive(Debug, Clone)]
1097pub struct DatasetControlHandle {
1098 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1099}
1100
1101impl fidl::endpoints::ControlHandle for DatasetControlHandle {
1102 fn shutdown(&self) {
1103 self.inner.shutdown()
1104 }
1105 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1106 self.inner.shutdown_with_epitaph(status)
1107 }
1108
1109 fn is_closed(&self) -> bool {
1110 self.inner.channel().is_closed()
1111 }
1112 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1113 self.inner.channel().on_closed()
1114 }
1115
1116 #[cfg(target_os = "fuchsia")]
1117 fn signal_peer(
1118 &self,
1119 clear_mask: zx::Signals,
1120 set_mask: zx::Signals,
1121 ) -> Result<(), zx_status::Status> {
1122 use fidl::Peered;
1123 self.inner.channel().signal_peer(clear_mask, set_mask)
1124 }
1125}
1126
1127impl DatasetControlHandle {}
1128
1129#[must_use = "FIDL methods require a response to be sent"]
1130#[derive(Debug)]
1131pub struct DatasetGetActiveTlvsResponder {
1132 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1133 tx_id: u32,
1134}
1135
1136impl std::ops::Drop for DatasetGetActiveTlvsResponder {
1140 fn drop(&mut self) {
1141 self.control_handle.shutdown();
1142 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1144 }
1145}
1146
1147impl fidl::endpoints::Responder for DatasetGetActiveTlvsResponder {
1148 type ControlHandle = DatasetControlHandle;
1149
1150 fn control_handle(&self) -> &DatasetControlHandle {
1151 &self.control_handle
1152 }
1153
1154 fn drop_without_shutdown(mut self) {
1155 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1157 std::mem::forget(self);
1159 }
1160}
1161
1162impl DatasetGetActiveTlvsResponder {
1163 pub fn send(self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1167 let _result = self.send_raw(dataset);
1168 if _result.is_err() {
1169 self.control_handle.shutdown();
1170 }
1171 self.drop_without_shutdown();
1172 _result
1173 }
1174
1175 pub fn send_no_shutdown_on_err(self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1177 let _result = self.send_raw(dataset);
1178 self.drop_without_shutdown();
1179 _result
1180 }
1181
1182 fn send_raw(&self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1183 self.control_handle.inner.send::<DatasetGetActiveTlvsResponse>(
1184 (dataset,),
1185 self.tx_id,
1186 0x3004d50d9fb69b92,
1187 fidl::encoding::DynamicFlags::empty(),
1188 )
1189 }
1190}
1191
1192#[must_use = "FIDL methods require a response to be sent"]
1193#[derive(Debug)]
1194pub struct DatasetSetActiveTlvsResponder {
1195 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1196 tx_id: u32,
1197}
1198
1199impl std::ops::Drop for DatasetSetActiveTlvsResponder {
1203 fn drop(&mut self) {
1204 self.control_handle.shutdown();
1205 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1207 }
1208}
1209
1210impl fidl::endpoints::Responder for DatasetSetActiveTlvsResponder {
1211 type ControlHandle = DatasetControlHandle;
1212
1213 fn control_handle(&self) -> &DatasetControlHandle {
1214 &self.control_handle
1215 }
1216
1217 fn drop_without_shutdown(mut self) {
1218 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1220 std::mem::forget(self);
1222 }
1223}
1224
1225impl DatasetSetActiveTlvsResponder {
1226 pub fn send(self) -> Result<(), fidl::Error> {
1230 let _result = self.send_raw();
1231 if _result.is_err() {
1232 self.control_handle.shutdown();
1233 }
1234 self.drop_without_shutdown();
1235 _result
1236 }
1237
1238 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1240 let _result = self.send_raw();
1241 self.drop_without_shutdown();
1242 _result
1243 }
1244
1245 fn send_raw(&self) -> Result<(), fidl::Error> {
1246 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1247 (),
1248 self.tx_id,
1249 0x5a8dc1d4e3b578e7,
1250 fidl::encoding::DynamicFlags::empty(),
1251 )
1252 }
1253}
1254
1255#[must_use = "FIDL methods require a response to be sent"]
1256#[derive(Debug)]
1257pub struct DatasetAttachAllNodesToResponder {
1258 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1259 tx_id: u32,
1260}
1261
1262impl std::ops::Drop for DatasetAttachAllNodesToResponder {
1266 fn drop(&mut self) {
1267 self.control_handle.shutdown();
1268 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1270 }
1271}
1272
1273impl fidl::endpoints::Responder for DatasetAttachAllNodesToResponder {
1274 type ControlHandle = DatasetControlHandle;
1275
1276 fn control_handle(&self) -> &DatasetControlHandle {
1277 &self.control_handle
1278 }
1279
1280 fn drop_without_shutdown(mut self) {
1281 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1283 std::mem::forget(self);
1285 }
1286}
1287
1288impl DatasetAttachAllNodesToResponder {
1289 pub fn send(self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1293 let _result = self.send_raw(delay_ms);
1294 if _result.is_err() {
1295 self.control_handle.shutdown();
1296 }
1297 self.drop_without_shutdown();
1298 _result
1299 }
1300
1301 pub fn send_no_shutdown_on_err(self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1303 let _result = self.send_raw(delay_ms);
1304 self.drop_without_shutdown();
1305 _result
1306 }
1307
1308 fn send_raw(&self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1309 self.control_handle.inner.send::<DatasetAttachAllNodesToResponse>(
1310 (delay_ms,),
1311 self.tx_id,
1312 0x6057e8b429c4aefe,
1313 fidl::encoding::DynamicFlags::empty(),
1314 )
1315 }
1316}
1317
1318#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1319pub struct DatasetConnectorMarker;
1320
1321impl fidl::endpoints::ProtocolMarker for DatasetConnectorMarker {
1322 type Proxy = DatasetConnectorProxy;
1323 type RequestStream = DatasetConnectorRequestStream;
1324 #[cfg(target_os = "fuchsia")]
1325 type SynchronousProxy = DatasetConnectorSynchronousProxy;
1326
1327 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.DatasetConnector";
1328}
1329impl fidl::endpoints::DiscoverableProtocolMarker for DatasetConnectorMarker {}
1330
1331pub trait DatasetConnectorProxyInterface: Send + Sync {
1332 fn r#connect(
1333 &self,
1334 name: &str,
1335 server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1336 ) -> Result<(), fidl::Error>;
1337}
1338#[derive(Debug)]
1339#[cfg(target_os = "fuchsia")]
1340pub struct DatasetConnectorSynchronousProxy {
1341 client: fidl::client::sync::Client,
1342}
1343
1344#[cfg(target_os = "fuchsia")]
1345impl fidl::endpoints::SynchronousProxy for DatasetConnectorSynchronousProxy {
1346 type Proxy = DatasetConnectorProxy;
1347 type Protocol = DatasetConnectorMarker;
1348
1349 fn from_channel(inner: fidl::Channel) -> Self {
1350 Self::new(inner)
1351 }
1352
1353 fn into_channel(self) -> fidl::Channel {
1354 self.client.into_channel()
1355 }
1356
1357 fn as_channel(&self) -> &fidl::Channel {
1358 self.client.as_channel()
1359 }
1360}
1361
1362#[cfg(target_os = "fuchsia")]
1363impl DatasetConnectorSynchronousProxy {
1364 pub fn new(channel: fidl::Channel) -> Self {
1365 let protocol_name = <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1366 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1367 }
1368
1369 pub fn into_channel(self) -> fidl::Channel {
1370 self.client.into_channel()
1371 }
1372
1373 pub fn wait_for_event(
1376 &self,
1377 deadline: zx::MonotonicInstant,
1378 ) -> Result<DatasetConnectorEvent, fidl::Error> {
1379 DatasetConnectorEvent::decode(self.client.wait_for_event(deadline)?)
1380 }
1381
1382 pub fn r#connect(
1399 &self,
1400 mut name: &str,
1401 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1402 ) -> Result<(), fidl::Error> {
1403 self.client.send::<DatasetConnectorConnectRequest>(
1404 (name, server_end),
1405 0x24dff5d2c0cee02b,
1406 fidl::encoding::DynamicFlags::empty(),
1407 )
1408 }
1409}
1410
1411#[cfg(target_os = "fuchsia")]
1412impl From<DatasetConnectorSynchronousProxy> for zx::Handle {
1413 fn from(value: DatasetConnectorSynchronousProxy) -> Self {
1414 value.into_channel().into()
1415 }
1416}
1417
1418#[cfg(target_os = "fuchsia")]
1419impl From<fidl::Channel> for DatasetConnectorSynchronousProxy {
1420 fn from(value: fidl::Channel) -> Self {
1421 Self::new(value)
1422 }
1423}
1424
1425#[cfg(target_os = "fuchsia")]
1426impl fidl::endpoints::FromClient for DatasetConnectorSynchronousProxy {
1427 type Protocol = DatasetConnectorMarker;
1428
1429 fn from_client(value: fidl::endpoints::ClientEnd<DatasetConnectorMarker>) -> Self {
1430 Self::new(value.into_channel())
1431 }
1432}
1433
1434#[derive(Debug, Clone)]
1435pub struct DatasetConnectorProxy {
1436 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1437}
1438
1439impl fidl::endpoints::Proxy for DatasetConnectorProxy {
1440 type Protocol = DatasetConnectorMarker;
1441
1442 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1443 Self::new(inner)
1444 }
1445
1446 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1447 self.client.into_channel().map_err(|client| Self { client })
1448 }
1449
1450 fn as_channel(&self) -> &::fidl::AsyncChannel {
1451 self.client.as_channel()
1452 }
1453}
1454
1455impl DatasetConnectorProxy {
1456 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1458 let protocol_name = <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1459 Self { client: fidl::client::Client::new(channel, protocol_name) }
1460 }
1461
1462 pub fn take_event_stream(&self) -> DatasetConnectorEventStream {
1468 DatasetConnectorEventStream { event_receiver: self.client.take_event_receiver() }
1469 }
1470
1471 pub fn r#connect(
1488 &self,
1489 mut name: &str,
1490 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1491 ) -> Result<(), fidl::Error> {
1492 DatasetConnectorProxyInterface::r#connect(self, name, server_end)
1493 }
1494}
1495
1496impl DatasetConnectorProxyInterface for DatasetConnectorProxy {
1497 fn r#connect(
1498 &self,
1499 mut name: &str,
1500 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1501 ) -> Result<(), fidl::Error> {
1502 self.client.send::<DatasetConnectorConnectRequest>(
1503 (name, server_end),
1504 0x24dff5d2c0cee02b,
1505 fidl::encoding::DynamicFlags::empty(),
1506 )
1507 }
1508}
1509
1510pub struct DatasetConnectorEventStream {
1511 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1512}
1513
1514impl std::marker::Unpin for DatasetConnectorEventStream {}
1515
1516impl futures::stream::FusedStream for DatasetConnectorEventStream {
1517 fn is_terminated(&self) -> bool {
1518 self.event_receiver.is_terminated()
1519 }
1520}
1521
1522impl futures::Stream for DatasetConnectorEventStream {
1523 type Item = Result<DatasetConnectorEvent, fidl::Error>;
1524
1525 fn poll_next(
1526 mut self: std::pin::Pin<&mut Self>,
1527 cx: &mut std::task::Context<'_>,
1528 ) -> std::task::Poll<Option<Self::Item>> {
1529 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1530 &mut self.event_receiver,
1531 cx
1532 )?) {
1533 Some(buf) => std::task::Poll::Ready(Some(DatasetConnectorEvent::decode(buf))),
1534 None => std::task::Poll::Ready(None),
1535 }
1536 }
1537}
1538
1539#[derive(Debug)]
1540pub enum DatasetConnectorEvent {}
1541
1542impl DatasetConnectorEvent {
1543 fn decode(
1545 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1546 ) -> Result<DatasetConnectorEvent, fidl::Error> {
1547 let (bytes, _handles) = buf.split_mut();
1548 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1549 debug_assert_eq!(tx_header.tx_id, 0);
1550 match tx_header.ordinal {
1551 _ => Err(fidl::Error::UnknownOrdinal {
1552 ordinal: tx_header.ordinal,
1553 protocol_name:
1554 <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1555 }),
1556 }
1557 }
1558}
1559
1560pub struct DatasetConnectorRequestStream {
1562 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1563 is_terminated: bool,
1564}
1565
1566impl std::marker::Unpin for DatasetConnectorRequestStream {}
1567
1568impl futures::stream::FusedStream for DatasetConnectorRequestStream {
1569 fn is_terminated(&self) -> bool {
1570 self.is_terminated
1571 }
1572}
1573
1574impl fidl::endpoints::RequestStream for DatasetConnectorRequestStream {
1575 type Protocol = DatasetConnectorMarker;
1576 type ControlHandle = DatasetConnectorControlHandle;
1577
1578 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1579 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1580 }
1581
1582 fn control_handle(&self) -> Self::ControlHandle {
1583 DatasetConnectorControlHandle { inner: self.inner.clone() }
1584 }
1585
1586 fn into_inner(
1587 self,
1588 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1589 {
1590 (self.inner, self.is_terminated)
1591 }
1592
1593 fn from_inner(
1594 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1595 is_terminated: bool,
1596 ) -> Self {
1597 Self { inner, is_terminated }
1598 }
1599}
1600
1601impl futures::Stream for DatasetConnectorRequestStream {
1602 type Item = Result<DatasetConnectorRequest, fidl::Error>;
1603
1604 fn poll_next(
1605 mut self: std::pin::Pin<&mut Self>,
1606 cx: &mut std::task::Context<'_>,
1607 ) -> std::task::Poll<Option<Self::Item>> {
1608 let this = &mut *self;
1609 if this.inner.check_shutdown(cx) {
1610 this.is_terminated = true;
1611 return std::task::Poll::Ready(None);
1612 }
1613 if this.is_terminated {
1614 panic!("polled DatasetConnectorRequestStream after completion");
1615 }
1616 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1617 |bytes, handles| {
1618 match this.inner.channel().read_etc(cx, bytes, handles) {
1619 std::task::Poll::Ready(Ok(())) => {}
1620 std::task::Poll::Pending => return std::task::Poll::Pending,
1621 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1622 this.is_terminated = true;
1623 return std::task::Poll::Ready(None);
1624 }
1625 std::task::Poll::Ready(Err(e)) => {
1626 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1627 e.into(),
1628 ))))
1629 }
1630 }
1631
1632 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1634
1635 std::task::Poll::Ready(Some(match header.ordinal {
1636 0x24dff5d2c0cee02b => {
1637 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1638 let mut req = fidl::new_empty!(
1639 DatasetConnectorConnectRequest,
1640 fidl::encoding::DefaultFuchsiaResourceDialect
1641 );
1642 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
1643 let control_handle =
1644 DatasetConnectorControlHandle { inner: this.inner.clone() };
1645 Ok(DatasetConnectorRequest::Connect {
1646 name: req.name,
1647 server_end: req.server_end,
1648
1649 control_handle,
1650 })
1651 }
1652 _ => Err(fidl::Error::UnknownOrdinal {
1653 ordinal: header.ordinal,
1654 protocol_name:
1655 <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1656 }),
1657 }))
1658 },
1659 )
1660 }
1661}
1662
1663#[derive(Debug)]
1665pub enum DatasetConnectorRequest {
1666 Connect {
1683 name: String,
1684 server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1685 control_handle: DatasetConnectorControlHandle,
1686 },
1687}
1688
1689impl DatasetConnectorRequest {
1690 #[allow(irrefutable_let_patterns)]
1691 pub fn into_connect(
1692 self,
1693 ) -> Option<(String, fidl::endpoints::ServerEnd<DatasetMarker>, DatasetConnectorControlHandle)>
1694 {
1695 if let DatasetConnectorRequest::Connect { name, server_end, control_handle } = self {
1696 Some((name, server_end, control_handle))
1697 } else {
1698 None
1699 }
1700 }
1701
1702 pub fn method_name(&self) -> &'static str {
1704 match *self {
1705 DatasetConnectorRequest::Connect { .. } => "connect",
1706 }
1707 }
1708}
1709
1710#[derive(Debug, Clone)]
1711pub struct DatasetConnectorControlHandle {
1712 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1713}
1714
1715impl fidl::endpoints::ControlHandle for DatasetConnectorControlHandle {
1716 fn shutdown(&self) {
1717 self.inner.shutdown()
1718 }
1719 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1720 self.inner.shutdown_with_epitaph(status)
1721 }
1722
1723 fn is_closed(&self) -> bool {
1724 self.inner.channel().is_closed()
1725 }
1726 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1727 self.inner.channel().on_closed()
1728 }
1729
1730 #[cfg(target_os = "fuchsia")]
1731 fn signal_peer(
1732 &self,
1733 clear_mask: zx::Signals,
1734 set_mask: zx::Signals,
1735 ) -> Result<(), zx_status::Status> {
1736 use fidl::Peered;
1737 self.inner.channel().signal_peer(clear_mask, set_mask)
1738 }
1739}
1740
1741impl DatasetConnectorControlHandle {}
1742
1743#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1744pub struct FeatureMarker;
1745
1746impl fidl::endpoints::ProtocolMarker for FeatureMarker {
1747 type Proxy = FeatureProxy;
1748 type RequestStream = FeatureRequestStream;
1749 #[cfg(target_os = "fuchsia")]
1750 type SynchronousProxy = FeatureSynchronousProxy;
1751
1752 const DEBUG_NAME: &'static str = "(anonymous) Feature";
1753}
1754
1755pub trait FeatureProxyInterface: Send + Sync {
1756 type UpdateFeatureConfigResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1757 + Send;
1758 fn r#update_feature_config(
1759 &self,
1760 config: &FeatureConfig,
1761 ) -> Self::UpdateFeatureConfigResponseFut;
1762 type GetFeatureConfigResponseFut: std::future::Future<Output = Result<FeatureConfig, fidl::Error>>
1763 + Send;
1764 fn r#get_feature_config(&self) -> Self::GetFeatureConfigResponseFut;
1765}
1766#[derive(Debug)]
1767#[cfg(target_os = "fuchsia")]
1768pub struct FeatureSynchronousProxy {
1769 client: fidl::client::sync::Client,
1770}
1771
1772#[cfg(target_os = "fuchsia")]
1773impl fidl::endpoints::SynchronousProxy for FeatureSynchronousProxy {
1774 type Proxy = FeatureProxy;
1775 type Protocol = FeatureMarker;
1776
1777 fn from_channel(inner: fidl::Channel) -> Self {
1778 Self::new(inner)
1779 }
1780
1781 fn into_channel(self) -> fidl::Channel {
1782 self.client.into_channel()
1783 }
1784
1785 fn as_channel(&self) -> &fidl::Channel {
1786 self.client.as_channel()
1787 }
1788}
1789
1790#[cfg(target_os = "fuchsia")]
1791impl FeatureSynchronousProxy {
1792 pub fn new(channel: fidl::Channel) -> Self {
1793 let protocol_name = <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1794 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1795 }
1796
1797 pub fn into_channel(self) -> fidl::Channel {
1798 self.client.into_channel()
1799 }
1800
1801 pub fn wait_for_event(
1804 &self,
1805 deadline: zx::MonotonicInstant,
1806 ) -> Result<FeatureEvent, fidl::Error> {
1807 FeatureEvent::decode(self.client.wait_for_event(deadline)?)
1808 }
1809
1810 pub fn r#update_feature_config(
1815 &self,
1816 mut config: &FeatureConfig,
1817 ___deadline: zx::MonotonicInstant,
1818 ) -> Result<(), fidl::Error> {
1819 let _response = self
1820 .client
1821 .send_query::<FeatureUpdateFeatureConfigRequest, fidl::encoding::EmptyPayload>(
1822 (config,),
1823 0x2d24a706e8730410,
1824 fidl::encoding::DynamicFlags::empty(),
1825 ___deadline,
1826 )?;
1827 Ok(_response)
1828 }
1829
1830 pub fn r#get_feature_config(
1836 &self,
1837 ___deadline: zx::MonotonicInstant,
1838 ) -> Result<FeatureConfig, fidl::Error> {
1839 let _response = self
1840 .client
1841 .send_query::<fidl::encoding::EmptyPayload, FeatureGetFeatureConfigResponse>(
1842 (),
1843 0x2ab1896aea843611,
1844 fidl::encoding::DynamicFlags::empty(),
1845 ___deadline,
1846 )?;
1847 Ok(_response.config)
1848 }
1849}
1850
1851#[cfg(target_os = "fuchsia")]
1852impl From<FeatureSynchronousProxy> for zx::Handle {
1853 fn from(value: FeatureSynchronousProxy) -> Self {
1854 value.into_channel().into()
1855 }
1856}
1857
1858#[cfg(target_os = "fuchsia")]
1859impl From<fidl::Channel> for FeatureSynchronousProxy {
1860 fn from(value: fidl::Channel) -> Self {
1861 Self::new(value)
1862 }
1863}
1864
1865#[cfg(target_os = "fuchsia")]
1866impl fidl::endpoints::FromClient for FeatureSynchronousProxy {
1867 type Protocol = FeatureMarker;
1868
1869 fn from_client(value: fidl::endpoints::ClientEnd<FeatureMarker>) -> Self {
1870 Self::new(value.into_channel())
1871 }
1872}
1873
1874#[derive(Debug, Clone)]
1875pub struct FeatureProxy {
1876 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1877}
1878
1879impl fidl::endpoints::Proxy for FeatureProxy {
1880 type Protocol = FeatureMarker;
1881
1882 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1883 Self::new(inner)
1884 }
1885
1886 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1887 self.client.into_channel().map_err(|client| Self { client })
1888 }
1889
1890 fn as_channel(&self) -> &::fidl::AsyncChannel {
1891 self.client.as_channel()
1892 }
1893}
1894
1895impl FeatureProxy {
1896 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1898 let protocol_name = <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1899 Self { client: fidl::client::Client::new(channel, protocol_name) }
1900 }
1901
1902 pub fn take_event_stream(&self) -> FeatureEventStream {
1908 FeatureEventStream { event_receiver: self.client.take_event_receiver() }
1909 }
1910
1911 pub fn r#update_feature_config(
1916 &self,
1917 mut config: &FeatureConfig,
1918 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1919 FeatureProxyInterface::r#update_feature_config(self, config)
1920 }
1921
1922 pub fn r#get_feature_config(
1928 &self,
1929 ) -> fidl::client::QueryResponseFut<FeatureConfig, fidl::encoding::DefaultFuchsiaResourceDialect>
1930 {
1931 FeatureProxyInterface::r#get_feature_config(self)
1932 }
1933}
1934
1935impl FeatureProxyInterface for FeatureProxy {
1936 type UpdateFeatureConfigResponseFut =
1937 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1938 fn r#update_feature_config(
1939 &self,
1940 mut config: &FeatureConfig,
1941 ) -> Self::UpdateFeatureConfigResponseFut {
1942 fn _decode(
1943 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1944 ) -> Result<(), fidl::Error> {
1945 let _response = fidl::client::decode_transaction_body::<
1946 fidl::encoding::EmptyPayload,
1947 fidl::encoding::DefaultFuchsiaResourceDialect,
1948 0x2d24a706e8730410,
1949 >(_buf?)?;
1950 Ok(_response)
1951 }
1952 self.client.send_query_and_decode::<FeatureUpdateFeatureConfigRequest, ()>(
1953 (config,),
1954 0x2d24a706e8730410,
1955 fidl::encoding::DynamicFlags::empty(),
1956 _decode,
1957 )
1958 }
1959
1960 type GetFeatureConfigResponseFut = fidl::client::QueryResponseFut<
1961 FeatureConfig,
1962 fidl::encoding::DefaultFuchsiaResourceDialect,
1963 >;
1964 fn r#get_feature_config(&self) -> Self::GetFeatureConfigResponseFut {
1965 fn _decode(
1966 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1967 ) -> Result<FeatureConfig, fidl::Error> {
1968 let _response = fidl::client::decode_transaction_body::<
1969 FeatureGetFeatureConfigResponse,
1970 fidl::encoding::DefaultFuchsiaResourceDialect,
1971 0x2ab1896aea843611,
1972 >(_buf?)?;
1973 Ok(_response.config)
1974 }
1975 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FeatureConfig>(
1976 (),
1977 0x2ab1896aea843611,
1978 fidl::encoding::DynamicFlags::empty(),
1979 _decode,
1980 )
1981 }
1982}
1983
1984pub struct FeatureEventStream {
1985 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1986}
1987
1988impl std::marker::Unpin for FeatureEventStream {}
1989
1990impl futures::stream::FusedStream for FeatureEventStream {
1991 fn is_terminated(&self) -> bool {
1992 self.event_receiver.is_terminated()
1993 }
1994}
1995
1996impl futures::Stream for FeatureEventStream {
1997 type Item = Result<FeatureEvent, fidl::Error>;
1998
1999 fn poll_next(
2000 mut self: std::pin::Pin<&mut Self>,
2001 cx: &mut std::task::Context<'_>,
2002 ) -> std::task::Poll<Option<Self::Item>> {
2003 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2004 &mut self.event_receiver,
2005 cx
2006 )?) {
2007 Some(buf) => std::task::Poll::Ready(Some(FeatureEvent::decode(buf))),
2008 None => std::task::Poll::Ready(None),
2009 }
2010 }
2011}
2012
2013#[derive(Debug)]
2014pub enum FeatureEvent {}
2015
2016impl FeatureEvent {
2017 fn decode(
2019 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2020 ) -> Result<FeatureEvent, fidl::Error> {
2021 let (bytes, _handles) = buf.split_mut();
2022 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2023 debug_assert_eq!(tx_header.tx_id, 0);
2024 match tx_header.ordinal {
2025 _ => Err(fidl::Error::UnknownOrdinal {
2026 ordinal: tx_header.ordinal,
2027 protocol_name: <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2028 }),
2029 }
2030 }
2031}
2032
2033pub struct FeatureRequestStream {
2035 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2036 is_terminated: bool,
2037}
2038
2039impl std::marker::Unpin for FeatureRequestStream {}
2040
2041impl futures::stream::FusedStream for FeatureRequestStream {
2042 fn is_terminated(&self) -> bool {
2043 self.is_terminated
2044 }
2045}
2046
2047impl fidl::endpoints::RequestStream for FeatureRequestStream {
2048 type Protocol = FeatureMarker;
2049 type ControlHandle = FeatureControlHandle;
2050
2051 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2052 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2053 }
2054
2055 fn control_handle(&self) -> Self::ControlHandle {
2056 FeatureControlHandle { inner: self.inner.clone() }
2057 }
2058
2059 fn into_inner(
2060 self,
2061 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2062 {
2063 (self.inner, self.is_terminated)
2064 }
2065
2066 fn from_inner(
2067 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2068 is_terminated: bool,
2069 ) -> Self {
2070 Self { inner, is_terminated }
2071 }
2072}
2073
2074impl futures::Stream for FeatureRequestStream {
2075 type Item = Result<FeatureRequest, fidl::Error>;
2076
2077 fn poll_next(
2078 mut self: std::pin::Pin<&mut Self>,
2079 cx: &mut std::task::Context<'_>,
2080 ) -> std::task::Poll<Option<Self::Item>> {
2081 let this = &mut *self;
2082 if this.inner.check_shutdown(cx) {
2083 this.is_terminated = true;
2084 return std::task::Poll::Ready(None);
2085 }
2086 if this.is_terminated {
2087 panic!("polled FeatureRequestStream after completion");
2088 }
2089 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2090 |bytes, handles| {
2091 match this.inner.channel().read_etc(cx, bytes, handles) {
2092 std::task::Poll::Ready(Ok(())) => {}
2093 std::task::Poll::Pending => return std::task::Poll::Pending,
2094 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2095 this.is_terminated = true;
2096 return std::task::Poll::Ready(None);
2097 }
2098 std::task::Poll::Ready(Err(e)) => {
2099 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2100 e.into(),
2101 ))))
2102 }
2103 }
2104
2105 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2107
2108 std::task::Poll::Ready(Some(match header.ordinal {
2109 0x2d24a706e8730410 => {
2110 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2111 let mut req = fidl::new_empty!(
2112 FeatureUpdateFeatureConfigRequest,
2113 fidl::encoding::DefaultFuchsiaResourceDialect
2114 );
2115 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FeatureUpdateFeatureConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2116 let control_handle = FeatureControlHandle { inner: this.inner.clone() };
2117 Ok(FeatureRequest::UpdateFeatureConfig {
2118 config: req.config,
2119
2120 responder: FeatureUpdateFeatureConfigResponder {
2121 control_handle: std::mem::ManuallyDrop::new(control_handle),
2122 tx_id: header.tx_id,
2123 },
2124 })
2125 }
2126 0x2ab1896aea843611 => {
2127 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2128 let mut req = fidl::new_empty!(
2129 fidl::encoding::EmptyPayload,
2130 fidl::encoding::DefaultFuchsiaResourceDialect
2131 );
2132 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2133 let control_handle = FeatureControlHandle { inner: this.inner.clone() };
2134 Ok(FeatureRequest::GetFeatureConfig {
2135 responder: FeatureGetFeatureConfigResponder {
2136 control_handle: std::mem::ManuallyDrop::new(control_handle),
2137 tx_id: header.tx_id,
2138 },
2139 })
2140 }
2141 _ => Err(fidl::Error::UnknownOrdinal {
2142 ordinal: header.ordinal,
2143 protocol_name:
2144 <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2145 }),
2146 }))
2147 },
2148 )
2149 }
2150}
2151
2152#[derive(Debug)]
2155pub enum FeatureRequest {
2156 UpdateFeatureConfig { config: FeatureConfig, responder: FeatureUpdateFeatureConfigResponder },
2161 GetFeatureConfig { responder: FeatureGetFeatureConfigResponder },
2167}
2168
2169impl FeatureRequest {
2170 #[allow(irrefutable_let_patterns)]
2171 pub fn into_update_feature_config(
2172 self,
2173 ) -> Option<(FeatureConfig, FeatureUpdateFeatureConfigResponder)> {
2174 if let FeatureRequest::UpdateFeatureConfig { config, responder } = self {
2175 Some((config, responder))
2176 } else {
2177 None
2178 }
2179 }
2180
2181 #[allow(irrefutable_let_patterns)]
2182 pub fn into_get_feature_config(self) -> Option<(FeatureGetFeatureConfigResponder)> {
2183 if let FeatureRequest::GetFeatureConfig { responder } = self {
2184 Some((responder))
2185 } else {
2186 None
2187 }
2188 }
2189
2190 pub fn method_name(&self) -> &'static str {
2192 match *self {
2193 FeatureRequest::UpdateFeatureConfig { .. } => "update_feature_config",
2194 FeatureRequest::GetFeatureConfig { .. } => "get_feature_config",
2195 }
2196 }
2197}
2198
2199#[derive(Debug, Clone)]
2200pub struct FeatureControlHandle {
2201 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2202}
2203
2204impl fidl::endpoints::ControlHandle for FeatureControlHandle {
2205 fn shutdown(&self) {
2206 self.inner.shutdown()
2207 }
2208 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2209 self.inner.shutdown_with_epitaph(status)
2210 }
2211
2212 fn is_closed(&self) -> bool {
2213 self.inner.channel().is_closed()
2214 }
2215 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2216 self.inner.channel().on_closed()
2217 }
2218
2219 #[cfg(target_os = "fuchsia")]
2220 fn signal_peer(
2221 &self,
2222 clear_mask: zx::Signals,
2223 set_mask: zx::Signals,
2224 ) -> Result<(), zx_status::Status> {
2225 use fidl::Peered;
2226 self.inner.channel().signal_peer(clear_mask, set_mask)
2227 }
2228}
2229
2230impl FeatureControlHandle {}
2231
2232#[must_use = "FIDL methods require a response to be sent"]
2233#[derive(Debug)]
2234pub struct FeatureUpdateFeatureConfigResponder {
2235 control_handle: std::mem::ManuallyDrop<FeatureControlHandle>,
2236 tx_id: u32,
2237}
2238
2239impl std::ops::Drop for FeatureUpdateFeatureConfigResponder {
2243 fn drop(&mut self) {
2244 self.control_handle.shutdown();
2245 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2247 }
2248}
2249
2250impl fidl::endpoints::Responder for FeatureUpdateFeatureConfigResponder {
2251 type ControlHandle = FeatureControlHandle;
2252
2253 fn control_handle(&self) -> &FeatureControlHandle {
2254 &self.control_handle
2255 }
2256
2257 fn drop_without_shutdown(mut self) {
2258 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2260 std::mem::forget(self);
2262 }
2263}
2264
2265impl FeatureUpdateFeatureConfigResponder {
2266 pub fn send(self) -> Result<(), fidl::Error> {
2270 let _result = self.send_raw();
2271 if _result.is_err() {
2272 self.control_handle.shutdown();
2273 }
2274 self.drop_without_shutdown();
2275 _result
2276 }
2277
2278 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2280 let _result = self.send_raw();
2281 self.drop_without_shutdown();
2282 _result
2283 }
2284
2285 fn send_raw(&self) -> Result<(), fidl::Error> {
2286 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2287 (),
2288 self.tx_id,
2289 0x2d24a706e8730410,
2290 fidl::encoding::DynamicFlags::empty(),
2291 )
2292 }
2293}
2294
2295#[must_use = "FIDL methods require a response to be sent"]
2296#[derive(Debug)]
2297pub struct FeatureGetFeatureConfigResponder {
2298 control_handle: std::mem::ManuallyDrop<FeatureControlHandle>,
2299 tx_id: u32,
2300}
2301
2302impl std::ops::Drop for FeatureGetFeatureConfigResponder {
2306 fn drop(&mut self) {
2307 self.control_handle.shutdown();
2308 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2310 }
2311}
2312
2313impl fidl::endpoints::Responder for FeatureGetFeatureConfigResponder {
2314 type ControlHandle = FeatureControlHandle;
2315
2316 fn control_handle(&self) -> &FeatureControlHandle {
2317 &self.control_handle
2318 }
2319
2320 fn drop_without_shutdown(mut self) {
2321 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2323 std::mem::forget(self);
2325 }
2326}
2327
2328impl FeatureGetFeatureConfigResponder {
2329 pub fn send(self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
2333 let _result = self.send_raw(config);
2334 if _result.is_err() {
2335 self.control_handle.shutdown();
2336 }
2337 self.drop_without_shutdown();
2338 _result
2339 }
2340
2341 pub fn send_no_shutdown_on_err(self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
2343 let _result = self.send_raw(config);
2344 self.drop_without_shutdown();
2345 _result
2346 }
2347
2348 fn send_raw(&self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
2349 self.control_handle.inner.send::<FeatureGetFeatureConfigResponse>(
2350 (config,),
2351 self.tx_id,
2352 0x2ab1896aea843611,
2353 fidl::encoding::DynamicFlags::empty(),
2354 )
2355 }
2356}
2357
2358#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2359pub struct FeatureConnectorMarker;
2360
2361impl fidl::endpoints::ProtocolMarker for FeatureConnectorMarker {
2362 type Proxy = FeatureConnectorProxy;
2363 type RequestStream = FeatureConnectorRequestStream;
2364 #[cfg(target_os = "fuchsia")]
2365 type SynchronousProxy = FeatureConnectorSynchronousProxy;
2366
2367 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.FeatureConnector";
2368}
2369impl fidl::endpoints::DiscoverableProtocolMarker for FeatureConnectorMarker {}
2370
2371pub trait FeatureConnectorProxyInterface: Send + Sync {
2372 fn r#connect(
2373 &self,
2374 name: &str,
2375 server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2376 ) -> Result<(), fidl::Error>;
2377}
2378#[derive(Debug)]
2379#[cfg(target_os = "fuchsia")]
2380pub struct FeatureConnectorSynchronousProxy {
2381 client: fidl::client::sync::Client,
2382}
2383
2384#[cfg(target_os = "fuchsia")]
2385impl fidl::endpoints::SynchronousProxy for FeatureConnectorSynchronousProxy {
2386 type Proxy = FeatureConnectorProxy;
2387 type Protocol = FeatureConnectorMarker;
2388
2389 fn from_channel(inner: fidl::Channel) -> Self {
2390 Self::new(inner)
2391 }
2392
2393 fn into_channel(self) -> fidl::Channel {
2394 self.client.into_channel()
2395 }
2396
2397 fn as_channel(&self) -> &fidl::Channel {
2398 self.client.as_channel()
2399 }
2400}
2401
2402#[cfg(target_os = "fuchsia")]
2403impl FeatureConnectorSynchronousProxy {
2404 pub fn new(channel: fidl::Channel) -> Self {
2405 let protocol_name = <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2406 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2407 }
2408
2409 pub fn into_channel(self) -> fidl::Channel {
2410 self.client.into_channel()
2411 }
2412
2413 pub fn wait_for_event(
2416 &self,
2417 deadline: zx::MonotonicInstant,
2418 ) -> Result<FeatureConnectorEvent, fidl::Error> {
2419 FeatureConnectorEvent::decode(self.client.wait_for_event(deadline)?)
2420 }
2421
2422 pub fn r#connect(
2439 &self,
2440 mut name: &str,
2441 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2442 ) -> Result<(), fidl::Error> {
2443 self.client.send::<FeatureConnectorConnectRequest>(
2444 (name, server_end),
2445 0x470f006d630987a5,
2446 fidl::encoding::DynamicFlags::empty(),
2447 )
2448 }
2449}
2450
2451#[cfg(target_os = "fuchsia")]
2452impl From<FeatureConnectorSynchronousProxy> for zx::Handle {
2453 fn from(value: FeatureConnectorSynchronousProxy) -> Self {
2454 value.into_channel().into()
2455 }
2456}
2457
2458#[cfg(target_os = "fuchsia")]
2459impl From<fidl::Channel> for FeatureConnectorSynchronousProxy {
2460 fn from(value: fidl::Channel) -> Self {
2461 Self::new(value)
2462 }
2463}
2464
2465#[cfg(target_os = "fuchsia")]
2466impl fidl::endpoints::FromClient for FeatureConnectorSynchronousProxy {
2467 type Protocol = FeatureConnectorMarker;
2468
2469 fn from_client(value: fidl::endpoints::ClientEnd<FeatureConnectorMarker>) -> Self {
2470 Self::new(value.into_channel())
2471 }
2472}
2473
2474#[derive(Debug, Clone)]
2475pub struct FeatureConnectorProxy {
2476 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2477}
2478
2479impl fidl::endpoints::Proxy for FeatureConnectorProxy {
2480 type Protocol = FeatureConnectorMarker;
2481
2482 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2483 Self::new(inner)
2484 }
2485
2486 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2487 self.client.into_channel().map_err(|client| Self { client })
2488 }
2489
2490 fn as_channel(&self) -> &::fidl::AsyncChannel {
2491 self.client.as_channel()
2492 }
2493}
2494
2495impl FeatureConnectorProxy {
2496 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2498 let protocol_name = <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2499 Self { client: fidl::client::Client::new(channel, protocol_name) }
2500 }
2501
2502 pub fn take_event_stream(&self) -> FeatureConnectorEventStream {
2508 FeatureConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2509 }
2510
2511 pub fn r#connect(
2528 &self,
2529 mut name: &str,
2530 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2531 ) -> Result<(), fidl::Error> {
2532 FeatureConnectorProxyInterface::r#connect(self, name, server_end)
2533 }
2534}
2535
2536impl FeatureConnectorProxyInterface for FeatureConnectorProxy {
2537 fn r#connect(
2538 &self,
2539 mut name: &str,
2540 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2541 ) -> Result<(), fidl::Error> {
2542 self.client.send::<FeatureConnectorConnectRequest>(
2543 (name, server_end),
2544 0x470f006d630987a5,
2545 fidl::encoding::DynamicFlags::empty(),
2546 )
2547 }
2548}
2549
2550pub struct FeatureConnectorEventStream {
2551 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2552}
2553
2554impl std::marker::Unpin for FeatureConnectorEventStream {}
2555
2556impl futures::stream::FusedStream for FeatureConnectorEventStream {
2557 fn is_terminated(&self) -> bool {
2558 self.event_receiver.is_terminated()
2559 }
2560}
2561
2562impl futures::Stream for FeatureConnectorEventStream {
2563 type Item = Result<FeatureConnectorEvent, fidl::Error>;
2564
2565 fn poll_next(
2566 mut self: std::pin::Pin<&mut Self>,
2567 cx: &mut std::task::Context<'_>,
2568 ) -> std::task::Poll<Option<Self::Item>> {
2569 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2570 &mut self.event_receiver,
2571 cx
2572 )?) {
2573 Some(buf) => std::task::Poll::Ready(Some(FeatureConnectorEvent::decode(buf))),
2574 None => std::task::Poll::Ready(None),
2575 }
2576 }
2577}
2578
2579#[derive(Debug)]
2580pub enum FeatureConnectorEvent {}
2581
2582impl FeatureConnectorEvent {
2583 fn decode(
2585 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2586 ) -> Result<FeatureConnectorEvent, fidl::Error> {
2587 let (bytes, _handles) = buf.split_mut();
2588 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2589 debug_assert_eq!(tx_header.tx_id, 0);
2590 match tx_header.ordinal {
2591 _ => Err(fidl::Error::UnknownOrdinal {
2592 ordinal: tx_header.ordinal,
2593 protocol_name:
2594 <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2595 }),
2596 }
2597 }
2598}
2599
2600pub struct FeatureConnectorRequestStream {
2602 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2603 is_terminated: bool,
2604}
2605
2606impl std::marker::Unpin for FeatureConnectorRequestStream {}
2607
2608impl futures::stream::FusedStream for FeatureConnectorRequestStream {
2609 fn is_terminated(&self) -> bool {
2610 self.is_terminated
2611 }
2612}
2613
2614impl fidl::endpoints::RequestStream for FeatureConnectorRequestStream {
2615 type Protocol = FeatureConnectorMarker;
2616 type ControlHandle = FeatureConnectorControlHandle;
2617
2618 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2619 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2620 }
2621
2622 fn control_handle(&self) -> Self::ControlHandle {
2623 FeatureConnectorControlHandle { inner: self.inner.clone() }
2624 }
2625
2626 fn into_inner(
2627 self,
2628 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2629 {
2630 (self.inner, self.is_terminated)
2631 }
2632
2633 fn from_inner(
2634 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2635 is_terminated: bool,
2636 ) -> Self {
2637 Self { inner, is_terminated }
2638 }
2639}
2640
2641impl futures::Stream for FeatureConnectorRequestStream {
2642 type Item = Result<FeatureConnectorRequest, fidl::Error>;
2643
2644 fn poll_next(
2645 mut self: std::pin::Pin<&mut Self>,
2646 cx: &mut std::task::Context<'_>,
2647 ) -> std::task::Poll<Option<Self::Item>> {
2648 let this = &mut *self;
2649 if this.inner.check_shutdown(cx) {
2650 this.is_terminated = true;
2651 return std::task::Poll::Ready(None);
2652 }
2653 if this.is_terminated {
2654 panic!("polled FeatureConnectorRequestStream after completion");
2655 }
2656 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2657 |bytes, handles| {
2658 match this.inner.channel().read_etc(cx, bytes, handles) {
2659 std::task::Poll::Ready(Ok(())) => {}
2660 std::task::Poll::Pending => return std::task::Poll::Pending,
2661 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2662 this.is_terminated = true;
2663 return std::task::Poll::Ready(None);
2664 }
2665 std::task::Poll::Ready(Err(e)) => {
2666 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2667 e.into(),
2668 ))))
2669 }
2670 }
2671
2672 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2674
2675 std::task::Poll::Ready(Some(match header.ordinal {
2676 0x470f006d630987a5 => {
2677 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2678 let mut req = fidl::new_empty!(
2679 FeatureConnectorConnectRequest,
2680 fidl::encoding::DefaultFuchsiaResourceDialect
2681 );
2682 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FeatureConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2683 let control_handle =
2684 FeatureConnectorControlHandle { inner: this.inner.clone() };
2685 Ok(FeatureConnectorRequest::Connect {
2686 name: req.name,
2687 server_end: req.server_end,
2688
2689 control_handle,
2690 })
2691 }
2692 _ => Err(fidl::Error::UnknownOrdinal {
2693 ordinal: header.ordinal,
2694 protocol_name:
2695 <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2696 }),
2697 }))
2698 },
2699 )
2700 }
2701}
2702
2703#[derive(Debug)]
2705pub enum FeatureConnectorRequest {
2706 Connect {
2723 name: String,
2724 server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
2725 control_handle: FeatureConnectorControlHandle,
2726 },
2727}
2728
2729impl FeatureConnectorRequest {
2730 #[allow(irrefutable_let_patterns)]
2731 pub fn into_connect(
2732 self,
2733 ) -> Option<(String, fidl::endpoints::ServerEnd<FeatureMarker>, FeatureConnectorControlHandle)>
2734 {
2735 if let FeatureConnectorRequest::Connect { name, server_end, control_handle } = self {
2736 Some((name, server_end, control_handle))
2737 } else {
2738 None
2739 }
2740 }
2741
2742 pub fn method_name(&self) -> &'static str {
2744 match *self {
2745 FeatureConnectorRequest::Connect { .. } => "connect",
2746 }
2747 }
2748}
2749
2750#[derive(Debug, Clone)]
2751pub struct FeatureConnectorControlHandle {
2752 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2753}
2754
2755impl fidl::endpoints::ControlHandle for FeatureConnectorControlHandle {
2756 fn shutdown(&self) {
2757 self.inner.shutdown()
2758 }
2759 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2760 self.inner.shutdown_with_epitaph(status)
2761 }
2762
2763 fn is_closed(&self) -> bool {
2764 self.inner.channel().is_closed()
2765 }
2766 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2767 self.inner.channel().on_closed()
2768 }
2769
2770 #[cfg(target_os = "fuchsia")]
2771 fn signal_peer(
2772 &self,
2773 clear_mask: zx::Signals,
2774 set_mask: zx::Signals,
2775 ) -> Result<(), zx_status::Status> {
2776 use fidl::Peered;
2777 self.inner.channel().signal_peer(clear_mask, set_mask)
2778 }
2779}
2780
2781impl FeatureConnectorControlHandle {}
2782
2783#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2784pub struct MeshcopMarker;
2785
2786impl fidl::endpoints::ProtocolMarker for MeshcopMarker {
2787 type Proxy = MeshcopProxy;
2788 type RequestStream = MeshcopRequestStream;
2789 #[cfg(target_os = "fuchsia")]
2790 type SynchronousProxy = MeshcopSynchronousProxy;
2791
2792 const DEBUG_NAME: &'static str = "(anonymous) Meshcop";
2793}
2794
2795pub trait MeshcopProxyInterface: Send + Sync {
2796 type UpdateTxtEntriesResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2797 fn r#update_txt_entries(&self, txt_entries: &[TxtEntries])
2798 -> Self::UpdateTxtEntriesResponseFut;
2799}
2800#[derive(Debug)]
2801#[cfg(target_os = "fuchsia")]
2802pub struct MeshcopSynchronousProxy {
2803 client: fidl::client::sync::Client,
2804}
2805
2806#[cfg(target_os = "fuchsia")]
2807impl fidl::endpoints::SynchronousProxy for MeshcopSynchronousProxy {
2808 type Proxy = MeshcopProxy;
2809 type Protocol = MeshcopMarker;
2810
2811 fn from_channel(inner: fidl::Channel) -> Self {
2812 Self::new(inner)
2813 }
2814
2815 fn into_channel(self) -> fidl::Channel {
2816 self.client.into_channel()
2817 }
2818
2819 fn as_channel(&self) -> &fidl::Channel {
2820 self.client.as_channel()
2821 }
2822}
2823
2824#[cfg(target_os = "fuchsia")]
2825impl MeshcopSynchronousProxy {
2826 pub fn new(channel: fidl::Channel) -> Self {
2827 let protocol_name = <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2828 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2829 }
2830
2831 pub fn into_channel(self) -> fidl::Channel {
2832 self.client.into_channel()
2833 }
2834
2835 pub fn wait_for_event(
2838 &self,
2839 deadline: zx::MonotonicInstant,
2840 ) -> Result<MeshcopEvent, fidl::Error> {
2841 MeshcopEvent::decode(self.client.wait_for_event(deadline)?)
2842 }
2843
2844 pub fn r#update_txt_entries(
2868 &self,
2869 mut txt_entries: &[TxtEntries],
2870 ___deadline: zx::MonotonicInstant,
2871 ) -> Result<(), fidl::Error> {
2872 let _response = self
2873 .client
2874 .send_query::<MeshcopUpdateTxtEntriesRequest, fidl::encoding::EmptyPayload>(
2875 (txt_entries,),
2876 0x358d4d9593140bed,
2877 fidl::encoding::DynamicFlags::empty(),
2878 ___deadline,
2879 )?;
2880 Ok(_response)
2881 }
2882}
2883
2884#[cfg(target_os = "fuchsia")]
2885impl From<MeshcopSynchronousProxy> for zx::Handle {
2886 fn from(value: MeshcopSynchronousProxy) -> Self {
2887 value.into_channel().into()
2888 }
2889}
2890
2891#[cfg(target_os = "fuchsia")]
2892impl From<fidl::Channel> for MeshcopSynchronousProxy {
2893 fn from(value: fidl::Channel) -> Self {
2894 Self::new(value)
2895 }
2896}
2897
2898#[cfg(target_os = "fuchsia")]
2899impl fidl::endpoints::FromClient for MeshcopSynchronousProxy {
2900 type Protocol = MeshcopMarker;
2901
2902 fn from_client(value: fidl::endpoints::ClientEnd<MeshcopMarker>) -> Self {
2903 Self::new(value.into_channel())
2904 }
2905}
2906
2907#[derive(Debug, Clone)]
2908pub struct MeshcopProxy {
2909 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2910}
2911
2912impl fidl::endpoints::Proxy for MeshcopProxy {
2913 type Protocol = MeshcopMarker;
2914
2915 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2916 Self::new(inner)
2917 }
2918
2919 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2920 self.client.into_channel().map_err(|client| Self { client })
2921 }
2922
2923 fn as_channel(&self) -> &::fidl::AsyncChannel {
2924 self.client.as_channel()
2925 }
2926}
2927
2928impl MeshcopProxy {
2929 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2931 let protocol_name = <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2932 Self { client: fidl::client::Client::new(channel, protocol_name) }
2933 }
2934
2935 pub fn take_event_stream(&self) -> MeshcopEventStream {
2941 MeshcopEventStream { event_receiver: self.client.take_event_receiver() }
2942 }
2943
2944 pub fn r#update_txt_entries(
2968 &self,
2969 mut txt_entries: &[TxtEntries],
2970 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2971 MeshcopProxyInterface::r#update_txt_entries(self, txt_entries)
2972 }
2973}
2974
2975impl MeshcopProxyInterface for MeshcopProxy {
2976 type UpdateTxtEntriesResponseFut =
2977 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2978 fn r#update_txt_entries(
2979 &self,
2980 mut txt_entries: &[TxtEntries],
2981 ) -> Self::UpdateTxtEntriesResponseFut {
2982 fn _decode(
2983 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2984 ) -> Result<(), fidl::Error> {
2985 let _response = fidl::client::decode_transaction_body::<
2986 fidl::encoding::EmptyPayload,
2987 fidl::encoding::DefaultFuchsiaResourceDialect,
2988 0x358d4d9593140bed,
2989 >(_buf?)?;
2990 Ok(_response)
2991 }
2992 self.client.send_query_and_decode::<MeshcopUpdateTxtEntriesRequest, ()>(
2993 (txt_entries,),
2994 0x358d4d9593140bed,
2995 fidl::encoding::DynamicFlags::empty(),
2996 _decode,
2997 )
2998 }
2999}
3000
3001pub struct MeshcopEventStream {
3002 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3003}
3004
3005impl std::marker::Unpin for MeshcopEventStream {}
3006
3007impl futures::stream::FusedStream for MeshcopEventStream {
3008 fn is_terminated(&self) -> bool {
3009 self.event_receiver.is_terminated()
3010 }
3011}
3012
3013impl futures::Stream for MeshcopEventStream {
3014 type Item = Result<MeshcopEvent, fidl::Error>;
3015
3016 fn poll_next(
3017 mut self: std::pin::Pin<&mut Self>,
3018 cx: &mut std::task::Context<'_>,
3019 ) -> std::task::Poll<Option<Self::Item>> {
3020 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3021 &mut self.event_receiver,
3022 cx
3023 )?) {
3024 Some(buf) => std::task::Poll::Ready(Some(MeshcopEvent::decode(buf))),
3025 None => std::task::Poll::Ready(None),
3026 }
3027 }
3028}
3029
3030#[derive(Debug)]
3031pub enum MeshcopEvent {}
3032
3033impl MeshcopEvent {
3034 fn decode(
3036 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3037 ) -> Result<MeshcopEvent, fidl::Error> {
3038 let (bytes, _handles) = buf.split_mut();
3039 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3040 debug_assert_eq!(tx_header.tx_id, 0);
3041 match tx_header.ordinal {
3042 _ => Err(fidl::Error::UnknownOrdinal {
3043 ordinal: tx_header.ordinal,
3044 protocol_name: <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3045 }),
3046 }
3047 }
3048}
3049
3050pub struct MeshcopRequestStream {
3052 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3053 is_terminated: bool,
3054}
3055
3056impl std::marker::Unpin for MeshcopRequestStream {}
3057
3058impl futures::stream::FusedStream for MeshcopRequestStream {
3059 fn is_terminated(&self) -> bool {
3060 self.is_terminated
3061 }
3062}
3063
3064impl fidl::endpoints::RequestStream for MeshcopRequestStream {
3065 type Protocol = MeshcopMarker;
3066 type ControlHandle = MeshcopControlHandle;
3067
3068 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3069 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3070 }
3071
3072 fn control_handle(&self) -> Self::ControlHandle {
3073 MeshcopControlHandle { inner: self.inner.clone() }
3074 }
3075
3076 fn into_inner(
3077 self,
3078 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3079 {
3080 (self.inner, self.is_terminated)
3081 }
3082
3083 fn from_inner(
3084 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3085 is_terminated: bool,
3086 ) -> Self {
3087 Self { inner, is_terminated }
3088 }
3089}
3090
3091impl futures::Stream for MeshcopRequestStream {
3092 type Item = Result<MeshcopRequest, fidl::Error>;
3093
3094 fn poll_next(
3095 mut self: std::pin::Pin<&mut Self>,
3096 cx: &mut std::task::Context<'_>,
3097 ) -> std::task::Poll<Option<Self::Item>> {
3098 let this = &mut *self;
3099 if this.inner.check_shutdown(cx) {
3100 this.is_terminated = true;
3101 return std::task::Poll::Ready(None);
3102 }
3103 if this.is_terminated {
3104 panic!("polled MeshcopRequestStream after completion");
3105 }
3106 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3107 |bytes, handles| {
3108 match this.inner.channel().read_etc(cx, bytes, handles) {
3109 std::task::Poll::Ready(Ok(())) => {}
3110 std::task::Poll::Pending => return std::task::Poll::Pending,
3111 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3112 this.is_terminated = true;
3113 return std::task::Poll::Ready(None);
3114 }
3115 std::task::Poll::Ready(Err(e)) => {
3116 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3117 e.into(),
3118 ))))
3119 }
3120 }
3121
3122 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3124
3125 std::task::Poll::Ready(Some(match header.ordinal {
3126 0x358d4d9593140bed => {
3127 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3128 let mut req = fidl::new_empty!(
3129 MeshcopUpdateTxtEntriesRequest,
3130 fidl::encoding::DefaultFuchsiaResourceDialect
3131 );
3132 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MeshcopUpdateTxtEntriesRequest>(&header, _body_bytes, handles, &mut req)?;
3133 let control_handle = MeshcopControlHandle { inner: this.inner.clone() };
3134 Ok(MeshcopRequest::UpdateTxtEntries {
3135 txt_entries: req.txt_entries,
3136
3137 responder: MeshcopUpdateTxtEntriesResponder {
3138 control_handle: std::mem::ManuallyDrop::new(control_handle),
3139 tx_id: header.tx_id,
3140 },
3141 })
3142 }
3143 _ => Err(fidl::Error::UnknownOrdinal {
3144 ordinal: header.ordinal,
3145 protocol_name:
3146 <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3147 }),
3148 }))
3149 },
3150 )
3151 }
3152}
3153
3154#[derive(Debug)]
3156pub enum MeshcopRequest {
3157 UpdateTxtEntries { txt_entries: Vec<TxtEntries>, responder: MeshcopUpdateTxtEntriesResponder },
3181}
3182
3183impl MeshcopRequest {
3184 #[allow(irrefutable_let_patterns)]
3185 pub fn into_update_txt_entries(
3186 self,
3187 ) -> Option<(Vec<TxtEntries>, MeshcopUpdateTxtEntriesResponder)> {
3188 if let MeshcopRequest::UpdateTxtEntries { txt_entries, responder } = self {
3189 Some((txt_entries, responder))
3190 } else {
3191 None
3192 }
3193 }
3194
3195 pub fn method_name(&self) -> &'static str {
3197 match *self {
3198 MeshcopRequest::UpdateTxtEntries { .. } => "update_txt_entries",
3199 }
3200 }
3201}
3202
3203#[derive(Debug, Clone)]
3204pub struct MeshcopControlHandle {
3205 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3206}
3207
3208impl fidl::endpoints::ControlHandle for MeshcopControlHandle {
3209 fn shutdown(&self) {
3210 self.inner.shutdown()
3211 }
3212 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3213 self.inner.shutdown_with_epitaph(status)
3214 }
3215
3216 fn is_closed(&self) -> bool {
3217 self.inner.channel().is_closed()
3218 }
3219 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3220 self.inner.channel().on_closed()
3221 }
3222
3223 #[cfg(target_os = "fuchsia")]
3224 fn signal_peer(
3225 &self,
3226 clear_mask: zx::Signals,
3227 set_mask: zx::Signals,
3228 ) -> Result<(), zx_status::Status> {
3229 use fidl::Peered;
3230 self.inner.channel().signal_peer(clear_mask, set_mask)
3231 }
3232}
3233
3234impl MeshcopControlHandle {}
3235
3236#[must_use = "FIDL methods require a response to be sent"]
3237#[derive(Debug)]
3238pub struct MeshcopUpdateTxtEntriesResponder {
3239 control_handle: std::mem::ManuallyDrop<MeshcopControlHandle>,
3240 tx_id: u32,
3241}
3242
3243impl std::ops::Drop for MeshcopUpdateTxtEntriesResponder {
3247 fn drop(&mut self) {
3248 self.control_handle.shutdown();
3249 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3251 }
3252}
3253
3254impl fidl::endpoints::Responder for MeshcopUpdateTxtEntriesResponder {
3255 type ControlHandle = MeshcopControlHandle;
3256
3257 fn control_handle(&self) -> &MeshcopControlHandle {
3258 &self.control_handle
3259 }
3260
3261 fn drop_without_shutdown(mut self) {
3262 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3264 std::mem::forget(self);
3266 }
3267}
3268
3269impl MeshcopUpdateTxtEntriesResponder {
3270 pub fn send(self) -> Result<(), fidl::Error> {
3274 let _result = self.send_raw();
3275 if _result.is_err() {
3276 self.control_handle.shutdown();
3277 }
3278 self.drop_without_shutdown();
3279 _result
3280 }
3281
3282 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3284 let _result = self.send_raw();
3285 self.drop_without_shutdown();
3286 _result
3287 }
3288
3289 fn send_raw(&self) -> Result<(), fidl::Error> {
3290 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3291 (),
3292 self.tx_id,
3293 0x358d4d9593140bed,
3294 fidl::encoding::DynamicFlags::empty(),
3295 )
3296 }
3297}
3298
3299#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3300pub struct MeshcopConnectorMarker;
3301
3302impl fidl::endpoints::ProtocolMarker for MeshcopConnectorMarker {
3303 type Proxy = MeshcopConnectorProxy;
3304 type RequestStream = MeshcopConnectorRequestStream;
3305 #[cfg(target_os = "fuchsia")]
3306 type SynchronousProxy = MeshcopConnectorSynchronousProxy;
3307
3308 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.MeshcopConnector";
3309}
3310impl fidl::endpoints::DiscoverableProtocolMarker for MeshcopConnectorMarker {}
3311
3312pub trait MeshcopConnectorProxyInterface: Send + Sync {
3313 fn r#connect(
3314 &self,
3315 name: &str,
3316 server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3317 ) -> Result<(), fidl::Error>;
3318}
3319#[derive(Debug)]
3320#[cfg(target_os = "fuchsia")]
3321pub struct MeshcopConnectorSynchronousProxy {
3322 client: fidl::client::sync::Client,
3323}
3324
3325#[cfg(target_os = "fuchsia")]
3326impl fidl::endpoints::SynchronousProxy for MeshcopConnectorSynchronousProxy {
3327 type Proxy = MeshcopConnectorProxy;
3328 type Protocol = MeshcopConnectorMarker;
3329
3330 fn from_channel(inner: fidl::Channel) -> Self {
3331 Self::new(inner)
3332 }
3333
3334 fn into_channel(self) -> fidl::Channel {
3335 self.client.into_channel()
3336 }
3337
3338 fn as_channel(&self) -> &fidl::Channel {
3339 self.client.as_channel()
3340 }
3341}
3342
3343#[cfg(target_os = "fuchsia")]
3344impl MeshcopConnectorSynchronousProxy {
3345 pub fn new(channel: fidl::Channel) -> Self {
3346 let protocol_name = <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3347 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3348 }
3349
3350 pub fn into_channel(self) -> fidl::Channel {
3351 self.client.into_channel()
3352 }
3353
3354 pub fn wait_for_event(
3357 &self,
3358 deadline: zx::MonotonicInstant,
3359 ) -> Result<MeshcopConnectorEvent, fidl::Error> {
3360 MeshcopConnectorEvent::decode(self.client.wait_for_event(deadline)?)
3361 }
3362
3363 pub fn r#connect(
3380 &self,
3381 mut name: &str,
3382 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3383 ) -> Result<(), fidl::Error> {
3384 self.client.send::<MeshcopConnectorConnectRequest>(
3385 (name, server_end),
3386 0x53f87536b40ad6fb,
3387 fidl::encoding::DynamicFlags::empty(),
3388 )
3389 }
3390}
3391
3392#[cfg(target_os = "fuchsia")]
3393impl From<MeshcopConnectorSynchronousProxy> for zx::Handle {
3394 fn from(value: MeshcopConnectorSynchronousProxy) -> Self {
3395 value.into_channel().into()
3396 }
3397}
3398
3399#[cfg(target_os = "fuchsia")]
3400impl From<fidl::Channel> for MeshcopConnectorSynchronousProxy {
3401 fn from(value: fidl::Channel) -> Self {
3402 Self::new(value)
3403 }
3404}
3405
3406#[cfg(target_os = "fuchsia")]
3407impl fidl::endpoints::FromClient for MeshcopConnectorSynchronousProxy {
3408 type Protocol = MeshcopConnectorMarker;
3409
3410 fn from_client(value: fidl::endpoints::ClientEnd<MeshcopConnectorMarker>) -> Self {
3411 Self::new(value.into_channel())
3412 }
3413}
3414
3415#[derive(Debug, Clone)]
3416pub struct MeshcopConnectorProxy {
3417 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3418}
3419
3420impl fidl::endpoints::Proxy for MeshcopConnectorProxy {
3421 type Protocol = MeshcopConnectorMarker;
3422
3423 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3424 Self::new(inner)
3425 }
3426
3427 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3428 self.client.into_channel().map_err(|client| Self { client })
3429 }
3430
3431 fn as_channel(&self) -> &::fidl::AsyncChannel {
3432 self.client.as_channel()
3433 }
3434}
3435
3436impl MeshcopConnectorProxy {
3437 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3439 let protocol_name = <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3440 Self { client: fidl::client::Client::new(channel, protocol_name) }
3441 }
3442
3443 pub fn take_event_stream(&self) -> MeshcopConnectorEventStream {
3449 MeshcopConnectorEventStream { event_receiver: self.client.take_event_receiver() }
3450 }
3451
3452 pub fn r#connect(
3469 &self,
3470 mut name: &str,
3471 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3472 ) -> Result<(), fidl::Error> {
3473 MeshcopConnectorProxyInterface::r#connect(self, name, server_end)
3474 }
3475}
3476
3477impl MeshcopConnectorProxyInterface for MeshcopConnectorProxy {
3478 fn r#connect(
3479 &self,
3480 mut name: &str,
3481 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3482 ) -> Result<(), fidl::Error> {
3483 self.client.send::<MeshcopConnectorConnectRequest>(
3484 (name, server_end),
3485 0x53f87536b40ad6fb,
3486 fidl::encoding::DynamicFlags::empty(),
3487 )
3488 }
3489}
3490
3491pub struct MeshcopConnectorEventStream {
3492 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3493}
3494
3495impl std::marker::Unpin for MeshcopConnectorEventStream {}
3496
3497impl futures::stream::FusedStream for MeshcopConnectorEventStream {
3498 fn is_terminated(&self) -> bool {
3499 self.event_receiver.is_terminated()
3500 }
3501}
3502
3503impl futures::Stream for MeshcopConnectorEventStream {
3504 type Item = Result<MeshcopConnectorEvent, fidl::Error>;
3505
3506 fn poll_next(
3507 mut self: std::pin::Pin<&mut Self>,
3508 cx: &mut std::task::Context<'_>,
3509 ) -> std::task::Poll<Option<Self::Item>> {
3510 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3511 &mut self.event_receiver,
3512 cx
3513 )?) {
3514 Some(buf) => std::task::Poll::Ready(Some(MeshcopConnectorEvent::decode(buf))),
3515 None => std::task::Poll::Ready(None),
3516 }
3517 }
3518}
3519
3520#[derive(Debug)]
3521pub enum MeshcopConnectorEvent {}
3522
3523impl MeshcopConnectorEvent {
3524 fn decode(
3526 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3527 ) -> Result<MeshcopConnectorEvent, fidl::Error> {
3528 let (bytes, _handles) = buf.split_mut();
3529 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3530 debug_assert_eq!(tx_header.tx_id, 0);
3531 match tx_header.ordinal {
3532 _ => Err(fidl::Error::UnknownOrdinal {
3533 ordinal: tx_header.ordinal,
3534 protocol_name:
3535 <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3536 }),
3537 }
3538 }
3539}
3540
3541pub struct MeshcopConnectorRequestStream {
3543 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3544 is_terminated: bool,
3545}
3546
3547impl std::marker::Unpin for MeshcopConnectorRequestStream {}
3548
3549impl futures::stream::FusedStream for MeshcopConnectorRequestStream {
3550 fn is_terminated(&self) -> bool {
3551 self.is_terminated
3552 }
3553}
3554
3555impl fidl::endpoints::RequestStream for MeshcopConnectorRequestStream {
3556 type Protocol = MeshcopConnectorMarker;
3557 type ControlHandle = MeshcopConnectorControlHandle;
3558
3559 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3560 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3561 }
3562
3563 fn control_handle(&self) -> Self::ControlHandle {
3564 MeshcopConnectorControlHandle { inner: self.inner.clone() }
3565 }
3566
3567 fn into_inner(
3568 self,
3569 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3570 {
3571 (self.inner, self.is_terminated)
3572 }
3573
3574 fn from_inner(
3575 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3576 is_terminated: bool,
3577 ) -> Self {
3578 Self { inner, is_terminated }
3579 }
3580}
3581
3582impl futures::Stream for MeshcopConnectorRequestStream {
3583 type Item = Result<MeshcopConnectorRequest, fidl::Error>;
3584
3585 fn poll_next(
3586 mut self: std::pin::Pin<&mut Self>,
3587 cx: &mut std::task::Context<'_>,
3588 ) -> std::task::Poll<Option<Self::Item>> {
3589 let this = &mut *self;
3590 if this.inner.check_shutdown(cx) {
3591 this.is_terminated = true;
3592 return std::task::Poll::Ready(None);
3593 }
3594 if this.is_terminated {
3595 panic!("polled MeshcopConnectorRequestStream after completion");
3596 }
3597 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3598 |bytes, handles| {
3599 match this.inner.channel().read_etc(cx, bytes, handles) {
3600 std::task::Poll::Ready(Ok(())) => {}
3601 std::task::Poll::Pending => return std::task::Poll::Pending,
3602 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3603 this.is_terminated = true;
3604 return std::task::Poll::Ready(None);
3605 }
3606 std::task::Poll::Ready(Err(e)) => {
3607 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3608 e.into(),
3609 ))))
3610 }
3611 }
3612
3613 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3615
3616 std::task::Poll::Ready(Some(match header.ordinal {
3617 0x53f87536b40ad6fb => {
3618 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3619 let mut req = fidl::new_empty!(
3620 MeshcopConnectorConnectRequest,
3621 fidl::encoding::DefaultFuchsiaResourceDialect
3622 );
3623 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MeshcopConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
3624 let control_handle =
3625 MeshcopConnectorControlHandle { inner: this.inner.clone() };
3626 Ok(MeshcopConnectorRequest::Connect {
3627 name: req.name,
3628 server_end: req.server_end,
3629
3630 control_handle,
3631 })
3632 }
3633 _ => Err(fidl::Error::UnknownOrdinal {
3634 ordinal: header.ordinal,
3635 protocol_name:
3636 <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3637 }),
3638 }))
3639 },
3640 )
3641 }
3642}
3643
3644#[derive(Debug)]
3646pub enum MeshcopConnectorRequest {
3647 Connect {
3664 name: String,
3665 server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
3666 control_handle: MeshcopConnectorControlHandle,
3667 },
3668}
3669
3670impl MeshcopConnectorRequest {
3671 #[allow(irrefutable_let_patterns)]
3672 pub fn into_connect(
3673 self,
3674 ) -> Option<(String, fidl::endpoints::ServerEnd<MeshcopMarker>, MeshcopConnectorControlHandle)>
3675 {
3676 if let MeshcopConnectorRequest::Connect { name, server_end, control_handle } = self {
3677 Some((name, server_end, control_handle))
3678 } else {
3679 None
3680 }
3681 }
3682
3683 pub fn method_name(&self) -> &'static str {
3685 match *self {
3686 MeshcopConnectorRequest::Connect { .. } => "connect",
3687 }
3688 }
3689}
3690
3691#[derive(Debug, Clone)]
3692pub struct MeshcopConnectorControlHandle {
3693 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3694}
3695
3696impl fidl::endpoints::ControlHandle for MeshcopConnectorControlHandle {
3697 fn shutdown(&self) {
3698 self.inner.shutdown()
3699 }
3700 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3701 self.inner.shutdown_with_epitaph(status)
3702 }
3703
3704 fn is_closed(&self) -> bool {
3705 self.inner.channel().is_closed()
3706 }
3707 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3708 self.inner.channel().on_closed()
3709 }
3710
3711 #[cfg(target_os = "fuchsia")]
3712 fn signal_peer(
3713 &self,
3714 clear_mask: zx::Signals,
3715 set_mask: zx::Signals,
3716 ) -> Result<(), zx_status::Status> {
3717 use fidl::Peered;
3718 self.inner.channel().signal_peer(clear_mask, set_mask)
3719 }
3720}
3721
3722impl MeshcopConnectorControlHandle {}
3723
3724#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3725pub struct ThreadCapabilitiesMarker;
3726
3727impl fidl::endpoints::ProtocolMarker for ThreadCapabilitiesMarker {
3728 type Proxy = ThreadCapabilitiesProxy;
3729 type RequestStream = ThreadCapabilitiesRequestStream;
3730 #[cfg(target_os = "fuchsia")]
3731 type SynchronousProxy = ThreadCapabilitiesSynchronousProxy;
3732
3733 const DEBUG_NAME: &'static str = "(anonymous) ThreadCapabilities";
3734}
3735
3736pub trait ThreadCapabilitiesProxyInterface: Send + Sync {
3737 type GetCapabilitiesResponseFut: std::future::Future<Output = Result<Capabilities, fidl::Error>>
3738 + Send;
3739 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
3740}
3741#[derive(Debug)]
3742#[cfg(target_os = "fuchsia")]
3743pub struct ThreadCapabilitiesSynchronousProxy {
3744 client: fidl::client::sync::Client,
3745}
3746
3747#[cfg(target_os = "fuchsia")]
3748impl fidl::endpoints::SynchronousProxy for ThreadCapabilitiesSynchronousProxy {
3749 type Proxy = ThreadCapabilitiesProxy;
3750 type Protocol = ThreadCapabilitiesMarker;
3751
3752 fn from_channel(inner: fidl::Channel) -> Self {
3753 Self::new(inner)
3754 }
3755
3756 fn into_channel(self) -> fidl::Channel {
3757 self.client.into_channel()
3758 }
3759
3760 fn as_channel(&self) -> &fidl::Channel {
3761 self.client.as_channel()
3762 }
3763}
3764
3765#[cfg(target_os = "fuchsia")]
3766impl ThreadCapabilitiesSynchronousProxy {
3767 pub fn new(channel: fidl::Channel) -> Self {
3768 let protocol_name =
3769 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3770 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3771 }
3772
3773 pub fn into_channel(self) -> fidl::Channel {
3774 self.client.into_channel()
3775 }
3776
3777 pub fn wait_for_event(
3780 &self,
3781 deadline: zx::MonotonicInstant,
3782 ) -> Result<ThreadCapabilitiesEvent, fidl::Error> {
3783 ThreadCapabilitiesEvent::decode(self.client.wait_for_event(deadline)?)
3784 }
3785
3786 pub fn r#get_capabilities(
3791 &self,
3792 ___deadline: zx::MonotonicInstant,
3793 ) -> Result<Capabilities, fidl::Error> {
3794 let _response = self
3795 .client
3796 .send_query::<fidl::encoding::EmptyPayload, ThreadCapabilitiesGetCapabilitiesResponse>(
3797 (),
3798 0x5a0823ac35f2d425,
3799 fidl::encoding::DynamicFlags::empty(),
3800 ___deadline,
3801 )?;
3802 Ok(_response.capabilities)
3803 }
3804}
3805
3806#[cfg(target_os = "fuchsia")]
3807impl From<ThreadCapabilitiesSynchronousProxy> for zx::Handle {
3808 fn from(value: ThreadCapabilitiesSynchronousProxy) -> Self {
3809 value.into_channel().into()
3810 }
3811}
3812
3813#[cfg(target_os = "fuchsia")]
3814impl From<fidl::Channel> for ThreadCapabilitiesSynchronousProxy {
3815 fn from(value: fidl::Channel) -> Self {
3816 Self::new(value)
3817 }
3818}
3819
3820#[cfg(target_os = "fuchsia")]
3821impl fidl::endpoints::FromClient for ThreadCapabilitiesSynchronousProxy {
3822 type Protocol = ThreadCapabilitiesMarker;
3823
3824 fn from_client(value: fidl::endpoints::ClientEnd<ThreadCapabilitiesMarker>) -> Self {
3825 Self::new(value.into_channel())
3826 }
3827}
3828
3829#[derive(Debug, Clone)]
3830pub struct ThreadCapabilitiesProxy {
3831 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3832}
3833
3834impl fidl::endpoints::Proxy for ThreadCapabilitiesProxy {
3835 type Protocol = ThreadCapabilitiesMarker;
3836
3837 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3838 Self::new(inner)
3839 }
3840
3841 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3842 self.client.into_channel().map_err(|client| Self { client })
3843 }
3844
3845 fn as_channel(&self) -> &::fidl::AsyncChannel {
3846 self.client.as_channel()
3847 }
3848}
3849
3850impl ThreadCapabilitiesProxy {
3851 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3853 let protocol_name =
3854 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3855 Self { client: fidl::client::Client::new(channel, protocol_name) }
3856 }
3857
3858 pub fn take_event_stream(&self) -> ThreadCapabilitiesEventStream {
3864 ThreadCapabilitiesEventStream { event_receiver: self.client.take_event_receiver() }
3865 }
3866
3867 pub fn r#get_capabilities(
3872 &self,
3873 ) -> fidl::client::QueryResponseFut<Capabilities, fidl::encoding::DefaultFuchsiaResourceDialect>
3874 {
3875 ThreadCapabilitiesProxyInterface::r#get_capabilities(self)
3876 }
3877}
3878
3879impl ThreadCapabilitiesProxyInterface for ThreadCapabilitiesProxy {
3880 type GetCapabilitiesResponseFut =
3881 fidl::client::QueryResponseFut<Capabilities, fidl::encoding::DefaultFuchsiaResourceDialect>;
3882 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
3883 fn _decode(
3884 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3885 ) -> Result<Capabilities, fidl::Error> {
3886 let _response = fidl::client::decode_transaction_body::<
3887 ThreadCapabilitiesGetCapabilitiesResponse,
3888 fidl::encoding::DefaultFuchsiaResourceDialect,
3889 0x5a0823ac35f2d425,
3890 >(_buf?)?;
3891 Ok(_response.capabilities)
3892 }
3893 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Capabilities>(
3894 (),
3895 0x5a0823ac35f2d425,
3896 fidl::encoding::DynamicFlags::empty(),
3897 _decode,
3898 )
3899 }
3900}
3901
3902pub struct ThreadCapabilitiesEventStream {
3903 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3904}
3905
3906impl std::marker::Unpin for ThreadCapabilitiesEventStream {}
3907
3908impl futures::stream::FusedStream for ThreadCapabilitiesEventStream {
3909 fn is_terminated(&self) -> bool {
3910 self.event_receiver.is_terminated()
3911 }
3912}
3913
3914impl futures::Stream for ThreadCapabilitiesEventStream {
3915 type Item = Result<ThreadCapabilitiesEvent, fidl::Error>;
3916
3917 fn poll_next(
3918 mut self: std::pin::Pin<&mut Self>,
3919 cx: &mut std::task::Context<'_>,
3920 ) -> std::task::Poll<Option<Self::Item>> {
3921 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3922 &mut self.event_receiver,
3923 cx
3924 )?) {
3925 Some(buf) => std::task::Poll::Ready(Some(ThreadCapabilitiesEvent::decode(buf))),
3926 None => std::task::Poll::Ready(None),
3927 }
3928 }
3929}
3930
3931#[derive(Debug)]
3932pub enum ThreadCapabilitiesEvent {}
3933
3934impl ThreadCapabilitiesEvent {
3935 fn decode(
3937 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3938 ) -> Result<ThreadCapabilitiesEvent, fidl::Error> {
3939 let (bytes, _handles) = buf.split_mut();
3940 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3941 debug_assert_eq!(tx_header.tx_id, 0);
3942 match tx_header.ordinal {
3943 _ => Err(fidl::Error::UnknownOrdinal {
3944 ordinal: tx_header.ordinal,
3945 protocol_name:
3946 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3947 }),
3948 }
3949 }
3950}
3951
3952pub struct ThreadCapabilitiesRequestStream {
3954 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3955 is_terminated: bool,
3956}
3957
3958impl std::marker::Unpin for ThreadCapabilitiesRequestStream {}
3959
3960impl futures::stream::FusedStream for ThreadCapabilitiesRequestStream {
3961 fn is_terminated(&self) -> bool {
3962 self.is_terminated
3963 }
3964}
3965
3966impl fidl::endpoints::RequestStream for ThreadCapabilitiesRequestStream {
3967 type Protocol = ThreadCapabilitiesMarker;
3968 type ControlHandle = ThreadCapabilitiesControlHandle;
3969
3970 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3971 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3972 }
3973
3974 fn control_handle(&self) -> Self::ControlHandle {
3975 ThreadCapabilitiesControlHandle { inner: self.inner.clone() }
3976 }
3977
3978 fn into_inner(
3979 self,
3980 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3981 {
3982 (self.inner, self.is_terminated)
3983 }
3984
3985 fn from_inner(
3986 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3987 is_terminated: bool,
3988 ) -> Self {
3989 Self { inner, is_terminated }
3990 }
3991}
3992
3993impl futures::Stream for ThreadCapabilitiesRequestStream {
3994 type Item = Result<ThreadCapabilitiesRequest, fidl::Error>;
3995
3996 fn poll_next(
3997 mut self: std::pin::Pin<&mut Self>,
3998 cx: &mut std::task::Context<'_>,
3999 ) -> std::task::Poll<Option<Self::Item>> {
4000 let this = &mut *self;
4001 if this.inner.check_shutdown(cx) {
4002 this.is_terminated = true;
4003 return std::task::Poll::Ready(None);
4004 }
4005 if this.is_terminated {
4006 panic!("polled ThreadCapabilitiesRequestStream after completion");
4007 }
4008 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4009 |bytes, handles| {
4010 match this.inner.channel().read_etc(cx, bytes, handles) {
4011 std::task::Poll::Ready(Ok(())) => {}
4012 std::task::Poll::Pending => return std::task::Poll::Pending,
4013 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4014 this.is_terminated = true;
4015 return std::task::Poll::Ready(None);
4016 }
4017 std::task::Poll::Ready(Err(e)) => {
4018 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4019 e.into(),
4020 ))))
4021 }
4022 }
4023
4024 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4026
4027 std::task::Poll::Ready(Some(match header.ordinal {
4028 0x5a0823ac35f2d425 => {
4029 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4030 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4031 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4032 let control_handle = ThreadCapabilitiesControlHandle {
4033 inner: this.inner.clone(),
4034 };
4035 Ok(ThreadCapabilitiesRequest::GetCapabilities {
4036 responder: ThreadCapabilitiesGetCapabilitiesResponder {
4037 control_handle: std::mem::ManuallyDrop::new(control_handle),
4038 tx_id: header.tx_id,
4039 },
4040 })
4041 }
4042 _ => Err(fidl::Error::UnknownOrdinal {
4043 ordinal: header.ordinal,
4044 protocol_name: <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4045 }),
4046 }))
4047 },
4048 )
4049 }
4050}
4051
4052#[derive(Debug)]
4054pub enum ThreadCapabilitiesRequest {
4055 GetCapabilities { responder: ThreadCapabilitiesGetCapabilitiesResponder },
4060}
4061
4062impl ThreadCapabilitiesRequest {
4063 #[allow(irrefutable_let_patterns)]
4064 pub fn into_get_capabilities(self) -> Option<(ThreadCapabilitiesGetCapabilitiesResponder)> {
4065 if let ThreadCapabilitiesRequest::GetCapabilities { responder } = self {
4066 Some((responder))
4067 } else {
4068 None
4069 }
4070 }
4071
4072 pub fn method_name(&self) -> &'static str {
4074 match *self {
4075 ThreadCapabilitiesRequest::GetCapabilities { .. } => "get_capabilities",
4076 }
4077 }
4078}
4079
4080#[derive(Debug, Clone)]
4081pub struct ThreadCapabilitiesControlHandle {
4082 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4083}
4084
4085impl fidl::endpoints::ControlHandle for ThreadCapabilitiesControlHandle {
4086 fn shutdown(&self) {
4087 self.inner.shutdown()
4088 }
4089 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4090 self.inner.shutdown_with_epitaph(status)
4091 }
4092
4093 fn is_closed(&self) -> bool {
4094 self.inner.channel().is_closed()
4095 }
4096 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4097 self.inner.channel().on_closed()
4098 }
4099
4100 #[cfg(target_os = "fuchsia")]
4101 fn signal_peer(
4102 &self,
4103 clear_mask: zx::Signals,
4104 set_mask: zx::Signals,
4105 ) -> Result<(), zx_status::Status> {
4106 use fidl::Peered;
4107 self.inner.channel().signal_peer(clear_mask, set_mask)
4108 }
4109}
4110
4111impl ThreadCapabilitiesControlHandle {}
4112
4113#[must_use = "FIDL methods require a response to be sent"]
4114#[derive(Debug)]
4115pub struct ThreadCapabilitiesGetCapabilitiesResponder {
4116 control_handle: std::mem::ManuallyDrop<ThreadCapabilitiesControlHandle>,
4117 tx_id: u32,
4118}
4119
4120impl std::ops::Drop for ThreadCapabilitiesGetCapabilitiesResponder {
4124 fn drop(&mut self) {
4125 self.control_handle.shutdown();
4126 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4128 }
4129}
4130
4131impl fidl::endpoints::Responder for ThreadCapabilitiesGetCapabilitiesResponder {
4132 type ControlHandle = ThreadCapabilitiesControlHandle;
4133
4134 fn control_handle(&self) -> &ThreadCapabilitiesControlHandle {
4135 &self.control_handle
4136 }
4137
4138 fn drop_without_shutdown(mut self) {
4139 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4141 std::mem::forget(self);
4143 }
4144}
4145
4146impl ThreadCapabilitiesGetCapabilitiesResponder {
4147 pub fn send(self, mut capabilities: &Capabilities) -> Result<(), fidl::Error> {
4151 let _result = self.send_raw(capabilities);
4152 if _result.is_err() {
4153 self.control_handle.shutdown();
4154 }
4155 self.drop_without_shutdown();
4156 _result
4157 }
4158
4159 pub fn send_no_shutdown_on_err(
4161 self,
4162 mut capabilities: &Capabilities,
4163 ) -> Result<(), fidl::Error> {
4164 let _result = self.send_raw(capabilities);
4165 self.drop_without_shutdown();
4166 _result
4167 }
4168
4169 fn send_raw(&self, mut capabilities: &Capabilities) -> Result<(), fidl::Error> {
4170 self.control_handle.inner.send::<ThreadCapabilitiesGetCapabilitiesResponse>(
4171 (capabilities,),
4172 self.tx_id,
4173 0x5a0823ac35f2d425,
4174 fidl::encoding::DynamicFlags::empty(),
4175 )
4176 }
4177}
4178
4179mod internal {
4180 use super::*;
4181
4182 impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorConnectRequest {
4183 type Borrowed<'a> = &'a mut Self;
4184 fn take_or_borrow<'a>(
4185 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4186 ) -> Self::Borrowed<'a> {
4187 value
4188 }
4189 }
4190
4191 unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorConnectRequest {
4192 type Owned = Self;
4193
4194 #[inline(always)]
4195 fn inline_align(_context: fidl::encoding::Context) -> usize {
4196 8
4197 }
4198
4199 #[inline(always)]
4200 fn inline_size(_context: fidl::encoding::Context) -> usize {
4201 24
4202 }
4203 }
4204
4205 unsafe impl
4206 fidl::encoding::Encode<
4207 CapabilitiesConnectorConnectRequest,
4208 fidl::encoding::DefaultFuchsiaResourceDialect,
4209 > for &mut CapabilitiesConnectorConnectRequest
4210 {
4211 #[inline]
4212 unsafe fn encode(
4213 self,
4214 encoder: &mut fidl::encoding::Encoder<
4215 '_,
4216 fidl::encoding::DefaultFuchsiaResourceDialect,
4217 >,
4218 offset: usize,
4219 _depth: fidl::encoding::Depth,
4220 ) -> fidl::Result<()> {
4221 encoder.debug_check_bounds::<CapabilitiesConnectorConnectRequest>(offset);
4222 fidl::encoding::Encode::<CapabilitiesConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4224 (
4225 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4226 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4227 ),
4228 encoder, offset, _depth
4229 )
4230 }
4231 }
4232 unsafe impl<
4233 T0: fidl::encoding::Encode<
4234 fidl::encoding::BoundedString<32>,
4235 fidl::encoding::DefaultFuchsiaResourceDialect,
4236 >,
4237 T1: fidl::encoding::Encode<
4238 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
4239 fidl::encoding::DefaultFuchsiaResourceDialect,
4240 >,
4241 >
4242 fidl::encoding::Encode<
4243 CapabilitiesConnectorConnectRequest,
4244 fidl::encoding::DefaultFuchsiaResourceDialect,
4245 > for (T0, T1)
4246 {
4247 #[inline]
4248 unsafe fn encode(
4249 self,
4250 encoder: &mut fidl::encoding::Encoder<
4251 '_,
4252 fidl::encoding::DefaultFuchsiaResourceDialect,
4253 >,
4254 offset: usize,
4255 depth: fidl::encoding::Depth,
4256 ) -> fidl::Result<()> {
4257 encoder.debug_check_bounds::<CapabilitiesConnectorConnectRequest>(offset);
4258 unsafe {
4261 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4262 (ptr as *mut u64).write_unaligned(0);
4263 }
4264 self.0.encode(encoder, offset + 0, depth)?;
4266 self.1.encode(encoder, offset + 16, depth)?;
4267 Ok(())
4268 }
4269 }
4270
4271 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4272 for CapabilitiesConnectorConnectRequest
4273 {
4274 #[inline(always)]
4275 fn new_empty() -> Self {
4276 Self {
4277 name: fidl::new_empty!(
4278 fidl::encoding::BoundedString<32>,
4279 fidl::encoding::DefaultFuchsiaResourceDialect
4280 ),
4281 server_end: fidl::new_empty!(
4282 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
4283 fidl::encoding::DefaultFuchsiaResourceDialect
4284 ),
4285 }
4286 }
4287
4288 #[inline]
4289 unsafe fn decode(
4290 &mut self,
4291 decoder: &mut fidl::encoding::Decoder<
4292 '_,
4293 fidl::encoding::DefaultFuchsiaResourceDialect,
4294 >,
4295 offset: usize,
4296 _depth: fidl::encoding::Depth,
4297 ) -> fidl::Result<()> {
4298 decoder.debug_check_bounds::<Self>(offset);
4299 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4301 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4302 let mask = 0xffffffff00000000u64;
4303 let maskedval = padval & mask;
4304 if maskedval != 0 {
4305 return Err(fidl::Error::NonZeroPadding {
4306 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4307 });
4308 }
4309 fidl::decode!(
4310 fidl::encoding::BoundedString<32>,
4311 fidl::encoding::DefaultFuchsiaResourceDialect,
4312 &mut self.name,
4313 decoder,
4314 offset + 0,
4315 _depth
4316 )?;
4317 fidl::decode!(
4318 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
4319 fidl::encoding::DefaultFuchsiaResourceDialect,
4320 &mut self.server_end,
4321 decoder,
4322 offset + 16,
4323 _depth
4324 )?;
4325 Ok(())
4326 }
4327 }
4328
4329 impl fidl::encoding::ResourceTypeMarker for DatasetConnectorConnectRequest {
4330 type Borrowed<'a> = &'a mut Self;
4331 fn take_or_borrow<'a>(
4332 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4333 ) -> Self::Borrowed<'a> {
4334 value
4335 }
4336 }
4337
4338 unsafe impl fidl::encoding::TypeMarker for DatasetConnectorConnectRequest {
4339 type Owned = Self;
4340
4341 #[inline(always)]
4342 fn inline_align(_context: fidl::encoding::Context) -> usize {
4343 8
4344 }
4345
4346 #[inline(always)]
4347 fn inline_size(_context: fidl::encoding::Context) -> usize {
4348 24
4349 }
4350 }
4351
4352 unsafe impl
4353 fidl::encoding::Encode<
4354 DatasetConnectorConnectRequest,
4355 fidl::encoding::DefaultFuchsiaResourceDialect,
4356 > for &mut DatasetConnectorConnectRequest
4357 {
4358 #[inline]
4359 unsafe fn encode(
4360 self,
4361 encoder: &mut fidl::encoding::Encoder<
4362 '_,
4363 fidl::encoding::DefaultFuchsiaResourceDialect,
4364 >,
4365 offset: usize,
4366 _depth: fidl::encoding::Depth,
4367 ) -> fidl::Result<()> {
4368 encoder.debug_check_bounds::<DatasetConnectorConnectRequest>(offset);
4369 fidl::encoding::Encode::<DatasetConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4371 (
4372 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4373 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4374 ),
4375 encoder, offset, _depth
4376 )
4377 }
4378 }
4379 unsafe impl<
4380 T0: fidl::encoding::Encode<
4381 fidl::encoding::BoundedString<32>,
4382 fidl::encoding::DefaultFuchsiaResourceDialect,
4383 >,
4384 T1: fidl::encoding::Encode<
4385 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
4386 fidl::encoding::DefaultFuchsiaResourceDialect,
4387 >,
4388 >
4389 fidl::encoding::Encode<
4390 DatasetConnectorConnectRequest,
4391 fidl::encoding::DefaultFuchsiaResourceDialect,
4392 > for (T0, T1)
4393 {
4394 #[inline]
4395 unsafe fn encode(
4396 self,
4397 encoder: &mut fidl::encoding::Encoder<
4398 '_,
4399 fidl::encoding::DefaultFuchsiaResourceDialect,
4400 >,
4401 offset: usize,
4402 depth: fidl::encoding::Depth,
4403 ) -> fidl::Result<()> {
4404 encoder.debug_check_bounds::<DatasetConnectorConnectRequest>(offset);
4405 unsafe {
4408 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4409 (ptr as *mut u64).write_unaligned(0);
4410 }
4411 self.0.encode(encoder, offset + 0, depth)?;
4413 self.1.encode(encoder, offset + 16, depth)?;
4414 Ok(())
4415 }
4416 }
4417
4418 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4419 for DatasetConnectorConnectRequest
4420 {
4421 #[inline(always)]
4422 fn new_empty() -> Self {
4423 Self {
4424 name: fidl::new_empty!(
4425 fidl::encoding::BoundedString<32>,
4426 fidl::encoding::DefaultFuchsiaResourceDialect
4427 ),
4428 server_end: fidl::new_empty!(
4429 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
4430 fidl::encoding::DefaultFuchsiaResourceDialect
4431 ),
4432 }
4433 }
4434
4435 #[inline]
4436 unsafe fn decode(
4437 &mut self,
4438 decoder: &mut fidl::encoding::Decoder<
4439 '_,
4440 fidl::encoding::DefaultFuchsiaResourceDialect,
4441 >,
4442 offset: usize,
4443 _depth: fidl::encoding::Depth,
4444 ) -> fidl::Result<()> {
4445 decoder.debug_check_bounds::<Self>(offset);
4446 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4448 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4449 let mask = 0xffffffff00000000u64;
4450 let maskedval = padval & mask;
4451 if maskedval != 0 {
4452 return Err(fidl::Error::NonZeroPadding {
4453 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4454 });
4455 }
4456 fidl::decode!(
4457 fidl::encoding::BoundedString<32>,
4458 fidl::encoding::DefaultFuchsiaResourceDialect,
4459 &mut self.name,
4460 decoder,
4461 offset + 0,
4462 _depth
4463 )?;
4464 fidl::decode!(
4465 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
4466 fidl::encoding::DefaultFuchsiaResourceDialect,
4467 &mut self.server_end,
4468 decoder,
4469 offset + 16,
4470 _depth
4471 )?;
4472 Ok(())
4473 }
4474 }
4475
4476 impl fidl::encoding::ResourceTypeMarker for FeatureConnectorConnectRequest {
4477 type Borrowed<'a> = &'a mut Self;
4478 fn take_or_borrow<'a>(
4479 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4480 ) -> Self::Borrowed<'a> {
4481 value
4482 }
4483 }
4484
4485 unsafe impl fidl::encoding::TypeMarker for FeatureConnectorConnectRequest {
4486 type Owned = Self;
4487
4488 #[inline(always)]
4489 fn inline_align(_context: fidl::encoding::Context) -> usize {
4490 8
4491 }
4492
4493 #[inline(always)]
4494 fn inline_size(_context: fidl::encoding::Context) -> usize {
4495 24
4496 }
4497 }
4498
4499 unsafe impl
4500 fidl::encoding::Encode<
4501 FeatureConnectorConnectRequest,
4502 fidl::encoding::DefaultFuchsiaResourceDialect,
4503 > for &mut FeatureConnectorConnectRequest
4504 {
4505 #[inline]
4506 unsafe fn encode(
4507 self,
4508 encoder: &mut fidl::encoding::Encoder<
4509 '_,
4510 fidl::encoding::DefaultFuchsiaResourceDialect,
4511 >,
4512 offset: usize,
4513 _depth: fidl::encoding::Depth,
4514 ) -> fidl::Result<()> {
4515 encoder.debug_check_bounds::<FeatureConnectorConnectRequest>(offset);
4516 fidl::encoding::Encode::<FeatureConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4518 (
4519 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4520 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4521 ),
4522 encoder, offset, _depth
4523 )
4524 }
4525 }
4526 unsafe impl<
4527 T0: fidl::encoding::Encode<
4528 fidl::encoding::BoundedString<32>,
4529 fidl::encoding::DefaultFuchsiaResourceDialect,
4530 >,
4531 T1: fidl::encoding::Encode<
4532 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
4533 fidl::encoding::DefaultFuchsiaResourceDialect,
4534 >,
4535 >
4536 fidl::encoding::Encode<
4537 FeatureConnectorConnectRequest,
4538 fidl::encoding::DefaultFuchsiaResourceDialect,
4539 > for (T0, T1)
4540 {
4541 #[inline]
4542 unsafe fn encode(
4543 self,
4544 encoder: &mut fidl::encoding::Encoder<
4545 '_,
4546 fidl::encoding::DefaultFuchsiaResourceDialect,
4547 >,
4548 offset: usize,
4549 depth: fidl::encoding::Depth,
4550 ) -> fidl::Result<()> {
4551 encoder.debug_check_bounds::<FeatureConnectorConnectRequest>(offset);
4552 unsafe {
4555 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4556 (ptr as *mut u64).write_unaligned(0);
4557 }
4558 self.0.encode(encoder, offset + 0, depth)?;
4560 self.1.encode(encoder, offset + 16, depth)?;
4561 Ok(())
4562 }
4563 }
4564
4565 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4566 for FeatureConnectorConnectRequest
4567 {
4568 #[inline(always)]
4569 fn new_empty() -> Self {
4570 Self {
4571 name: fidl::new_empty!(
4572 fidl::encoding::BoundedString<32>,
4573 fidl::encoding::DefaultFuchsiaResourceDialect
4574 ),
4575 server_end: fidl::new_empty!(
4576 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
4577 fidl::encoding::DefaultFuchsiaResourceDialect
4578 ),
4579 }
4580 }
4581
4582 #[inline]
4583 unsafe fn decode(
4584 &mut self,
4585 decoder: &mut fidl::encoding::Decoder<
4586 '_,
4587 fidl::encoding::DefaultFuchsiaResourceDialect,
4588 >,
4589 offset: usize,
4590 _depth: fidl::encoding::Depth,
4591 ) -> fidl::Result<()> {
4592 decoder.debug_check_bounds::<Self>(offset);
4593 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4595 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4596 let mask = 0xffffffff00000000u64;
4597 let maskedval = padval & mask;
4598 if maskedval != 0 {
4599 return Err(fidl::Error::NonZeroPadding {
4600 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4601 });
4602 }
4603 fidl::decode!(
4604 fidl::encoding::BoundedString<32>,
4605 fidl::encoding::DefaultFuchsiaResourceDialect,
4606 &mut self.name,
4607 decoder,
4608 offset + 0,
4609 _depth
4610 )?;
4611 fidl::decode!(
4612 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
4613 fidl::encoding::DefaultFuchsiaResourceDialect,
4614 &mut self.server_end,
4615 decoder,
4616 offset + 16,
4617 _depth
4618 )?;
4619 Ok(())
4620 }
4621 }
4622
4623 impl fidl::encoding::ResourceTypeMarker for MeshcopConnectorConnectRequest {
4624 type Borrowed<'a> = &'a mut Self;
4625 fn take_or_borrow<'a>(
4626 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4627 ) -> Self::Borrowed<'a> {
4628 value
4629 }
4630 }
4631
4632 unsafe impl fidl::encoding::TypeMarker for MeshcopConnectorConnectRequest {
4633 type Owned = Self;
4634
4635 #[inline(always)]
4636 fn inline_align(_context: fidl::encoding::Context) -> usize {
4637 8
4638 }
4639
4640 #[inline(always)]
4641 fn inline_size(_context: fidl::encoding::Context) -> usize {
4642 24
4643 }
4644 }
4645
4646 unsafe impl
4647 fidl::encoding::Encode<
4648 MeshcopConnectorConnectRequest,
4649 fidl::encoding::DefaultFuchsiaResourceDialect,
4650 > for &mut MeshcopConnectorConnectRequest
4651 {
4652 #[inline]
4653 unsafe fn encode(
4654 self,
4655 encoder: &mut fidl::encoding::Encoder<
4656 '_,
4657 fidl::encoding::DefaultFuchsiaResourceDialect,
4658 >,
4659 offset: usize,
4660 _depth: fidl::encoding::Depth,
4661 ) -> fidl::Result<()> {
4662 encoder.debug_check_bounds::<MeshcopConnectorConnectRequest>(offset);
4663 fidl::encoding::Encode::<MeshcopConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4665 (
4666 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
4667 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
4668 ),
4669 encoder, offset, _depth
4670 )
4671 }
4672 }
4673 unsafe impl<
4674 T0: fidl::encoding::Encode<
4675 fidl::encoding::BoundedString<32>,
4676 fidl::encoding::DefaultFuchsiaResourceDialect,
4677 >,
4678 T1: fidl::encoding::Encode<
4679 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
4680 fidl::encoding::DefaultFuchsiaResourceDialect,
4681 >,
4682 >
4683 fidl::encoding::Encode<
4684 MeshcopConnectorConnectRequest,
4685 fidl::encoding::DefaultFuchsiaResourceDialect,
4686 > for (T0, T1)
4687 {
4688 #[inline]
4689 unsafe fn encode(
4690 self,
4691 encoder: &mut fidl::encoding::Encoder<
4692 '_,
4693 fidl::encoding::DefaultFuchsiaResourceDialect,
4694 >,
4695 offset: usize,
4696 depth: fidl::encoding::Depth,
4697 ) -> fidl::Result<()> {
4698 encoder.debug_check_bounds::<MeshcopConnectorConnectRequest>(offset);
4699 unsafe {
4702 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4703 (ptr as *mut u64).write_unaligned(0);
4704 }
4705 self.0.encode(encoder, offset + 0, depth)?;
4707 self.1.encode(encoder, offset + 16, depth)?;
4708 Ok(())
4709 }
4710 }
4711
4712 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4713 for MeshcopConnectorConnectRequest
4714 {
4715 #[inline(always)]
4716 fn new_empty() -> Self {
4717 Self {
4718 name: fidl::new_empty!(
4719 fidl::encoding::BoundedString<32>,
4720 fidl::encoding::DefaultFuchsiaResourceDialect
4721 ),
4722 server_end: fidl::new_empty!(
4723 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
4724 fidl::encoding::DefaultFuchsiaResourceDialect
4725 ),
4726 }
4727 }
4728
4729 #[inline]
4730 unsafe fn decode(
4731 &mut self,
4732 decoder: &mut fidl::encoding::Decoder<
4733 '_,
4734 fidl::encoding::DefaultFuchsiaResourceDialect,
4735 >,
4736 offset: usize,
4737 _depth: fidl::encoding::Depth,
4738 ) -> fidl::Result<()> {
4739 decoder.debug_check_bounds::<Self>(offset);
4740 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4742 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4743 let mask = 0xffffffff00000000u64;
4744 let maskedval = padval & mask;
4745 if maskedval != 0 {
4746 return Err(fidl::Error::NonZeroPadding {
4747 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4748 });
4749 }
4750 fidl::decode!(
4751 fidl::encoding::BoundedString<32>,
4752 fidl::encoding::DefaultFuchsiaResourceDialect,
4753 &mut self.name,
4754 decoder,
4755 offset + 0,
4756 _depth
4757 )?;
4758 fidl::decode!(
4759 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
4760 fidl::encoding::DefaultFuchsiaResourceDialect,
4761 &mut self.server_end,
4762 decoder,
4763 offset + 16,
4764 _depth
4765 )?;
4766 Ok(())
4767 }
4768 }
4769}