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 EpskcConnectorConnectRequest {
38 pub name: String,
39 pub server_end: fidl::endpoints::ServerEnd<EpskcMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for EpskcConnectorConnectRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct FeatureConnectorConnectRequest {
49 pub name: String,
50 pub server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
54 for FeatureConnectorConnectRequest
55{
56}
57
58#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
59pub struct MeshcopConnectorConnectRequest {
60 pub name: String,
61 pub server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
62}
63
64impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
65 for MeshcopConnectorConnectRequest
66{
67}
68
69#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
70pub struct CapabilitiesConnectorMarker;
71
72impl fidl::endpoints::ProtocolMarker for CapabilitiesConnectorMarker {
73 type Proxy = CapabilitiesConnectorProxy;
74 type RequestStream = CapabilitiesConnectorRequestStream;
75 #[cfg(target_os = "fuchsia")]
76 type SynchronousProxy = CapabilitiesConnectorSynchronousProxy;
77
78 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.CapabilitiesConnector";
79}
80impl fidl::endpoints::DiscoverableProtocolMarker for CapabilitiesConnectorMarker {}
81
82pub trait CapabilitiesConnectorProxyInterface: Send + Sync {
83 fn r#connect(
84 &self,
85 name: &str,
86 server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
87 ) -> Result<(), fidl::Error>;
88}
89#[derive(Debug)]
90#[cfg(target_os = "fuchsia")]
91pub struct CapabilitiesConnectorSynchronousProxy {
92 client: fidl::client::sync::Client,
93}
94
95#[cfg(target_os = "fuchsia")]
96impl fidl::endpoints::SynchronousProxy for CapabilitiesConnectorSynchronousProxy {
97 type Proxy = CapabilitiesConnectorProxy;
98 type Protocol = CapabilitiesConnectorMarker;
99
100 fn from_channel(inner: fidl::Channel) -> Self {
101 Self::new(inner)
102 }
103
104 fn into_channel(self) -> fidl::Channel {
105 self.client.into_channel()
106 }
107
108 fn as_channel(&self) -> &fidl::Channel {
109 self.client.as_channel()
110 }
111}
112
113#[cfg(target_os = "fuchsia")]
114impl CapabilitiesConnectorSynchronousProxy {
115 pub fn new(channel: fidl::Channel) -> Self {
116 Self { client: fidl::client::sync::Client::new(channel) }
117 }
118
119 pub fn into_channel(self) -> fidl::Channel {
120 self.client.into_channel()
121 }
122
123 pub fn wait_for_event(
126 &self,
127 deadline: zx::MonotonicInstant,
128 ) -> Result<CapabilitiesConnectorEvent, fidl::Error> {
129 CapabilitiesConnectorEvent::decode(
130 self.client.wait_for_event::<CapabilitiesConnectorMarker>(deadline)?,
131 )
132 }
133
134 pub fn r#connect(
151 &self,
152 mut name: &str,
153 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
154 ) -> Result<(), fidl::Error> {
155 self.client.send::<CapabilitiesConnectorConnectRequest>(
156 (name, server_end),
157 0x1dadd551ecacd85,
158 fidl::encoding::DynamicFlags::empty(),
159 )
160 }
161}
162
163#[cfg(target_os = "fuchsia")]
164impl From<CapabilitiesConnectorSynchronousProxy> for zx::NullableHandle {
165 fn from(value: CapabilitiesConnectorSynchronousProxy) -> Self {
166 value.into_channel().into()
167 }
168}
169
170#[cfg(target_os = "fuchsia")]
171impl From<fidl::Channel> for CapabilitiesConnectorSynchronousProxy {
172 fn from(value: fidl::Channel) -> Self {
173 Self::new(value)
174 }
175}
176
177#[cfg(target_os = "fuchsia")]
178impl fidl::endpoints::FromClient for CapabilitiesConnectorSynchronousProxy {
179 type Protocol = CapabilitiesConnectorMarker;
180
181 fn from_client(value: fidl::endpoints::ClientEnd<CapabilitiesConnectorMarker>) -> Self {
182 Self::new(value.into_channel())
183 }
184}
185
186#[derive(Debug, Clone)]
187pub struct CapabilitiesConnectorProxy {
188 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
189}
190
191impl fidl::endpoints::Proxy for CapabilitiesConnectorProxy {
192 type Protocol = CapabilitiesConnectorMarker;
193
194 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
195 Self::new(inner)
196 }
197
198 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
199 self.client.into_channel().map_err(|client| Self { client })
200 }
201
202 fn as_channel(&self) -> &::fidl::AsyncChannel {
203 self.client.as_channel()
204 }
205}
206
207impl CapabilitiesConnectorProxy {
208 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
210 let protocol_name =
211 <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
212 Self { client: fidl::client::Client::new(channel, protocol_name) }
213 }
214
215 pub fn take_event_stream(&self) -> CapabilitiesConnectorEventStream {
221 CapabilitiesConnectorEventStream { event_receiver: self.client.take_event_receiver() }
222 }
223
224 pub fn r#connect(
241 &self,
242 mut name: &str,
243 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
244 ) -> Result<(), fidl::Error> {
245 CapabilitiesConnectorProxyInterface::r#connect(self, name, server_end)
246 }
247}
248
249impl CapabilitiesConnectorProxyInterface for CapabilitiesConnectorProxy {
250 fn r#connect(
251 &self,
252 mut name: &str,
253 mut server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
254 ) -> Result<(), fidl::Error> {
255 self.client.send::<CapabilitiesConnectorConnectRequest>(
256 (name, server_end),
257 0x1dadd551ecacd85,
258 fidl::encoding::DynamicFlags::empty(),
259 )
260 }
261}
262
263pub struct CapabilitiesConnectorEventStream {
264 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
265}
266
267impl std::marker::Unpin for CapabilitiesConnectorEventStream {}
268
269impl futures::stream::FusedStream for CapabilitiesConnectorEventStream {
270 fn is_terminated(&self) -> bool {
271 self.event_receiver.is_terminated()
272 }
273}
274
275impl futures::Stream for CapabilitiesConnectorEventStream {
276 type Item = Result<CapabilitiesConnectorEvent, fidl::Error>;
277
278 fn poll_next(
279 mut self: std::pin::Pin<&mut Self>,
280 cx: &mut std::task::Context<'_>,
281 ) -> std::task::Poll<Option<Self::Item>> {
282 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
283 &mut self.event_receiver,
284 cx
285 )?) {
286 Some(buf) => std::task::Poll::Ready(Some(CapabilitiesConnectorEvent::decode(buf))),
287 None => std::task::Poll::Ready(None),
288 }
289 }
290}
291
292#[derive(Debug)]
293pub enum CapabilitiesConnectorEvent {}
294
295impl CapabilitiesConnectorEvent {
296 fn decode(
298 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
299 ) -> Result<CapabilitiesConnectorEvent, fidl::Error> {
300 let (bytes, _handles) = buf.split_mut();
301 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
302 debug_assert_eq!(tx_header.tx_id, 0);
303 match tx_header.ordinal {
304 _ => Err(fidl::Error::UnknownOrdinal {
305 ordinal: tx_header.ordinal,
306 protocol_name:
307 <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
308 }),
309 }
310 }
311}
312
313pub struct CapabilitiesConnectorRequestStream {
315 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
316 is_terminated: bool,
317}
318
319impl std::marker::Unpin for CapabilitiesConnectorRequestStream {}
320
321impl futures::stream::FusedStream for CapabilitiesConnectorRequestStream {
322 fn is_terminated(&self) -> bool {
323 self.is_terminated
324 }
325}
326
327impl fidl::endpoints::RequestStream for CapabilitiesConnectorRequestStream {
328 type Protocol = CapabilitiesConnectorMarker;
329 type ControlHandle = CapabilitiesConnectorControlHandle;
330
331 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
332 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
333 }
334
335 fn control_handle(&self) -> Self::ControlHandle {
336 CapabilitiesConnectorControlHandle { inner: self.inner.clone() }
337 }
338
339 fn into_inner(
340 self,
341 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
342 {
343 (self.inner, self.is_terminated)
344 }
345
346 fn from_inner(
347 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
348 is_terminated: bool,
349 ) -> Self {
350 Self { inner, is_terminated }
351 }
352}
353
354impl futures::Stream for CapabilitiesConnectorRequestStream {
355 type Item = Result<CapabilitiesConnectorRequest, fidl::Error>;
356
357 fn poll_next(
358 mut self: std::pin::Pin<&mut Self>,
359 cx: &mut std::task::Context<'_>,
360 ) -> std::task::Poll<Option<Self::Item>> {
361 let this = &mut *self;
362 if this.inner.check_shutdown(cx) {
363 this.is_terminated = true;
364 return std::task::Poll::Ready(None);
365 }
366 if this.is_terminated {
367 panic!("polled CapabilitiesConnectorRequestStream after completion");
368 }
369 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
370 |bytes, handles| {
371 match this.inner.channel().read_etc(cx, bytes, handles) {
372 std::task::Poll::Ready(Ok(())) => {}
373 std::task::Poll::Pending => return std::task::Poll::Pending,
374 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
375 this.is_terminated = true;
376 return std::task::Poll::Ready(None);
377 }
378 std::task::Poll::Ready(Err(e)) => {
379 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
380 e.into(),
381 ))));
382 }
383 }
384
385 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
387
388 std::task::Poll::Ready(Some(match header.ordinal {
389 0x1dadd551ecacd85 => {
390 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
391 let mut req = fidl::new_empty!(CapabilitiesConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
392 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
393 let control_handle = CapabilitiesConnectorControlHandle {
394 inner: this.inner.clone(),
395 };
396 Ok(CapabilitiesConnectorRequest::Connect {name: req.name,
397server_end: req.server_end,
398
399 control_handle,
400 })
401 }
402 _ => Err(fidl::Error::UnknownOrdinal {
403 ordinal: header.ordinal,
404 protocol_name: <CapabilitiesConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
405 }),
406 }))
407 },
408 )
409 }
410}
411
412#[derive(Debug)]
414pub enum CapabilitiesConnectorRequest {
415 Connect {
432 name: String,
433 server_end: fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
434 control_handle: CapabilitiesConnectorControlHandle,
435 },
436}
437
438impl CapabilitiesConnectorRequest {
439 #[allow(irrefutable_let_patterns)]
440 pub fn into_connect(
441 self,
442 ) -> Option<(
443 String,
444 fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>,
445 CapabilitiesConnectorControlHandle,
446 )> {
447 if let CapabilitiesConnectorRequest::Connect { name, server_end, control_handle } = self {
448 Some((name, server_end, control_handle))
449 } else {
450 None
451 }
452 }
453
454 pub fn method_name(&self) -> &'static str {
456 match *self {
457 CapabilitiesConnectorRequest::Connect { .. } => "connect",
458 }
459 }
460}
461
462#[derive(Debug, Clone)]
463pub struct CapabilitiesConnectorControlHandle {
464 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
465}
466
467impl CapabilitiesConnectorControlHandle {
468 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
469 self.inner.shutdown_with_epitaph(status.into())
470 }
471}
472
473impl fidl::endpoints::ControlHandle for CapabilitiesConnectorControlHandle {
474 fn shutdown(&self) {
475 self.inner.shutdown()
476 }
477
478 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
479 self.inner.shutdown_with_epitaph(status)
480 }
481
482 fn is_closed(&self) -> bool {
483 self.inner.channel().is_closed()
484 }
485 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
486 self.inner.channel().on_closed()
487 }
488
489 #[cfg(target_os = "fuchsia")]
490 fn signal_peer(
491 &self,
492 clear_mask: zx::Signals,
493 set_mask: zx::Signals,
494 ) -> Result<(), zx_status::Status> {
495 use fidl::Peered;
496 self.inner.channel().signal_peer(clear_mask, set_mask)
497 }
498}
499
500impl CapabilitiesConnectorControlHandle {}
501
502#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
503pub struct DatasetMarker;
504
505impl fidl::endpoints::ProtocolMarker for DatasetMarker {
506 type Proxy = DatasetProxy;
507 type RequestStream = DatasetRequestStream;
508 #[cfg(target_os = "fuchsia")]
509 type SynchronousProxy = DatasetSynchronousProxy;
510
511 const DEBUG_NAME: &'static str = "(anonymous) Dataset";
512}
513
514pub trait DatasetProxyInterface: Send + Sync {
515 type GetActiveTlvsResponseFut: std::future::Future<Output = Result<Option<Vec<u8>>, fidl::Error>>
516 + Send;
517 fn r#get_active_tlvs(&self) -> Self::GetActiveTlvsResponseFut;
518 type SetActiveTlvsResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
519 fn r#set_active_tlvs(&self, dataset: &[u8]) -> Self::SetActiveTlvsResponseFut;
520 type AttachAllNodesToResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
521 fn r#attach_all_nodes_to(&self, dataset: &[u8]) -> Self::AttachAllNodesToResponseFut;
522}
523#[derive(Debug)]
524#[cfg(target_os = "fuchsia")]
525pub struct DatasetSynchronousProxy {
526 client: fidl::client::sync::Client,
527}
528
529#[cfg(target_os = "fuchsia")]
530impl fidl::endpoints::SynchronousProxy for DatasetSynchronousProxy {
531 type Proxy = DatasetProxy;
532 type Protocol = DatasetMarker;
533
534 fn from_channel(inner: fidl::Channel) -> Self {
535 Self::new(inner)
536 }
537
538 fn into_channel(self) -> fidl::Channel {
539 self.client.into_channel()
540 }
541
542 fn as_channel(&self) -> &fidl::Channel {
543 self.client.as_channel()
544 }
545}
546
547#[cfg(target_os = "fuchsia")]
548impl DatasetSynchronousProxy {
549 pub fn new(channel: fidl::Channel) -> Self {
550 Self { client: fidl::client::sync::Client::new(channel) }
551 }
552
553 pub fn into_channel(self) -> fidl::Channel {
554 self.client.into_channel()
555 }
556
557 pub fn wait_for_event(
560 &self,
561 deadline: zx::MonotonicInstant,
562 ) -> Result<DatasetEvent, fidl::Error> {
563 DatasetEvent::decode(self.client.wait_for_event::<DatasetMarker>(deadline)?)
564 }
565
566 pub fn r#get_active_tlvs(
577 &self,
578 ___deadline: zx::MonotonicInstant,
579 ) -> Result<Option<Vec<u8>>, fidl::Error> {
580 let _response = self.client.send_query::<
581 fidl::encoding::EmptyPayload,
582 DatasetGetActiveTlvsResponse,
583 DatasetMarker,
584 >(
585 (),
586 0x3004d50d9fb69b92,
587 fidl::encoding::DynamicFlags::empty(),
588 ___deadline,
589 )?;
590 Ok(_response.dataset)
591 }
592
593 pub fn r#set_active_tlvs(
603 &self,
604 mut dataset: &[u8],
605 ___deadline: zx::MonotonicInstant,
606 ) -> Result<(), fidl::Error> {
607 let _response = self
608 .client
609 .send_query::<DatasetSetActiveTlvsRequest, fidl::encoding::EmptyPayload, DatasetMarker>(
610 (dataset,),
611 0x5a8dc1d4e3b578e7,
612 fidl::encoding::DynamicFlags::empty(),
613 ___deadline,
614 )?;
615 Ok(_response)
616 }
617
618 pub fn r#attach_all_nodes_to(
638 &self,
639 mut dataset: &[u8],
640 ___deadline: zx::MonotonicInstant,
641 ) -> Result<i64, fidl::Error> {
642 let _response = self.client.send_query::<
643 DatasetAttachAllNodesToRequest,
644 DatasetAttachAllNodesToResponse,
645 DatasetMarker,
646 >(
647 (dataset,),
648 0x6057e8b429c4aefe,
649 fidl::encoding::DynamicFlags::empty(),
650 ___deadline,
651 )?;
652 Ok(_response.delay_ms)
653 }
654}
655
656#[cfg(target_os = "fuchsia")]
657impl From<DatasetSynchronousProxy> for zx::NullableHandle {
658 fn from(value: DatasetSynchronousProxy) -> Self {
659 value.into_channel().into()
660 }
661}
662
663#[cfg(target_os = "fuchsia")]
664impl From<fidl::Channel> for DatasetSynchronousProxy {
665 fn from(value: fidl::Channel) -> Self {
666 Self::new(value)
667 }
668}
669
670#[cfg(target_os = "fuchsia")]
671impl fidl::endpoints::FromClient for DatasetSynchronousProxy {
672 type Protocol = DatasetMarker;
673
674 fn from_client(value: fidl::endpoints::ClientEnd<DatasetMarker>) -> Self {
675 Self::new(value.into_channel())
676 }
677}
678
679#[derive(Debug, Clone)]
680pub struct DatasetProxy {
681 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
682}
683
684impl fidl::endpoints::Proxy for DatasetProxy {
685 type Protocol = DatasetMarker;
686
687 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
688 Self::new(inner)
689 }
690
691 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
692 self.client.into_channel().map_err(|client| Self { client })
693 }
694
695 fn as_channel(&self) -> &::fidl::AsyncChannel {
696 self.client.as_channel()
697 }
698}
699
700impl DatasetProxy {
701 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
703 let protocol_name = <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
704 Self { client: fidl::client::Client::new(channel, protocol_name) }
705 }
706
707 pub fn take_event_stream(&self) -> DatasetEventStream {
713 DatasetEventStream { event_receiver: self.client.take_event_receiver() }
714 }
715
716 pub fn r#get_active_tlvs(
727 &self,
728 ) -> fidl::client::QueryResponseFut<
729 Option<Vec<u8>>,
730 fidl::encoding::DefaultFuchsiaResourceDialect,
731 > {
732 DatasetProxyInterface::r#get_active_tlvs(self)
733 }
734
735 pub fn r#set_active_tlvs(
745 &self,
746 mut dataset: &[u8],
747 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
748 DatasetProxyInterface::r#set_active_tlvs(self, dataset)
749 }
750
751 pub fn r#attach_all_nodes_to(
771 &self,
772 mut dataset: &[u8],
773 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
774 DatasetProxyInterface::r#attach_all_nodes_to(self, dataset)
775 }
776}
777
778impl DatasetProxyInterface for DatasetProxy {
779 type GetActiveTlvsResponseFut = fidl::client::QueryResponseFut<
780 Option<Vec<u8>>,
781 fidl::encoding::DefaultFuchsiaResourceDialect,
782 >;
783 fn r#get_active_tlvs(&self) -> Self::GetActiveTlvsResponseFut {
784 fn _decode(
785 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
786 ) -> Result<Option<Vec<u8>>, fidl::Error> {
787 let _response = fidl::client::decode_transaction_body::<
788 DatasetGetActiveTlvsResponse,
789 fidl::encoding::DefaultFuchsiaResourceDialect,
790 0x3004d50d9fb69b92,
791 >(_buf?)?;
792 Ok(_response.dataset)
793 }
794 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Option<Vec<u8>>>(
795 (),
796 0x3004d50d9fb69b92,
797 fidl::encoding::DynamicFlags::empty(),
798 _decode,
799 )
800 }
801
802 type SetActiveTlvsResponseFut =
803 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
804 fn r#set_active_tlvs(&self, mut dataset: &[u8]) -> Self::SetActiveTlvsResponseFut {
805 fn _decode(
806 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
807 ) -> Result<(), fidl::Error> {
808 let _response = fidl::client::decode_transaction_body::<
809 fidl::encoding::EmptyPayload,
810 fidl::encoding::DefaultFuchsiaResourceDialect,
811 0x5a8dc1d4e3b578e7,
812 >(_buf?)?;
813 Ok(_response)
814 }
815 self.client.send_query_and_decode::<DatasetSetActiveTlvsRequest, ()>(
816 (dataset,),
817 0x5a8dc1d4e3b578e7,
818 fidl::encoding::DynamicFlags::empty(),
819 _decode,
820 )
821 }
822
823 type AttachAllNodesToResponseFut =
824 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
825 fn r#attach_all_nodes_to(&self, mut dataset: &[u8]) -> Self::AttachAllNodesToResponseFut {
826 fn _decode(
827 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
828 ) -> Result<i64, fidl::Error> {
829 let _response = fidl::client::decode_transaction_body::<
830 DatasetAttachAllNodesToResponse,
831 fidl::encoding::DefaultFuchsiaResourceDialect,
832 0x6057e8b429c4aefe,
833 >(_buf?)?;
834 Ok(_response.delay_ms)
835 }
836 self.client.send_query_and_decode::<DatasetAttachAllNodesToRequest, i64>(
837 (dataset,),
838 0x6057e8b429c4aefe,
839 fidl::encoding::DynamicFlags::empty(),
840 _decode,
841 )
842 }
843}
844
845pub struct DatasetEventStream {
846 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
847}
848
849impl std::marker::Unpin for DatasetEventStream {}
850
851impl futures::stream::FusedStream for DatasetEventStream {
852 fn is_terminated(&self) -> bool {
853 self.event_receiver.is_terminated()
854 }
855}
856
857impl futures::Stream for DatasetEventStream {
858 type Item = Result<DatasetEvent, fidl::Error>;
859
860 fn poll_next(
861 mut self: std::pin::Pin<&mut Self>,
862 cx: &mut std::task::Context<'_>,
863 ) -> std::task::Poll<Option<Self::Item>> {
864 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
865 &mut self.event_receiver,
866 cx
867 )?) {
868 Some(buf) => std::task::Poll::Ready(Some(DatasetEvent::decode(buf))),
869 None => std::task::Poll::Ready(None),
870 }
871 }
872}
873
874#[derive(Debug)]
875pub enum DatasetEvent {}
876
877impl DatasetEvent {
878 fn decode(
880 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
881 ) -> Result<DatasetEvent, fidl::Error> {
882 let (bytes, _handles) = buf.split_mut();
883 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
884 debug_assert_eq!(tx_header.tx_id, 0);
885 match tx_header.ordinal {
886 _ => Err(fidl::Error::UnknownOrdinal {
887 ordinal: tx_header.ordinal,
888 protocol_name: <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
889 }),
890 }
891 }
892}
893
894pub struct DatasetRequestStream {
896 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
897 is_terminated: bool,
898}
899
900impl std::marker::Unpin for DatasetRequestStream {}
901
902impl futures::stream::FusedStream for DatasetRequestStream {
903 fn is_terminated(&self) -> bool {
904 self.is_terminated
905 }
906}
907
908impl fidl::endpoints::RequestStream for DatasetRequestStream {
909 type Protocol = DatasetMarker;
910 type ControlHandle = DatasetControlHandle;
911
912 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
913 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
914 }
915
916 fn control_handle(&self) -> Self::ControlHandle {
917 DatasetControlHandle { inner: self.inner.clone() }
918 }
919
920 fn into_inner(
921 self,
922 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
923 {
924 (self.inner, self.is_terminated)
925 }
926
927 fn from_inner(
928 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
929 is_terminated: bool,
930 ) -> Self {
931 Self { inner, is_terminated }
932 }
933}
934
935impl futures::Stream for DatasetRequestStream {
936 type Item = Result<DatasetRequest, fidl::Error>;
937
938 fn poll_next(
939 mut self: std::pin::Pin<&mut Self>,
940 cx: &mut std::task::Context<'_>,
941 ) -> std::task::Poll<Option<Self::Item>> {
942 let this = &mut *self;
943 if this.inner.check_shutdown(cx) {
944 this.is_terminated = true;
945 return std::task::Poll::Ready(None);
946 }
947 if this.is_terminated {
948 panic!("polled DatasetRequestStream after completion");
949 }
950 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
951 |bytes, handles| {
952 match this.inner.channel().read_etc(cx, bytes, handles) {
953 std::task::Poll::Ready(Ok(())) => {}
954 std::task::Poll::Pending => return std::task::Poll::Pending,
955 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
956 this.is_terminated = true;
957 return std::task::Poll::Ready(None);
958 }
959 std::task::Poll::Ready(Err(e)) => {
960 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
961 e.into(),
962 ))));
963 }
964 }
965
966 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
968
969 std::task::Poll::Ready(Some(match header.ordinal {
970 0x3004d50d9fb69b92 => {
971 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
972 let mut req = fidl::new_empty!(
973 fidl::encoding::EmptyPayload,
974 fidl::encoding::DefaultFuchsiaResourceDialect
975 );
976 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
977 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
978 Ok(DatasetRequest::GetActiveTlvs {
979 responder: DatasetGetActiveTlvsResponder {
980 control_handle: std::mem::ManuallyDrop::new(control_handle),
981 tx_id: header.tx_id,
982 },
983 })
984 }
985 0x5a8dc1d4e3b578e7 => {
986 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
987 let mut req = fidl::new_empty!(
988 DatasetSetActiveTlvsRequest,
989 fidl::encoding::DefaultFuchsiaResourceDialect
990 );
991 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetSetActiveTlvsRequest>(&header, _body_bytes, handles, &mut req)?;
992 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
993 Ok(DatasetRequest::SetActiveTlvs {
994 dataset: req.dataset,
995
996 responder: DatasetSetActiveTlvsResponder {
997 control_handle: std::mem::ManuallyDrop::new(control_handle),
998 tx_id: header.tx_id,
999 },
1000 })
1001 }
1002 0x6057e8b429c4aefe => {
1003 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1004 let mut req = fidl::new_empty!(
1005 DatasetAttachAllNodesToRequest,
1006 fidl::encoding::DefaultFuchsiaResourceDialect
1007 );
1008 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetAttachAllNodesToRequest>(&header, _body_bytes, handles, &mut req)?;
1009 let control_handle = DatasetControlHandle { inner: this.inner.clone() };
1010 Ok(DatasetRequest::AttachAllNodesTo {
1011 dataset: req.dataset,
1012
1013 responder: DatasetAttachAllNodesToResponder {
1014 control_handle: std::mem::ManuallyDrop::new(control_handle),
1015 tx_id: header.tx_id,
1016 },
1017 })
1018 }
1019 _ => Err(fidl::Error::UnknownOrdinal {
1020 ordinal: header.ordinal,
1021 protocol_name:
1022 <DatasetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1023 }),
1024 }))
1025 },
1026 )
1027 }
1028}
1029
1030#[derive(Debug)]
1037pub enum DatasetRequest {
1038 GetActiveTlvs { responder: DatasetGetActiveTlvsResponder },
1049 SetActiveTlvs { dataset: Vec<u8>, responder: DatasetSetActiveTlvsResponder },
1059 AttachAllNodesTo { dataset: Vec<u8>, responder: DatasetAttachAllNodesToResponder },
1079}
1080
1081impl DatasetRequest {
1082 #[allow(irrefutable_let_patterns)]
1083 pub fn into_get_active_tlvs(self) -> Option<(DatasetGetActiveTlvsResponder)> {
1084 if let DatasetRequest::GetActiveTlvs { responder } = self {
1085 Some((responder))
1086 } else {
1087 None
1088 }
1089 }
1090
1091 #[allow(irrefutable_let_patterns)]
1092 pub fn into_set_active_tlvs(self) -> Option<(Vec<u8>, DatasetSetActiveTlvsResponder)> {
1093 if let DatasetRequest::SetActiveTlvs { dataset, responder } = self {
1094 Some((dataset, responder))
1095 } else {
1096 None
1097 }
1098 }
1099
1100 #[allow(irrefutable_let_patterns)]
1101 pub fn into_attach_all_nodes_to(self) -> Option<(Vec<u8>, DatasetAttachAllNodesToResponder)> {
1102 if let DatasetRequest::AttachAllNodesTo { dataset, responder } = self {
1103 Some((dataset, responder))
1104 } else {
1105 None
1106 }
1107 }
1108
1109 pub fn method_name(&self) -> &'static str {
1111 match *self {
1112 DatasetRequest::GetActiveTlvs { .. } => "get_active_tlvs",
1113 DatasetRequest::SetActiveTlvs { .. } => "set_active_tlvs",
1114 DatasetRequest::AttachAllNodesTo { .. } => "attach_all_nodes_to",
1115 }
1116 }
1117}
1118
1119#[derive(Debug, Clone)]
1120pub struct DatasetControlHandle {
1121 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1122}
1123
1124impl DatasetControlHandle {
1125 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1126 self.inner.shutdown_with_epitaph(status.into())
1127 }
1128}
1129
1130impl fidl::endpoints::ControlHandle for DatasetControlHandle {
1131 fn shutdown(&self) {
1132 self.inner.shutdown()
1133 }
1134
1135 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1136 self.inner.shutdown_with_epitaph(status)
1137 }
1138
1139 fn is_closed(&self) -> bool {
1140 self.inner.channel().is_closed()
1141 }
1142 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1143 self.inner.channel().on_closed()
1144 }
1145
1146 #[cfg(target_os = "fuchsia")]
1147 fn signal_peer(
1148 &self,
1149 clear_mask: zx::Signals,
1150 set_mask: zx::Signals,
1151 ) -> Result<(), zx_status::Status> {
1152 use fidl::Peered;
1153 self.inner.channel().signal_peer(clear_mask, set_mask)
1154 }
1155}
1156
1157impl DatasetControlHandle {}
1158
1159#[must_use = "FIDL methods require a response to be sent"]
1160#[derive(Debug)]
1161pub struct DatasetGetActiveTlvsResponder {
1162 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1163 tx_id: u32,
1164}
1165
1166impl std::ops::Drop for DatasetGetActiveTlvsResponder {
1170 fn drop(&mut self) {
1171 self.control_handle.shutdown();
1172 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1174 }
1175}
1176
1177impl fidl::endpoints::Responder for DatasetGetActiveTlvsResponder {
1178 type ControlHandle = DatasetControlHandle;
1179
1180 fn control_handle(&self) -> &DatasetControlHandle {
1181 &self.control_handle
1182 }
1183
1184 fn drop_without_shutdown(mut self) {
1185 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1187 std::mem::forget(self);
1189 }
1190}
1191
1192impl DatasetGetActiveTlvsResponder {
1193 pub fn send(self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1197 let _result = self.send_raw(dataset);
1198 if _result.is_err() {
1199 self.control_handle.shutdown();
1200 }
1201 self.drop_without_shutdown();
1202 _result
1203 }
1204
1205 pub fn send_no_shutdown_on_err(self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1207 let _result = self.send_raw(dataset);
1208 self.drop_without_shutdown();
1209 _result
1210 }
1211
1212 fn send_raw(&self, mut dataset: Option<&[u8]>) -> Result<(), fidl::Error> {
1213 self.control_handle.inner.send::<DatasetGetActiveTlvsResponse>(
1214 (dataset,),
1215 self.tx_id,
1216 0x3004d50d9fb69b92,
1217 fidl::encoding::DynamicFlags::empty(),
1218 )
1219 }
1220}
1221
1222#[must_use = "FIDL methods require a response to be sent"]
1223#[derive(Debug)]
1224pub struct DatasetSetActiveTlvsResponder {
1225 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1226 tx_id: u32,
1227}
1228
1229impl std::ops::Drop for DatasetSetActiveTlvsResponder {
1233 fn drop(&mut self) {
1234 self.control_handle.shutdown();
1235 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1237 }
1238}
1239
1240impl fidl::endpoints::Responder for DatasetSetActiveTlvsResponder {
1241 type ControlHandle = DatasetControlHandle;
1242
1243 fn control_handle(&self) -> &DatasetControlHandle {
1244 &self.control_handle
1245 }
1246
1247 fn drop_without_shutdown(mut self) {
1248 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1250 std::mem::forget(self);
1252 }
1253}
1254
1255impl DatasetSetActiveTlvsResponder {
1256 pub fn send(self) -> Result<(), fidl::Error> {
1260 let _result = self.send_raw();
1261 if _result.is_err() {
1262 self.control_handle.shutdown();
1263 }
1264 self.drop_without_shutdown();
1265 _result
1266 }
1267
1268 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1270 let _result = self.send_raw();
1271 self.drop_without_shutdown();
1272 _result
1273 }
1274
1275 fn send_raw(&self) -> Result<(), fidl::Error> {
1276 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1277 (),
1278 self.tx_id,
1279 0x5a8dc1d4e3b578e7,
1280 fidl::encoding::DynamicFlags::empty(),
1281 )
1282 }
1283}
1284
1285#[must_use = "FIDL methods require a response to be sent"]
1286#[derive(Debug)]
1287pub struct DatasetAttachAllNodesToResponder {
1288 control_handle: std::mem::ManuallyDrop<DatasetControlHandle>,
1289 tx_id: u32,
1290}
1291
1292impl std::ops::Drop for DatasetAttachAllNodesToResponder {
1296 fn drop(&mut self) {
1297 self.control_handle.shutdown();
1298 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1300 }
1301}
1302
1303impl fidl::endpoints::Responder for DatasetAttachAllNodesToResponder {
1304 type ControlHandle = DatasetControlHandle;
1305
1306 fn control_handle(&self) -> &DatasetControlHandle {
1307 &self.control_handle
1308 }
1309
1310 fn drop_without_shutdown(mut self) {
1311 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1313 std::mem::forget(self);
1315 }
1316}
1317
1318impl DatasetAttachAllNodesToResponder {
1319 pub fn send(self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1323 let _result = self.send_raw(delay_ms);
1324 if _result.is_err() {
1325 self.control_handle.shutdown();
1326 }
1327 self.drop_without_shutdown();
1328 _result
1329 }
1330
1331 pub fn send_no_shutdown_on_err(self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1333 let _result = self.send_raw(delay_ms);
1334 self.drop_without_shutdown();
1335 _result
1336 }
1337
1338 fn send_raw(&self, mut delay_ms: i64) -> Result<(), fidl::Error> {
1339 self.control_handle.inner.send::<DatasetAttachAllNodesToResponse>(
1340 (delay_ms,),
1341 self.tx_id,
1342 0x6057e8b429c4aefe,
1343 fidl::encoding::DynamicFlags::empty(),
1344 )
1345 }
1346}
1347
1348#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1349pub struct DatasetConnectorMarker;
1350
1351impl fidl::endpoints::ProtocolMarker for DatasetConnectorMarker {
1352 type Proxy = DatasetConnectorProxy;
1353 type RequestStream = DatasetConnectorRequestStream;
1354 #[cfg(target_os = "fuchsia")]
1355 type SynchronousProxy = DatasetConnectorSynchronousProxy;
1356
1357 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.DatasetConnector";
1358}
1359impl fidl::endpoints::DiscoverableProtocolMarker for DatasetConnectorMarker {}
1360
1361pub trait DatasetConnectorProxyInterface: Send + Sync {
1362 fn r#connect(
1363 &self,
1364 name: &str,
1365 server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1366 ) -> Result<(), fidl::Error>;
1367}
1368#[derive(Debug)]
1369#[cfg(target_os = "fuchsia")]
1370pub struct DatasetConnectorSynchronousProxy {
1371 client: fidl::client::sync::Client,
1372}
1373
1374#[cfg(target_os = "fuchsia")]
1375impl fidl::endpoints::SynchronousProxy for DatasetConnectorSynchronousProxy {
1376 type Proxy = DatasetConnectorProxy;
1377 type Protocol = DatasetConnectorMarker;
1378
1379 fn from_channel(inner: fidl::Channel) -> Self {
1380 Self::new(inner)
1381 }
1382
1383 fn into_channel(self) -> fidl::Channel {
1384 self.client.into_channel()
1385 }
1386
1387 fn as_channel(&self) -> &fidl::Channel {
1388 self.client.as_channel()
1389 }
1390}
1391
1392#[cfg(target_os = "fuchsia")]
1393impl DatasetConnectorSynchronousProxy {
1394 pub fn new(channel: fidl::Channel) -> Self {
1395 Self { client: fidl::client::sync::Client::new(channel) }
1396 }
1397
1398 pub fn into_channel(self) -> fidl::Channel {
1399 self.client.into_channel()
1400 }
1401
1402 pub fn wait_for_event(
1405 &self,
1406 deadline: zx::MonotonicInstant,
1407 ) -> Result<DatasetConnectorEvent, fidl::Error> {
1408 DatasetConnectorEvent::decode(
1409 self.client.wait_for_event::<DatasetConnectorMarker>(deadline)?,
1410 )
1411 }
1412
1413 pub fn r#connect(
1430 &self,
1431 mut name: &str,
1432 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1433 ) -> Result<(), fidl::Error> {
1434 self.client.send::<DatasetConnectorConnectRequest>(
1435 (name, server_end),
1436 0x24dff5d2c0cee02b,
1437 fidl::encoding::DynamicFlags::empty(),
1438 )
1439 }
1440}
1441
1442#[cfg(target_os = "fuchsia")]
1443impl From<DatasetConnectorSynchronousProxy> for zx::NullableHandle {
1444 fn from(value: DatasetConnectorSynchronousProxy) -> Self {
1445 value.into_channel().into()
1446 }
1447}
1448
1449#[cfg(target_os = "fuchsia")]
1450impl From<fidl::Channel> for DatasetConnectorSynchronousProxy {
1451 fn from(value: fidl::Channel) -> Self {
1452 Self::new(value)
1453 }
1454}
1455
1456#[cfg(target_os = "fuchsia")]
1457impl fidl::endpoints::FromClient for DatasetConnectorSynchronousProxy {
1458 type Protocol = DatasetConnectorMarker;
1459
1460 fn from_client(value: fidl::endpoints::ClientEnd<DatasetConnectorMarker>) -> Self {
1461 Self::new(value.into_channel())
1462 }
1463}
1464
1465#[derive(Debug, Clone)]
1466pub struct DatasetConnectorProxy {
1467 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1468}
1469
1470impl fidl::endpoints::Proxy for DatasetConnectorProxy {
1471 type Protocol = DatasetConnectorMarker;
1472
1473 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1474 Self::new(inner)
1475 }
1476
1477 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1478 self.client.into_channel().map_err(|client| Self { client })
1479 }
1480
1481 fn as_channel(&self) -> &::fidl::AsyncChannel {
1482 self.client.as_channel()
1483 }
1484}
1485
1486impl DatasetConnectorProxy {
1487 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1489 let protocol_name = <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1490 Self { client: fidl::client::Client::new(channel, protocol_name) }
1491 }
1492
1493 pub fn take_event_stream(&self) -> DatasetConnectorEventStream {
1499 DatasetConnectorEventStream { event_receiver: self.client.take_event_receiver() }
1500 }
1501
1502 pub fn r#connect(
1519 &self,
1520 mut name: &str,
1521 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1522 ) -> Result<(), fidl::Error> {
1523 DatasetConnectorProxyInterface::r#connect(self, name, server_end)
1524 }
1525}
1526
1527impl DatasetConnectorProxyInterface for DatasetConnectorProxy {
1528 fn r#connect(
1529 &self,
1530 mut name: &str,
1531 mut server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1532 ) -> Result<(), fidl::Error> {
1533 self.client.send::<DatasetConnectorConnectRequest>(
1534 (name, server_end),
1535 0x24dff5d2c0cee02b,
1536 fidl::encoding::DynamicFlags::empty(),
1537 )
1538 }
1539}
1540
1541pub struct DatasetConnectorEventStream {
1542 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1543}
1544
1545impl std::marker::Unpin for DatasetConnectorEventStream {}
1546
1547impl futures::stream::FusedStream for DatasetConnectorEventStream {
1548 fn is_terminated(&self) -> bool {
1549 self.event_receiver.is_terminated()
1550 }
1551}
1552
1553impl futures::Stream for DatasetConnectorEventStream {
1554 type Item = Result<DatasetConnectorEvent, fidl::Error>;
1555
1556 fn poll_next(
1557 mut self: std::pin::Pin<&mut Self>,
1558 cx: &mut std::task::Context<'_>,
1559 ) -> std::task::Poll<Option<Self::Item>> {
1560 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1561 &mut self.event_receiver,
1562 cx
1563 )?) {
1564 Some(buf) => std::task::Poll::Ready(Some(DatasetConnectorEvent::decode(buf))),
1565 None => std::task::Poll::Ready(None),
1566 }
1567 }
1568}
1569
1570#[derive(Debug)]
1571pub enum DatasetConnectorEvent {}
1572
1573impl DatasetConnectorEvent {
1574 fn decode(
1576 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1577 ) -> Result<DatasetConnectorEvent, fidl::Error> {
1578 let (bytes, _handles) = buf.split_mut();
1579 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1580 debug_assert_eq!(tx_header.tx_id, 0);
1581 match tx_header.ordinal {
1582 _ => Err(fidl::Error::UnknownOrdinal {
1583 ordinal: tx_header.ordinal,
1584 protocol_name:
1585 <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1586 }),
1587 }
1588 }
1589}
1590
1591pub struct DatasetConnectorRequestStream {
1593 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1594 is_terminated: bool,
1595}
1596
1597impl std::marker::Unpin for DatasetConnectorRequestStream {}
1598
1599impl futures::stream::FusedStream for DatasetConnectorRequestStream {
1600 fn is_terminated(&self) -> bool {
1601 self.is_terminated
1602 }
1603}
1604
1605impl fidl::endpoints::RequestStream for DatasetConnectorRequestStream {
1606 type Protocol = DatasetConnectorMarker;
1607 type ControlHandle = DatasetConnectorControlHandle;
1608
1609 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1610 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1611 }
1612
1613 fn control_handle(&self) -> Self::ControlHandle {
1614 DatasetConnectorControlHandle { inner: self.inner.clone() }
1615 }
1616
1617 fn into_inner(
1618 self,
1619 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1620 {
1621 (self.inner, self.is_terminated)
1622 }
1623
1624 fn from_inner(
1625 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1626 is_terminated: bool,
1627 ) -> Self {
1628 Self { inner, is_terminated }
1629 }
1630}
1631
1632impl futures::Stream for DatasetConnectorRequestStream {
1633 type Item = Result<DatasetConnectorRequest, fidl::Error>;
1634
1635 fn poll_next(
1636 mut self: std::pin::Pin<&mut Self>,
1637 cx: &mut std::task::Context<'_>,
1638 ) -> std::task::Poll<Option<Self::Item>> {
1639 let this = &mut *self;
1640 if this.inner.check_shutdown(cx) {
1641 this.is_terminated = true;
1642 return std::task::Poll::Ready(None);
1643 }
1644 if this.is_terminated {
1645 panic!("polled DatasetConnectorRequestStream after completion");
1646 }
1647 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1648 |bytes, handles| {
1649 match this.inner.channel().read_etc(cx, bytes, handles) {
1650 std::task::Poll::Ready(Ok(())) => {}
1651 std::task::Poll::Pending => return std::task::Poll::Pending,
1652 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1653 this.is_terminated = true;
1654 return std::task::Poll::Ready(None);
1655 }
1656 std::task::Poll::Ready(Err(e)) => {
1657 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1658 e.into(),
1659 ))));
1660 }
1661 }
1662
1663 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1665
1666 std::task::Poll::Ready(Some(match header.ordinal {
1667 0x24dff5d2c0cee02b => {
1668 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1669 let mut req = fidl::new_empty!(
1670 DatasetConnectorConnectRequest,
1671 fidl::encoding::DefaultFuchsiaResourceDialect
1672 );
1673 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DatasetConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
1674 let control_handle =
1675 DatasetConnectorControlHandle { inner: this.inner.clone() };
1676 Ok(DatasetConnectorRequest::Connect {
1677 name: req.name,
1678 server_end: req.server_end,
1679
1680 control_handle,
1681 })
1682 }
1683 _ => Err(fidl::Error::UnknownOrdinal {
1684 ordinal: header.ordinal,
1685 protocol_name:
1686 <DatasetConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1687 }),
1688 }))
1689 },
1690 )
1691 }
1692}
1693
1694#[derive(Debug)]
1696pub enum DatasetConnectorRequest {
1697 Connect {
1714 name: String,
1715 server_end: fidl::endpoints::ServerEnd<DatasetMarker>,
1716 control_handle: DatasetConnectorControlHandle,
1717 },
1718}
1719
1720impl DatasetConnectorRequest {
1721 #[allow(irrefutable_let_patterns)]
1722 pub fn into_connect(
1723 self,
1724 ) -> Option<(String, fidl::endpoints::ServerEnd<DatasetMarker>, DatasetConnectorControlHandle)>
1725 {
1726 if let DatasetConnectorRequest::Connect { name, server_end, control_handle } = self {
1727 Some((name, server_end, control_handle))
1728 } else {
1729 None
1730 }
1731 }
1732
1733 pub fn method_name(&self) -> &'static str {
1735 match *self {
1736 DatasetConnectorRequest::Connect { .. } => "connect",
1737 }
1738 }
1739}
1740
1741#[derive(Debug, Clone)]
1742pub struct DatasetConnectorControlHandle {
1743 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1744}
1745
1746impl DatasetConnectorControlHandle {
1747 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1748 self.inner.shutdown_with_epitaph(status.into())
1749 }
1750}
1751
1752impl fidl::endpoints::ControlHandle for DatasetConnectorControlHandle {
1753 fn shutdown(&self) {
1754 self.inner.shutdown()
1755 }
1756
1757 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1758 self.inner.shutdown_with_epitaph(status)
1759 }
1760
1761 fn is_closed(&self) -> bool {
1762 self.inner.channel().is_closed()
1763 }
1764 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1765 self.inner.channel().on_closed()
1766 }
1767
1768 #[cfg(target_os = "fuchsia")]
1769 fn signal_peer(
1770 &self,
1771 clear_mask: zx::Signals,
1772 set_mask: zx::Signals,
1773 ) -> Result<(), zx_status::Status> {
1774 use fidl::Peered;
1775 self.inner.channel().signal_peer(clear_mask, set_mask)
1776 }
1777}
1778
1779impl DatasetConnectorControlHandle {}
1780
1781#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1782pub struct EpskcMarker;
1783
1784impl fidl::endpoints::ProtocolMarker for EpskcMarker {
1785 type Proxy = EpskcProxy;
1786 type RequestStream = EpskcRequestStream;
1787 #[cfg(target_os = "fuchsia")]
1788 type SynchronousProxy = EpskcSynchronousProxy;
1789
1790 const DEBUG_NAME: &'static str = "(anonymous) Epskc";
1791}
1792pub type EpskcStartEphemeralKeyResult = Result<Vec<u8>, i32>;
1793pub type EpskcStopEphemeralKeyResult = Result<(), i32>;
1794
1795pub trait EpskcProxyInterface: Send + Sync {
1796 type StartEphemeralKeyResponseFut: std::future::Future<Output = Result<EpskcStartEphemeralKeyResult, fidl::Error>>
1797 + Send;
1798 fn r#start_ephemeral_key(&self, lifetime: u32) -> Self::StartEphemeralKeyResponseFut;
1799 type StopEphemeralKeyResponseFut: std::future::Future<Output = Result<EpskcStopEphemeralKeyResult, fidl::Error>>
1800 + Send;
1801 fn r#stop_ephemeral_key(
1802 &self,
1803 retain_active_session: bool,
1804 ) -> Self::StopEphemeralKeyResponseFut;
1805 type WatchEphemeralKeyStateResponseFut: std::future::Future<Output = Result<EphemeralKeyState, fidl::Error>>
1806 + Send;
1807 fn r#watch_ephemeral_key_state(&self) -> Self::WatchEphemeralKeyStateResponseFut;
1808}
1809#[derive(Debug)]
1810#[cfg(target_os = "fuchsia")]
1811pub struct EpskcSynchronousProxy {
1812 client: fidl::client::sync::Client,
1813}
1814
1815#[cfg(target_os = "fuchsia")]
1816impl fidl::endpoints::SynchronousProxy for EpskcSynchronousProxy {
1817 type Proxy = EpskcProxy;
1818 type Protocol = EpskcMarker;
1819
1820 fn from_channel(inner: fidl::Channel) -> Self {
1821 Self::new(inner)
1822 }
1823
1824 fn into_channel(self) -> fidl::Channel {
1825 self.client.into_channel()
1826 }
1827
1828 fn as_channel(&self) -> &fidl::Channel {
1829 self.client.as_channel()
1830 }
1831}
1832
1833#[cfg(target_os = "fuchsia")]
1834impl EpskcSynchronousProxy {
1835 pub fn new(channel: fidl::Channel) -> Self {
1836 Self { client: fidl::client::sync::Client::new(channel) }
1837 }
1838
1839 pub fn into_channel(self) -> fidl::Channel {
1840 self.client.into_channel()
1841 }
1842
1843 pub fn wait_for_event(
1846 &self,
1847 deadline: zx::MonotonicInstant,
1848 ) -> Result<EpskcEvent, fidl::Error> {
1849 EpskcEvent::decode(self.client.wait_for_event::<EpskcMarker>(deadline)?)
1850 }
1851
1852 pub fn r#start_ephemeral_key(
1882 &self,
1883 mut lifetime: u32,
1884 ___deadline: zx::MonotonicInstant,
1885 ) -> Result<EpskcStartEphemeralKeyResult, fidl::Error> {
1886 let _response = self.client.send_query::<
1887 EpskcStartEphemeralKeyRequest,
1888 fidl::encoding::FlexibleResultType<EpskcStartEphemeralKeyResponse, i32>,
1889 EpskcMarker,
1890 >(
1891 (lifetime,),
1892 0x215e7ca3dab0a8b7,
1893 fidl::encoding::DynamicFlags::FLEXIBLE,
1894 ___deadline,
1895 )?
1896 .into_result::<EpskcMarker>("start_ephemeral_key")?;
1897 Ok(_response.map(|x| x.key))
1898 }
1899
1900 pub fn r#stop_ephemeral_key(
1912 &self,
1913 mut retain_active_session: bool,
1914 ___deadline: zx::MonotonicInstant,
1915 ) -> Result<EpskcStopEphemeralKeyResult, fidl::Error> {
1916 let _response = self.client.send_query::<
1917 EpskcStopEphemeralKeyRequest,
1918 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1919 EpskcMarker,
1920 >(
1921 (retain_active_session,),
1922 0x33a89ab1cfd88906,
1923 fidl::encoding::DynamicFlags::FLEXIBLE,
1924 ___deadline,
1925 )?
1926 .into_result::<EpskcMarker>("stop_ephemeral_key")?;
1927 Ok(_response.map(|x| x))
1928 }
1929
1930 pub fn r#watch_ephemeral_key_state(
1946 &self,
1947 ___deadline: zx::MonotonicInstant,
1948 ) -> Result<EphemeralKeyState, fidl::Error> {
1949 let _response = self.client.send_query::<
1950 fidl::encoding::EmptyPayload,
1951 fidl::encoding::FlexibleType<EpskcWatchEphemeralKeyStateResponse>,
1952 EpskcMarker,
1953 >(
1954 (),
1955 0x7b1d12c0c02988c3,
1956 fidl::encoding::DynamicFlags::FLEXIBLE,
1957 ___deadline,
1958 )?
1959 .into_result::<EpskcMarker>("watch_ephemeral_key_state")?;
1960 Ok(_response.state)
1961 }
1962}
1963
1964#[cfg(target_os = "fuchsia")]
1965impl From<EpskcSynchronousProxy> for zx::NullableHandle {
1966 fn from(value: EpskcSynchronousProxy) -> Self {
1967 value.into_channel().into()
1968 }
1969}
1970
1971#[cfg(target_os = "fuchsia")]
1972impl From<fidl::Channel> for EpskcSynchronousProxy {
1973 fn from(value: fidl::Channel) -> Self {
1974 Self::new(value)
1975 }
1976}
1977
1978#[cfg(target_os = "fuchsia")]
1979impl fidl::endpoints::FromClient for EpskcSynchronousProxy {
1980 type Protocol = EpskcMarker;
1981
1982 fn from_client(value: fidl::endpoints::ClientEnd<EpskcMarker>) -> Self {
1983 Self::new(value.into_channel())
1984 }
1985}
1986
1987#[derive(Debug, Clone)]
1988pub struct EpskcProxy {
1989 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1990}
1991
1992impl fidl::endpoints::Proxy for EpskcProxy {
1993 type Protocol = EpskcMarker;
1994
1995 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1996 Self::new(inner)
1997 }
1998
1999 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2000 self.client.into_channel().map_err(|client| Self { client })
2001 }
2002
2003 fn as_channel(&self) -> &::fidl::AsyncChannel {
2004 self.client.as_channel()
2005 }
2006}
2007
2008impl EpskcProxy {
2009 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2011 let protocol_name = <EpskcMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2012 Self { client: fidl::client::Client::new(channel, protocol_name) }
2013 }
2014
2015 pub fn take_event_stream(&self) -> EpskcEventStream {
2021 EpskcEventStream { event_receiver: self.client.take_event_receiver() }
2022 }
2023
2024 pub fn r#start_ephemeral_key(
2054 &self,
2055 mut lifetime: u32,
2056 ) -> fidl::client::QueryResponseFut<
2057 EpskcStartEphemeralKeyResult,
2058 fidl::encoding::DefaultFuchsiaResourceDialect,
2059 > {
2060 EpskcProxyInterface::r#start_ephemeral_key(self, lifetime)
2061 }
2062
2063 pub fn r#stop_ephemeral_key(
2075 &self,
2076 mut retain_active_session: bool,
2077 ) -> fidl::client::QueryResponseFut<
2078 EpskcStopEphemeralKeyResult,
2079 fidl::encoding::DefaultFuchsiaResourceDialect,
2080 > {
2081 EpskcProxyInterface::r#stop_ephemeral_key(self, retain_active_session)
2082 }
2083
2084 pub fn r#watch_ephemeral_key_state(
2100 &self,
2101 ) -> fidl::client::QueryResponseFut<
2102 EphemeralKeyState,
2103 fidl::encoding::DefaultFuchsiaResourceDialect,
2104 > {
2105 EpskcProxyInterface::r#watch_ephemeral_key_state(self)
2106 }
2107}
2108
2109impl EpskcProxyInterface for EpskcProxy {
2110 type StartEphemeralKeyResponseFut = fidl::client::QueryResponseFut<
2111 EpskcStartEphemeralKeyResult,
2112 fidl::encoding::DefaultFuchsiaResourceDialect,
2113 >;
2114 fn r#start_ephemeral_key(&self, mut lifetime: u32) -> Self::StartEphemeralKeyResponseFut {
2115 fn _decode(
2116 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2117 ) -> Result<EpskcStartEphemeralKeyResult, fidl::Error> {
2118 let _response = fidl::client::decode_transaction_body::<
2119 fidl::encoding::FlexibleResultType<EpskcStartEphemeralKeyResponse, i32>,
2120 fidl::encoding::DefaultFuchsiaResourceDialect,
2121 0x215e7ca3dab0a8b7,
2122 >(_buf?)?
2123 .into_result::<EpskcMarker>("start_ephemeral_key")?;
2124 Ok(_response.map(|x| x.key))
2125 }
2126 self.client
2127 .send_query_and_decode::<EpskcStartEphemeralKeyRequest, EpskcStartEphemeralKeyResult>(
2128 (lifetime,),
2129 0x215e7ca3dab0a8b7,
2130 fidl::encoding::DynamicFlags::FLEXIBLE,
2131 _decode,
2132 )
2133 }
2134
2135 type StopEphemeralKeyResponseFut = fidl::client::QueryResponseFut<
2136 EpskcStopEphemeralKeyResult,
2137 fidl::encoding::DefaultFuchsiaResourceDialect,
2138 >;
2139 fn r#stop_ephemeral_key(
2140 &self,
2141 mut retain_active_session: bool,
2142 ) -> Self::StopEphemeralKeyResponseFut {
2143 fn _decode(
2144 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2145 ) -> Result<EpskcStopEphemeralKeyResult, fidl::Error> {
2146 let _response = fidl::client::decode_transaction_body::<
2147 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2148 fidl::encoding::DefaultFuchsiaResourceDialect,
2149 0x33a89ab1cfd88906,
2150 >(_buf?)?
2151 .into_result::<EpskcMarker>("stop_ephemeral_key")?;
2152 Ok(_response.map(|x| x))
2153 }
2154 self.client
2155 .send_query_and_decode::<EpskcStopEphemeralKeyRequest, EpskcStopEphemeralKeyResult>(
2156 (retain_active_session,),
2157 0x33a89ab1cfd88906,
2158 fidl::encoding::DynamicFlags::FLEXIBLE,
2159 _decode,
2160 )
2161 }
2162
2163 type WatchEphemeralKeyStateResponseFut = fidl::client::QueryResponseFut<
2164 EphemeralKeyState,
2165 fidl::encoding::DefaultFuchsiaResourceDialect,
2166 >;
2167 fn r#watch_ephemeral_key_state(&self) -> Self::WatchEphemeralKeyStateResponseFut {
2168 fn _decode(
2169 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2170 ) -> Result<EphemeralKeyState, fidl::Error> {
2171 let _response = fidl::client::decode_transaction_body::<
2172 fidl::encoding::FlexibleType<EpskcWatchEphemeralKeyStateResponse>,
2173 fidl::encoding::DefaultFuchsiaResourceDialect,
2174 0x7b1d12c0c02988c3,
2175 >(_buf?)?
2176 .into_result::<EpskcMarker>("watch_ephemeral_key_state")?;
2177 Ok(_response.state)
2178 }
2179 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, EphemeralKeyState>(
2180 (),
2181 0x7b1d12c0c02988c3,
2182 fidl::encoding::DynamicFlags::FLEXIBLE,
2183 _decode,
2184 )
2185 }
2186}
2187
2188pub struct EpskcEventStream {
2189 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2190}
2191
2192impl std::marker::Unpin for EpskcEventStream {}
2193
2194impl futures::stream::FusedStream for EpskcEventStream {
2195 fn is_terminated(&self) -> bool {
2196 self.event_receiver.is_terminated()
2197 }
2198}
2199
2200impl futures::Stream for EpskcEventStream {
2201 type Item = Result<EpskcEvent, fidl::Error>;
2202
2203 fn poll_next(
2204 mut self: std::pin::Pin<&mut Self>,
2205 cx: &mut std::task::Context<'_>,
2206 ) -> std::task::Poll<Option<Self::Item>> {
2207 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2208 &mut self.event_receiver,
2209 cx
2210 )?) {
2211 Some(buf) => std::task::Poll::Ready(Some(EpskcEvent::decode(buf))),
2212 None => std::task::Poll::Ready(None),
2213 }
2214 }
2215}
2216
2217#[derive(Debug)]
2218pub enum EpskcEvent {
2219 #[non_exhaustive]
2220 _UnknownEvent {
2221 ordinal: u64,
2223 },
2224}
2225
2226impl EpskcEvent {
2227 fn decode(
2229 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2230 ) -> Result<EpskcEvent, fidl::Error> {
2231 let (bytes, _handles) = buf.split_mut();
2232 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2233 debug_assert_eq!(tx_header.tx_id, 0);
2234 match tx_header.ordinal {
2235 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2236 Ok(EpskcEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2237 }
2238 _ => Err(fidl::Error::UnknownOrdinal {
2239 ordinal: tx_header.ordinal,
2240 protocol_name: <EpskcMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2241 }),
2242 }
2243 }
2244}
2245
2246pub struct EpskcRequestStream {
2248 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2249 is_terminated: bool,
2250}
2251
2252impl std::marker::Unpin for EpskcRequestStream {}
2253
2254impl futures::stream::FusedStream for EpskcRequestStream {
2255 fn is_terminated(&self) -> bool {
2256 self.is_terminated
2257 }
2258}
2259
2260impl fidl::endpoints::RequestStream for EpskcRequestStream {
2261 type Protocol = EpskcMarker;
2262 type ControlHandle = EpskcControlHandle;
2263
2264 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2265 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2266 }
2267
2268 fn control_handle(&self) -> Self::ControlHandle {
2269 EpskcControlHandle { inner: self.inner.clone() }
2270 }
2271
2272 fn into_inner(
2273 self,
2274 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2275 {
2276 (self.inner, self.is_terminated)
2277 }
2278
2279 fn from_inner(
2280 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2281 is_terminated: bool,
2282 ) -> Self {
2283 Self { inner, is_terminated }
2284 }
2285}
2286
2287impl futures::Stream for EpskcRequestStream {
2288 type Item = Result<EpskcRequest, fidl::Error>;
2289
2290 fn poll_next(
2291 mut self: std::pin::Pin<&mut Self>,
2292 cx: &mut std::task::Context<'_>,
2293 ) -> std::task::Poll<Option<Self::Item>> {
2294 let this = &mut *self;
2295 if this.inner.check_shutdown(cx) {
2296 this.is_terminated = true;
2297 return std::task::Poll::Ready(None);
2298 }
2299 if this.is_terminated {
2300 panic!("polled EpskcRequestStream after completion");
2301 }
2302 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2303 |bytes, handles| {
2304 match this.inner.channel().read_etc(cx, bytes, handles) {
2305 std::task::Poll::Ready(Ok(())) => {}
2306 std::task::Poll::Pending => return std::task::Poll::Pending,
2307 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2308 this.is_terminated = true;
2309 return std::task::Poll::Ready(None);
2310 }
2311 std::task::Poll::Ready(Err(e)) => {
2312 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2313 e.into(),
2314 ))));
2315 }
2316 }
2317
2318 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2320
2321 std::task::Poll::Ready(Some(match header.ordinal {
2322 0x215e7ca3dab0a8b7 => {
2323 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2324 let mut req = fidl::new_empty!(
2325 EpskcStartEphemeralKeyRequest,
2326 fidl::encoding::DefaultFuchsiaResourceDialect
2327 );
2328 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EpskcStartEphemeralKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2329 let control_handle = EpskcControlHandle { inner: this.inner.clone() };
2330 Ok(EpskcRequest::StartEphemeralKey {
2331 lifetime: req.lifetime,
2332
2333 responder: EpskcStartEphemeralKeyResponder {
2334 control_handle: std::mem::ManuallyDrop::new(control_handle),
2335 tx_id: header.tx_id,
2336 },
2337 })
2338 }
2339 0x33a89ab1cfd88906 => {
2340 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2341 let mut req = fidl::new_empty!(
2342 EpskcStopEphemeralKeyRequest,
2343 fidl::encoding::DefaultFuchsiaResourceDialect
2344 );
2345 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EpskcStopEphemeralKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2346 let control_handle = EpskcControlHandle { inner: this.inner.clone() };
2347 Ok(EpskcRequest::StopEphemeralKey {
2348 retain_active_session: req.retain_active_session,
2349
2350 responder: EpskcStopEphemeralKeyResponder {
2351 control_handle: std::mem::ManuallyDrop::new(control_handle),
2352 tx_id: header.tx_id,
2353 },
2354 })
2355 }
2356 0x7b1d12c0c02988c3 => {
2357 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2358 let mut req = fidl::new_empty!(
2359 fidl::encoding::EmptyPayload,
2360 fidl::encoding::DefaultFuchsiaResourceDialect
2361 );
2362 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2363 let control_handle = EpskcControlHandle { inner: this.inner.clone() };
2364 Ok(EpskcRequest::WatchEphemeralKeyState {
2365 responder: EpskcWatchEphemeralKeyStateResponder {
2366 control_handle: std::mem::ManuallyDrop::new(control_handle),
2367 tx_id: header.tx_id,
2368 },
2369 })
2370 }
2371 _ if header.tx_id == 0
2372 && header
2373 .dynamic_flags()
2374 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2375 {
2376 Ok(EpskcRequest::_UnknownMethod {
2377 ordinal: header.ordinal,
2378 control_handle: EpskcControlHandle { inner: this.inner.clone() },
2379 method_type: fidl::MethodType::OneWay,
2380 })
2381 }
2382 _ if header
2383 .dynamic_flags()
2384 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2385 {
2386 this.inner.send_framework_err(
2387 fidl::encoding::FrameworkErr::UnknownMethod,
2388 header.tx_id,
2389 header.ordinal,
2390 header.dynamic_flags(),
2391 (bytes, handles),
2392 )?;
2393 Ok(EpskcRequest::_UnknownMethod {
2394 ordinal: header.ordinal,
2395 control_handle: EpskcControlHandle { inner: this.inner.clone() },
2396 method_type: fidl::MethodType::TwoWay,
2397 })
2398 }
2399 _ => Err(fidl::Error::UnknownOrdinal {
2400 ordinal: header.ordinal,
2401 protocol_name: <EpskcMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2402 }),
2403 }))
2404 },
2405 )
2406 }
2407}
2408
2409#[derive(Debug)]
2414pub enum EpskcRequest {
2415 StartEphemeralKey { lifetime: u32, responder: EpskcStartEphemeralKeyResponder },
2445 StopEphemeralKey { retain_active_session: bool, responder: EpskcStopEphemeralKeyResponder },
2457 WatchEphemeralKeyState { responder: EpskcWatchEphemeralKeyStateResponder },
2473 #[non_exhaustive]
2475 _UnknownMethod {
2476 ordinal: u64,
2478 control_handle: EpskcControlHandle,
2479 method_type: fidl::MethodType,
2480 },
2481}
2482
2483impl EpskcRequest {
2484 #[allow(irrefutable_let_patterns)]
2485 pub fn into_start_ephemeral_key(self) -> Option<(u32, EpskcStartEphemeralKeyResponder)> {
2486 if let EpskcRequest::StartEphemeralKey { lifetime, responder } = self {
2487 Some((lifetime, responder))
2488 } else {
2489 None
2490 }
2491 }
2492
2493 #[allow(irrefutable_let_patterns)]
2494 pub fn into_stop_ephemeral_key(self) -> Option<(bool, EpskcStopEphemeralKeyResponder)> {
2495 if let EpskcRequest::StopEphemeralKey { retain_active_session, responder } = self {
2496 Some((retain_active_session, responder))
2497 } else {
2498 None
2499 }
2500 }
2501
2502 #[allow(irrefutable_let_patterns)]
2503 pub fn into_watch_ephemeral_key_state(self) -> Option<(EpskcWatchEphemeralKeyStateResponder)> {
2504 if let EpskcRequest::WatchEphemeralKeyState { responder } = self {
2505 Some((responder))
2506 } else {
2507 None
2508 }
2509 }
2510
2511 pub fn method_name(&self) -> &'static str {
2513 match *self {
2514 EpskcRequest::StartEphemeralKey { .. } => "start_ephemeral_key",
2515 EpskcRequest::StopEphemeralKey { .. } => "stop_ephemeral_key",
2516 EpskcRequest::WatchEphemeralKeyState { .. } => "watch_ephemeral_key_state",
2517 EpskcRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2518 "unknown one-way method"
2519 }
2520 EpskcRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2521 "unknown two-way method"
2522 }
2523 }
2524 }
2525}
2526
2527#[derive(Debug, Clone)]
2528pub struct EpskcControlHandle {
2529 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2530}
2531
2532impl EpskcControlHandle {
2533 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2534 self.inner.shutdown_with_epitaph(status.into())
2535 }
2536}
2537
2538impl fidl::endpoints::ControlHandle for EpskcControlHandle {
2539 fn shutdown(&self) {
2540 self.inner.shutdown()
2541 }
2542
2543 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2544 self.inner.shutdown_with_epitaph(status)
2545 }
2546
2547 fn is_closed(&self) -> bool {
2548 self.inner.channel().is_closed()
2549 }
2550 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2551 self.inner.channel().on_closed()
2552 }
2553
2554 #[cfg(target_os = "fuchsia")]
2555 fn signal_peer(
2556 &self,
2557 clear_mask: zx::Signals,
2558 set_mask: zx::Signals,
2559 ) -> Result<(), zx_status::Status> {
2560 use fidl::Peered;
2561 self.inner.channel().signal_peer(clear_mask, set_mask)
2562 }
2563}
2564
2565impl EpskcControlHandle {}
2566
2567#[must_use = "FIDL methods require a response to be sent"]
2568#[derive(Debug)]
2569pub struct EpskcStartEphemeralKeyResponder {
2570 control_handle: std::mem::ManuallyDrop<EpskcControlHandle>,
2571 tx_id: u32,
2572}
2573
2574impl std::ops::Drop for EpskcStartEphemeralKeyResponder {
2578 fn drop(&mut self) {
2579 self.control_handle.shutdown();
2580 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2582 }
2583}
2584
2585impl fidl::endpoints::Responder for EpskcStartEphemeralKeyResponder {
2586 type ControlHandle = EpskcControlHandle;
2587
2588 fn control_handle(&self) -> &EpskcControlHandle {
2589 &self.control_handle
2590 }
2591
2592 fn drop_without_shutdown(mut self) {
2593 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2595 std::mem::forget(self);
2597 }
2598}
2599
2600impl EpskcStartEphemeralKeyResponder {
2601 pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2605 let _result = self.send_raw(result);
2606 if _result.is_err() {
2607 self.control_handle.shutdown();
2608 }
2609 self.drop_without_shutdown();
2610 _result
2611 }
2612
2613 pub fn send_no_shutdown_on_err(
2615 self,
2616 mut result: Result<&[u8], i32>,
2617 ) -> Result<(), fidl::Error> {
2618 let _result = self.send_raw(result);
2619 self.drop_without_shutdown();
2620 _result
2621 }
2622
2623 fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2624 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2625 EpskcStartEphemeralKeyResponse,
2626 i32,
2627 >>(
2628 fidl::encoding::FlexibleResult::new(result.map(|key| (key,))),
2629 self.tx_id,
2630 0x215e7ca3dab0a8b7,
2631 fidl::encoding::DynamicFlags::FLEXIBLE,
2632 )
2633 }
2634}
2635
2636#[must_use = "FIDL methods require a response to be sent"]
2637#[derive(Debug)]
2638pub struct EpskcStopEphemeralKeyResponder {
2639 control_handle: std::mem::ManuallyDrop<EpskcControlHandle>,
2640 tx_id: u32,
2641}
2642
2643impl std::ops::Drop for EpskcStopEphemeralKeyResponder {
2647 fn drop(&mut self) {
2648 self.control_handle.shutdown();
2649 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2651 }
2652}
2653
2654impl fidl::endpoints::Responder for EpskcStopEphemeralKeyResponder {
2655 type ControlHandle = EpskcControlHandle;
2656
2657 fn control_handle(&self) -> &EpskcControlHandle {
2658 &self.control_handle
2659 }
2660
2661 fn drop_without_shutdown(mut self) {
2662 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2664 std::mem::forget(self);
2666 }
2667}
2668
2669impl EpskcStopEphemeralKeyResponder {
2670 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2674 let _result = self.send_raw(result);
2675 if _result.is_err() {
2676 self.control_handle.shutdown();
2677 }
2678 self.drop_without_shutdown();
2679 _result
2680 }
2681
2682 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2684 let _result = self.send_raw(result);
2685 self.drop_without_shutdown();
2686 _result
2687 }
2688
2689 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2690 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2691 fidl::encoding::EmptyStruct,
2692 i32,
2693 >>(
2694 fidl::encoding::FlexibleResult::new(result),
2695 self.tx_id,
2696 0x33a89ab1cfd88906,
2697 fidl::encoding::DynamicFlags::FLEXIBLE,
2698 )
2699 }
2700}
2701
2702#[must_use = "FIDL methods require a response to be sent"]
2703#[derive(Debug)]
2704pub struct EpskcWatchEphemeralKeyStateResponder {
2705 control_handle: std::mem::ManuallyDrop<EpskcControlHandle>,
2706 tx_id: u32,
2707}
2708
2709impl std::ops::Drop for EpskcWatchEphemeralKeyStateResponder {
2713 fn drop(&mut self) {
2714 self.control_handle.shutdown();
2715 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2717 }
2718}
2719
2720impl fidl::endpoints::Responder for EpskcWatchEphemeralKeyStateResponder {
2721 type ControlHandle = EpskcControlHandle;
2722
2723 fn control_handle(&self) -> &EpskcControlHandle {
2724 &self.control_handle
2725 }
2726
2727 fn drop_without_shutdown(mut self) {
2728 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2730 std::mem::forget(self);
2732 }
2733}
2734
2735impl EpskcWatchEphemeralKeyStateResponder {
2736 pub fn send(self, mut state: EphemeralKeyState) -> Result<(), fidl::Error> {
2740 let _result = self.send_raw(state);
2741 if _result.is_err() {
2742 self.control_handle.shutdown();
2743 }
2744 self.drop_without_shutdown();
2745 _result
2746 }
2747
2748 pub fn send_no_shutdown_on_err(self, mut state: EphemeralKeyState) -> Result<(), fidl::Error> {
2750 let _result = self.send_raw(state);
2751 self.drop_without_shutdown();
2752 _result
2753 }
2754
2755 fn send_raw(&self, mut state: EphemeralKeyState) -> Result<(), fidl::Error> {
2756 self.control_handle
2757 .inner
2758 .send::<fidl::encoding::FlexibleType<EpskcWatchEphemeralKeyStateResponse>>(
2759 fidl::encoding::Flexible::new((state,)),
2760 self.tx_id,
2761 0x7b1d12c0c02988c3,
2762 fidl::encoding::DynamicFlags::FLEXIBLE,
2763 )
2764 }
2765}
2766
2767#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2768pub struct EpskcConnectorMarker;
2769
2770impl fidl::endpoints::ProtocolMarker for EpskcConnectorMarker {
2771 type Proxy = EpskcConnectorProxy;
2772 type RequestStream = EpskcConnectorRequestStream;
2773 #[cfg(target_os = "fuchsia")]
2774 type SynchronousProxy = EpskcConnectorSynchronousProxy;
2775
2776 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.EpskcConnector";
2777}
2778impl fidl::endpoints::DiscoverableProtocolMarker for EpskcConnectorMarker {}
2779
2780pub trait EpskcConnectorProxyInterface: Send + Sync {
2781 fn r#connect(
2782 &self,
2783 name: &str,
2784 server_end: fidl::endpoints::ServerEnd<EpskcMarker>,
2785 ) -> Result<(), fidl::Error>;
2786}
2787#[derive(Debug)]
2788#[cfg(target_os = "fuchsia")]
2789pub struct EpskcConnectorSynchronousProxy {
2790 client: fidl::client::sync::Client,
2791}
2792
2793#[cfg(target_os = "fuchsia")]
2794impl fidl::endpoints::SynchronousProxy for EpskcConnectorSynchronousProxy {
2795 type Proxy = EpskcConnectorProxy;
2796 type Protocol = EpskcConnectorMarker;
2797
2798 fn from_channel(inner: fidl::Channel) -> Self {
2799 Self::new(inner)
2800 }
2801
2802 fn into_channel(self) -> fidl::Channel {
2803 self.client.into_channel()
2804 }
2805
2806 fn as_channel(&self) -> &fidl::Channel {
2807 self.client.as_channel()
2808 }
2809}
2810
2811#[cfg(target_os = "fuchsia")]
2812impl EpskcConnectorSynchronousProxy {
2813 pub fn new(channel: fidl::Channel) -> Self {
2814 Self { client: fidl::client::sync::Client::new(channel) }
2815 }
2816
2817 pub fn into_channel(self) -> fidl::Channel {
2818 self.client.into_channel()
2819 }
2820
2821 pub fn wait_for_event(
2824 &self,
2825 deadline: zx::MonotonicInstant,
2826 ) -> Result<EpskcConnectorEvent, fidl::Error> {
2827 EpskcConnectorEvent::decode(self.client.wait_for_event::<EpskcConnectorMarker>(deadline)?)
2828 }
2829
2830 pub fn r#connect(
2847 &self,
2848 mut name: &str,
2849 mut server_end: fidl::endpoints::ServerEnd<EpskcMarker>,
2850 ) -> Result<(), fidl::Error> {
2851 self.client.send::<EpskcConnectorConnectRequest>(
2852 (name, server_end),
2853 0x1df4842606b2f03c,
2854 fidl::encoding::DynamicFlags::FLEXIBLE,
2855 )
2856 }
2857}
2858
2859#[cfg(target_os = "fuchsia")]
2860impl From<EpskcConnectorSynchronousProxy> for zx::NullableHandle {
2861 fn from(value: EpskcConnectorSynchronousProxy) -> Self {
2862 value.into_channel().into()
2863 }
2864}
2865
2866#[cfg(target_os = "fuchsia")]
2867impl From<fidl::Channel> for EpskcConnectorSynchronousProxy {
2868 fn from(value: fidl::Channel) -> Self {
2869 Self::new(value)
2870 }
2871}
2872
2873#[cfg(target_os = "fuchsia")]
2874impl fidl::endpoints::FromClient for EpskcConnectorSynchronousProxy {
2875 type Protocol = EpskcConnectorMarker;
2876
2877 fn from_client(value: fidl::endpoints::ClientEnd<EpskcConnectorMarker>) -> Self {
2878 Self::new(value.into_channel())
2879 }
2880}
2881
2882#[derive(Debug, Clone)]
2883pub struct EpskcConnectorProxy {
2884 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2885}
2886
2887impl fidl::endpoints::Proxy for EpskcConnectorProxy {
2888 type Protocol = EpskcConnectorMarker;
2889
2890 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2891 Self::new(inner)
2892 }
2893
2894 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2895 self.client.into_channel().map_err(|client| Self { client })
2896 }
2897
2898 fn as_channel(&self) -> &::fidl::AsyncChannel {
2899 self.client.as_channel()
2900 }
2901}
2902
2903impl EpskcConnectorProxy {
2904 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2906 let protocol_name = <EpskcConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2907 Self { client: fidl::client::Client::new(channel, protocol_name) }
2908 }
2909
2910 pub fn take_event_stream(&self) -> EpskcConnectorEventStream {
2916 EpskcConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2917 }
2918
2919 pub fn r#connect(
2936 &self,
2937 mut name: &str,
2938 mut server_end: fidl::endpoints::ServerEnd<EpskcMarker>,
2939 ) -> Result<(), fidl::Error> {
2940 EpskcConnectorProxyInterface::r#connect(self, name, server_end)
2941 }
2942}
2943
2944impl EpskcConnectorProxyInterface for EpskcConnectorProxy {
2945 fn r#connect(
2946 &self,
2947 mut name: &str,
2948 mut server_end: fidl::endpoints::ServerEnd<EpskcMarker>,
2949 ) -> Result<(), fidl::Error> {
2950 self.client.send::<EpskcConnectorConnectRequest>(
2951 (name, server_end),
2952 0x1df4842606b2f03c,
2953 fidl::encoding::DynamicFlags::FLEXIBLE,
2954 )
2955 }
2956}
2957
2958pub struct EpskcConnectorEventStream {
2959 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2960}
2961
2962impl std::marker::Unpin for EpskcConnectorEventStream {}
2963
2964impl futures::stream::FusedStream for EpskcConnectorEventStream {
2965 fn is_terminated(&self) -> bool {
2966 self.event_receiver.is_terminated()
2967 }
2968}
2969
2970impl futures::Stream for EpskcConnectorEventStream {
2971 type Item = Result<EpskcConnectorEvent, fidl::Error>;
2972
2973 fn poll_next(
2974 mut self: std::pin::Pin<&mut Self>,
2975 cx: &mut std::task::Context<'_>,
2976 ) -> std::task::Poll<Option<Self::Item>> {
2977 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2978 &mut self.event_receiver,
2979 cx
2980 )?) {
2981 Some(buf) => std::task::Poll::Ready(Some(EpskcConnectorEvent::decode(buf))),
2982 None => std::task::Poll::Ready(None),
2983 }
2984 }
2985}
2986
2987#[derive(Debug)]
2988pub enum EpskcConnectorEvent {
2989 #[non_exhaustive]
2990 _UnknownEvent {
2991 ordinal: u64,
2993 },
2994}
2995
2996impl EpskcConnectorEvent {
2997 fn decode(
2999 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3000 ) -> Result<EpskcConnectorEvent, fidl::Error> {
3001 let (bytes, _handles) = buf.split_mut();
3002 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3003 debug_assert_eq!(tx_header.tx_id, 0);
3004 match tx_header.ordinal {
3005 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3006 Ok(EpskcConnectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3007 }
3008 _ => Err(fidl::Error::UnknownOrdinal {
3009 ordinal: tx_header.ordinal,
3010 protocol_name:
3011 <EpskcConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3012 }),
3013 }
3014 }
3015}
3016
3017pub struct EpskcConnectorRequestStream {
3019 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3020 is_terminated: bool,
3021}
3022
3023impl std::marker::Unpin for EpskcConnectorRequestStream {}
3024
3025impl futures::stream::FusedStream for EpskcConnectorRequestStream {
3026 fn is_terminated(&self) -> bool {
3027 self.is_terminated
3028 }
3029}
3030
3031impl fidl::endpoints::RequestStream for EpskcConnectorRequestStream {
3032 type Protocol = EpskcConnectorMarker;
3033 type ControlHandle = EpskcConnectorControlHandle;
3034
3035 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3036 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3037 }
3038
3039 fn control_handle(&self) -> Self::ControlHandle {
3040 EpskcConnectorControlHandle { inner: self.inner.clone() }
3041 }
3042
3043 fn into_inner(
3044 self,
3045 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3046 {
3047 (self.inner, self.is_terminated)
3048 }
3049
3050 fn from_inner(
3051 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3052 is_terminated: bool,
3053 ) -> Self {
3054 Self { inner, is_terminated }
3055 }
3056}
3057
3058impl futures::Stream for EpskcConnectorRequestStream {
3059 type Item = Result<EpskcConnectorRequest, fidl::Error>;
3060
3061 fn poll_next(
3062 mut self: std::pin::Pin<&mut Self>,
3063 cx: &mut std::task::Context<'_>,
3064 ) -> std::task::Poll<Option<Self::Item>> {
3065 let this = &mut *self;
3066 if this.inner.check_shutdown(cx) {
3067 this.is_terminated = true;
3068 return std::task::Poll::Ready(None);
3069 }
3070 if this.is_terminated {
3071 panic!("polled EpskcConnectorRequestStream after completion");
3072 }
3073 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3074 |bytes, handles| {
3075 match this.inner.channel().read_etc(cx, bytes, handles) {
3076 std::task::Poll::Ready(Ok(())) => {}
3077 std::task::Poll::Pending => return std::task::Poll::Pending,
3078 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3079 this.is_terminated = true;
3080 return std::task::Poll::Ready(None);
3081 }
3082 std::task::Poll::Ready(Err(e)) => {
3083 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3084 e.into(),
3085 ))));
3086 }
3087 }
3088
3089 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3091
3092 std::task::Poll::Ready(Some(match header.ordinal {
3093 0x1df4842606b2f03c => {
3094 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3095 let mut req = fidl::new_empty!(
3096 EpskcConnectorConnectRequest,
3097 fidl::encoding::DefaultFuchsiaResourceDialect
3098 );
3099 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EpskcConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
3100 let control_handle =
3101 EpskcConnectorControlHandle { inner: this.inner.clone() };
3102 Ok(EpskcConnectorRequest::Connect {
3103 name: req.name,
3104 server_end: req.server_end,
3105
3106 control_handle,
3107 })
3108 }
3109 _ if header.tx_id == 0
3110 && header
3111 .dynamic_flags()
3112 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3113 {
3114 Ok(EpskcConnectorRequest::_UnknownMethod {
3115 ordinal: header.ordinal,
3116 control_handle: EpskcConnectorControlHandle {
3117 inner: this.inner.clone(),
3118 },
3119 method_type: fidl::MethodType::OneWay,
3120 })
3121 }
3122 _ if header
3123 .dynamic_flags()
3124 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3125 {
3126 this.inner.send_framework_err(
3127 fidl::encoding::FrameworkErr::UnknownMethod,
3128 header.tx_id,
3129 header.ordinal,
3130 header.dynamic_flags(),
3131 (bytes, handles),
3132 )?;
3133 Ok(EpskcConnectorRequest::_UnknownMethod {
3134 ordinal: header.ordinal,
3135 control_handle: EpskcConnectorControlHandle {
3136 inner: this.inner.clone(),
3137 },
3138 method_type: fidl::MethodType::TwoWay,
3139 })
3140 }
3141 _ => Err(fidl::Error::UnknownOrdinal {
3142 ordinal: header.ordinal,
3143 protocol_name:
3144 <EpskcConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3145 }),
3146 }))
3147 },
3148 )
3149 }
3150}
3151
3152#[derive(Debug)]
3154pub enum EpskcConnectorRequest {
3155 Connect {
3172 name: String,
3173 server_end: fidl::endpoints::ServerEnd<EpskcMarker>,
3174 control_handle: EpskcConnectorControlHandle,
3175 },
3176 #[non_exhaustive]
3178 _UnknownMethod {
3179 ordinal: u64,
3181 control_handle: EpskcConnectorControlHandle,
3182 method_type: fidl::MethodType,
3183 },
3184}
3185
3186impl EpskcConnectorRequest {
3187 #[allow(irrefutable_let_patterns)]
3188 pub fn into_connect(
3189 self,
3190 ) -> Option<(String, fidl::endpoints::ServerEnd<EpskcMarker>, EpskcConnectorControlHandle)>
3191 {
3192 if let EpskcConnectorRequest::Connect { name, server_end, control_handle } = self {
3193 Some((name, server_end, control_handle))
3194 } else {
3195 None
3196 }
3197 }
3198
3199 pub fn method_name(&self) -> &'static str {
3201 match *self {
3202 EpskcConnectorRequest::Connect { .. } => "connect",
3203 EpskcConnectorRequest::_UnknownMethod {
3204 method_type: fidl::MethodType::OneWay, ..
3205 } => "unknown one-way method",
3206 EpskcConnectorRequest::_UnknownMethod {
3207 method_type: fidl::MethodType::TwoWay, ..
3208 } => "unknown two-way method",
3209 }
3210 }
3211}
3212
3213#[derive(Debug, Clone)]
3214pub struct EpskcConnectorControlHandle {
3215 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3216}
3217
3218impl EpskcConnectorControlHandle {
3219 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3220 self.inner.shutdown_with_epitaph(status.into())
3221 }
3222}
3223
3224impl fidl::endpoints::ControlHandle for EpskcConnectorControlHandle {
3225 fn shutdown(&self) {
3226 self.inner.shutdown()
3227 }
3228
3229 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3230 self.inner.shutdown_with_epitaph(status)
3231 }
3232
3233 fn is_closed(&self) -> bool {
3234 self.inner.channel().is_closed()
3235 }
3236 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3237 self.inner.channel().on_closed()
3238 }
3239
3240 #[cfg(target_os = "fuchsia")]
3241 fn signal_peer(
3242 &self,
3243 clear_mask: zx::Signals,
3244 set_mask: zx::Signals,
3245 ) -> Result<(), zx_status::Status> {
3246 use fidl::Peered;
3247 self.inner.channel().signal_peer(clear_mask, set_mask)
3248 }
3249}
3250
3251impl EpskcConnectorControlHandle {}
3252
3253#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3254pub struct FeatureMarker;
3255
3256impl fidl::endpoints::ProtocolMarker for FeatureMarker {
3257 type Proxy = FeatureProxy;
3258 type RequestStream = FeatureRequestStream;
3259 #[cfg(target_os = "fuchsia")]
3260 type SynchronousProxy = FeatureSynchronousProxy;
3261
3262 const DEBUG_NAME: &'static str = "(anonymous) Feature";
3263}
3264
3265pub trait FeatureProxyInterface: Send + Sync {
3266 type UpdateFeatureConfigResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
3267 + Send;
3268 fn r#update_feature_config(
3269 &self,
3270 config: &FeatureConfig,
3271 ) -> Self::UpdateFeatureConfigResponseFut;
3272 type GetFeatureConfigResponseFut: std::future::Future<Output = Result<FeatureConfig, fidl::Error>>
3273 + Send;
3274 fn r#get_feature_config(&self) -> Self::GetFeatureConfigResponseFut;
3275}
3276#[derive(Debug)]
3277#[cfg(target_os = "fuchsia")]
3278pub struct FeatureSynchronousProxy {
3279 client: fidl::client::sync::Client,
3280}
3281
3282#[cfg(target_os = "fuchsia")]
3283impl fidl::endpoints::SynchronousProxy for FeatureSynchronousProxy {
3284 type Proxy = FeatureProxy;
3285 type Protocol = FeatureMarker;
3286
3287 fn from_channel(inner: fidl::Channel) -> Self {
3288 Self::new(inner)
3289 }
3290
3291 fn into_channel(self) -> fidl::Channel {
3292 self.client.into_channel()
3293 }
3294
3295 fn as_channel(&self) -> &fidl::Channel {
3296 self.client.as_channel()
3297 }
3298}
3299
3300#[cfg(target_os = "fuchsia")]
3301impl FeatureSynchronousProxy {
3302 pub fn new(channel: fidl::Channel) -> Self {
3303 Self { client: fidl::client::sync::Client::new(channel) }
3304 }
3305
3306 pub fn into_channel(self) -> fidl::Channel {
3307 self.client.into_channel()
3308 }
3309
3310 pub fn wait_for_event(
3313 &self,
3314 deadline: zx::MonotonicInstant,
3315 ) -> Result<FeatureEvent, fidl::Error> {
3316 FeatureEvent::decode(self.client.wait_for_event::<FeatureMarker>(deadline)?)
3317 }
3318
3319 pub fn r#update_feature_config(
3324 &self,
3325 mut config: &FeatureConfig,
3326 ___deadline: zx::MonotonicInstant,
3327 ) -> Result<(), fidl::Error> {
3328 let _response = self.client.send_query::<
3329 FeatureUpdateFeatureConfigRequest,
3330 fidl::encoding::EmptyPayload,
3331 FeatureMarker,
3332 >(
3333 (config,),
3334 0x2d24a706e8730410,
3335 fidl::encoding::DynamicFlags::empty(),
3336 ___deadline,
3337 )?;
3338 Ok(_response)
3339 }
3340
3341 pub fn r#get_feature_config(
3347 &self,
3348 ___deadline: zx::MonotonicInstant,
3349 ) -> Result<FeatureConfig, fidl::Error> {
3350 let _response = self.client.send_query::<
3351 fidl::encoding::EmptyPayload,
3352 FeatureGetFeatureConfigResponse,
3353 FeatureMarker,
3354 >(
3355 (),
3356 0x2ab1896aea843611,
3357 fidl::encoding::DynamicFlags::empty(),
3358 ___deadline,
3359 )?;
3360 Ok(_response.config)
3361 }
3362}
3363
3364#[cfg(target_os = "fuchsia")]
3365impl From<FeatureSynchronousProxy> for zx::NullableHandle {
3366 fn from(value: FeatureSynchronousProxy) -> Self {
3367 value.into_channel().into()
3368 }
3369}
3370
3371#[cfg(target_os = "fuchsia")]
3372impl From<fidl::Channel> for FeatureSynchronousProxy {
3373 fn from(value: fidl::Channel) -> Self {
3374 Self::new(value)
3375 }
3376}
3377
3378#[cfg(target_os = "fuchsia")]
3379impl fidl::endpoints::FromClient for FeatureSynchronousProxy {
3380 type Protocol = FeatureMarker;
3381
3382 fn from_client(value: fidl::endpoints::ClientEnd<FeatureMarker>) -> Self {
3383 Self::new(value.into_channel())
3384 }
3385}
3386
3387#[derive(Debug, Clone)]
3388pub struct FeatureProxy {
3389 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3390}
3391
3392impl fidl::endpoints::Proxy for FeatureProxy {
3393 type Protocol = FeatureMarker;
3394
3395 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3396 Self::new(inner)
3397 }
3398
3399 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3400 self.client.into_channel().map_err(|client| Self { client })
3401 }
3402
3403 fn as_channel(&self) -> &::fidl::AsyncChannel {
3404 self.client.as_channel()
3405 }
3406}
3407
3408impl FeatureProxy {
3409 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3411 let protocol_name = <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3412 Self { client: fidl::client::Client::new(channel, protocol_name) }
3413 }
3414
3415 pub fn take_event_stream(&self) -> FeatureEventStream {
3421 FeatureEventStream { event_receiver: self.client.take_event_receiver() }
3422 }
3423
3424 pub fn r#update_feature_config(
3429 &self,
3430 mut config: &FeatureConfig,
3431 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
3432 FeatureProxyInterface::r#update_feature_config(self, config)
3433 }
3434
3435 pub fn r#get_feature_config(
3441 &self,
3442 ) -> fidl::client::QueryResponseFut<FeatureConfig, fidl::encoding::DefaultFuchsiaResourceDialect>
3443 {
3444 FeatureProxyInterface::r#get_feature_config(self)
3445 }
3446}
3447
3448impl FeatureProxyInterface for FeatureProxy {
3449 type UpdateFeatureConfigResponseFut =
3450 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3451 fn r#update_feature_config(
3452 &self,
3453 mut config: &FeatureConfig,
3454 ) -> Self::UpdateFeatureConfigResponseFut {
3455 fn _decode(
3456 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3457 ) -> Result<(), fidl::Error> {
3458 let _response = fidl::client::decode_transaction_body::<
3459 fidl::encoding::EmptyPayload,
3460 fidl::encoding::DefaultFuchsiaResourceDialect,
3461 0x2d24a706e8730410,
3462 >(_buf?)?;
3463 Ok(_response)
3464 }
3465 self.client.send_query_and_decode::<FeatureUpdateFeatureConfigRequest, ()>(
3466 (config,),
3467 0x2d24a706e8730410,
3468 fidl::encoding::DynamicFlags::empty(),
3469 _decode,
3470 )
3471 }
3472
3473 type GetFeatureConfigResponseFut = fidl::client::QueryResponseFut<
3474 FeatureConfig,
3475 fidl::encoding::DefaultFuchsiaResourceDialect,
3476 >;
3477 fn r#get_feature_config(&self) -> Self::GetFeatureConfigResponseFut {
3478 fn _decode(
3479 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3480 ) -> Result<FeatureConfig, fidl::Error> {
3481 let _response = fidl::client::decode_transaction_body::<
3482 FeatureGetFeatureConfigResponse,
3483 fidl::encoding::DefaultFuchsiaResourceDialect,
3484 0x2ab1896aea843611,
3485 >(_buf?)?;
3486 Ok(_response.config)
3487 }
3488 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FeatureConfig>(
3489 (),
3490 0x2ab1896aea843611,
3491 fidl::encoding::DynamicFlags::empty(),
3492 _decode,
3493 )
3494 }
3495}
3496
3497pub struct FeatureEventStream {
3498 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3499}
3500
3501impl std::marker::Unpin for FeatureEventStream {}
3502
3503impl futures::stream::FusedStream for FeatureEventStream {
3504 fn is_terminated(&self) -> bool {
3505 self.event_receiver.is_terminated()
3506 }
3507}
3508
3509impl futures::Stream for FeatureEventStream {
3510 type Item = Result<FeatureEvent, fidl::Error>;
3511
3512 fn poll_next(
3513 mut self: std::pin::Pin<&mut Self>,
3514 cx: &mut std::task::Context<'_>,
3515 ) -> std::task::Poll<Option<Self::Item>> {
3516 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3517 &mut self.event_receiver,
3518 cx
3519 )?) {
3520 Some(buf) => std::task::Poll::Ready(Some(FeatureEvent::decode(buf))),
3521 None => std::task::Poll::Ready(None),
3522 }
3523 }
3524}
3525
3526#[derive(Debug)]
3527pub enum FeatureEvent {}
3528
3529impl FeatureEvent {
3530 fn decode(
3532 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3533 ) -> Result<FeatureEvent, fidl::Error> {
3534 let (bytes, _handles) = buf.split_mut();
3535 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3536 debug_assert_eq!(tx_header.tx_id, 0);
3537 match tx_header.ordinal {
3538 _ => Err(fidl::Error::UnknownOrdinal {
3539 ordinal: tx_header.ordinal,
3540 protocol_name: <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3541 }),
3542 }
3543 }
3544}
3545
3546pub struct FeatureRequestStream {
3548 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3549 is_terminated: bool,
3550}
3551
3552impl std::marker::Unpin for FeatureRequestStream {}
3553
3554impl futures::stream::FusedStream for FeatureRequestStream {
3555 fn is_terminated(&self) -> bool {
3556 self.is_terminated
3557 }
3558}
3559
3560impl fidl::endpoints::RequestStream for FeatureRequestStream {
3561 type Protocol = FeatureMarker;
3562 type ControlHandle = FeatureControlHandle;
3563
3564 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3565 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3566 }
3567
3568 fn control_handle(&self) -> Self::ControlHandle {
3569 FeatureControlHandle { inner: self.inner.clone() }
3570 }
3571
3572 fn into_inner(
3573 self,
3574 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3575 {
3576 (self.inner, self.is_terminated)
3577 }
3578
3579 fn from_inner(
3580 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3581 is_terminated: bool,
3582 ) -> Self {
3583 Self { inner, is_terminated }
3584 }
3585}
3586
3587impl futures::Stream for FeatureRequestStream {
3588 type Item = Result<FeatureRequest, fidl::Error>;
3589
3590 fn poll_next(
3591 mut self: std::pin::Pin<&mut Self>,
3592 cx: &mut std::task::Context<'_>,
3593 ) -> std::task::Poll<Option<Self::Item>> {
3594 let this = &mut *self;
3595 if this.inner.check_shutdown(cx) {
3596 this.is_terminated = true;
3597 return std::task::Poll::Ready(None);
3598 }
3599 if this.is_terminated {
3600 panic!("polled FeatureRequestStream after completion");
3601 }
3602 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3603 |bytes, handles| {
3604 match this.inner.channel().read_etc(cx, bytes, handles) {
3605 std::task::Poll::Ready(Ok(())) => {}
3606 std::task::Poll::Pending => return std::task::Poll::Pending,
3607 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3608 this.is_terminated = true;
3609 return std::task::Poll::Ready(None);
3610 }
3611 std::task::Poll::Ready(Err(e)) => {
3612 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3613 e.into(),
3614 ))));
3615 }
3616 }
3617
3618 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3620
3621 std::task::Poll::Ready(Some(match header.ordinal {
3622 0x2d24a706e8730410 => {
3623 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3624 let mut req = fidl::new_empty!(
3625 FeatureUpdateFeatureConfigRequest,
3626 fidl::encoding::DefaultFuchsiaResourceDialect
3627 );
3628 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FeatureUpdateFeatureConfigRequest>(&header, _body_bytes, handles, &mut req)?;
3629 let control_handle = FeatureControlHandle { inner: this.inner.clone() };
3630 Ok(FeatureRequest::UpdateFeatureConfig {
3631 config: req.config,
3632
3633 responder: FeatureUpdateFeatureConfigResponder {
3634 control_handle: std::mem::ManuallyDrop::new(control_handle),
3635 tx_id: header.tx_id,
3636 },
3637 })
3638 }
3639 0x2ab1896aea843611 => {
3640 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3641 let mut req = fidl::new_empty!(
3642 fidl::encoding::EmptyPayload,
3643 fidl::encoding::DefaultFuchsiaResourceDialect
3644 );
3645 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3646 let control_handle = FeatureControlHandle { inner: this.inner.clone() };
3647 Ok(FeatureRequest::GetFeatureConfig {
3648 responder: FeatureGetFeatureConfigResponder {
3649 control_handle: std::mem::ManuallyDrop::new(control_handle),
3650 tx_id: header.tx_id,
3651 },
3652 })
3653 }
3654 _ => Err(fidl::Error::UnknownOrdinal {
3655 ordinal: header.ordinal,
3656 protocol_name:
3657 <FeatureMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3658 }),
3659 }))
3660 },
3661 )
3662 }
3663}
3664
3665#[derive(Debug)]
3668pub enum FeatureRequest {
3669 UpdateFeatureConfig { config: FeatureConfig, responder: FeatureUpdateFeatureConfigResponder },
3674 GetFeatureConfig { responder: FeatureGetFeatureConfigResponder },
3680}
3681
3682impl FeatureRequest {
3683 #[allow(irrefutable_let_patterns)]
3684 pub fn into_update_feature_config(
3685 self,
3686 ) -> Option<(FeatureConfig, FeatureUpdateFeatureConfigResponder)> {
3687 if let FeatureRequest::UpdateFeatureConfig { config, responder } = self {
3688 Some((config, responder))
3689 } else {
3690 None
3691 }
3692 }
3693
3694 #[allow(irrefutable_let_patterns)]
3695 pub fn into_get_feature_config(self) -> Option<(FeatureGetFeatureConfigResponder)> {
3696 if let FeatureRequest::GetFeatureConfig { responder } = self {
3697 Some((responder))
3698 } else {
3699 None
3700 }
3701 }
3702
3703 pub fn method_name(&self) -> &'static str {
3705 match *self {
3706 FeatureRequest::UpdateFeatureConfig { .. } => "update_feature_config",
3707 FeatureRequest::GetFeatureConfig { .. } => "get_feature_config",
3708 }
3709 }
3710}
3711
3712#[derive(Debug, Clone)]
3713pub struct FeatureControlHandle {
3714 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3715}
3716
3717impl FeatureControlHandle {
3718 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3719 self.inner.shutdown_with_epitaph(status.into())
3720 }
3721}
3722
3723impl fidl::endpoints::ControlHandle for FeatureControlHandle {
3724 fn shutdown(&self) {
3725 self.inner.shutdown()
3726 }
3727
3728 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3729 self.inner.shutdown_with_epitaph(status)
3730 }
3731
3732 fn is_closed(&self) -> bool {
3733 self.inner.channel().is_closed()
3734 }
3735 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3736 self.inner.channel().on_closed()
3737 }
3738
3739 #[cfg(target_os = "fuchsia")]
3740 fn signal_peer(
3741 &self,
3742 clear_mask: zx::Signals,
3743 set_mask: zx::Signals,
3744 ) -> Result<(), zx_status::Status> {
3745 use fidl::Peered;
3746 self.inner.channel().signal_peer(clear_mask, set_mask)
3747 }
3748}
3749
3750impl FeatureControlHandle {}
3751
3752#[must_use = "FIDL methods require a response to be sent"]
3753#[derive(Debug)]
3754pub struct FeatureUpdateFeatureConfigResponder {
3755 control_handle: std::mem::ManuallyDrop<FeatureControlHandle>,
3756 tx_id: u32,
3757}
3758
3759impl std::ops::Drop for FeatureUpdateFeatureConfigResponder {
3763 fn drop(&mut self) {
3764 self.control_handle.shutdown();
3765 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3767 }
3768}
3769
3770impl fidl::endpoints::Responder for FeatureUpdateFeatureConfigResponder {
3771 type ControlHandle = FeatureControlHandle;
3772
3773 fn control_handle(&self) -> &FeatureControlHandle {
3774 &self.control_handle
3775 }
3776
3777 fn drop_without_shutdown(mut self) {
3778 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3780 std::mem::forget(self);
3782 }
3783}
3784
3785impl FeatureUpdateFeatureConfigResponder {
3786 pub fn send(self) -> Result<(), fidl::Error> {
3790 let _result = self.send_raw();
3791 if _result.is_err() {
3792 self.control_handle.shutdown();
3793 }
3794 self.drop_without_shutdown();
3795 _result
3796 }
3797
3798 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3800 let _result = self.send_raw();
3801 self.drop_without_shutdown();
3802 _result
3803 }
3804
3805 fn send_raw(&self) -> Result<(), fidl::Error> {
3806 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3807 (),
3808 self.tx_id,
3809 0x2d24a706e8730410,
3810 fidl::encoding::DynamicFlags::empty(),
3811 )
3812 }
3813}
3814
3815#[must_use = "FIDL methods require a response to be sent"]
3816#[derive(Debug)]
3817pub struct FeatureGetFeatureConfigResponder {
3818 control_handle: std::mem::ManuallyDrop<FeatureControlHandle>,
3819 tx_id: u32,
3820}
3821
3822impl std::ops::Drop for FeatureGetFeatureConfigResponder {
3826 fn drop(&mut self) {
3827 self.control_handle.shutdown();
3828 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3830 }
3831}
3832
3833impl fidl::endpoints::Responder for FeatureGetFeatureConfigResponder {
3834 type ControlHandle = FeatureControlHandle;
3835
3836 fn control_handle(&self) -> &FeatureControlHandle {
3837 &self.control_handle
3838 }
3839
3840 fn drop_without_shutdown(mut self) {
3841 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3843 std::mem::forget(self);
3845 }
3846}
3847
3848impl FeatureGetFeatureConfigResponder {
3849 pub fn send(self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
3853 let _result = self.send_raw(config);
3854 if _result.is_err() {
3855 self.control_handle.shutdown();
3856 }
3857 self.drop_without_shutdown();
3858 _result
3859 }
3860
3861 pub fn send_no_shutdown_on_err(self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
3863 let _result = self.send_raw(config);
3864 self.drop_without_shutdown();
3865 _result
3866 }
3867
3868 fn send_raw(&self, mut config: &FeatureConfig) -> Result<(), fidl::Error> {
3869 self.control_handle.inner.send::<FeatureGetFeatureConfigResponse>(
3870 (config,),
3871 self.tx_id,
3872 0x2ab1896aea843611,
3873 fidl::encoding::DynamicFlags::empty(),
3874 )
3875 }
3876}
3877
3878#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3879pub struct FeatureConnectorMarker;
3880
3881impl fidl::endpoints::ProtocolMarker for FeatureConnectorMarker {
3882 type Proxy = FeatureConnectorProxy;
3883 type RequestStream = FeatureConnectorRequestStream;
3884 #[cfg(target_os = "fuchsia")]
3885 type SynchronousProxy = FeatureConnectorSynchronousProxy;
3886
3887 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.FeatureConnector";
3888}
3889impl fidl::endpoints::DiscoverableProtocolMarker for FeatureConnectorMarker {}
3890
3891pub trait FeatureConnectorProxyInterface: Send + Sync {
3892 fn r#connect(
3893 &self,
3894 name: &str,
3895 server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
3896 ) -> Result<(), fidl::Error>;
3897}
3898#[derive(Debug)]
3899#[cfg(target_os = "fuchsia")]
3900pub struct FeatureConnectorSynchronousProxy {
3901 client: fidl::client::sync::Client,
3902}
3903
3904#[cfg(target_os = "fuchsia")]
3905impl fidl::endpoints::SynchronousProxy for FeatureConnectorSynchronousProxy {
3906 type Proxy = FeatureConnectorProxy;
3907 type Protocol = FeatureConnectorMarker;
3908
3909 fn from_channel(inner: fidl::Channel) -> Self {
3910 Self::new(inner)
3911 }
3912
3913 fn into_channel(self) -> fidl::Channel {
3914 self.client.into_channel()
3915 }
3916
3917 fn as_channel(&self) -> &fidl::Channel {
3918 self.client.as_channel()
3919 }
3920}
3921
3922#[cfg(target_os = "fuchsia")]
3923impl FeatureConnectorSynchronousProxy {
3924 pub fn new(channel: fidl::Channel) -> Self {
3925 Self { client: fidl::client::sync::Client::new(channel) }
3926 }
3927
3928 pub fn into_channel(self) -> fidl::Channel {
3929 self.client.into_channel()
3930 }
3931
3932 pub fn wait_for_event(
3935 &self,
3936 deadline: zx::MonotonicInstant,
3937 ) -> Result<FeatureConnectorEvent, fidl::Error> {
3938 FeatureConnectorEvent::decode(
3939 self.client.wait_for_event::<FeatureConnectorMarker>(deadline)?,
3940 )
3941 }
3942
3943 pub fn r#connect(
3960 &self,
3961 mut name: &str,
3962 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
3963 ) -> Result<(), fidl::Error> {
3964 self.client.send::<FeatureConnectorConnectRequest>(
3965 (name, server_end),
3966 0x470f006d630987a5,
3967 fidl::encoding::DynamicFlags::empty(),
3968 )
3969 }
3970}
3971
3972#[cfg(target_os = "fuchsia")]
3973impl From<FeatureConnectorSynchronousProxy> for zx::NullableHandle {
3974 fn from(value: FeatureConnectorSynchronousProxy) -> Self {
3975 value.into_channel().into()
3976 }
3977}
3978
3979#[cfg(target_os = "fuchsia")]
3980impl From<fidl::Channel> for FeatureConnectorSynchronousProxy {
3981 fn from(value: fidl::Channel) -> Self {
3982 Self::new(value)
3983 }
3984}
3985
3986#[cfg(target_os = "fuchsia")]
3987impl fidl::endpoints::FromClient for FeatureConnectorSynchronousProxy {
3988 type Protocol = FeatureConnectorMarker;
3989
3990 fn from_client(value: fidl::endpoints::ClientEnd<FeatureConnectorMarker>) -> Self {
3991 Self::new(value.into_channel())
3992 }
3993}
3994
3995#[derive(Debug, Clone)]
3996pub struct FeatureConnectorProxy {
3997 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3998}
3999
4000impl fidl::endpoints::Proxy for FeatureConnectorProxy {
4001 type Protocol = FeatureConnectorMarker;
4002
4003 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4004 Self::new(inner)
4005 }
4006
4007 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4008 self.client.into_channel().map_err(|client| Self { client })
4009 }
4010
4011 fn as_channel(&self) -> &::fidl::AsyncChannel {
4012 self.client.as_channel()
4013 }
4014}
4015
4016impl FeatureConnectorProxy {
4017 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4019 let protocol_name = <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4020 Self { client: fidl::client::Client::new(channel, protocol_name) }
4021 }
4022
4023 pub fn take_event_stream(&self) -> FeatureConnectorEventStream {
4029 FeatureConnectorEventStream { event_receiver: self.client.take_event_receiver() }
4030 }
4031
4032 pub fn r#connect(
4049 &self,
4050 mut name: &str,
4051 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
4052 ) -> Result<(), fidl::Error> {
4053 FeatureConnectorProxyInterface::r#connect(self, name, server_end)
4054 }
4055}
4056
4057impl FeatureConnectorProxyInterface for FeatureConnectorProxy {
4058 fn r#connect(
4059 &self,
4060 mut name: &str,
4061 mut server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
4062 ) -> Result<(), fidl::Error> {
4063 self.client.send::<FeatureConnectorConnectRequest>(
4064 (name, server_end),
4065 0x470f006d630987a5,
4066 fidl::encoding::DynamicFlags::empty(),
4067 )
4068 }
4069}
4070
4071pub struct FeatureConnectorEventStream {
4072 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4073}
4074
4075impl std::marker::Unpin for FeatureConnectorEventStream {}
4076
4077impl futures::stream::FusedStream for FeatureConnectorEventStream {
4078 fn is_terminated(&self) -> bool {
4079 self.event_receiver.is_terminated()
4080 }
4081}
4082
4083impl futures::Stream for FeatureConnectorEventStream {
4084 type Item = Result<FeatureConnectorEvent, fidl::Error>;
4085
4086 fn poll_next(
4087 mut self: std::pin::Pin<&mut Self>,
4088 cx: &mut std::task::Context<'_>,
4089 ) -> std::task::Poll<Option<Self::Item>> {
4090 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4091 &mut self.event_receiver,
4092 cx
4093 )?) {
4094 Some(buf) => std::task::Poll::Ready(Some(FeatureConnectorEvent::decode(buf))),
4095 None => std::task::Poll::Ready(None),
4096 }
4097 }
4098}
4099
4100#[derive(Debug)]
4101pub enum FeatureConnectorEvent {}
4102
4103impl FeatureConnectorEvent {
4104 fn decode(
4106 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4107 ) -> Result<FeatureConnectorEvent, fidl::Error> {
4108 let (bytes, _handles) = buf.split_mut();
4109 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4110 debug_assert_eq!(tx_header.tx_id, 0);
4111 match tx_header.ordinal {
4112 _ => Err(fidl::Error::UnknownOrdinal {
4113 ordinal: tx_header.ordinal,
4114 protocol_name:
4115 <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4116 }),
4117 }
4118 }
4119}
4120
4121pub struct FeatureConnectorRequestStream {
4123 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4124 is_terminated: bool,
4125}
4126
4127impl std::marker::Unpin for FeatureConnectorRequestStream {}
4128
4129impl futures::stream::FusedStream for FeatureConnectorRequestStream {
4130 fn is_terminated(&self) -> bool {
4131 self.is_terminated
4132 }
4133}
4134
4135impl fidl::endpoints::RequestStream for FeatureConnectorRequestStream {
4136 type Protocol = FeatureConnectorMarker;
4137 type ControlHandle = FeatureConnectorControlHandle;
4138
4139 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4140 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4141 }
4142
4143 fn control_handle(&self) -> Self::ControlHandle {
4144 FeatureConnectorControlHandle { inner: self.inner.clone() }
4145 }
4146
4147 fn into_inner(
4148 self,
4149 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4150 {
4151 (self.inner, self.is_terminated)
4152 }
4153
4154 fn from_inner(
4155 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4156 is_terminated: bool,
4157 ) -> Self {
4158 Self { inner, is_terminated }
4159 }
4160}
4161
4162impl futures::Stream for FeatureConnectorRequestStream {
4163 type Item = Result<FeatureConnectorRequest, fidl::Error>;
4164
4165 fn poll_next(
4166 mut self: std::pin::Pin<&mut Self>,
4167 cx: &mut std::task::Context<'_>,
4168 ) -> std::task::Poll<Option<Self::Item>> {
4169 let this = &mut *self;
4170 if this.inner.check_shutdown(cx) {
4171 this.is_terminated = true;
4172 return std::task::Poll::Ready(None);
4173 }
4174 if this.is_terminated {
4175 panic!("polled FeatureConnectorRequestStream after completion");
4176 }
4177 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4178 |bytes, handles| {
4179 match this.inner.channel().read_etc(cx, bytes, handles) {
4180 std::task::Poll::Ready(Ok(())) => {}
4181 std::task::Poll::Pending => return std::task::Poll::Pending,
4182 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4183 this.is_terminated = true;
4184 return std::task::Poll::Ready(None);
4185 }
4186 std::task::Poll::Ready(Err(e)) => {
4187 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4188 e.into(),
4189 ))));
4190 }
4191 }
4192
4193 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4195
4196 std::task::Poll::Ready(Some(match header.ordinal {
4197 0x470f006d630987a5 => {
4198 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4199 let mut req = fidl::new_empty!(
4200 FeatureConnectorConnectRequest,
4201 fidl::encoding::DefaultFuchsiaResourceDialect
4202 );
4203 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FeatureConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
4204 let control_handle =
4205 FeatureConnectorControlHandle { inner: this.inner.clone() };
4206 Ok(FeatureConnectorRequest::Connect {
4207 name: req.name,
4208 server_end: req.server_end,
4209
4210 control_handle,
4211 })
4212 }
4213 _ => Err(fidl::Error::UnknownOrdinal {
4214 ordinal: header.ordinal,
4215 protocol_name:
4216 <FeatureConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4217 }),
4218 }))
4219 },
4220 )
4221 }
4222}
4223
4224#[derive(Debug)]
4226pub enum FeatureConnectorRequest {
4227 Connect {
4244 name: String,
4245 server_end: fidl::endpoints::ServerEnd<FeatureMarker>,
4246 control_handle: FeatureConnectorControlHandle,
4247 },
4248}
4249
4250impl FeatureConnectorRequest {
4251 #[allow(irrefutable_let_patterns)]
4252 pub fn into_connect(
4253 self,
4254 ) -> Option<(String, fidl::endpoints::ServerEnd<FeatureMarker>, FeatureConnectorControlHandle)>
4255 {
4256 if let FeatureConnectorRequest::Connect { name, server_end, control_handle } = self {
4257 Some((name, server_end, control_handle))
4258 } else {
4259 None
4260 }
4261 }
4262
4263 pub fn method_name(&self) -> &'static str {
4265 match *self {
4266 FeatureConnectorRequest::Connect { .. } => "connect",
4267 }
4268 }
4269}
4270
4271#[derive(Debug, Clone)]
4272pub struct FeatureConnectorControlHandle {
4273 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4274}
4275
4276impl FeatureConnectorControlHandle {
4277 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4278 self.inner.shutdown_with_epitaph(status.into())
4279 }
4280}
4281
4282impl fidl::endpoints::ControlHandle for FeatureConnectorControlHandle {
4283 fn shutdown(&self) {
4284 self.inner.shutdown()
4285 }
4286
4287 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4288 self.inner.shutdown_with_epitaph(status)
4289 }
4290
4291 fn is_closed(&self) -> bool {
4292 self.inner.channel().is_closed()
4293 }
4294 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4295 self.inner.channel().on_closed()
4296 }
4297
4298 #[cfg(target_os = "fuchsia")]
4299 fn signal_peer(
4300 &self,
4301 clear_mask: zx::Signals,
4302 set_mask: zx::Signals,
4303 ) -> Result<(), zx_status::Status> {
4304 use fidl::Peered;
4305 self.inner.channel().signal_peer(clear_mask, set_mask)
4306 }
4307}
4308
4309impl FeatureConnectorControlHandle {}
4310
4311#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4312pub struct MeshcopMarker;
4313
4314impl fidl::endpoints::ProtocolMarker for MeshcopMarker {
4315 type Proxy = MeshcopProxy;
4316 type RequestStream = MeshcopRequestStream;
4317 #[cfg(target_os = "fuchsia")]
4318 type SynchronousProxy = MeshcopSynchronousProxy;
4319
4320 const DEBUG_NAME: &'static str = "(anonymous) Meshcop";
4321}
4322
4323pub trait MeshcopProxyInterface: Send + Sync {
4324 type UpdateTxtEntriesResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4325 fn r#update_txt_entries(&self, txt_entries: &[TxtEntries])
4326 -> Self::UpdateTxtEntriesResponseFut;
4327}
4328#[derive(Debug)]
4329#[cfg(target_os = "fuchsia")]
4330pub struct MeshcopSynchronousProxy {
4331 client: fidl::client::sync::Client,
4332}
4333
4334#[cfg(target_os = "fuchsia")]
4335impl fidl::endpoints::SynchronousProxy for MeshcopSynchronousProxy {
4336 type Proxy = MeshcopProxy;
4337 type Protocol = MeshcopMarker;
4338
4339 fn from_channel(inner: fidl::Channel) -> Self {
4340 Self::new(inner)
4341 }
4342
4343 fn into_channel(self) -> fidl::Channel {
4344 self.client.into_channel()
4345 }
4346
4347 fn as_channel(&self) -> &fidl::Channel {
4348 self.client.as_channel()
4349 }
4350}
4351
4352#[cfg(target_os = "fuchsia")]
4353impl MeshcopSynchronousProxy {
4354 pub fn new(channel: fidl::Channel) -> Self {
4355 Self { client: fidl::client::sync::Client::new(channel) }
4356 }
4357
4358 pub fn into_channel(self) -> fidl::Channel {
4359 self.client.into_channel()
4360 }
4361
4362 pub fn wait_for_event(
4365 &self,
4366 deadline: zx::MonotonicInstant,
4367 ) -> Result<MeshcopEvent, fidl::Error> {
4368 MeshcopEvent::decode(self.client.wait_for_event::<MeshcopMarker>(deadline)?)
4369 }
4370
4371 pub fn r#update_txt_entries(
4395 &self,
4396 mut txt_entries: &[TxtEntries],
4397 ___deadline: zx::MonotonicInstant,
4398 ) -> Result<(), fidl::Error> {
4399 let _response = self.client.send_query::<
4400 MeshcopUpdateTxtEntriesRequest,
4401 fidl::encoding::EmptyPayload,
4402 MeshcopMarker,
4403 >(
4404 (txt_entries,),
4405 0x358d4d9593140bed,
4406 fidl::encoding::DynamicFlags::empty(),
4407 ___deadline,
4408 )?;
4409 Ok(_response)
4410 }
4411}
4412
4413#[cfg(target_os = "fuchsia")]
4414impl From<MeshcopSynchronousProxy> for zx::NullableHandle {
4415 fn from(value: MeshcopSynchronousProxy) -> Self {
4416 value.into_channel().into()
4417 }
4418}
4419
4420#[cfg(target_os = "fuchsia")]
4421impl From<fidl::Channel> for MeshcopSynchronousProxy {
4422 fn from(value: fidl::Channel) -> Self {
4423 Self::new(value)
4424 }
4425}
4426
4427#[cfg(target_os = "fuchsia")]
4428impl fidl::endpoints::FromClient for MeshcopSynchronousProxy {
4429 type Protocol = MeshcopMarker;
4430
4431 fn from_client(value: fidl::endpoints::ClientEnd<MeshcopMarker>) -> Self {
4432 Self::new(value.into_channel())
4433 }
4434}
4435
4436#[derive(Debug, Clone)]
4437pub struct MeshcopProxy {
4438 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4439}
4440
4441impl fidl::endpoints::Proxy for MeshcopProxy {
4442 type Protocol = MeshcopMarker;
4443
4444 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4445 Self::new(inner)
4446 }
4447
4448 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4449 self.client.into_channel().map_err(|client| Self { client })
4450 }
4451
4452 fn as_channel(&self) -> &::fidl::AsyncChannel {
4453 self.client.as_channel()
4454 }
4455}
4456
4457impl MeshcopProxy {
4458 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4460 let protocol_name = <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4461 Self { client: fidl::client::Client::new(channel, protocol_name) }
4462 }
4463
4464 pub fn take_event_stream(&self) -> MeshcopEventStream {
4470 MeshcopEventStream { event_receiver: self.client.take_event_receiver() }
4471 }
4472
4473 pub fn r#update_txt_entries(
4497 &self,
4498 mut txt_entries: &[TxtEntries],
4499 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4500 MeshcopProxyInterface::r#update_txt_entries(self, txt_entries)
4501 }
4502}
4503
4504impl MeshcopProxyInterface for MeshcopProxy {
4505 type UpdateTxtEntriesResponseFut =
4506 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4507 fn r#update_txt_entries(
4508 &self,
4509 mut txt_entries: &[TxtEntries],
4510 ) -> Self::UpdateTxtEntriesResponseFut {
4511 fn _decode(
4512 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4513 ) -> Result<(), fidl::Error> {
4514 let _response = fidl::client::decode_transaction_body::<
4515 fidl::encoding::EmptyPayload,
4516 fidl::encoding::DefaultFuchsiaResourceDialect,
4517 0x358d4d9593140bed,
4518 >(_buf?)?;
4519 Ok(_response)
4520 }
4521 self.client.send_query_and_decode::<MeshcopUpdateTxtEntriesRequest, ()>(
4522 (txt_entries,),
4523 0x358d4d9593140bed,
4524 fidl::encoding::DynamicFlags::empty(),
4525 _decode,
4526 )
4527 }
4528}
4529
4530pub struct MeshcopEventStream {
4531 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4532}
4533
4534impl std::marker::Unpin for MeshcopEventStream {}
4535
4536impl futures::stream::FusedStream for MeshcopEventStream {
4537 fn is_terminated(&self) -> bool {
4538 self.event_receiver.is_terminated()
4539 }
4540}
4541
4542impl futures::Stream for MeshcopEventStream {
4543 type Item = Result<MeshcopEvent, fidl::Error>;
4544
4545 fn poll_next(
4546 mut self: std::pin::Pin<&mut Self>,
4547 cx: &mut std::task::Context<'_>,
4548 ) -> std::task::Poll<Option<Self::Item>> {
4549 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4550 &mut self.event_receiver,
4551 cx
4552 )?) {
4553 Some(buf) => std::task::Poll::Ready(Some(MeshcopEvent::decode(buf))),
4554 None => std::task::Poll::Ready(None),
4555 }
4556 }
4557}
4558
4559#[derive(Debug)]
4560pub enum MeshcopEvent {}
4561
4562impl MeshcopEvent {
4563 fn decode(
4565 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4566 ) -> Result<MeshcopEvent, fidl::Error> {
4567 let (bytes, _handles) = buf.split_mut();
4568 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4569 debug_assert_eq!(tx_header.tx_id, 0);
4570 match tx_header.ordinal {
4571 _ => Err(fidl::Error::UnknownOrdinal {
4572 ordinal: tx_header.ordinal,
4573 protocol_name: <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4574 }),
4575 }
4576 }
4577}
4578
4579pub struct MeshcopRequestStream {
4581 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4582 is_terminated: bool,
4583}
4584
4585impl std::marker::Unpin for MeshcopRequestStream {}
4586
4587impl futures::stream::FusedStream for MeshcopRequestStream {
4588 fn is_terminated(&self) -> bool {
4589 self.is_terminated
4590 }
4591}
4592
4593impl fidl::endpoints::RequestStream for MeshcopRequestStream {
4594 type Protocol = MeshcopMarker;
4595 type ControlHandle = MeshcopControlHandle;
4596
4597 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4598 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4599 }
4600
4601 fn control_handle(&self) -> Self::ControlHandle {
4602 MeshcopControlHandle { inner: self.inner.clone() }
4603 }
4604
4605 fn into_inner(
4606 self,
4607 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4608 {
4609 (self.inner, self.is_terminated)
4610 }
4611
4612 fn from_inner(
4613 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4614 is_terminated: bool,
4615 ) -> Self {
4616 Self { inner, is_terminated }
4617 }
4618}
4619
4620impl futures::Stream for MeshcopRequestStream {
4621 type Item = Result<MeshcopRequest, fidl::Error>;
4622
4623 fn poll_next(
4624 mut self: std::pin::Pin<&mut Self>,
4625 cx: &mut std::task::Context<'_>,
4626 ) -> std::task::Poll<Option<Self::Item>> {
4627 let this = &mut *self;
4628 if this.inner.check_shutdown(cx) {
4629 this.is_terminated = true;
4630 return std::task::Poll::Ready(None);
4631 }
4632 if this.is_terminated {
4633 panic!("polled MeshcopRequestStream after completion");
4634 }
4635 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4636 |bytes, handles| {
4637 match this.inner.channel().read_etc(cx, bytes, handles) {
4638 std::task::Poll::Ready(Ok(())) => {}
4639 std::task::Poll::Pending => return std::task::Poll::Pending,
4640 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4641 this.is_terminated = true;
4642 return std::task::Poll::Ready(None);
4643 }
4644 std::task::Poll::Ready(Err(e)) => {
4645 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4646 e.into(),
4647 ))));
4648 }
4649 }
4650
4651 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4653
4654 std::task::Poll::Ready(Some(match header.ordinal {
4655 0x358d4d9593140bed => {
4656 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4657 let mut req = fidl::new_empty!(
4658 MeshcopUpdateTxtEntriesRequest,
4659 fidl::encoding::DefaultFuchsiaResourceDialect
4660 );
4661 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MeshcopUpdateTxtEntriesRequest>(&header, _body_bytes, handles, &mut req)?;
4662 let control_handle = MeshcopControlHandle { inner: this.inner.clone() };
4663 Ok(MeshcopRequest::UpdateTxtEntries {
4664 txt_entries: req.txt_entries,
4665
4666 responder: MeshcopUpdateTxtEntriesResponder {
4667 control_handle: std::mem::ManuallyDrop::new(control_handle),
4668 tx_id: header.tx_id,
4669 },
4670 })
4671 }
4672 _ => Err(fidl::Error::UnknownOrdinal {
4673 ordinal: header.ordinal,
4674 protocol_name:
4675 <MeshcopMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4676 }),
4677 }))
4678 },
4679 )
4680 }
4681}
4682
4683#[derive(Debug)]
4685pub enum MeshcopRequest {
4686 UpdateTxtEntries { txt_entries: Vec<TxtEntries>, responder: MeshcopUpdateTxtEntriesResponder },
4710}
4711
4712impl MeshcopRequest {
4713 #[allow(irrefutable_let_patterns)]
4714 pub fn into_update_txt_entries(
4715 self,
4716 ) -> Option<(Vec<TxtEntries>, MeshcopUpdateTxtEntriesResponder)> {
4717 if let MeshcopRequest::UpdateTxtEntries { txt_entries, responder } = self {
4718 Some((txt_entries, responder))
4719 } else {
4720 None
4721 }
4722 }
4723
4724 pub fn method_name(&self) -> &'static str {
4726 match *self {
4727 MeshcopRequest::UpdateTxtEntries { .. } => "update_txt_entries",
4728 }
4729 }
4730}
4731
4732#[derive(Debug, Clone)]
4733pub struct MeshcopControlHandle {
4734 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4735}
4736
4737impl MeshcopControlHandle {
4738 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4739 self.inner.shutdown_with_epitaph(status.into())
4740 }
4741}
4742
4743impl fidl::endpoints::ControlHandle for MeshcopControlHandle {
4744 fn shutdown(&self) {
4745 self.inner.shutdown()
4746 }
4747
4748 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4749 self.inner.shutdown_with_epitaph(status)
4750 }
4751
4752 fn is_closed(&self) -> bool {
4753 self.inner.channel().is_closed()
4754 }
4755 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4756 self.inner.channel().on_closed()
4757 }
4758
4759 #[cfg(target_os = "fuchsia")]
4760 fn signal_peer(
4761 &self,
4762 clear_mask: zx::Signals,
4763 set_mask: zx::Signals,
4764 ) -> Result<(), zx_status::Status> {
4765 use fidl::Peered;
4766 self.inner.channel().signal_peer(clear_mask, set_mask)
4767 }
4768}
4769
4770impl MeshcopControlHandle {}
4771
4772#[must_use = "FIDL methods require a response to be sent"]
4773#[derive(Debug)]
4774pub struct MeshcopUpdateTxtEntriesResponder {
4775 control_handle: std::mem::ManuallyDrop<MeshcopControlHandle>,
4776 tx_id: u32,
4777}
4778
4779impl std::ops::Drop for MeshcopUpdateTxtEntriesResponder {
4783 fn drop(&mut self) {
4784 self.control_handle.shutdown();
4785 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4787 }
4788}
4789
4790impl fidl::endpoints::Responder for MeshcopUpdateTxtEntriesResponder {
4791 type ControlHandle = MeshcopControlHandle;
4792
4793 fn control_handle(&self) -> &MeshcopControlHandle {
4794 &self.control_handle
4795 }
4796
4797 fn drop_without_shutdown(mut self) {
4798 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4800 std::mem::forget(self);
4802 }
4803}
4804
4805impl MeshcopUpdateTxtEntriesResponder {
4806 pub fn send(self) -> Result<(), fidl::Error> {
4810 let _result = self.send_raw();
4811 if _result.is_err() {
4812 self.control_handle.shutdown();
4813 }
4814 self.drop_without_shutdown();
4815 _result
4816 }
4817
4818 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4820 let _result = self.send_raw();
4821 self.drop_without_shutdown();
4822 _result
4823 }
4824
4825 fn send_raw(&self) -> Result<(), fidl::Error> {
4826 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
4827 (),
4828 self.tx_id,
4829 0x358d4d9593140bed,
4830 fidl::encoding::DynamicFlags::empty(),
4831 )
4832 }
4833}
4834
4835#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4836pub struct MeshcopConnectorMarker;
4837
4838impl fidl::endpoints::ProtocolMarker for MeshcopConnectorMarker {
4839 type Proxy = MeshcopConnectorProxy;
4840 type RequestStream = MeshcopConnectorRequestStream;
4841 #[cfg(target_os = "fuchsia")]
4842 type SynchronousProxy = MeshcopConnectorSynchronousProxy;
4843
4844 const DEBUG_NAME: &'static str = "fuchsia.lowpan.thread.MeshcopConnector";
4845}
4846impl fidl::endpoints::DiscoverableProtocolMarker for MeshcopConnectorMarker {}
4847
4848pub trait MeshcopConnectorProxyInterface: Send + Sync {
4849 fn r#connect(
4850 &self,
4851 name: &str,
4852 server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
4853 ) -> Result<(), fidl::Error>;
4854}
4855#[derive(Debug)]
4856#[cfg(target_os = "fuchsia")]
4857pub struct MeshcopConnectorSynchronousProxy {
4858 client: fidl::client::sync::Client,
4859}
4860
4861#[cfg(target_os = "fuchsia")]
4862impl fidl::endpoints::SynchronousProxy for MeshcopConnectorSynchronousProxy {
4863 type Proxy = MeshcopConnectorProxy;
4864 type Protocol = MeshcopConnectorMarker;
4865
4866 fn from_channel(inner: fidl::Channel) -> Self {
4867 Self::new(inner)
4868 }
4869
4870 fn into_channel(self) -> fidl::Channel {
4871 self.client.into_channel()
4872 }
4873
4874 fn as_channel(&self) -> &fidl::Channel {
4875 self.client.as_channel()
4876 }
4877}
4878
4879#[cfg(target_os = "fuchsia")]
4880impl MeshcopConnectorSynchronousProxy {
4881 pub fn new(channel: fidl::Channel) -> Self {
4882 Self { client: fidl::client::sync::Client::new(channel) }
4883 }
4884
4885 pub fn into_channel(self) -> fidl::Channel {
4886 self.client.into_channel()
4887 }
4888
4889 pub fn wait_for_event(
4892 &self,
4893 deadline: zx::MonotonicInstant,
4894 ) -> Result<MeshcopConnectorEvent, fidl::Error> {
4895 MeshcopConnectorEvent::decode(
4896 self.client.wait_for_event::<MeshcopConnectorMarker>(deadline)?,
4897 )
4898 }
4899
4900 pub fn r#connect(
4917 &self,
4918 mut name: &str,
4919 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
4920 ) -> Result<(), fidl::Error> {
4921 self.client.send::<MeshcopConnectorConnectRequest>(
4922 (name, server_end),
4923 0x53f87536b40ad6fb,
4924 fidl::encoding::DynamicFlags::empty(),
4925 )
4926 }
4927}
4928
4929#[cfg(target_os = "fuchsia")]
4930impl From<MeshcopConnectorSynchronousProxy> for zx::NullableHandle {
4931 fn from(value: MeshcopConnectorSynchronousProxy) -> Self {
4932 value.into_channel().into()
4933 }
4934}
4935
4936#[cfg(target_os = "fuchsia")]
4937impl From<fidl::Channel> for MeshcopConnectorSynchronousProxy {
4938 fn from(value: fidl::Channel) -> Self {
4939 Self::new(value)
4940 }
4941}
4942
4943#[cfg(target_os = "fuchsia")]
4944impl fidl::endpoints::FromClient for MeshcopConnectorSynchronousProxy {
4945 type Protocol = MeshcopConnectorMarker;
4946
4947 fn from_client(value: fidl::endpoints::ClientEnd<MeshcopConnectorMarker>) -> Self {
4948 Self::new(value.into_channel())
4949 }
4950}
4951
4952#[derive(Debug, Clone)]
4953pub struct MeshcopConnectorProxy {
4954 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4955}
4956
4957impl fidl::endpoints::Proxy for MeshcopConnectorProxy {
4958 type Protocol = MeshcopConnectorMarker;
4959
4960 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4961 Self::new(inner)
4962 }
4963
4964 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4965 self.client.into_channel().map_err(|client| Self { client })
4966 }
4967
4968 fn as_channel(&self) -> &::fidl::AsyncChannel {
4969 self.client.as_channel()
4970 }
4971}
4972
4973impl MeshcopConnectorProxy {
4974 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4976 let protocol_name = <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4977 Self { client: fidl::client::Client::new(channel, protocol_name) }
4978 }
4979
4980 pub fn take_event_stream(&self) -> MeshcopConnectorEventStream {
4986 MeshcopConnectorEventStream { event_receiver: self.client.take_event_receiver() }
4987 }
4988
4989 pub fn r#connect(
5006 &self,
5007 mut name: &str,
5008 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
5009 ) -> Result<(), fidl::Error> {
5010 MeshcopConnectorProxyInterface::r#connect(self, name, server_end)
5011 }
5012}
5013
5014impl MeshcopConnectorProxyInterface for MeshcopConnectorProxy {
5015 fn r#connect(
5016 &self,
5017 mut name: &str,
5018 mut server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
5019 ) -> Result<(), fidl::Error> {
5020 self.client.send::<MeshcopConnectorConnectRequest>(
5021 (name, server_end),
5022 0x53f87536b40ad6fb,
5023 fidl::encoding::DynamicFlags::empty(),
5024 )
5025 }
5026}
5027
5028pub struct MeshcopConnectorEventStream {
5029 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5030}
5031
5032impl std::marker::Unpin for MeshcopConnectorEventStream {}
5033
5034impl futures::stream::FusedStream for MeshcopConnectorEventStream {
5035 fn is_terminated(&self) -> bool {
5036 self.event_receiver.is_terminated()
5037 }
5038}
5039
5040impl futures::Stream for MeshcopConnectorEventStream {
5041 type Item = Result<MeshcopConnectorEvent, fidl::Error>;
5042
5043 fn poll_next(
5044 mut self: std::pin::Pin<&mut Self>,
5045 cx: &mut std::task::Context<'_>,
5046 ) -> std::task::Poll<Option<Self::Item>> {
5047 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5048 &mut self.event_receiver,
5049 cx
5050 )?) {
5051 Some(buf) => std::task::Poll::Ready(Some(MeshcopConnectorEvent::decode(buf))),
5052 None => std::task::Poll::Ready(None),
5053 }
5054 }
5055}
5056
5057#[derive(Debug)]
5058pub enum MeshcopConnectorEvent {}
5059
5060impl MeshcopConnectorEvent {
5061 fn decode(
5063 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5064 ) -> Result<MeshcopConnectorEvent, fidl::Error> {
5065 let (bytes, _handles) = buf.split_mut();
5066 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5067 debug_assert_eq!(tx_header.tx_id, 0);
5068 match tx_header.ordinal {
5069 _ => Err(fidl::Error::UnknownOrdinal {
5070 ordinal: tx_header.ordinal,
5071 protocol_name:
5072 <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5073 }),
5074 }
5075 }
5076}
5077
5078pub struct MeshcopConnectorRequestStream {
5080 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5081 is_terminated: bool,
5082}
5083
5084impl std::marker::Unpin for MeshcopConnectorRequestStream {}
5085
5086impl futures::stream::FusedStream for MeshcopConnectorRequestStream {
5087 fn is_terminated(&self) -> bool {
5088 self.is_terminated
5089 }
5090}
5091
5092impl fidl::endpoints::RequestStream for MeshcopConnectorRequestStream {
5093 type Protocol = MeshcopConnectorMarker;
5094 type ControlHandle = MeshcopConnectorControlHandle;
5095
5096 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5097 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5098 }
5099
5100 fn control_handle(&self) -> Self::ControlHandle {
5101 MeshcopConnectorControlHandle { inner: self.inner.clone() }
5102 }
5103
5104 fn into_inner(
5105 self,
5106 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5107 {
5108 (self.inner, self.is_terminated)
5109 }
5110
5111 fn from_inner(
5112 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5113 is_terminated: bool,
5114 ) -> Self {
5115 Self { inner, is_terminated }
5116 }
5117}
5118
5119impl futures::Stream for MeshcopConnectorRequestStream {
5120 type Item = Result<MeshcopConnectorRequest, fidl::Error>;
5121
5122 fn poll_next(
5123 mut self: std::pin::Pin<&mut Self>,
5124 cx: &mut std::task::Context<'_>,
5125 ) -> std::task::Poll<Option<Self::Item>> {
5126 let this = &mut *self;
5127 if this.inner.check_shutdown(cx) {
5128 this.is_terminated = true;
5129 return std::task::Poll::Ready(None);
5130 }
5131 if this.is_terminated {
5132 panic!("polled MeshcopConnectorRequestStream after completion");
5133 }
5134 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5135 |bytes, handles| {
5136 match this.inner.channel().read_etc(cx, bytes, handles) {
5137 std::task::Poll::Ready(Ok(())) => {}
5138 std::task::Poll::Pending => return std::task::Poll::Pending,
5139 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5140 this.is_terminated = true;
5141 return std::task::Poll::Ready(None);
5142 }
5143 std::task::Poll::Ready(Err(e)) => {
5144 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5145 e.into(),
5146 ))));
5147 }
5148 }
5149
5150 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5152
5153 std::task::Poll::Ready(Some(match header.ordinal {
5154 0x53f87536b40ad6fb => {
5155 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5156 let mut req = fidl::new_empty!(
5157 MeshcopConnectorConnectRequest,
5158 fidl::encoding::DefaultFuchsiaResourceDialect
5159 );
5160 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MeshcopConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
5161 let control_handle =
5162 MeshcopConnectorControlHandle { inner: this.inner.clone() };
5163 Ok(MeshcopConnectorRequest::Connect {
5164 name: req.name,
5165 server_end: req.server_end,
5166
5167 control_handle,
5168 })
5169 }
5170 _ => Err(fidl::Error::UnknownOrdinal {
5171 ordinal: header.ordinal,
5172 protocol_name:
5173 <MeshcopConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5174 }),
5175 }))
5176 },
5177 )
5178 }
5179}
5180
5181#[derive(Debug)]
5183pub enum MeshcopConnectorRequest {
5184 Connect {
5201 name: String,
5202 server_end: fidl::endpoints::ServerEnd<MeshcopMarker>,
5203 control_handle: MeshcopConnectorControlHandle,
5204 },
5205}
5206
5207impl MeshcopConnectorRequest {
5208 #[allow(irrefutable_let_patterns)]
5209 pub fn into_connect(
5210 self,
5211 ) -> Option<(String, fidl::endpoints::ServerEnd<MeshcopMarker>, MeshcopConnectorControlHandle)>
5212 {
5213 if let MeshcopConnectorRequest::Connect { name, server_end, control_handle } = self {
5214 Some((name, server_end, control_handle))
5215 } else {
5216 None
5217 }
5218 }
5219
5220 pub fn method_name(&self) -> &'static str {
5222 match *self {
5223 MeshcopConnectorRequest::Connect { .. } => "connect",
5224 }
5225 }
5226}
5227
5228#[derive(Debug, Clone)]
5229pub struct MeshcopConnectorControlHandle {
5230 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5231}
5232
5233impl MeshcopConnectorControlHandle {
5234 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5235 self.inner.shutdown_with_epitaph(status.into())
5236 }
5237}
5238
5239impl fidl::endpoints::ControlHandle for MeshcopConnectorControlHandle {
5240 fn shutdown(&self) {
5241 self.inner.shutdown()
5242 }
5243
5244 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5245 self.inner.shutdown_with_epitaph(status)
5246 }
5247
5248 fn is_closed(&self) -> bool {
5249 self.inner.channel().is_closed()
5250 }
5251 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5252 self.inner.channel().on_closed()
5253 }
5254
5255 #[cfg(target_os = "fuchsia")]
5256 fn signal_peer(
5257 &self,
5258 clear_mask: zx::Signals,
5259 set_mask: zx::Signals,
5260 ) -> Result<(), zx_status::Status> {
5261 use fidl::Peered;
5262 self.inner.channel().signal_peer(clear_mask, set_mask)
5263 }
5264}
5265
5266impl MeshcopConnectorControlHandle {}
5267
5268#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5269pub struct ThreadCapabilitiesMarker;
5270
5271impl fidl::endpoints::ProtocolMarker for ThreadCapabilitiesMarker {
5272 type Proxy = ThreadCapabilitiesProxy;
5273 type RequestStream = ThreadCapabilitiesRequestStream;
5274 #[cfg(target_os = "fuchsia")]
5275 type SynchronousProxy = ThreadCapabilitiesSynchronousProxy;
5276
5277 const DEBUG_NAME: &'static str = "(anonymous) ThreadCapabilities";
5278}
5279
5280pub trait ThreadCapabilitiesProxyInterface: Send + Sync {
5281 type GetCapabilitiesResponseFut: std::future::Future<Output = Result<Capabilities, fidl::Error>>
5282 + Send;
5283 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
5284}
5285#[derive(Debug)]
5286#[cfg(target_os = "fuchsia")]
5287pub struct ThreadCapabilitiesSynchronousProxy {
5288 client: fidl::client::sync::Client,
5289}
5290
5291#[cfg(target_os = "fuchsia")]
5292impl fidl::endpoints::SynchronousProxy for ThreadCapabilitiesSynchronousProxy {
5293 type Proxy = ThreadCapabilitiesProxy;
5294 type Protocol = ThreadCapabilitiesMarker;
5295
5296 fn from_channel(inner: fidl::Channel) -> Self {
5297 Self::new(inner)
5298 }
5299
5300 fn into_channel(self) -> fidl::Channel {
5301 self.client.into_channel()
5302 }
5303
5304 fn as_channel(&self) -> &fidl::Channel {
5305 self.client.as_channel()
5306 }
5307}
5308
5309#[cfg(target_os = "fuchsia")]
5310impl ThreadCapabilitiesSynchronousProxy {
5311 pub fn new(channel: fidl::Channel) -> Self {
5312 Self { client: fidl::client::sync::Client::new(channel) }
5313 }
5314
5315 pub fn into_channel(self) -> fidl::Channel {
5316 self.client.into_channel()
5317 }
5318
5319 pub fn wait_for_event(
5322 &self,
5323 deadline: zx::MonotonicInstant,
5324 ) -> Result<ThreadCapabilitiesEvent, fidl::Error> {
5325 ThreadCapabilitiesEvent::decode(
5326 self.client.wait_for_event::<ThreadCapabilitiesMarker>(deadline)?,
5327 )
5328 }
5329
5330 pub fn r#get_capabilities(
5335 &self,
5336 ___deadline: zx::MonotonicInstant,
5337 ) -> Result<Capabilities, fidl::Error> {
5338 let _response = self.client.send_query::<
5339 fidl::encoding::EmptyPayload,
5340 ThreadCapabilitiesGetCapabilitiesResponse,
5341 ThreadCapabilitiesMarker,
5342 >(
5343 (),
5344 0x5a0823ac35f2d425,
5345 fidl::encoding::DynamicFlags::empty(),
5346 ___deadline,
5347 )?;
5348 Ok(_response.capabilities)
5349 }
5350}
5351
5352#[cfg(target_os = "fuchsia")]
5353impl From<ThreadCapabilitiesSynchronousProxy> for zx::NullableHandle {
5354 fn from(value: ThreadCapabilitiesSynchronousProxy) -> Self {
5355 value.into_channel().into()
5356 }
5357}
5358
5359#[cfg(target_os = "fuchsia")]
5360impl From<fidl::Channel> for ThreadCapabilitiesSynchronousProxy {
5361 fn from(value: fidl::Channel) -> Self {
5362 Self::new(value)
5363 }
5364}
5365
5366#[cfg(target_os = "fuchsia")]
5367impl fidl::endpoints::FromClient for ThreadCapabilitiesSynchronousProxy {
5368 type Protocol = ThreadCapabilitiesMarker;
5369
5370 fn from_client(value: fidl::endpoints::ClientEnd<ThreadCapabilitiesMarker>) -> Self {
5371 Self::new(value.into_channel())
5372 }
5373}
5374
5375#[derive(Debug, Clone)]
5376pub struct ThreadCapabilitiesProxy {
5377 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5378}
5379
5380impl fidl::endpoints::Proxy for ThreadCapabilitiesProxy {
5381 type Protocol = ThreadCapabilitiesMarker;
5382
5383 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5384 Self::new(inner)
5385 }
5386
5387 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5388 self.client.into_channel().map_err(|client| Self { client })
5389 }
5390
5391 fn as_channel(&self) -> &::fidl::AsyncChannel {
5392 self.client.as_channel()
5393 }
5394}
5395
5396impl ThreadCapabilitiesProxy {
5397 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5399 let protocol_name =
5400 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5401 Self { client: fidl::client::Client::new(channel, protocol_name) }
5402 }
5403
5404 pub fn take_event_stream(&self) -> ThreadCapabilitiesEventStream {
5410 ThreadCapabilitiesEventStream { event_receiver: self.client.take_event_receiver() }
5411 }
5412
5413 pub fn r#get_capabilities(
5418 &self,
5419 ) -> fidl::client::QueryResponseFut<Capabilities, fidl::encoding::DefaultFuchsiaResourceDialect>
5420 {
5421 ThreadCapabilitiesProxyInterface::r#get_capabilities(self)
5422 }
5423}
5424
5425impl ThreadCapabilitiesProxyInterface for ThreadCapabilitiesProxy {
5426 type GetCapabilitiesResponseFut =
5427 fidl::client::QueryResponseFut<Capabilities, fidl::encoding::DefaultFuchsiaResourceDialect>;
5428 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
5429 fn _decode(
5430 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5431 ) -> Result<Capabilities, fidl::Error> {
5432 let _response = fidl::client::decode_transaction_body::<
5433 ThreadCapabilitiesGetCapabilitiesResponse,
5434 fidl::encoding::DefaultFuchsiaResourceDialect,
5435 0x5a0823ac35f2d425,
5436 >(_buf?)?;
5437 Ok(_response.capabilities)
5438 }
5439 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Capabilities>(
5440 (),
5441 0x5a0823ac35f2d425,
5442 fidl::encoding::DynamicFlags::empty(),
5443 _decode,
5444 )
5445 }
5446}
5447
5448pub struct ThreadCapabilitiesEventStream {
5449 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5450}
5451
5452impl std::marker::Unpin for ThreadCapabilitiesEventStream {}
5453
5454impl futures::stream::FusedStream for ThreadCapabilitiesEventStream {
5455 fn is_terminated(&self) -> bool {
5456 self.event_receiver.is_terminated()
5457 }
5458}
5459
5460impl futures::Stream for ThreadCapabilitiesEventStream {
5461 type Item = Result<ThreadCapabilitiesEvent, fidl::Error>;
5462
5463 fn poll_next(
5464 mut self: std::pin::Pin<&mut Self>,
5465 cx: &mut std::task::Context<'_>,
5466 ) -> std::task::Poll<Option<Self::Item>> {
5467 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5468 &mut self.event_receiver,
5469 cx
5470 )?) {
5471 Some(buf) => std::task::Poll::Ready(Some(ThreadCapabilitiesEvent::decode(buf))),
5472 None => std::task::Poll::Ready(None),
5473 }
5474 }
5475}
5476
5477#[derive(Debug)]
5478pub enum ThreadCapabilitiesEvent {}
5479
5480impl ThreadCapabilitiesEvent {
5481 fn decode(
5483 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5484 ) -> Result<ThreadCapabilitiesEvent, fidl::Error> {
5485 let (bytes, _handles) = buf.split_mut();
5486 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5487 debug_assert_eq!(tx_header.tx_id, 0);
5488 match tx_header.ordinal {
5489 _ => Err(fidl::Error::UnknownOrdinal {
5490 ordinal: tx_header.ordinal,
5491 protocol_name:
5492 <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5493 }),
5494 }
5495 }
5496}
5497
5498pub struct ThreadCapabilitiesRequestStream {
5500 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5501 is_terminated: bool,
5502}
5503
5504impl std::marker::Unpin for ThreadCapabilitiesRequestStream {}
5505
5506impl futures::stream::FusedStream for ThreadCapabilitiesRequestStream {
5507 fn is_terminated(&self) -> bool {
5508 self.is_terminated
5509 }
5510}
5511
5512impl fidl::endpoints::RequestStream for ThreadCapabilitiesRequestStream {
5513 type Protocol = ThreadCapabilitiesMarker;
5514 type ControlHandle = ThreadCapabilitiesControlHandle;
5515
5516 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5517 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5518 }
5519
5520 fn control_handle(&self) -> Self::ControlHandle {
5521 ThreadCapabilitiesControlHandle { inner: self.inner.clone() }
5522 }
5523
5524 fn into_inner(
5525 self,
5526 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5527 {
5528 (self.inner, self.is_terminated)
5529 }
5530
5531 fn from_inner(
5532 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5533 is_terminated: bool,
5534 ) -> Self {
5535 Self { inner, is_terminated }
5536 }
5537}
5538
5539impl futures::Stream for ThreadCapabilitiesRequestStream {
5540 type Item = Result<ThreadCapabilitiesRequest, fidl::Error>;
5541
5542 fn poll_next(
5543 mut self: std::pin::Pin<&mut Self>,
5544 cx: &mut std::task::Context<'_>,
5545 ) -> std::task::Poll<Option<Self::Item>> {
5546 let this = &mut *self;
5547 if this.inner.check_shutdown(cx) {
5548 this.is_terminated = true;
5549 return std::task::Poll::Ready(None);
5550 }
5551 if this.is_terminated {
5552 panic!("polled ThreadCapabilitiesRequestStream after completion");
5553 }
5554 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5555 |bytes, handles| {
5556 match this.inner.channel().read_etc(cx, bytes, handles) {
5557 std::task::Poll::Ready(Ok(())) => {}
5558 std::task::Poll::Pending => return std::task::Poll::Pending,
5559 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5560 this.is_terminated = true;
5561 return std::task::Poll::Ready(None);
5562 }
5563 std::task::Poll::Ready(Err(e)) => {
5564 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5565 e.into(),
5566 ))));
5567 }
5568 }
5569
5570 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5572
5573 std::task::Poll::Ready(Some(match header.ordinal {
5574 0x5a0823ac35f2d425 => {
5575 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5576 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
5577 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5578 let control_handle = ThreadCapabilitiesControlHandle {
5579 inner: this.inner.clone(),
5580 };
5581 Ok(ThreadCapabilitiesRequest::GetCapabilities {
5582 responder: ThreadCapabilitiesGetCapabilitiesResponder {
5583 control_handle: std::mem::ManuallyDrop::new(control_handle),
5584 tx_id: header.tx_id,
5585 },
5586 })
5587 }
5588 _ => Err(fidl::Error::UnknownOrdinal {
5589 ordinal: header.ordinal,
5590 protocol_name: <ThreadCapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5591 }),
5592 }))
5593 },
5594 )
5595 }
5596}
5597
5598#[derive(Debug)]
5600pub enum ThreadCapabilitiesRequest {
5601 GetCapabilities { responder: ThreadCapabilitiesGetCapabilitiesResponder },
5606}
5607
5608impl ThreadCapabilitiesRequest {
5609 #[allow(irrefutable_let_patterns)]
5610 pub fn into_get_capabilities(self) -> Option<(ThreadCapabilitiesGetCapabilitiesResponder)> {
5611 if let ThreadCapabilitiesRequest::GetCapabilities { responder } = self {
5612 Some((responder))
5613 } else {
5614 None
5615 }
5616 }
5617
5618 pub fn method_name(&self) -> &'static str {
5620 match *self {
5621 ThreadCapabilitiesRequest::GetCapabilities { .. } => "get_capabilities",
5622 }
5623 }
5624}
5625
5626#[derive(Debug, Clone)]
5627pub struct ThreadCapabilitiesControlHandle {
5628 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5629}
5630
5631impl ThreadCapabilitiesControlHandle {
5632 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5633 self.inner.shutdown_with_epitaph(status.into())
5634 }
5635}
5636
5637impl fidl::endpoints::ControlHandle for ThreadCapabilitiesControlHandle {
5638 fn shutdown(&self) {
5639 self.inner.shutdown()
5640 }
5641
5642 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5643 self.inner.shutdown_with_epitaph(status)
5644 }
5645
5646 fn is_closed(&self) -> bool {
5647 self.inner.channel().is_closed()
5648 }
5649 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5650 self.inner.channel().on_closed()
5651 }
5652
5653 #[cfg(target_os = "fuchsia")]
5654 fn signal_peer(
5655 &self,
5656 clear_mask: zx::Signals,
5657 set_mask: zx::Signals,
5658 ) -> Result<(), zx_status::Status> {
5659 use fidl::Peered;
5660 self.inner.channel().signal_peer(clear_mask, set_mask)
5661 }
5662}
5663
5664impl ThreadCapabilitiesControlHandle {}
5665
5666#[must_use = "FIDL methods require a response to be sent"]
5667#[derive(Debug)]
5668pub struct ThreadCapabilitiesGetCapabilitiesResponder {
5669 control_handle: std::mem::ManuallyDrop<ThreadCapabilitiesControlHandle>,
5670 tx_id: u32,
5671}
5672
5673impl std::ops::Drop for ThreadCapabilitiesGetCapabilitiesResponder {
5677 fn drop(&mut self) {
5678 self.control_handle.shutdown();
5679 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5681 }
5682}
5683
5684impl fidl::endpoints::Responder for ThreadCapabilitiesGetCapabilitiesResponder {
5685 type ControlHandle = ThreadCapabilitiesControlHandle;
5686
5687 fn control_handle(&self) -> &ThreadCapabilitiesControlHandle {
5688 &self.control_handle
5689 }
5690
5691 fn drop_without_shutdown(mut self) {
5692 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5694 std::mem::forget(self);
5696 }
5697}
5698
5699impl ThreadCapabilitiesGetCapabilitiesResponder {
5700 pub fn send(self, mut capabilities: &Capabilities) -> Result<(), fidl::Error> {
5704 let _result = self.send_raw(capabilities);
5705 if _result.is_err() {
5706 self.control_handle.shutdown();
5707 }
5708 self.drop_without_shutdown();
5709 _result
5710 }
5711
5712 pub fn send_no_shutdown_on_err(
5714 self,
5715 mut capabilities: &Capabilities,
5716 ) -> Result<(), fidl::Error> {
5717 let _result = self.send_raw(capabilities);
5718 self.drop_without_shutdown();
5719 _result
5720 }
5721
5722 fn send_raw(&self, mut capabilities: &Capabilities) -> Result<(), fidl::Error> {
5723 self.control_handle.inner.send::<ThreadCapabilitiesGetCapabilitiesResponse>(
5724 (capabilities,),
5725 self.tx_id,
5726 0x5a0823ac35f2d425,
5727 fidl::encoding::DynamicFlags::empty(),
5728 )
5729 }
5730}
5731
5732mod internal {
5733 use super::*;
5734
5735 impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorConnectRequest {
5736 type Borrowed<'a> = &'a mut Self;
5737 fn take_or_borrow<'a>(
5738 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5739 ) -> Self::Borrowed<'a> {
5740 value
5741 }
5742 }
5743
5744 unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorConnectRequest {
5745 type Owned = Self;
5746
5747 #[inline(always)]
5748 fn inline_align(_context: fidl::encoding::Context) -> usize {
5749 8
5750 }
5751
5752 #[inline(always)]
5753 fn inline_size(_context: fidl::encoding::Context) -> usize {
5754 24
5755 }
5756 }
5757
5758 unsafe impl
5759 fidl::encoding::Encode<
5760 CapabilitiesConnectorConnectRequest,
5761 fidl::encoding::DefaultFuchsiaResourceDialect,
5762 > for &mut CapabilitiesConnectorConnectRequest
5763 {
5764 #[inline]
5765 unsafe fn encode(
5766 self,
5767 encoder: &mut fidl::encoding::Encoder<
5768 '_,
5769 fidl::encoding::DefaultFuchsiaResourceDialect,
5770 >,
5771 offset: usize,
5772 _depth: fidl::encoding::Depth,
5773 ) -> fidl::Result<()> {
5774 encoder.debug_check_bounds::<CapabilitiesConnectorConnectRequest>(offset);
5775 fidl::encoding::Encode::<CapabilitiesConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5777 (
5778 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
5779 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
5780 ),
5781 encoder, offset, _depth
5782 )
5783 }
5784 }
5785 unsafe impl<
5786 T0: fidl::encoding::Encode<
5787 fidl::encoding::BoundedString<32>,
5788 fidl::encoding::DefaultFuchsiaResourceDialect,
5789 >,
5790 T1: fidl::encoding::Encode<
5791 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
5792 fidl::encoding::DefaultFuchsiaResourceDialect,
5793 >,
5794 >
5795 fidl::encoding::Encode<
5796 CapabilitiesConnectorConnectRequest,
5797 fidl::encoding::DefaultFuchsiaResourceDialect,
5798 > for (T0, T1)
5799 {
5800 #[inline]
5801 unsafe fn encode(
5802 self,
5803 encoder: &mut fidl::encoding::Encoder<
5804 '_,
5805 fidl::encoding::DefaultFuchsiaResourceDialect,
5806 >,
5807 offset: usize,
5808 depth: fidl::encoding::Depth,
5809 ) -> fidl::Result<()> {
5810 encoder.debug_check_bounds::<CapabilitiesConnectorConnectRequest>(offset);
5811 unsafe {
5814 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5815 (ptr as *mut u64).write_unaligned(0);
5816 }
5817 self.0.encode(encoder, offset + 0, depth)?;
5819 self.1.encode(encoder, offset + 16, depth)?;
5820 Ok(())
5821 }
5822 }
5823
5824 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5825 for CapabilitiesConnectorConnectRequest
5826 {
5827 #[inline(always)]
5828 fn new_empty() -> Self {
5829 Self {
5830 name: fidl::new_empty!(
5831 fidl::encoding::BoundedString<32>,
5832 fidl::encoding::DefaultFuchsiaResourceDialect
5833 ),
5834 server_end: fidl::new_empty!(
5835 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
5836 fidl::encoding::DefaultFuchsiaResourceDialect
5837 ),
5838 }
5839 }
5840
5841 #[inline]
5842 unsafe fn decode(
5843 &mut self,
5844 decoder: &mut fidl::encoding::Decoder<
5845 '_,
5846 fidl::encoding::DefaultFuchsiaResourceDialect,
5847 >,
5848 offset: usize,
5849 _depth: fidl::encoding::Depth,
5850 ) -> fidl::Result<()> {
5851 decoder.debug_check_bounds::<Self>(offset);
5852 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5854 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5855 let mask = 0xffffffff00000000u64;
5856 let maskedval = padval & mask;
5857 if maskedval != 0 {
5858 return Err(fidl::Error::NonZeroPadding {
5859 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5860 });
5861 }
5862 fidl::decode!(
5863 fidl::encoding::BoundedString<32>,
5864 fidl::encoding::DefaultFuchsiaResourceDialect,
5865 &mut self.name,
5866 decoder,
5867 offset + 0,
5868 _depth
5869 )?;
5870 fidl::decode!(
5871 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ThreadCapabilitiesMarker>>,
5872 fidl::encoding::DefaultFuchsiaResourceDialect,
5873 &mut self.server_end,
5874 decoder,
5875 offset + 16,
5876 _depth
5877 )?;
5878 Ok(())
5879 }
5880 }
5881
5882 impl fidl::encoding::ResourceTypeMarker for DatasetConnectorConnectRequest {
5883 type Borrowed<'a> = &'a mut Self;
5884 fn take_or_borrow<'a>(
5885 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5886 ) -> Self::Borrowed<'a> {
5887 value
5888 }
5889 }
5890
5891 unsafe impl fidl::encoding::TypeMarker for DatasetConnectorConnectRequest {
5892 type Owned = Self;
5893
5894 #[inline(always)]
5895 fn inline_align(_context: fidl::encoding::Context) -> usize {
5896 8
5897 }
5898
5899 #[inline(always)]
5900 fn inline_size(_context: fidl::encoding::Context) -> usize {
5901 24
5902 }
5903 }
5904
5905 unsafe impl
5906 fidl::encoding::Encode<
5907 DatasetConnectorConnectRequest,
5908 fidl::encoding::DefaultFuchsiaResourceDialect,
5909 > for &mut DatasetConnectorConnectRequest
5910 {
5911 #[inline]
5912 unsafe fn encode(
5913 self,
5914 encoder: &mut fidl::encoding::Encoder<
5915 '_,
5916 fidl::encoding::DefaultFuchsiaResourceDialect,
5917 >,
5918 offset: usize,
5919 _depth: fidl::encoding::Depth,
5920 ) -> fidl::Result<()> {
5921 encoder.debug_check_bounds::<DatasetConnectorConnectRequest>(offset);
5922 fidl::encoding::Encode::<DatasetConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5924 (
5925 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
5926 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
5927 ),
5928 encoder, offset, _depth
5929 )
5930 }
5931 }
5932 unsafe impl<
5933 T0: fidl::encoding::Encode<
5934 fidl::encoding::BoundedString<32>,
5935 fidl::encoding::DefaultFuchsiaResourceDialect,
5936 >,
5937 T1: fidl::encoding::Encode<
5938 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
5939 fidl::encoding::DefaultFuchsiaResourceDialect,
5940 >,
5941 >
5942 fidl::encoding::Encode<
5943 DatasetConnectorConnectRequest,
5944 fidl::encoding::DefaultFuchsiaResourceDialect,
5945 > for (T0, T1)
5946 {
5947 #[inline]
5948 unsafe fn encode(
5949 self,
5950 encoder: &mut fidl::encoding::Encoder<
5951 '_,
5952 fidl::encoding::DefaultFuchsiaResourceDialect,
5953 >,
5954 offset: usize,
5955 depth: fidl::encoding::Depth,
5956 ) -> fidl::Result<()> {
5957 encoder.debug_check_bounds::<DatasetConnectorConnectRequest>(offset);
5958 unsafe {
5961 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5962 (ptr as *mut u64).write_unaligned(0);
5963 }
5964 self.0.encode(encoder, offset + 0, depth)?;
5966 self.1.encode(encoder, offset + 16, depth)?;
5967 Ok(())
5968 }
5969 }
5970
5971 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5972 for DatasetConnectorConnectRequest
5973 {
5974 #[inline(always)]
5975 fn new_empty() -> Self {
5976 Self {
5977 name: fidl::new_empty!(
5978 fidl::encoding::BoundedString<32>,
5979 fidl::encoding::DefaultFuchsiaResourceDialect
5980 ),
5981 server_end: fidl::new_empty!(
5982 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
5983 fidl::encoding::DefaultFuchsiaResourceDialect
5984 ),
5985 }
5986 }
5987
5988 #[inline]
5989 unsafe fn decode(
5990 &mut self,
5991 decoder: &mut fidl::encoding::Decoder<
5992 '_,
5993 fidl::encoding::DefaultFuchsiaResourceDialect,
5994 >,
5995 offset: usize,
5996 _depth: fidl::encoding::Depth,
5997 ) -> fidl::Result<()> {
5998 decoder.debug_check_bounds::<Self>(offset);
5999 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6001 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6002 let mask = 0xffffffff00000000u64;
6003 let maskedval = padval & mask;
6004 if maskedval != 0 {
6005 return Err(fidl::Error::NonZeroPadding {
6006 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6007 });
6008 }
6009 fidl::decode!(
6010 fidl::encoding::BoundedString<32>,
6011 fidl::encoding::DefaultFuchsiaResourceDialect,
6012 &mut self.name,
6013 decoder,
6014 offset + 0,
6015 _depth
6016 )?;
6017 fidl::decode!(
6018 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DatasetMarker>>,
6019 fidl::encoding::DefaultFuchsiaResourceDialect,
6020 &mut self.server_end,
6021 decoder,
6022 offset + 16,
6023 _depth
6024 )?;
6025 Ok(())
6026 }
6027 }
6028
6029 impl fidl::encoding::ResourceTypeMarker for EpskcConnectorConnectRequest {
6030 type Borrowed<'a> = &'a mut Self;
6031 fn take_or_borrow<'a>(
6032 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6033 ) -> Self::Borrowed<'a> {
6034 value
6035 }
6036 }
6037
6038 unsafe impl fidl::encoding::TypeMarker for EpskcConnectorConnectRequest {
6039 type Owned = Self;
6040
6041 #[inline(always)]
6042 fn inline_align(_context: fidl::encoding::Context) -> usize {
6043 8
6044 }
6045
6046 #[inline(always)]
6047 fn inline_size(_context: fidl::encoding::Context) -> usize {
6048 24
6049 }
6050 }
6051
6052 unsafe impl
6053 fidl::encoding::Encode<
6054 EpskcConnectorConnectRequest,
6055 fidl::encoding::DefaultFuchsiaResourceDialect,
6056 > for &mut EpskcConnectorConnectRequest
6057 {
6058 #[inline]
6059 unsafe fn encode(
6060 self,
6061 encoder: &mut fidl::encoding::Encoder<
6062 '_,
6063 fidl::encoding::DefaultFuchsiaResourceDialect,
6064 >,
6065 offset: usize,
6066 _depth: fidl::encoding::Depth,
6067 ) -> fidl::Result<()> {
6068 encoder.debug_check_bounds::<EpskcConnectorConnectRequest>(offset);
6069 fidl::encoding::Encode::<EpskcConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6071 (
6072 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
6073 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EpskcMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
6074 ),
6075 encoder, offset, _depth
6076 )
6077 }
6078 }
6079 unsafe impl<
6080 T0: fidl::encoding::Encode<
6081 fidl::encoding::BoundedString<32>,
6082 fidl::encoding::DefaultFuchsiaResourceDialect,
6083 >,
6084 T1: fidl::encoding::Encode<
6085 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EpskcMarker>>,
6086 fidl::encoding::DefaultFuchsiaResourceDialect,
6087 >,
6088 >
6089 fidl::encoding::Encode<
6090 EpskcConnectorConnectRequest,
6091 fidl::encoding::DefaultFuchsiaResourceDialect,
6092 > for (T0, T1)
6093 {
6094 #[inline]
6095 unsafe fn encode(
6096 self,
6097 encoder: &mut fidl::encoding::Encoder<
6098 '_,
6099 fidl::encoding::DefaultFuchsiaResourceDialect,
6100 >,
6101 offset: usize,
6102 depth: fidl::encoding::Depth,
6103 ) -> fidl::Result<()> {
6104 encoder.debug_check_bounds::<EpskcConnectorConnectRequest>(offset);
6105 unsafe {
6108 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
6109 (ptr as *mut u64).write_unaligned(0);
6110 }
6111 self.0.encode(encoder, offset + 0, depth)?;
6113 self.1.encode(encoder, offset + 16, depth)?;
6114 Ok(())
6115 }
6116 }
6117
6118 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6119 for EpskcConnectorConnectRequest
6120 {
6121 #[inline(always)]
6122 fn new_empty() -> Self {
6123 Self {
6124 name: fidl::new_empty!(
6125 fidl::encoding::BoundedString<32>,
6126 fidl::encoding::DefaultFuchsiaResourceDialect
6127 ),
6128 server_end: fidl::new_empty!(
6129 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EpskcMarker>>,
6130 fidl::encoding::DefaultFuchsiaResourceDialect
6131 ),
6132 }
6133 }
6134
6135 #[inline]
6136 unsafe fn decode(
6137 &mut self,
6138 decoder: &mut fidl::encoding::Decoder<
6139 '_,
6140 fidl::encoding::DefaultFuchsiaResourceDialect,
6141 >,
6142 offset: usize,
6143 _depth: fidl::encoding::Depth,
6144 ) -> fidl::Result<()> {
6145 decoder.debug_check_bounds::<Self>(offset);
6146 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6148 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6149 let mask = 0xffffffff00000000u64;
6150 let maskedval = padval & mask;
6151 if maskedval != 0 {
6152 return Err(fidl::Error::NonZeroPadding {
6153 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6154 });
6155 }
6156 fidl::decode!(
6157 fidl::encoding::BoundedString<32>,
6158 fidl::encoding::DefaultFuchsiaResourceDialect,
6159 &mut self.name,
6160 decoder,
6161 offset + 0,
6162 _depth
6163 )?;
6164 fidl::decode!(
6165 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EpskcMarker>>,
6166 fidl::encoding::DefaultFuchsiaResourceDialect,
6167 &mut self.server_end,
6168 decoder,
6169 offset + 16,
6170 _depth
6171 )?;
6172 Ok(())
6173 }
6174 }
6175
6176 impl fidl::encoding::ResourceTypeMarker for FeatureConnectorConnectRequest {
6177 type Borrowed<'a> = &'a mut Self;
6178 fn take_or_borrow<'a>(
6179 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6180 ) -> Self::Borrowed<'a> {
6181 value
6182 }
6183 }
6184
6185 unsafe impl fidl::encoding::TypeMarker for FeatureConnectorConnectRequest {
6186 type Owned = Self;
6187
6188 #[inline(always)]
6189 fn inline_align(_context: fidl::encoding::Context) -> usize {
6190 8
6191 }
6192
6193 #[inline(always)]
6194 fn inline_size(_context: fidl::encoding::Context) -> usize {
6195 24
6196 }
6197 }
6198
6199 unsafe impl
6200 fidl::encoding::Encode<
6201 FeatureConnectorConnectRequest,
6202 fidl::encoding::DefaultFuchsiaResourceDialect,
6203 > for &mut FeatureConnectorConnectRequest
6204 {
6205 #[inline]
6206 unsafe fn encode(
6207 self,
6208 encoder: &mut fidl::encoding::Encoder<
6209 '_,
6210 fidl::encoding::DefaultFuchsiaResourceDialect,
6211 >,
6212 offset: usize,
6213 _depth: fidl::encoding::Depth,
6214 ) -> fidl::Result<()> {
6215 encoder.debug_check_bounds::<FeatureConnectorConnectRequest>(offset);
6216 fidl::encoding::Encode::<FeatureConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6218 (
6219 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
6220 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
6221 ),
6222 encoder, offset, _depth
6223 )
6224 }
6225 }
6226 unsafe impl<
6227 T0: fidl::encoding::Encode<
6228 fidl::encoding::BoundedString<32>,
6229 fidl::encoding::DefaultFuchsiaResourceDialect,
6230 >,
6231 T1: fidl::encoding::Encode<
6232 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
6233 fidl::encoding::DefaultFuchsiaResourceDialect,
6234 >,
6235 >
6236 fidl::encoding::Encode<
6237 FeatureConnectorConnectRequest,
6238 fidl::encoding::DefaultFuchsiaResourceDialect,
6239 > for (T0, T1)
6240 {
6241 #[inline]
6242 unsafe fn encode(
6243 self,
6244 encoder: &mut fidl::encoding::Encoder<
6245 '_,
6246 fidl::encoding::DefaultFuchsiaResourceDialect,
6247 >,
6248 offset: usize,
6249 depth: fidl::encoding::Depth,
6250 ) -> fidl::Result<()> {
6251 encoder.debug_check_bounds::<FeatureConnectorConnectRequest>(offset);
6252 unsafe {
6255 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
6256 (ptr as *mut u64).write_unaligned(0);
6257 }
6258 self.0.encode(encoder, offset + 0, depth)?;
6260 self.1.encode(encoder, offset + 16, depth)?;
6261 Ok(())
6262 }
6263 }
6264
6265 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6266 for FeatureConnectorConnectRequest
6267 {
6268 #[inline(always)]
6269 fn new_empty() -> Self {
6270 Self {
6271 name: fidl::new_empty!(
6272 fidl::encoding::BoundedString<32>,
6273 fidl::encoding::DefaultFuchsiaResourceDialect
6274 ),
6275 server_end: fidl::new_empty!(
6276 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
6277 fidl::encoding::DefaultFuchsiaResourceDialect
6278 ),
6279 }
6280 }
6281
6282 #[inline]
6283 unsafe fn decode(
6284 &mut self,
6285 decoder: &mut fidl::encoding::Decoder<
6286 '_,
6287 fidl::encoding::DefaultFuchsiaResourceDialect,
6288 >,
6289 offset: usize,
6290 _depth: fidl::encoding::Depth,
6291 ) -> fidl::Result<()> {
6292 decoder.debug_check_bounds::<Self>(offset);
6293 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6295 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6296 let mask = 0xffffffff00000000u64;
6297 let maskedval = padval & mask;
6298 if maskedval != 0 {
6299 return Err(fidl::Error::NonZeroPadding {
6300 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6301 });
6302 }
6303 fidl::decode!(
6304 fidl::encoding::BoundedString<32>,
6305 fidl::encoding::DefaultFuchsiaResourceDialect,
6306 &mut self.name,
6307 decoder,
6308 offset + 0,
6309 _depth
6310 )?;
6311 fidl::decode!(
6312 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<FeatureMarker>>,
6313 fidl::encoding::DefaultFuchsiaResourceDialect,
6314 &mut self.server_end,
6315 decoder,
6316 offset + 16,
6317 _depth
6318 )?;
6319 Ok(())
6320 }
6321 }
6322
6323 impl fidl::encoding::ResourceTypeMarker for MeshcopConnectorConnectRequest {
6324 type Borrowed<'a> = &'a mut Self;
6325 fn take_or_borrow<'a>(
6326 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6327 ) -> Self::Borrowed<'a> {
6328 value
6329 }
6330 }
6331
6332 unsafe impl fidl::encoding::TypeMarker for MeshcopConnectorConnectRequest {
6333 type Owned = Self;
6334
6335 #[inline(always)]
6336 fn inline_align(_context: fidl::encoding::Context) -> usize {
6337 8
6338 }
6339
6340 #[inline(always)]
6341 fn inline_size(_context: fidl::encoding::Context) -> usize {
6342 24
6343 }
6344 }
6345
6346 unsafe impl
6347 fidl::encoding::Encode<
6348 MeshcopConnectorConnectRequest,
6349 fidl::encoding::DefaultFuchsiaResourceDialect,
6350 > for &mut MeshcopConnectorConnectRequest
6351 {
6352 #[inline]
6353 unsafe fn encode(
6354 self,
6355 encoder: &mut fidl::encoding::Encoder<
6356 '_,
6357 fidl::encoding::DefaultFuchsiaResourceDialect,
6358 >,
6359 offset: usize,
6360 _depth: fidl::encoding::Depth,
6361 ) -> fidl::Result<()> {
6362 encoder.debug_check_bounds::<MeshcopConnectorConnectRequest>(offset);
6363 fidl::encoding::Encode::<MeshcopConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6365 (
6366 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
6367 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
6368 ),
6369 encoder, offset, _depth
6370 )
6371 }
6372 }
6373 unsafe impl<
6374 T0: fidl::encoding::Encode<
6375 fidl::encoding::BoundedString<32>,
6376 fidl::encoding::DefaultFuchsiaResourceDialect,
6377 >,
6378 T1: fidl::encoding::Encode<
6379 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
6380 fidl::encoding::DefaultFuchsiaResourceDialect,
6381 >,
6382 >
6383 fidl::encoding::Encode<
6384 MeshcopConnectorConnectRequest,
6385 fidl::encoding::DefaultFuchsiaResourceDialect,
6386 > for (T0, T1)
6387 {
6388 #[inline]
6389 unsafe fn encode(
6390 self,
6391 encoder: &mut fidl::encoding::Encoder<
6392 '_,
6393 fidl::encoding::DefaultFuchsiaResourceDialect,
6394 >,
6395 offset: usize,
6396 depth: fidl::encoding::Depth,
6397 ) -> fidl::Result<()> {
6398 encoder.debug_check_bounds::<MeshcopConnectorConnectRequest>(offset);
6399 unsafe {
6402 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
6403 (ptr as *mut u64).write_unaligned(0);
6404 }
6405 self.0.encode(encoder, offset + 0, depth)?;
6407 self.1.encode(encoder, offset + 16, depth)?;
6408 Ok(())
6409 }
6410 }
6411
6412 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6413 for MeshcopConnectorConnectRequest
6414 {
6415 #[inline(always)]
6416 fn new_empty() -> Self {
6417 Self {
6418 name: fidl::new_empty!(
6419 fidl::encoding::BoundedString<32>,
6420 fidl::encoding::DefaultFuchsiaResourceDialect
6421 ),
6422 server_end: fidl::new_empty!(
6423 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
6424 fidl::encoding::DefaultFuchsiaResourceDialect
6425 ),
6426 }
6427 }
6428
6429 #[inline]
6430 unsafe fn decode(
6431 &mut self,
6432 decoder: &mut fidl::encoding::Decoder<
6433 '_,
6434 fidl::encoding::DefaultFuchsiaResourceDialect,
6435 >,
6436 offset: usize,
6437 _depth: fidl::encoding::Depth,
6438 ) -> fidl::Result<()> {
6439 decoder.debug_check_bounds::<Self>(offset);
6440 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6442 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6443 let mask = 0xffffffff00000000u64;
6444 let maskedval = padval & mask;
6445 if maskedval != 0 {
6446 return Err(fidl::Error::NonZeroPadding {
6447 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6448 });
6449 }
6450 fidl::decode!(
6451 fidl::encoding::BoundedString<32>,
6452 fidl::encoding::DefaultFuchsiaResourceDialect,
6453 &mut self.name,
6454 decoder,
6455 offset + 0,
6456 _depth
6457 )?;
6458 fidl::decode!(
6459 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MeshcopMarker>>,
6460 fidl::encoding::DefaultFuchsiaResourceDialect,
6461 &mut self.server_end,
6462 decoder,
6463 offset + 16,
6464 _depth
6465 )?;
6466 Ok(())
6467 }
6468 }
6469}