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_experimental_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DeviceConnectorConnectRequest {
16 pub name: String,
17 pub server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for DeviceConnectorConnectRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct DeviceExtraConnectorConnectRequest {
27 pub name: String,
28 pub server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32 for DeviceExtraConnectorConnectRequest
33{
34}
35
36#[derive(Debug, PartialEq)]
37pub struct DeviceExtraFormNetworkRequest {
38 pub params: fidl_fuchsia_lowpan_device::ProvisioningParams,
39 pub progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for DeviceExtraFormNetworkRequest
44{
45}
46
47#[derive(Debug, PartialEq)]
48pub struct DeviceExtraJoinNetworkRequest {
49 pub params: JoinParams,
50 pub progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
54 for DeviceExtraJoinNetworkRequest
55{
56}
57
58#[derive(Debug, PartialEq)]
59pub struct DeviceExtraStartNetworkScanRequest {
60 pub params: NetworkScanParameters,
61 pub stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
62}
63
64impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
65 for DeviceExtraStartNetworkScanRequest
66{
67}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct DeviceRouteConnectorConnectRequest {
71 pub name: String,
72 pub server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
73}
74
75impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
76 for DeviceRouteConnectorConnectRequest
77{
78}
79
80#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81pub struct DeviceRouteExtraConnectorConnectRequest {
82 pub name: String,
83 pub server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
84}
85
86impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
87 for DeviceRouteExtraConnectorConnectRequest
88{
89}
90
91#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
92pub struct LegacyJoiningConnectorConnectRequest {
93 pub name: String,
94 pub server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
95}
96
97impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
98 for LegacyJoiningConnectorConnectRequest
99{
100}
101
102#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103pub struct TelemetryProviderConnectorConnectRequest {
104 pub name: String,
105 pub server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
106}
107
108impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
109 for TelemetryProviderConnectorConnectRequest
110{
111}
112
113#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
114pub struct BeaconInfoStreamMarker;
115
116impl fidl::endpoints::ProtocolMarker for BeaconInfoStreamMarker {
117 type Proxy = BeaconInfoStreamProxy;
118 type RequestStream = BeaconInfoStreamRequestStream;
119 #[cfg(target_os = "fuchsia")]
120 type SynchronousProxy = BeaconInfoStreamSynchronousProxy;
121
122 const DEBUG_NAME: &'static str = "(anonymous) BeaconInfoStream";
123}
124
125pub trait BeaconInfoStreamProxyInterface: Send + Sync {
126 type NextResponseFut: std::future::Future<Output = Result<Vec<BeaconInfo>, fidl::Error>> + Send;
127 fn r#next(&self) -> Self::NextResponseFut;
128}
129#[derive(Debug)]
130#[cfg(target_os = "fuchsia")]
131pub struct BeaconInfoStreamSynchronousProxy {
132 client: fidl::client::sync::Client,
133}
134
135#[cfg(target_os = "fuchsia")]
136impl fidl::endpoints::SynchronousProxy for BeaconInfoStreamSynchronousProxy {
137 type Proxy = BeaconInfoStreamProxy;
138 type Protocol = BeaconInfoStreamMarker;
139
140 fn from_channel(inner: fidl::Channel) -> Self {
141 Self::new(inner)
142 }
143
144 fn into_channel(self) -> fidl::Channel {
145 self.client.into_channel()
146 }
147
148 fn as_channel(&self) -> &fidl::Channel {
149 self.client.as_channel()
150 }
151}
152
153#[cfg(target_os = "fuchsia")]
154impl BeaconInfoStreamSynchronousProxy {
155 pub fn new(channel: fidl::Channel) -> Self {
156 let protocol_name = <BeaconInfoStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
157 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
158 }
159
160 pub fn into_channel(self) -> fidl::Channel {
161 self.client.into_channel()
162 }
163
164 pub fn wait_for_event(
167 &self,
168 deadline: zx::MonotonicInstant,
169 ) -> Result<BeaconInfoStreamEvent, fidl::Error> {
170 BeaconInfoStreamEvent::decode(self.client.wait_for_event(deadline)?)
171 }
172
173 pub fn r#next(
178 &self,
179 ___deadline: zx::MonotonicInstant,
180 ) -> Result<Vec<BeaconInfo>, fidl::Error> {
181 let _response =
182 self.client.send_query::<fidl::encoding::EmptyPayload, BeaconInfoStreamNextResponse>(
183 (),
184 0x367a557363a340b6,
185 fidl::encoding::DynamicFlags::empty(),
186 ___deadline,
187 )?;
188 Ok(_response.beacons)
189 }
190}
191
192#[cfg(target_os = "fuchsia")]
193impl From<BeaconInfoStreamSynchronousProxy> for zx::Handle {
194 fn from(value: BeaconInfoStreamSynchronousProxy) -> Self {
195 value.into_channel().into()
196 }
197}
198
199#[cfg(target_os = "fuchsia")]
200impl From<fidl::Channel> for BeaconInfoStreamSynchronousProxy {
201 fn from(value: fidl::Channel) -> Self {
202 Self::new(value)
203 }
204}
205
206#[derive(Debug, Clone)]
207pub struct BeaconInfoStreamProxy {
208 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
209}
210
211impl fidl::endpoints::Proxy for BeaconInfoStreamProxy {
212 type Protocol = BeaconInfoStreamMarker;
213
214 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
215 Self::new(inner)
216 }
217
218 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
219 self.client.into_channel().map_err(|client| Self { client })
220 }
221
222 fn as_channel(&self) -> &::fidl::AsyncChannel {
223 self.client.as_channel()
224 }
225}
226
227impl BeaconInfoStreamProxy {
228 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
230 let protocol_name = <BeaconInfoStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
231 Self { client: fidl::client::Client::new(channel, protocol_name) }
232 }
233
234 pub fn take_event_stream(&self) -> BeaconInfoStreamEventStream {
240 BeaconInfoStreamEventStream { event_receiver: self.client.take_event_receiver() }
241 }
242
243 pub fn r#next(
248 &self,
249 ) -> fidl::client::QueryResponseFut<
250 Vec<BeaconInfo>,
251 fidl::encoding::DefaultFuchsiaResourceDialect,
252 > {
253 BeaconInfoStreamProxyInterface::r#next(self)
254 }
255}
256
257impl BeaconInfoStreamProxyInterface for BeaconInfoStreamProxy {
258 type NextResponseFut = fidl::client::QueryResponseFut<
259 Vec<BeaconInfo>,
260 fidl::encoding::DefaultFuchsiaResourceDialect,
261 >;
262 fn r#next(&self) -> Self::NextResponseFut {
263 fn _decode(
264 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
265 ) -> Result<Vec<BeaconInfo>, fidl::Error> {
266 let _response = fidl::client::decode_transaction_body::<
267 BeaconInfoStreamNextResponse,
268 fidl::encoding::DefaultFuchsiaResourceDialect,
269 0x367a557363a340b6,
270 >(_buf?)?;
271 Ok(_response.beacons)
272 }
273 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<BeaconInfo>>(
274 (),
275 0x367a557363a340b6,
276 fidl::encoding::DynamicFlags::empty(),
277 _decode,
278 )
279 }
280}
281
282pub struct BeaconInfoStreamEventStream {
283 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
284}
285
286impl std::marker::Unpin for BeaconInfoStreamEventStream {}
287
288impl futures::stream::FusedStream for BeaconInfoStreamEventStream {
289 fn is_terminated(&self) -> bool {
290 self.event_receiver.is_terminated()
291 }
292}
293
294impl futures::Stream for BeaconInfoStreamEventStream {
295 type Item = Result<BeaconInfoStreamEvent, fidl::Error>;
296
297 fn poll_next(
298 mut self: std::pin::Pin<&mut Self>,
299 cx: &mut std::task::Context<'_>,
300 ) -> std::task::Poll<Option<Self::Item>> {
301 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
302 &mut self.event_receiver,
303 cx
304 )?) {
305 Some(buf) => std::task::Poll::Ready(Some(BeaconInfoStreamEvent::decode(buf))),
306 None => std::task::Poll::Ready(None),
307 }
308 }
309}
310
311#[derive(Debug)]
312pub enum BeaconInfoStreamEvent {}
313
314impl BeaconInfoStreamEvent {
315 fn decode(
317 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
318 ) -> Result<BeaconInfoStreamEvent, fidl::Error> {
319 let (bytes, _handles) = buf.split_mut();
320 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
321 debug_assert_eq!(tx_header.tx_id, 0);
322 match tx_header.ordinal {
323 _ => Err(fidl::Error::UnknownOrdinal {
324 ordinal: tx_header.ordinal,
325 protocol_name:
326 <BeaconInfoStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
327 }),
328 }
329 }
330}
331
332pub struct BeaconInfoStreamRequestStream {
334 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
335 is_terminated: bool,
336}
337
338impl std::marker::Unpin for BeaconInfoStreamRequestStream {}
339
340impl futures::stream::FusedStream for BeaconInfoStreamRequestStream {
341 fn is_terminated(&self) -> bool {
342 self.is_terminated
343 }
344}
345
346impl fidl::endpoints::RequestStream for BeaconInfoStreamRequestStream {
347 type Protocol = BeaconInfoStreamMarker;
348 type ControlHandle = BeaconInfoStreamControlHandle;
349
350 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
351 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
352 }
353
354 fn control_handle(&self) -> Self::ControlHandle {
355 BeaconInfoStreamControlHandle { inner: self.inner.clone() }
356 }
357
358 fn into_inner(
359 self,
360 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
361 {
362 (self.inner, self.is_terminated)
363 }
364
365 fn from_inner(
366 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
367 is_terminated: bool,
368 ) -> Self {
369 Self { inner, is_terminated }
370 }
371}
372
373impl futures::Stream for BeaconInfoStreamRequestStream {
374 type Item = Result<BeaconInfoStreamRequest, fidl::Error>;
375
376 fn poll_next(
377 mut self: std::pin::Pin<&mut Self>,
378 cx: &mut std::task::Context<'_>,
379 ) -> std::task::Poll<Option<Self::Item>> {
380 let this = &mut *self;
381 if this.inner.check_shutdown(cx) {
382 this.is_terminated = true;
383 return std::task::Poll::Ready(None);
384 }
385 if this.is_terminated {
386 panic!("polled BeaconInfoStreamRequestStream after completion");
387 }
388 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
389 |bytes, handles| {
390 match this.inner.channel().read_etc(cx, bytes, handles) {
391 std::task::Poll::Ready(Ok(())) => {}
392 std::task::Poll::Pending => return std::task::Poll::Pending,
393 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
394 this.is_terminated = true;
395 return std::task::Poll::Ready(None);
396 }
397 std::task::Poll::Ready(Err(e)) => {
398 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
399 e.into(),
400 ))))
401 }
402 }
403
404 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
406
407 std::task::Poll::Ready(Some(match header.ordinal {
408 0x367a557363a340b6 => {
409 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
410 let mut req = fidl::new_empty!(
411 fidl::encoding::EmptyPayload,
412 fidl::encoding::DefaultFuchsiaResourceDialect
413 );
414 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
415 let control_handle =
416 BeaconInfoStreamControlHandle { inner: this.inner.clone() };
417 Ok(BeaconInfoStreamRequest::Next {
418 responder: BeaconInfoStreamNextResponder {
419 control_handle: std::mem::ManuallyDrop::new(control_handle),
420 tx_id: header.tx_id,
421 },
422 })
423 }
424 _ => Err(fidl::Error::UnknownOrdinal {
425 ordinal: header.ordinal,
426 protocol_name:
427 <BeaconInfoStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
428 }),
429 }))
430 },
431 )
432 }
433}
434
435#[derive(Debug)]
440pub enum BeaconInfoStreamRequest {
441 Next { responder: BeaconInfoStreamNextResponder },
446}
447
448impl BeaconInfoStreamRequest {
449 #[allow(irrefutable_let_patterns)]
450 pub fn into_next(self) -> Option<(BeaconInfoStreamNextResponder)> {
451 if let BeaconInfoStreamRequest::Next { responder } = self {
452 Some((responder))
453 } else {
454 None
455 }
456 }
457
458 pub fn method_name(&self) -> &'static str {
460 match *self {
461 BeaconInfoStreamRequest::Next { .. } => "next",
462 }
463 }
464}
465
466#[derive(Debug, Clone)]
467pub struct BeaconInfoStreamControlHandle {
468 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
469}
470
471impl fidl::endpoints::ControlHandle for BeaconInfoStreamControlHandle {
472 fn shutdown(&self) {
473 self.inner.shutdown()
474 }
475 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
476 self.inner.shutdown_with_epitaph(status)
477 }
478
479 fn is_closed(&self) -> bool {
480 self.inner.channel().is_closed()
481 }
482 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
483 self.inner.channel().on_closed()
484 }
485
486 #[cfg(target_os = "fuchsia")]
487 fn signal_peer(
488 &self,
489 clear_mask: zx::Signals,
490 set_mask: zx::Signals,
491 ) -> Result<(), zx_status::Status> {
492 use fidl::Peered;
493 self.inner.channel().signal_peer(clear_mask, set_mask)
494 }
495}
496
497impl BeaconInfoStreamControlHandle {}
498
499#[must_use = "FIDL methods require a response to be sent"]
500#[derive(Debug)]
501pub struct BeaconInfoStreamNextResponder {
502 control_handle: std::mem::ManuallyDrop<BeaconInfoStreamControlHandle>,
503 tx_id: u32,
504}
505
506impl std::ops::Drop for BeaconInfoStreamNextResponder {
510 fn drop(&mut self) {
511 self.control_handle.shutdown();
512 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
514 }
515}
516
517impl fidl::endpoints::Responder for BeaconInfoStreamNextResponder {
518 type ControlHandle = BeaconInfoStreamControlHandle;
519
520 fn control_handle(&self) -> &BeaconInfoStreamControlHandle {
521 &self.control_handle
522 }
523
524 fn drop_without_shutdown(mut self) {
525 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
527 std::mem::forget(self);
529 }
530}
531
532impl BeaconInfoStreamNextResponder {
533 pub fn send(self, mut beacons: &[BeaconInfo]) -> Result<(), fidl::Error> {
537 let _result = self.send_raw(beacons);
538 if _result.is_err() {
539 self.control_handle.shutdown();
540 }
541 self.drop_without_shutdown();
542 _result
543 }
544
545 pub fn send_no_shutdown_on_err(self, mut beacons: &[BeaconInfo]) -> Result<(), fidl::Error> {
547 let _result = self.send_raw(beacons);
548 self.drop_without_shutdown();
549 _result
550 }
551
552 fn send_raw(&self, mut beacons: &[BeaconInfo]) -> Result<(), fidl::Error> {
553 self.control_handle.inner.send::<BeaconInfoStreamNextResponse>(
554 (beacons,),
555 self.tx_id,
556 0x367a557363a340b6,
557 fidl::encoding::DynamicFlags::empty(),
558 )
559 }
560}
561
562#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
563pub struct DeviceMarker;
564
565impl fidl::endpoints::ProtocolMarker for DeviceMarker {
566 type Proxy = DeviceProxy;
567 type RequestStream = DeviceRequestStream;
568 #[cfg(target_os = "fuchsia")]
569 type SynchronousProxy = DeviceSynchronousProxy;
570
571 const DEBUG_NAME: &'static str = "(anonymous) Device";
572}
573
574pub trait DeviceProxyInterface: Send + Sync {
575 type GetSupportedChannelsResponseFut: std::future::Future<Output = Result<Vec<ChannelInfo>, fidl::Error>>
576 + Send;
577 fn r#get_supported_channels(&self) -> Self::GetSupportedChannelsResponseFut;
578}
579#[derive(Debug)]
580#[cfg(target_os = "fuchsia")]
581pub struct DeviceSynchronousProxy {
582 client: fidl::client::sync::Client,
583}
584
585#[cfg(target_os = "fuchsia")]
586impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
587 type Proxy = DeviceProxy;
588 type Protocol = DeviceMarker;
589
590 fn from_channel(inner: fidl::Channel) -> Self {
591 Self::new(inner)
592 }
593
594 fn into_channel(self) -> fidl::Channel {
595 self.client.into_channel()
596 }
597
598 fn as_channel(&self) -> &fidl::Channel {
599 self.client.as_channel()
600 }
601}
602
603#[cfg(target_os = "fuchsia")]
604impl DeviceSynchronousProxy {
605 pub fn new(channel: fidl::Channel) -> Self {
606 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
607 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
608 }
609
610 pub fn into_channel(self) -> fidl::Channel {
611 self.client.into_channel()
612 }
613
614 pub fn wait_for_event(
617 &self,
618 deadline: zx::MonotonicInstant,
619 ) -> Result<DeviceEvent, fidl::Error> {
620 DeviceEvent::decode(self.client.wait_for_event(deadline)?)
621 }
622
623 pub fn r#get_supported_channels(
626 &self,
627 ___deadline: zx::MonotonicInstant,
628 ) -> Result<Vec<ChannelInfo>, fidl::Error> {
629 let _response = self
630 .client
631 .send_query::<fidl::encoding::EmptyPayload, DeviceGetSupportedChannelsResponse>(
632 (),
633 0x2d8b969a9bd70f23,
634 fidl::encoding::DynamicFlags::empty(),
635 ___deadline,
636 )?;
637 Ok(_response.channels_info)
638 }
639}
640
641#[cfg(target_os = "fuchsia")]
642impl From<DeviceSynchronousProxy> for zx::Handle {
643 fn from(value: DeviceSynchronousProxy) -> Self {
644 value.into_channel().into()
645 }
646}
647
648#[cfg(target_os = "fuchsia")]
649impl From<fidl::Channel> for DeviceSynchronousProxy {
650 fn from(value: fidl::Channel) -> Self {
651 Self::new(value)
652 }
653}
654
655#[derive(Debug, Clone)]
656pub struct DeviceProxy {
657 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
658}
659
660impl fidl::endpoints::Proxy for DeviceProxy {
661 type Protocol = DeviceMarker;
662
663 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
664 Self::new(inner)
665 }
666
667 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
668 self.client.into_channel().map_err(|client| Self { client })
669 }
670
671 fn as_channel(&self) -> &::fidl::AsyncChannel {
672 self.client.as_channel()
673 }
674}
675
676impl DeviceProxy {
677 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
679 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
680 Self { client: fidl::client::Client::new(channel, protocol_name) }
681 }
682
683 pub fn take_event_stream(&self) -> DeviceEventStream {
689 DeviceEventStream { event_receiver: self.client.take_event_receiver() }
690 }
691
692 pub fn r#get_supported_channels(
695 &self,
696 ) -> fidl::client::QueryResponseFut<
697 Vec<ChannelInfo>,
698 fidl::encoding::DefaultFuchsiaResourceDialect,
699 > {
700 DeviceProxyInterface::r#get_supported_channels(self)
701 }
702}
703
704impl DeviceProxyInterface for DeviceProxy {
705 type GetSupportedChannelsResponseFut = fidl::client::QueryResponseFut<
706 Vec<ChannelInfo>,
707 fidl::encoding::DefaultFuchsiaResourceDialect,
708 >;
709 fn r#get_supported_channels(&self) -> Self::GetSupportedChannelsResponseFut {
710 fn _decode(
711 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
712 ) -> Result<Vec<ChannelInfo>, fidl::Error> {
713 let _response = fidl::client::decode_transaction_body::<
714 DeviceGetSupportedChannelsResponse,
715 fidl::encoding::DefaultFuchsiaResourceDialect,
716 0x2d8b969a9bd70f23,
717 >(_buf?)?;
718 Ok(_response.channels_info)
719 }
720 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ChannelInfo>>(
721 (),
722 0x2d8b969a9bd70f23,
723 fidl::encoding::DynamicFlags::empty(),
724 _decode,
725 )
726 }
727}
728
729pub struct DeviceEventStream {
730 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
731}
732
733impl std::marker::Unpin for DeviceEventStream {}
734
735impl futures::stream::FusedStream for DeviceEventStream {
736 fn is_terminated(&self) -> bool {
737 self.event_receiver.is_terminated()
738 }
739}
740
741impl futures::Stream for DeviceEventStream {
742 type Item = Result<DeviceEvent, fidl::Error>;
743
744 fn poll_next(
745 mut self: std::pin::Pin<&mut Self>,
746 cx: &mut std::task::Context<'_>,
747 ) -> std::task::Poll<Option<Self::Item>> {
748 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
749 &mut self.event_receiver,
750 cx
751 )?) {
752 Some(buf) => std::task::Poll::Ready(Some(DeviceEvent::decode(buf))),
753 None => std::task::Poll::Ready(None),
754 }
755 }
756}
757
758#[derive(Debug)]
759pub enum DeviceEvent {}
760
761impl DeviceEvent {
762 fn decode(
764 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
765 ) -> Result<DeviceEvent, fidl::Error> {
766 let (bytes, _handles) = buf.split_mut();
767 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
768 debug_assert_eq!(tx_header.tx_id, 0);
769 match tx_header.ordinal {
770 _ => Err(fidl::Error::UnknownOrdinal {
771 ordinal: tx_header.ordinal,
772 protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
773 }),
774 }
775 }
776}
777
778pub struct DeviceRequestStream {
780 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
781 is_terminated: bool,
782}
783
784impl std::marker::Unpin for DeviceRequestStream {}
785
786impl futures::stream::FusedStream for DeviceRequestStream {
787 fn is_terminated(&self) -> bool {
788 self.is_terminated
789 }
790}
791
792impl fidl::endpoints::RequestStream for DeviceRequestStream {
793 type Protocol = DeviceMarker;
794 type ControlHandle = DeviceControlHandle;
795
796 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
797 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
798 }
799
800 fn control_handle(&self) -> Self::ControlHandle {
801 DeviceControlHandle { inner: self.inner.clone() }
802 }
803
804 fn into_inner(
805 self,
806 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
807 {
808 (self.inner, self.is_terminated)
809 }
810
811 fn from_inner(
812 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
813 is_terminated: bool,
814 ) -> Self {
815 Self { inner, is_terminated }
816 }
817}
818
819impl futures::Stream for DeviceRequestStream {
820 type Item = Result<DeviceRequest, fidl::Error>;
821
822 fn poll_next(
823 mut self: std::pin::Pin<&mut Self>,
824 cx: &mut std::task::Context<'_>,
825 ) -> std::task::Poll<Option<Self::Item>> {
826 let this = &mut *self;
827 if this.inner.check_shutdown(cx) {
828 this.is_terminated = true;
829 return std::task::Poll::Ready(None);
830 }
831 if this.is_terminated {
832 panic!("polled DeviceRequestStream after completion");
833 }
834 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
835 |bytes, handles| {
836 match this.inner.channel().read_etc(cx, bytes, handles) {
837 std::task::Poll::Ready(Ok(())) => {}
838 std::task::Poll::Pending => return std::task::Poll::Pending,
839 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
840 this.is_terminated = true;
841 return std::task::Poll::Ready(None);
842 }
843 std::task::Poll::Ready(Err(e)) => {
844 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
845 e.into(),
846 ))))
847 }
848 }
849
850 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
852
853 std::task::Poll::Ready(Some(match header.ordinal {
854 0x2d8b969a9bd70f23 => {
855 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
856 let mut req = fidl::new_empty!(
857 fidl::encoding::EmptyPayload,
858 fidl::encoding::DefaultFuchsiaResourceDialect
859 );
860 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
861 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
862 Ok(DeviceRequest::GetSupportedChannels {
863 responder: DeviceGetSupportedChannelsResponder {
864 control_handle: std::mem::ManuallyDrop::new(control_handle),
865 tx_id: header.tx_id,
866 },
867 })
868 }
869 _ => Err(fidl::Error::UnknownOrdinal {
870 ordinal: header.ordinal,
871 protocol_name:
872 <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
873 }),
874 }))
875 },
876 )
877 }
878}
879
880#[derive(Debug)]
888pub enum DeviceRequest {
889 GetSupportedChannels { responder: DeviceGetSupportedChannelsResponder },
892}
893
894impl DeviceRequest {
895 #[allow(irrefutable_let_patterns)]
896 pub fn into_get_supported_channels(self) -> Option<(DeviceGetSupportedChannelsResponder)> {
897 if let DeviceRequest::GetSupportedChannels { responder } = self {
898 Some((responder))
899 } else {
900 None
901 }
902 }
903
904 pub fn method_name(&self) -> &'static str {
906 match *self {
907 DeviceRequest::GetSupportedChannels { .. } => "get_supported_channels",
908 }
909 }
910}
911
912#[derive(Debug, Clone)]
913pub struct DeviceControlHandle {
914 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
915}
916
917impl fidl::endpoints::ControlHandle for DeviceControlHandle {
918 fn shutdown(&self) {
919 self.inner.shutdown()
920 }
921 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
922 self.inner.shutdown_with_epitaph(status)
923 }
924
925 fn is_closed(&self) -> bool {
926 self.inner.channel().is_closed()
927 }
928 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
929 self.inner.channel().on_closed()
930 }
931
932 #[cfg(target_os = "fuchsia")]
933 fn signal_peer(
934 &self,
935 clear_mask: zx::Signals,
936 set_mask: zx::Signals,
937 ) -> Result<(), zx_status::Status> {
938 use fidl::Peered;
939 self.inner.channel().signal_peer(clear_mask, set_mask)
940 }
941}
942
943impl DeviceControlHandle {}
944
945#[must_use = "FIDL methods require a response to be sent"]
946#[derive(Debug)]
947pub struct DeviceGetSupportedChannelsResponder {
948 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
949 tx_id: u32,
950}
951
952impl std::ops::Drop for DeviceGetSupportedChannelsResponder {
956 fn drop(&mut self) {
957 self.control_handle.shutdown();
958 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
960 }
961}
962
963impl fidl::endpoints::Responder for DeviceGetSupportedChannelsResponder {
964 type ControlHandle = DeviceControlHandle;
965
966 fn control_handle(&self) -> &DeviceControlHandle {
967 &self.control_handle
968 }
969
970 fn drop_without_shutdown(mut self) {
971 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
973 std::mem::forget(self);
975 }
976}
977
978impl DeviceGetSupportedChannelsResponder {
979 pub fn send(self, mut channels_info: &[ChannelInfo]) -> Result<(), fidl::Error> {
983 let _result = self.send_raw(channels_info);
984 if _result.is_err() {
985 self.control_handle.shutdown();
986 }
987 self.drop_without_shutdown();
988 _result
989 }
990
991 pub fn send_no_shutdown_on_err(
993 self,
994 mut channels_info: &[ChannelInfo],
995 ) -> Result<(), fidl::Error> {
996 let _result = self.send_raw(channels_info);
997 self.drop_without_shutdown();
998 _result
999 }
1000
1001 fn send_raw(&self, mut channels_info: &[ChannelInfo]) -> Result<(), fidl::Error> {
1002 self.control_handle.inner.send::<DeviceGetSupportedChannelsResponse>(
1003 (channels_info,),
1004 self.tx_id,
1005 0x2d8b969a9bd70f23,
1006 fidl::encoding::DynamicFlags::empty(),
1007 )
1008 }
1009}
1010
1011#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1012pub struct DeviceConnectorMarker;
1013
1014impl fidl::endpoints::ProtocolMarker for DeviceConnectorMarker {
1015 type Proxy = DeviceConnectorProxy;
1016 type RequestStream = DeviceConnectorRequestStream;
1017 #[cfg(target_os = "fuchsia")]
1018 type SynchronousProxy = DeviceConnectorSynchronousProxy;
1019
1020 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceConnector";
1021}
1022impl fidl::endpoints::DiscoverableProtocolMarker for DeviceConnectorMarker {}
1023
1024pub trait DeviceConnectorProxyInterface: Send + Sync {
1025 fn r#connect(
1026 &self,
1027 name: &str,
1028 server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1029 ) -> Result<(), fidl::Error>;
1030}
1031#[derive(Debug)]
1032#[cfg(target_os = "fuchsia")]
1033pub struct DeviceConnectorSynchronousProxy {
1034 client: fidl::client::sync::Client,
1035}
1036
1037#[cfg(target_os = "fuchsia")]
1038impl fidl::endpoints::SynchronousProxy for DeviceConnectorSynchronousProxy {
1039 type Proxy = DeviceConnectorProxy;
1040 type Protocol = DeviceConnectorMarker;
1041
1042 fn from_channel(inner: fidl::Channel) -> Self {
1043 Self::new(inner)
1044 }
1045
1046 fn into_channel(self) -> fidl::Channel {
1047 self.client.into_channel()
1048 }
1049
1050 fn as_channel(&self) -> &fidl::Channel {
1051 self.client.as_channel()
1052 }
1053}
1054
1055#[cfg(target_os = "fuchsia")]
1056impl DeviceConnectorSynchronousProxy {
1057 pub fn new(channel: fidl::Channel) -> Self {
1058 let protocol_name = <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1059 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1060 }
1061
1062 pub fn into_channel(self) -> fidl::Channel {
1063 self.client.into_channel()
1064 }
1065
1066 pub fn wait_for_event(
1069 &self,
1070 deadline: zx::MonotonicInstant,
1071 ) -> Result<DeviceConnectorEvent, fidl::Error> {
1072 DeviceConnectorEvent::decode(self.client.wait_for_event(deadline)?)
1073 }
1074
1075 pub fn r#connect(
1092 &self,
1093 mut name: &str,
1094 mut server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1095 ) -> Result<(), fidl::Error> {
1096 self.client.send::<DeviceConnectorConnectRequest>(
1097 (name, server_end),
1098 0x296896c9304836cd,
1099 fidl::encoding::DynamicFlags::empty(),
1100 )
1101 }
1102}
1103
1104#[cfg(target_os = "fuchsia")]
1105impl From<DeviceConnectorSynchronousProxy> for zx::Handle {
1106 fn from(value: DeviceConnectorSynchronousProxy) -> Self {
1107 value.into_channel().into()
1108 }
1109}
1110
1111#[cfg(target_os = "fuchsia")]
1112impl From<fidl::Channel> for DeviceConnectorSynchronousProxy {
1113 fn from(value: fidl::Channel) -> Self {
1114 Self::new(value)
1115 }
1116}
1117
1118#[derive(Debug, Clone)]
1119pub struct DeviceConnectorProxy {
1120 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1121}
1122
1123impl fidl::endpoints::Proxy for DeviceConnectorProxy {
1124 type Protocol = DeviceConnectorMarker;
1125
1126 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1127 Self::new(inner)
1128 }
1129
1130 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1131 self.client.into_channel().map_err(|client| Self { client })
1132 }
1133
1134 fn as_channel(&self) -> &::fidl::AsyncChannel {
1135 self.client.as_channel()
1136 }
1137}
1138
1139impl DeviceConnectorProxy {
1140 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1142 let protocol_name = <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1143 Self { client: fidl::client::Client::new(channel, protocol_name) }
1144 }
1145
1146 pub fn take_event_stream(&self) -> DeviceConnectorEventStream {
1152 DeviceConnectorEventStream { event_receiver: self.client.take_event_receiver() }
1153 }
1154
1155 pub fn r#connect(
1172 &self,
1173 mut name: &str,
1174 mut server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1175 ) -> Result<(), fidl::Error> {
1176 DeviceConnectorProxyInterface::r#connect(self, name, server_end)
1177 }
1178}
1179
1180impl DeviceConnectorProxyInterface for DeviceConnectorProxy {
1181 fn r#connect(
1182 &self,
1183 mut name: &str,
1184 mut server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1185 ) -> Result<(), fidl::Error> {
1186 self.client.send::<DeviceConnectorConnectRequest>(
1187 (name, server_end),
1188 0x296896c9304836cd,
1189 fidl::encoding::DynamicFlags::empty(),
1190 )
1191 }
1192}
1193
1194pub struct DeviceConnectorEventStream {
1195 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1196}
1197
1198impl std::marker::Unpin for DeviceConnectorEventStream {}
1199
1200impl futures::stream::FusedStream for DeviceConnectorEventStream {
1201 fn is_terminated(&self) -> bool {
1202 self.event_receiver.is_terminated()
1203 }
1204}
1205
1206impl futures::Stream for DeviceConnectorEventStream {
1207 type Item = Result<DeviceConnectorEvent, fidl::Error>;
1208
1209 fn poll_next(
1210 mut self: std::pin::Pin<&mut Self>,
1211 cx: &mut std::task::Context<'_>,
1212 ) -> std::task::Poll<Option<Self::Item>> {
1213 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1214 &mut self.event_receiver,
1215 cx
1216 )?) {
1217 Some(buf) => std::task::Poll::Ready(Some(DeviceConnectorEvent::decode(buf))),
1218 None => std::task::Poll::Ready(None),
1219 }
1220 }
1221}
1222
1223#[derive(Debug)]
1224pub enum DeviceConnectorEvent {}
1225
1226impl DeviceConnectorEvent {
1227 fn decode(
1229 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1230 ) -> Result<DeviceConnectorEvent, fidl::Error> {
1231 let (bytes, _handles) = buf.split_mut();
1232 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1233 debug_assert_eq!(tx_header.tx_id, 0);
1234 match tx_header.ordinal {
1235 _ => Err(fidl::Error::UnknownOrdinal {
1236 ordinal: tx_header.ordinal,
1237 protocol_name:
1238 <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1239 }),
1240 }
1241 }
1242}
1243
1244pub struct DeviceConnectorRequestStream {
1246 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1247 is_terminated: bool,
1248}
1249
1250impl std::marker::Unpin for DeviceConnectorRequestStream {}
1251
1252impl futures::stream::FusedStream for DeviceConnectorRequestStream {
1253 fn is_terminated(&self) -> bool {
1254 self.is_terminated
1255 }
1256}
1257
1258impl fidl::endpoints::RequestStream for DeviceConnectorRequestStream {
1259 type Protocol = DeviceConnectorMarker;
1260 type ControlHandle = DeviceConnectorControlHandle;
1261
1262 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1263 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1264 }
1265
1266 fn control_handle(&self) -> Self::ControlHandle {
1267 DeviceConnectorControlHandle { inner: self.inner.clone() }
1268 }
1269
1270 fn into_inner(
1271 self,
1272 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1273 {
1274 (self.inner, self.is_terminated)
1275 }
1276
1277 fn from_inner(
1278 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1279 is_terminated: bool,
1280 ) -> Self {
1281 Self { inner, is_terminated }
1282 }
1283}
1284
1285impl futures::Stream for DeviceConnectorRequestStream {
1286 type Item = Result<DeviceConnectorRequest, fidl::Error>;
1287
1288 fn poll_next(
1289 mut self: std::pin::Pin<&mut Self>,
1290 cx: &mut std::task::Context<'_>,
1291 ) -> std::task::Poll<Option<Self::Item>> {
1292 let this = &mut *self;
1293 if this.inner.check_shutdown(cx) {
1294 this.is_terminated = true;
1295 return std::task::Poll::Ready(None);
1296 }
1297 if this.is_terminated {
1298 panic!("polled DeviceConnectorRequestStream after completion");
1299 }
1300 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1301 |bytes, handles| {
1302 match this.inner.channel().read_etc(cx, bytes, handles) {
1303 std::task::Poll::Ready(Ok(())) => {}
1304 std::task::Poll::Pending => return std::task::Poll::Pending,
1305 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1306 this.is_terminated = true;
1307 return std::task::Poll::Ready(None);
1308 }
1309 std::task::Poll::Ready(Err(e)) => {
1310 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1311 e.into(),
1312 ))))
1313 }
1314 }
1315
1316 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1318
1319 std::task::Poll::Ready(Some(match header.ordinal {
1320 0x296896c9304836cd => {
1321 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1322 let mut req = fidl::new_empty!(
1323 DeviceConnectorConnectRequest,
1324 fidl::encoding::DefaultFuchsiaResourceDialect
1325 );
1326 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
1327 let control_handle =
1328 DeviceConnectorControlHandle { inner: this.inner.clone() };
1329 Ok(DeviceConnectorRequest::Connect {
1330 name: req.name,
1331 server_end: req.server_end,
1332
1333 control_handle,
1334 })
1335 }
1336 _ => Err(fidl::Error::UnknownOrdinal {
1337 ordinal: header.ordinal,
1338 protocol_name:
1339 <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1340 }),
1341 }))
1342 },
1343 )
1344 }
1345}
1346
1347#[derive(Debug)]
1350pub enum DeviceConnectorRequest {
1351 Connect {
1368 name: String,
1369 server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1370 control_handle: DeviceConnectorControlHandle,
1371 },
1372}
1373
1374impl DeviceConnectorRequest {
1375 #[allow(irrefutable_let_patterns)]
1376 pub fn into_connect(
1377 self,
1378 ) -> Option<(String, fidl::endpoints::ServerEnd<DeviceMarker>, DeviceConnectorControlHandle)>
1379 {
1380 if let DeviceConnectorRequest::Connect { name, server_end, control_handle } = self {
1381 Some((name, server_end, control_handle))
1382 } else {
1383 None
1384 }
1385 }
1386
1387 pub fn method_name(&self) -> &'static str {
1389 match *self {
1390 DeviceConnectorRequest::Connect { .. } => "connect",
1391 }
1392 }
1393}
1394
1395#[derive(Debug, Clone)]
1396pub struct DeviceConnectorControlHandle {
1397 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1398}
1399
1400impl fidl::endpoints::ControlHandle for DeviceConnectorControlHandle {
1401 fn shutdown(&self) {
1402 self.inner.shutdown()
1403 }
1404 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1405 self.inner.shutdown_with_epitaph(status)
1406 }
1407
1408 fn is_closed(&self) -> bool {
1409 self.inner.channel().is_closed()
1410 }
1411 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1412 self.inner.channel().on_closed()
1413 }
1414
1415 #[cfg(target_os = "fuchsia")]
1416 fn signal_peer(
1417 &self,
1418 clear_mask: zx::Signals,
1419 set_mask: zx::Signals,
1420 ) -> Result<(), zx_status::Status> {
1421 use fidl::Peered;
1422 self.inner.channel().signal_peer(clear_mask, set_mask)
1423 }
1424}
1425
1426impl DeviceConnectorControlHandle {}
1427
1428#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1429pub struct DeviceExtraMarker;
1430
1431impl fidl::endpoints::ProtocolMarker for DeviceExtraMarker {
1432 type Proxy = DeviceExtraProxy;
1433 type RequestStream = DeviceExtraRequestStream;
1434 #[cfg(target_os = "fuchsia")]
1435 type SynchronousProxy = DeviceExtraSynchronousProxy;
1436
1437 const DEBUG_NAME: &'static str = "(anonymous) DeviceExtra";
1438}
1439
1440pub trait DeviceExtraProxyInterface: Send + Sync {
1441 fn r#form_network(
1442 &self,
1443 params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1444 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1445 ) -> Result<(), fidl::Error>;
1446 fn r#join_network(
1447 &self,
1448 params: &JoinParams,
1449 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1450 ) -> Result<(), fidl::Error>;
1451 fn r#start_network_scan(
1452 &self,
1453 params: &NetworkScanParameters,
1454 stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1455 ) -> Result<(), fidl::Error>;
1456}
1457#[derive(Debug)]
1458#[cfg(target_os = "fuchsia")]
1459pub struct DeviceExtraSynchronousProxy {
1460 client: fidl::client::sync::Client,
1461}
1462
1463#[cfg(target_os = "fuchsia")]
1464impl fidl::endpoints::SynchronousProxy for DeviceExtraSynchronousProxy {
1465 type Proxy = DeviceExtraProxy;
1466 type Protocol = DeviceExtraMarker;
1467
1468 fn from_channel(inner: fidl::Channel) -> Self {
1469 Self::new(inner)
1470 }
1471
1472 fn into_channel(self) -> fidl::Channel {
1473 self.client.into_channel()
1474 }
1475
1476 fn as_channel(&self) -> &fidl::Channel {
1477 self.client.as_channel()
1478 }
1479}
1480
1481#[cfg(target_os = "fuchsia")]
1482impl DeviceExtraSynchronousProxy {
1483 pub fn new(channel: fidl::Channel) -> Self {
1484 let protocol_name = <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1485 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1486 }
1487
1488 pub fn into_channel(self) -> fidl::Channel {
1489 self.client.into_channel()
1490 }
1491
1492 pub fn wait_for_event(
1495 &self,
1496 deadline: zx::MonotonicInstant,
1497 ) -> Result<DeviceExtraEvent, fidl::Error> {
1498 DeviceExtraEvent::decode(self.client.wait_for_event(deadline)?)
1499 }
1500
1501 pub fn r#form_network(
1524 &self,
1525 mut params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1526 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1527 ) -> Result<(), fidl::Error> {
1528 self.client.send::<DeviceExtraFormNetworkRequest>(
1529 (params, progress),
1530 0x6a8135f84bfc90e,
1531 fidl::encoding::DynamicFlags::empty(),
1532 )
1533 }
1534
1535 pub fn r#join_network(
1550 &self,
1551 mut params: &JoinParams,
1552 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1553 ) -> Result<(), fidl::Error> {
1554 self.client.send::<DeviceExtraJoinNetworkRequest>(
1555 (params, progress),
1556 0x3ea583bab79f81c0,
1557 fidl::encoding::DynamicFlags::empty(),
1558 )
1559 }
1560
1561 pub fn r#start_network_scan(
1581 &self,
1582 mut params: &NetworkScanParameters,
1583 mut stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1584 ) -> Result<(), fidl::Error> {
1585 self.client.send::<DeviceExtraStartNetworkScanRequest>(
1586 (params, stream),
1587 0x6288c73b79188b40,
1588 fidl::encoding::DynamicFlags::empty(),
1589 )
1590 }
1591}
1592
1593#[cfg(target_os = "fuchsia")]
1594impl From<DeviceExtraSynchronousProxy> for zx::Handle {
1595 fn from(value: DeviceExtraSynchronousProxy) -> Self {
1596 value.into_channel().into()
1597 }
1598}
1599
1600#[cfg(target_os = "fuchsia")]
1601impl From<fidl::Channel> for DeviceExtraSynchronousProxy {
1602 fn from(value: fidl::Channel) -> Self {
1603 Self::new(value)
1604 }
1605}
1606
1607#[derive(Debug, Clone)]
1608pub struct DeviceExtraProxy {
1609 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1610}
1611
1612impl fidl::endpoints::Proxy for DeviceExtraProxy {
1613 type Protocol = DeviceExtraMarker;
1614
1615 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1616 Self::new(inner)
1617 }
1618
1619 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1620 self.client.into_channel().map_err(|client| Self { client })
1621 }
1622
1623 fn as_channel(&self) -> &::fidl::AsyncChannel {
1624 self.client.as_channel()
1625 }
1626}
1627
1628impl DeviceExtraProxy {
1629 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1631 let protocol_name = <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1632 Self { client: fidl::client::Client::new(channel, protocol_name) }
1633 }
1634
1635 pub fn take_event_stream(&self) -> DeviceExtraEventStream {
1641 DeviceExtraEventStream { event_receiver: self.client.take_event_receiver() }
1642 }
1643
1644 pub fn r#form_network(
1667 &self,
1668 mut params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1669 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1670 ) -> Result<(), fidl::Error> {
1671 DeviceExtraProxyInterface::r#form_network(self, params, progress)
1672 }
1673
1674 pub fn r#join_network(
1689 &self,
1690 mut params: &JoinParams,
1691 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1692 ) -> Result<(), fidl::Error> {
1693 DeviceExtraProxyInterface::r#join_network(self, params, progress)
1694 }
1695
1696 pub fn r#start_network_scan(
1716 &self,
1717 mut params: &NetworkScanParameters,
1718 mut stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1719 ) -> Result<(), fidl::Error> {
1720 DeviceExtraProxyInterface::r#start_network_scan(self, params, stream)
1721 }
1722}
1723
1724impl DeviceExtraProxyInterface for DeviceExtraProxy {
1725 fn r#form_network(
1726 &self,
1727 mut params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1728 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1729 ) -> Result<(), fidl::Error> {
1730 self.client.send::<DeviceExtraFormNetworkRequest>(
1731 (params, progress),
1732 0x6a8135f84bfc90e,
1733 fidl::encoding::DynamicFlags::empty(),
1734 )
1735 }
1736
1737 fn r#join_network(
1738 &self,
1739 mut params: &JoinParams,
1740 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1741 ) -> Result<(), fidl::Error> {
1742 self.client.send::<DeviceExtraJoinNetworkRequest>(
1743 (params, progress),
1744 0x3ea583bab79f81c0,
1745 fidl::encoding::DynamicFlags::empty(),
1746 )
1747 }
1748
1749 fn r#start_network_scan(
1750 &self,
1751 mut params: &NetworkScanParameters,
1752 mut stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1753 ) -> Result<(), fidl::Error> {
1754 self.client.send::<DeviceExtraStartNetworkScanRequest>(
1755 (params, stream),
1756 0x6288c73b79188b40,
1757 fidl::encoding::DynamicFlags::empty(),
1758 )
1759 }
1760}
1761
1762pub struct DeviceExtraEventStream {
1763 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1764}
1765
1766impl std::marker::Unpin for DeviceExtraEventStream {}
1767
1768impl futures::stream::FusedStream for DeviceExtraEventStream {
1769 fn is_terminated(&self) -> bool {
1770 self.event_receiver.is_terminated()
1771 }
1772}
1773
1774impl futures::Stream for DeviceExtraEventStream {
1775 type Item = Result<DeviceExtraEvent, fidl::Error>;
1776
1777 fn poll_next(
1778 mut self: std::pin::Pin<&mut Self>,
1779 cx: &mut std::task::Context<'_>,
1780 ) -> std::task::Poll<Option<Self::Item>> {
1781 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1782 &mut self.event_receiver,
1783 cx
1784 )?) {
1785 Some(buf) => std::task::Poll::Ready(Some(DeviceExtraEvent::decode(buf))),
1786 None => std::task::Poll::Ready(None),
1787 }
1788 }
1789}
1790
1791#[derive(Debug)]
1792pub enum DeviceExtraEvent {}
1793
1794impl DeviceExtraEvent {
1795 fn decode(
1797 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1798 ) -> Result<DeviceExtraEvent, fidl::Error> {
1799 let (bytes, _handles) = buf.split_mut();
1800 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1801 debug_assert_eq!(tx_header.tx_id, 0);
1802 match tx_header.ordinal {
1803 _ => Err(fidl::Error::UnknownOrdinal {
1804 ordinal: tx_header.ordinal,
1805 protocol_name: <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1806 }),
1807 }
1808 }
1809}
1810
1811pub struct DeviceExtraRequestStream {
1813 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1814 is_terminated: bool,
1815}
1816
1817impl std::marker::Unpin for DeviceExtraRequestStream {}
1818
1819impl futures::stream::FusedStream for DeviceExtraRequestStream {
1820 fn is_terminated(&self) -> bool {
1821 self.is_terminated
1822 }
1823}
1824
1825impl fidl::endpoints::RequestStream for DeviceExtraRequestStream {
1826 type Protocol = DeviceExtraMarker;
1827 type ControlHandle = DeviceExtraControlHandle;
1828
1829 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1830 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1831 }
1832
1833 fn control_handle(&self) -> Self::ControlHandle {
1834 DeviceExtraControlHandle { inner: self.inner.clone() }
1835 }
1836
1837 fn into_inner(
1838 self,
1839 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1840 {
1841 (self.inner, self.is_terminated)
1842 }
1843
1844 fn from_inner(
1845 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1846 is_terminated: bool,
1847 ) -> Self {
1848 Self { inner, is_terminated }
1849 }
1850}
1851
1852impl futures::Stream for DeviceExtraRequestStream {
1853 type Item = Result<DeviceExtraRequest, fidl::Error>;
1854
1855 fn poll_next(
1856 mut self: std::pin::Pin<&mut Self>,
1857 cx: &mut std::task::Context<'_>,
1858 ) -> std::task::Poll<Option<Self::Item>> {
1859 let this = &mut *self;
1860 if this.inner.check_shutdown(cx) {
1861 this.is_terminated = true;
1862 return std::task::Poll::Ready(None);
1863 }
1864 if this.is_terminated {
1865 panic!("polled DeviceExtraRequestStream after completion");
1866 }
1867 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1868 |bytes, handles| {
1869 match this.inner.channel().read_etc(cx, bytes, handles) {
1870 std::task::Poll::Ready(Ok(())) => {}
1871 std::task::Poll::Pending => return std::task::Poll::Pending,
1872 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1873 this.is_terminated = true;
1874 return std::task::Poll::Ready(None);
1875 }
1876 std::task::Poll::Ready(Err(e)) => {
1877 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1878 e.into(),
1879 ))))
1880 }
1881 }
1882
1883 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1885
1886 std::task::Poll::Ready(Some(match header.ordinal {
1887 0x6a8135f84bfc90e => {
1888 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1889 let mut req = fidl::new_empty!(
1890 DeviceExtraFormNetworkRequest,
1891 fidl::encoding::DefaultFuchsiaResourceDialect
1892 );
1893 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraFormNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
1894 let control_handle = DeviceExtraControlHandle { inner: this.inner.clone() };
1895 Ok(DeviceExtraRequest::FormNetwork {
1896 params: req.params,
1897 progress: req.progress,
1898
1899 control_handle,
1900 })
1901 }
1902 0x3ea583bab79f81c0 => {
1903 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1904 let mut req = fidl::new_empty!(
1905 DeviceExtraJoinNetworkRequest,
1906 fidl::encoding::DefaultFuchsiaResourceDialect
1907 );
1908 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraJoinNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
1909 let control_handle = DeviceExtraControlHandle { inner: this.inner.clone() };
1910 Ok(DeviceExtraRequest::JoinNetwork {
1911 params: req.params,
1912 progress: req.progress,
1913
1914 control_handle,
1915 })
1916 }
1917 0x6288c73b79188b40 => {
1918 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1919 let mut req = fidl::new_empty!(
1920 DeviceExtraStartNetworkScanRequest,
1921 fidl::encoding::DefaultFuchsiaResourceDialect
1922 );
1923 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraStartNetworkScanRequest>(&header, _body_bytes, handles, &mut req)?;
1924 let control_handle = DeviceExtraControlHandle { inner: this.inner.clone() };
1925 Ok(DeviceExtraRequest::StartNetworkScan {
1926 params: req.params,
1927 stream: req.stream,
1928
1929 control_handle,
1930 })
1931 }
1932 _ => Err(fidl::Error::UnknownOrdinal {
1933 ordinal: header.ordinal,
1934 protocol_name:
1935 <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1936 }),
1937 }))
1938 },
1939 )
1940 }
1941}
1942
1943#[derive(Debug)]
1949pub enum DeviceExtraRequest {
1950 FormNetwork {
1973 params: fidl_fuchsia_lowpan_device::ProvisioningParams,
1974 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1975 control_handle: DeviceExtraControlHandle,
1976 },
1977 JoinNetwork {
1992 params: JoinParams,
1993 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1994 control_handle: DeviceExtraControlHandle,
1995 },
1996 StartNetworkScan {
2016 params: NetworkScanParameters,
2017 stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
2018 control_handle: DeviceExtraControlHandle,
2019 },
2020}
2021
2022impl DeviceExtraRequest {
2023 #[allow(irrefutable_let_patterns)]
2024 pub fn into_form_network(
2025 self,
2026 ) -> Option<(
2027 fidl_fuchsia_lowpan_device::ProvisioningParams,
2028 fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
2029 DeviceExtraControlHandle,
2030 )> {
2031 if let DeviceExtraRequest::FormNetwork { params, progress, control_handle } = self {
2032 Some((params, progress, control_handle))
2033 } else {
2034 None
2035 }
2036 }
2037
2038 #[allow(irrefutable_let_patterns)]
2039 pub fn into_join_network(
2040 self,
2041 ) -> Option<(
2042 JoinParams,
2043 fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
2044 DeviceExtraControlHandle,
2045 )> {
2046 if let DeviceExtraRequest::JoinNetwork { params, progress, control_handle } = self {
2047 Some((params, progress, control_handle))
2048 } else {
2049 None
2050 }
2051 }
2052
2053 #[allow(irrefutable_let_patterns)]
2054 pub fn into_start_network_scan(
2055 self,
2056 ) -> Option<(
2057 NetworkScanParameters,
2058 fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
2059 DeviceExtraControlHandle,
2060 )> {
2061 if let DeviceExtraRequest::StartNetworkScan { params, stream, control_handle } = self {
2062 Some((params, stream, control_handle))
2063 } else {
2064 None
2065 }
2066 }
2067
2068 pub fn method_name(&self) -> &'static str {
2070 match *self {
2071 DeviceExtraRequest::FormNetwork { .. } => "form_network",
2072 DeviceExtraRequest::JoinNetwork { .. } => "join_network",
2073 DeviceExtraRequest::StartNetworkScan { .. } => "start_network_scan",
2074 }
2075 }
2076}
2077
2078#[derive(Debug, Clone)]
2079pub struct DeviceExtraControlHandle {
2080 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2081}
2082
2083impl fidl::endpoints::ControlHandle for DeviceExtraControlHandle {
2084 fn shutdown(&self) {
2085 self.inner.shutdown()
2086 }
2087 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2088 self.inner.shutdown_with_epitaph(status)
2089 }
2090
2091 fn is_closed(&self) -> bool {
2092 self.inner.channel().is_closed()
2093 }
2094 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2095 self.inner.channel().on_closed()
2096 }
2097
2098 #[cfg(target_os = "fuchsia")]
2099 fn signal_peer(
2100 &self,
2101 clear_mask: zx::Signals,
2102 set_mask: zx::Signals,
2103 ) -> Result<(), zx_status::Status> {
2104 use fidl::Peered;
2105 self.inner.channel().signal_peer(clear_mask, set_mask)
2106 }
2107}
2108
2109impl DeviceExtraControlHandle {}
2110
2111#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2112pub struct DeviceExtraConnectorMarker;
2113
2114impl fidl::endpoints::ProtocolMarker for DeviceExtraConnectorMarker {
2115 type Proxy = DeviceExtraConnectorProxy;
2116 type RequestStream = DeviceExtraConnectorRequestStream;
2117 #[cfg(target_os = "fuchsia")]
2118 type SynchronousProxy = DeviceExtraConnectorSynchronousProxy;
2119
2120 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceExtraConnector";
2121}
2122impl fidl::endpoints::DiscoverableProtocolMarker for DeviceExtraConnectorMarker {}
2123
2124pub trait DeviceExtraConnectorProxyInterface: Send + Sync {
2125 fn r#connect(
2126 &self,
2127 name: &str,
2128 server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2129 ) -> Result<(), fidl::Error>;
2130}
2131#[derive(Debug)]
2132#[cfg(target_os = "fuchsia")]
2133pub struct DeviceExtraConnectorSynchronousProxy {
2134 client: fidl::client::sync::Client,
2135}
2136
2137#[cfg(target_os = "fuchsia")]
2138impl fidl::endpoints::SynchronousProxy for DeviceExtraConnectorSynchronousProxy {
2139 type Proxy = DeviceExtraConnectorProxy;
2140 type Protocol = DeviceExtraConnectorMarker;
2141
2142 fn from_channel(inner: fidl::Channel) -> Self {
2143 Self::new(inner)
2144 }
2145
2146 fn into_channel(self) -> fidl::Channel {
2147 self.client.into_channel()
2148 }
2149
2150 fn as_channel(&self) -> &fidl::Channel {
2151 self.client.as_channel()
2152 }
2153}
2154
2155#[cfg(target_os = "fuchsia")]
2156impl DeviceExtraConnectorSynchronousProxy {
2157 pub fn new(channel: fidl::Channel) -> Self {
2158 let protocol_name =
2159 <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2160 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2161 }
2162
2163 pub fn into_channel(self) -> fidl::Channel {
2164 self.client.into_channel()
2165 }
2166
2167 pub fn wait_for_event(
2170 &self,
2171 deadline: zx::MonotonicInstant,
2172 ) -> Result<DeviceExtraConnectorEvent, fidl::Error> {
2173 DeviceExtraConnectorEvent::decode(self.client.wait_for_event(deadline)?)
2174 }
2175
2176 pub fn r#connect(
2193 &self,
2194 mut name: &str,
2195 mut server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2196 ) -> Result<(), fidl::Error> {
2197 self.client.send::<DeviceExtraConnectorConnectRequest>(
2198 (name, server_end),
2199 0x3fcb37e4226c81e9,
2200 fidl::encoding::DynamicFlags::empty(),
2201 )
2202 }
2203}
2204
2205#[cfg(target_os = "fuchsia")]
2206impl From<DeviceExtraConnectorSynchronousProxy> for zx::Handle {
2207 fn from(value: DeviceExtraConnectorSynchronousProxy) -> Self {
2208 value.into_channel().into()
2209 }
2210}
2211
2212#[cfg(target_os = "fuchsia")]
2213impl From<fidl::Channel> for DeviceExtraConnectorSynchronousProxy {
2214 fn from(value: fidl::Channel) -> Self {
2215 Self::new(value)
2216 }
2217}
2218
2219#[derive(Debug, Clone)]
2220pub struct DeviceExtraConnectorProxy {
2221 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2222}
2223
2224impl fidl::endpoints::Proxy for DeviceExtraConnectorProxy {
2225 type Protocol = DeviceExtraConnectorMarker;
2226
2227 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2228 Self::new(inner)
2229 }
2230
2231 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2232 self.client.into_channel().map_err(|client| Self { client })
2233 }
2234
2235 fn as_channel(&self) -> &::fidl::AsyncChannel {
2236 self.client.as_channel()
2237 }
2238}
2239
2240impl DeviceExtraConnectorProxy {
2241 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2243 let protocol_name =
2244 <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2245 Self { client: fidl::client::Client::new(channel, protocol_name) }
2246 }
2247
2248 pub fn take_event_stream(&self) -> DeviceExtraConnectorEventStream {
2254 DeviceExtraConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2255 }
2256
2257 pub fn r#connect(
2274 &self,
2275 mut name: &str,
2276 mut server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2277 ) -> Result<(), fidl::Error> {
2278 DeviceExtraConnectorProxyInterface::r#connect(self, name, server_end)
2279 }
2280}
2281
2282impl DeviceExtraConnectorProxyInterface for DeviceExtraConnectorProxy {
2283 fn r#connect(
2284 &self,
2285 mut name: &str,
2286 mut server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2287 ) -> Result<(), fidl::Error> {
2288 self.client.send::<DeviceExtraConnectorConnectRequest>(
2289 (name, server_end),
2290 0x3fcb37e4226c81e9,
2291 fidl::encoding::DynamicFlags::empty(),
2292 )
2293 }
2294}
2295
2296pub struct DeviceExtraConnectorEventStream {
2297 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2298}
2299
2300impl std::marker::Unpin for DeviceExtraConnectorEventStream {}
2301
2302impl futures::stream::FusedStream for DeviceExtraConnectorEventStream {
2303 fn is_terminated(&self) -> bool {
2304 self.event_receiver.is_terminated()
2305 }
2306}
2307
2308impl futures::Stream for DeviceExtraConnectorEventStream {
2309 type Item = Result<DeviceExtraConnectorEvent, fidl::Error>;
2310
2311 fn poll_next(
2312 mut self: std::pin::Pin<&mut Self>,
2313 cx: &mut std::task::Context<'_>,
2314 ) -> std::task::Poll<Option<Self::Item>> {
2315 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2316 &mut self.event_receiver,
2317 cx
2318 )?) {
2319 Some(buf) => std::task::Poll::Ready(Some(DeviceExtraConnectorEvent::decode(buf))),
2320 None => std::task::Poll::Ready(None),
2321 }
2322 }
2323}
2324
2325#[derive(Debug)]
2326pub enum DeviceExtraConnectorEvent {}
2327
2328impl DeviceExtraConnectorEvent {
2329 fn decode(
2331 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2332 ) -> Result<DeviceExtraConnectorEvent, fidl::Error> {
2333 let (bytes, _handles) = buf.split_mut();
2334 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2335 debug_assert_eq!(tx_header.tx_id, 0);
2336 match tx_header.ordinal {
2337 _ => Err(fidl::Error::UnknownOrdinal {
2338 ordinal: tx_header.ordinal,
2339 protocol_name:
2340 <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2341 }),
2342 }
2343 }
2344}
2345
2346pub struct DeviceExtraConnectorRequestStream {
2348 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2349 is_terminated: bool,
2350}
2351
2352impl std::marker::Unpin for DeviceExtraConnectorRequestStream {}
2353
2354impl futures::stream::FusedStream for DeviceExtraConnectorRequestStream {
2355 fn is_terminated(&self) -> bool {
2356 self.is_terminated
2357 }
2358}
2359
2360impl fidl::endpoints::RequestStream for DeviceExtraConnectorRequestStream {
2361 type Protocol = DeviceExtraConnectorMarker;
2362 type ControlHandle = DeviceExtraConnectorControlHandle;
2363
2364 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2365 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2366 }
2367
2368 fn control_handle(&self) -> Self::ControlHandle {
2369 DeviceExtraConnectorControlHandle { inner: self.inner.clone() }
2370 }
2371
2372 fn into_inner(
2373 self,
2374 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2375 {
2376 (self.inner, self.is_terminated)
2377 }
2378
2379 fn from_inner(
2380 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2381 is_terminated: bool,
2382 ) -> Self {
2383 Self { inner, is_terminated }
2384 }
2385}
2386
2387impl futures::Stream for DeviceExtraConnectorRequestStream {
2388 type Item = Result<DeviceExtraConnectorRequest, fidl::Error>;
2389
2390 fn poll_next(
2391 mut self: std::pin::Pin<&mut Self>,
2392 cx: &mut std::task::Context<'_>,
2393 ) -> std::task::Poll<Option<Self::Item>> {
2394 let this = &mut *self;
2395 if this.inner.check_shutdown(cx) {
2396 this.is_terminated = true;
2397 return std::task::Poll::Ready(None);
2398 }
2399 if this.is_terminated {
2400 panic!("polled DeviceExtraConnectorRequestStream after completion");
2401 }
2402 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2403 |bytes, handles| {
2404 match this.inner.channel().read_etc(cx, bytes, handles) {
2405 std::task::Poll::Ready(Ok(())) => {}
2406 std::task::Poll::Pending => return std::task::Poll::Pending,
2407 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2408 this.is_terminated = true;
2409 return std::task::Poll::Ready(None);
2410 }
2411 std::task::Poll::Ready(Err(e)) => {
2412 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2413 e.into(),
2414 ))))
2415 }
2416 }
2417
2418 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2420
2421 std::task::Poll::Ready(Some(match header.ordinal {
2422 0x3fcb37e4226c81e9 => {
2423 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2424 let mut req = fidl::new_empty!(DeviceExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2425 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2426 let control_handle = DeviceExtraConnectorControlHandle {
2427 inner: this.inner.clone(),
2428 };
2429 Ok(DeviceExtraConnectorRequest::Connect {name: req.name,
2430server_end: req.server_end,
2431
2432 control_handle,
2433 })
2434 }
2435 _ => Err(fidl::Error::UnknownOrdinal {
2436 ordinal: header.ordinal,
2437 protocol_name: <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2438 }),
2439 }))
2440 },
2441 )
2442 }
2443}
2444
2445#[derive(Debug)]
2448pub enum DeviceExtraConnectorRequest {
2449 Connect {
2466 name: String,
2467 server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2468 control_handle: DeviceExtraConnectorControlHandle,
2469 },
2470}
2471
2472impl DeviceExtraConnectorRequest {
2473 #[allow(irrefutable_let_patterns)]
2474 pub fn into_connect(
2475 self,
2476 ) -> Option<(
2477 String,
2478 fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2479 DeviceExtraConnectorControlHandle,
2480 )> {
2481 if let DeviceExtraConnectorRequest::Connect { name, server_end, control_handle } = self {
2482 Some((name, server_end, control_handle))
2483 } else {
2484 None
2485 }
2486 }
2487
2488 pub fn method_name(&self) -> &'static str {
2490 match *self {
2491 DeviceExtraConnectorRequest::Connect { .. } => "connect",
2492 }
2493 }
2494}
2495
2496#[derive(Debug, Clone)]
2497pub struct DeviceExtraConnectorControlHandle {
2498 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2499}
2500
2501impl fidl::endpoints::ControlHandle for DeviceExtraConnectorControlHandle {
2502 fn shutdown(&self) {
2503 self.inner.shutdown()
2504 }
2505 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2506 self.inner.shutdown_with_epitaph(status)
2507 }
2508
2509 fn is_closed(&self) -> bool {
2510 self.inner.channel().is_closed()
2511 }
2512 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2513 self.inner.channel().on_closed()
2514 }
2515
2516 #[cfg(target_os = "fuchsia")]
2517 fn signal_peer(
2518 &self,
2519 clear_mask: zx::Signals,
2520 set_mask: zx::Signals,
2521 ) -> Result<(), zx_status::Status> {
2522 use fidl::Peered;
2523 self.inner.channel().signal_peer(clear_mask, set_mask)
2524 }
2525}
2526
2527impl DeviceExtraConnectorControlHandle {}
2528
2529#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2530pub struct DeviceRouteMarker;
2531
2532impl fidl::endpoints::ProtocolMarker for DeviceRouteMarker {
2533 type Proxy = DeviceRouteProxy;
2534 type RequestStream = DeviceRouteRequestStream;
2535 #[cfg(target_os = "fuchsia")]
2536 type SynchronousProxy = DeviceRouteSynchronousProxy;
2537
2538 const DEBUG_NAME: &'static str = "(anonymous) DeviceRoute";
2539}
2540
2541pub trait DeviceRouteProxyInterface: Send + Sync {
2542 type RegisterOnMeshPrefixResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2543 + Send;
2544 fn r#register_on_mesh_prefix(
2545 &self,
2546 prefix: &OnMeshPrefix,
2547 ) -> Self::RegisterOnMeshPrefixResponseFut;
2548 type UnregisterOnMeshPrefixResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2549 + Send;
2550 fn r#unregister_on_mesh_prefix(
2551 &self,
2552 subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2553 ) -> Self::UnregisterOnMeshPrefixResponseFut;
2554 type RegisterExternalRouteResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2555 + Send;
2556 fn r#register_external_route(
2557 &self,
2558 external_route: &ExternalRoute,
2559 ) -> Self::RegisterExternalRouteResponseFut;
2560 type UnregisterExternalRouteResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2561 + Send;
2562 fn r#unregister_external_route(
2563 &self,
2564 subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2565 ) -> Self::UnregisterExternalRouteResponseFut;
2566}
2567#[derive(Debug)]
2568#[cfg(target_os = "fuchsia")]
2569pub struct DeviceRouteSynchronousProxy {
2570 client: fidl::client::sync::Client,
2571}
2572
2573#[cfg(target_os = "fuchsia")]
2574impl fidl::endpoints::SynchronousProxy for DeviceRouteSynchronousProxy {
2575 type Proxy = DeviceRouteProxy;
2576 type Protocol = DeviceRouteMarker;
2577
2578 fn from_channel(inner: fidl::Channel) -> Self {
2579 Self::new(inner)
2580 }
2581
2582 fn into_channel(self) -> fidl::Channel {
2583 self.client.into_channel()
2584 }
2585
2586 fn as_channel(&self) -> &fidl::Channel {
2587 self.client.as_channel()
2588 }
2589}
2590
2591#[cfg(target_os = "fuchsia")]
2592impl DeviceRouteSynchronousProxy {
2593 pub fn new(channel: fidl::Channel) -> Self {
2594 let protocol_name = <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2595 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2596 }
2597
2598 pub fn into_channel(self) -> fidl::Channel {
2599 self.client.into_channel()
2600 }
2601
2602 pub fn wait_for_event(
2605 &self,
2606 deadline: zx::MonotonicInstant,
2607 ) -> Result<DeviceRouteEvent, fidl::Error> {
2608 DeviceRouteEvent::decode(self.client.wait_for_event(deadline)?)
2609 }
2610
2611 pub fn r#register_on_mesh_prefix(
2629 &self,
2630 mut prefix: &OnMeshPrefix,
2631 ___deadline: zx::MonotonicInstant,
2632 ) -> Result<(), fidl::Error> {
2633 let _response = self
2634 .client
2635 .send_query::<DeviceRouteRegisterOnMeshPrefixRequest, fidl::encoding::EmptyPayload>(
2636 (prefix,),
2637 0x2c4135231eb97f61,
2638 fidl::encoding::DynamicFlags::empty(),
2639 ___deadline,
2640 )?;
2641 Ok(_response)
2642 }
2643
2644 pub fn r#unregister_on_mesh_prefix(
2651 &self,
2652 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2653 ___deadline: zx::MonotonicInstant,
2654 ) -> Result<(), fidl::Error> {
2655 let _response = self
2656 .client
2657 .send_query::<DeviceRouteUnregisterOnMeshPrefixRequest, fidl::encoding::EmptyPayload>(
2658 (subnet,),
2659 0x82d5184028b797f,
2660 fidl::encoding::DynamicFlags::empty(),
2661 ___deadline,
2662 )?;
2663 Ok(_response)
2664 }
2665
2666 pub fn r#register_external_route(
2684 &self,
2685 mut external_route: &ExternalRoute,
2686 ___deadline: zx::MonotonicInstant,
2687 ) -> Result<(), fidl::Error> {
2688 let _response = self
2689 .client
2690 .send_query::<DeviceRouteRegisterExternalRouteRequest, fidl::encoding::EmptyPayload>(
2691 (external_route,),
2692 0x75f70f0fc34a5a73,
2693 fidl::encoding::DynamicFlags::empty(),
2694 ___deadline,
2695 )?;
2696 Ok(_response)
2697 }
2698
2699 pub fn r#unregister_external_route(
2706 &self,
2707 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2708 ___deadline: zx::MonotonicInstant,
2709 ) -> Result<(), fidl::Error> {
2710 let _response = self
2711 .client
2712 .send_query::<DeviceRouteUnregisterExternalRouteRequest, fidl::encoding::EmptyPayload>(
2713 (subnet,),
2714 0x3769be353b1d7088,
2715 fidl::encoding::DynamicFlags::empty(),
2716 ___deadline,
2717 )?;
2718 Ok(_response)
2719 }
2720}
2721
2722#[cfg(target_os = "fuchsia")]
2723impl From<DeviceRouteSynchronousProxy> for zx::Handle {
2724 fn from(value: DeviceRouteSynchronousProxy) -> Self {
2725 value.into_channel().into()
2726 }
2727}
2728
2729#[cfg(target_os = "fuchsia")]
2730impl From<fidl::Channel> for DeviceRouteSynchronousProxy {
2731 fn from(value: fidl::Channel) -> Self {
2732 Self::new(value)
2733 }
2734}
2735
2736#[derive(Debug, Clone)]
2737pub struct DeviceRouteProxy {
2738 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2739}
2740
2741impl fidl::endpoints::Proxy for DeviceRouteProxy {
2742 type Protocol = DeviceRouteMarker;
2743
2744 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2745 Self::new(inner)
2746 }
2747
2748 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2749 self.client.into_channel().map_err(|client| Self { client })
2750 }
2751
2752 fn as_channel(&self) -> &::fidl::AsyncChannel {
2753 self.client.as_channel()
2754 }
2755}
2756
2757impl DeviceRouteProxy {
2758 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2760 let protocol_name = <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2761 Self { client: fidl::client::Client::new(channel, protocol_name) }
2762 }
2763
2764 pub fn take_event_stream(&self) -> DeviceRouteEventStream {
2770 DeviceRouteEventStream { event_receiver: self.client.take_event_receiver() }
2771 }
2772
2773 pub fn r#register_on_mesh_prefix(
2791 &self,
2792 mut prefix: &OnMeshPrefix,
2793 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2794 DeviceRouteProxyInterface::r#register_on_mesh_prefix(self, prefix)
2795 }
2796
2797 pub fn r#unregister_on_mesh_prefix(
2804 &self,
2805 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2806 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2807 DeviceRouteProxyInterface::r#unregister_on_mesh_prefix(self, subnet)
2808 }
2809
2810 pub fn r#register_external_route(
2828 &self,
2829 mut external_route: &ExternalRoute,
2830 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2831 DeviceRouteProxyInterface::r#register_external_route(self, external_route)
2832 }
2833
2834 pub fn r#unregister_external_route(
2841 &self,
2842 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2843 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2844 DeviceRouteProxyInterface::r#unregister_external_route(self, subnet)
2845 }
2846}
2847
2848impl DeviceRouteProxyInterface for DeviceRouteProxy {
2849 type RegisterOnMeshPrefixResponseFut =
2850 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2851 fn r#register_on_mesh_prefix(
2852 &self,
2853 mut prefix: &OnMeshPrefix,
2854 ) -> Self::RegisterOnMeshPrefixResponseFut {
2855 fn _decode(
2856 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2857 ) -> Result<(), fidl::Error> {
2858 let _response = fidl::client::decode_transaction_body::<
2859 fidl::encoding::EmptyPayload,
2860 fidl::encoding::DefaultFuchsiaResourceDialect,
2861 0x2c4135231eb97f61,
2862 >(_buf?)?;
2863 Ok(_response)
2864 }
2865 self.client.send_query_and_decode::<DeviceRouteRegisterOnMeshPrefixRequest, ()>(
2866 (prefix,),
2867 0x2c4135231eb97f61,
2868 fidl::encoding::DynamicFlags::empty(),
2869 _decode,
2870 )
2871 }
2872
2873 type UnregisterOnMeshPrefixResponseFut =
2874 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2875 fn r#unregister_on_mesh_prefix(
2876 &self,
2877 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2878 ) -> Self::UnregisterOnMeshPrefixResponseFut {
2879 fn _decode(
2880 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2881 ) -> Result<(), fidl::Error> {
2882 let _response = fidl::client::decode_transaction_body::<
2883 fidl::encoding::EmptyPayload,
2884 fidl::encoding::DefaultFuchsiaResourceDialect,
2885 0x82d5184028b797f,
2886 >(_buf?)?;
2887 Ok(_response)
2888 }
2889 self.client.send_query_and_decode::<DeviceRouteUnregisterOnMeshPrefixRequest, ()>(
2890 (subnet,),
2891 0x82d5184028b797f,
2892 fidl::encoding::DynamicFlags::empty(),
2893 _decode,
2894 )
2895 }
2896
2897 type RegisterExternalRouteResponseFut =
2898 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2899 fn r#register_external_route(
2900 &self,
2901 mut external_route: &ExternalRoute,
2902 ) -> Self::RegisterExternalRouteResponseFut {
2903 fn _decode(
2904 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2905 ) -> Result<(), fidl::Error> {
2906 let _response = fidl::client::decode_transaction_body::<
2907 fidl::encoding::EmptyPayload,
2908 fidl::encoding::DefaultFuchsiaResourceDialect,
2909 0x75f70f0fc34a5a73,
2910 >(_buf?)?;
2911 Ok(_response)
2912 }
2913 self.client.send_query_and_decode::<DeviceRouteRegisterExternalRouteRequest, ()>(
2914 (external_route,),
2915 0x75f70f0fc34a5a73,
2916 fidl::encoding::DynamicFlags::empty(),
2917 _decode,
2918 )
2919 }
2920
2921 type UnregisterExternalRouteResponseFut =
2922 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2923 fn r#unregister_external_route(
2924 &self,
2925 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2926 ) -> Self::UnregisterExternalRouteResponseFut {
2927 fn _decode(
2928 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2929 ) -> Result<(), fidl::Error> {
2930 let _response = fidl::client::decode_transaction_body::<
2931 fidl::encoding::EmptyPayload,
2932 fidl::encoding::DefaultFuchsiaResourceDialect,
2933 0x3769be353b1d7088,
2934 >(_buf?)?;
2935 Ok(_response)
2936 }
2937 self.client.send_query_and_decode::<DeviceRouteUnregisterExternalRouteRequest, ()>(
2938 (subnet,),
2939 0x3769be353b1d7088,
2940 fidl::encoding::DynamicFlags::empty(),
2941 _decode,
2942 )
2943 }
2944}
2945
2946pub struct DeviceRouteEventStream {
2947 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2948}
2949
2950impl std::marker::Unpin for DeviceRouteEventStream {}
2951
2952impl futures::stream::FusedStream for DeviceRouteEventStream {
2953 fn is_terminated(&self) -> bool {
2954 self.event_receiver.is_terminated()
2955 }
2956}
2957
2958impl futures::Stream for DeviceRouteEventStream {
2959 type Item = Result<DeviceRouteEvent, fidl::Error>;
2960
2961 fn poll_next(
2962 mut self: std::pin::Pin<&mut Self>,
2963 cx: &mut std::task::Context<'_>,
2964 ) -> std::task::Poll<Option<Self::Item>> {
2965 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2966 &mut self.event_receiver,
2967 cx
2968 )?) {
2969 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteEvent::decode(buf))),
2970 None => std::task::Poll::Ready(None),
2971 }
2972 }
2973}
2974
2975#[derive(Debug)]
2976pub enum DeviceRouteEvent {}
2977
2978impl DeviceRouteEvent {
2979 fn decode(
2981 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2982 ) -> Result<DeviceRouteEvent, fidl::Error> {
2983 let (bytes, _handles) = buf.split_mut();
2984 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2985 debug_assert_eq!(tx_header.tx_id, 0);
2986 match tx_header.ordinal {
2987 _ => Err(fidl::Error::UnknownOrdinal {
2988 ordinal: tx_header.ordinal,
2989 protocol_name: <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2990 }),
2991 }
2992 }
2993}
2994
2995pub struct DeviceRouteRequestStream {
2997 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2998 is_terminated: bool,
2999}
3000
3001impl std::marker::Unpin for DeviceRouteRequestStream {}
3002
3003impl futures::stream::FusedStream for DeviceRouteRequestStream {
3004 fn is_terminated(&self) -> bool {
3005 self.is_terminated
3006 }
3007}
3008
3009impl fidl::endpoints::RequestStream for DeviceRouteRequestStream {
3010 type Protocol = DeviceRouteMarker;
3011 type ControlHandle = DeviceRouteControlHandle;
3012
3013 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3014 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3015 }
3016
3017 fn control_handle(&self) -> Self::ControlHandle {
3018 DeviceRouteControlHandle { inner: self.inner.clone() }
3019 }
3020
3021 fn into_inner(
3022 self,
3023 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3024 {
3025 (self.inner, self.is_terminated)
3026 }
3027
3028 fn from_inner(
3029 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3030 is_terminated: bool,
3031 ) -> Self {
3032 Self { inner, is_terminated }
3033 }
3034}
3035
3036impl futures::Stream for DeviceRouteRequestStream {
3037 type Item = Result<DeviceRouteRequest, fidl::Error>;
3038
3039 fn poll_next(
3040 mut self: std::pin::Pin<&mut Self>,
3041 cx: &mut std::task::Context<'_>,
3042 ) -> std::task::Poll<Option<Self::Item>> {
3043 let this = &mut *self;
3044 if this.inner.check_shutdown(cx) {
3045 this.is_terminated = true;
3046 return std::task::Poll::Ready(None);
3047 }
3048 if this.is_terminated {
3049 panic!("polled DeviceRouteRequestStream after completion");
3050 }
3051 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3052 |bytes, handles| {
3053 match this.inner.channel().read_etc(cx, bytes, handles) {
3054 std::task::Poll::Ready(Ok(())) => {}
3055 std::task::Poll::Pending => return std::task::Poll::Pending,
3056 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3057 this.is_terminated = true;
3058 return std::task::Poll::Ready(None);
3059 }
3060 std::task::Poll::Ready(Err(e)) => {
3061 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3062 e.into(),
3063 ))))
3064 }
3065 }
3066
3067 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3069
3070 std::task::Poll::Ready(Some(match header.ordinal {
3071 0x2c4135231eb97f61 => {
3072 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3073 let mut req = fidl::new_empty!(
3074 DeviceRouteRegisterOnMeshPrefixRequest,
3075 fidl::encoding::DefaultFuchsiaResourceDialect
3076 );
3077 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteRegisterOnMeshPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
3078 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3079 Ok(DeviceRouteRequest::RegisterOnMeshPrefix {
3080 prefix: req.prefix,
3081
3082 responder: DeviceRouteRegisterOnMeshPrefixResponder {
3083 control_handle: std::mem::ManuallyDrop::new(control_handle),
3084 tx_id: header.tx_id,
3085 },
3086 })
3087 }
3088 0x82d5184028b797f => {
3089 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3090 let mut req = fidl::new_empty!(
3091 DeviceRouteUnregisterOnMeshPrefixRequest,
3092 fidl::encoding::DefaultFuchsiaResourceDialect
3093 );
3094 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteUnregisterOnMeshPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
3095 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3096 Ok(DeviceRouteRequest::UnregisterOnMeshPrefix {
3097 subnet: req.subnet,
3098
3099 responder: DeviceRouteUnregisterOnMeshPrefixResponder {
3100 control_handle: std::mem::ManuallyDrop::new(control_handle),
3101 tx_id: header.tx_id,
3102 },
3103 })
3104 }
3105 0x75f70f0fc34a5a73 => {
3106 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3107 let mut req = fidl::new_empty!(
3108 DeviceRouteRegisterExternalRouteRequest,
3109 fidl::encoding::DefaultFuchsiaResourceDialect
3110 );
3111 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteRegisterExternalRouteRequest>(&header, _body_bytes, handles, &mut req)?;
3112 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3113 Ok(DeviceRouteRequest::RegisterExternalRoute {
3114 external_route: req.external_route,
3115
3116 responder: DeviceRouteRegisterExternalRouteResponder {
3117 control_handle: std::mem::ManuallyDrop::new(control_handle),
3118 tx_id: header.tx_id,
3119 },
3120 })
3121 }
3122 0x3769be353b1d7088 => {
3123 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3124 let mut req = fidl::new_empty!(
3125 DeviceRouteUnregisterExternalRouteRequest,
3126 fidl::encoding::DefaultFuchsiaResourceDialect
3127 );
3128 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteUnregisterExternalRouteRequest>(&header, _body_bytes, handles, &mut req)?;
3129 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3130 Ok(DeviceRouteRequest::UnregisterExternalRoute {
3131 subnet: req.subnet,
3132
3133 responder: DeviceRouteUnregisterExternalRouteResponder {
3134 control_handle: std::mem::ManuallyDrop::new(control_handle),
3135 tx_id: header.tx_id,
3136 },
3137 })
3138 }
3139 _ => Err(fidl::Error::UnknownOrdinal {
3140 ordinal: header.ordinal,
3141 protocol_name:
3142 <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3143 }),
3144 }))
3145 },
3146 )
3147 }
3148}
3149
3150#[derive(Debug)]
3156pub enum DeviceRouteRequest {
3157 RegisterOnMeshPrefix {
3175 prefix: OnMeshPrefix,
3176 responder: DeviceRouteRegisterOnMeshPrefixResponder,
3177 },
3178 UnregisterOnMeshPrefix {
3185 subnet: fidl_fuchsia_net::Ipv6AddressWithPrefix,
3186 responder: DeviceRouteUnregisterOnMeshPrefixResponder,
3187 },
3188 RegisterExternalRoute {
3206 external_route: ExternalRoute,
3207 responder: DeviceRouteRegisterExternalRouteResponder,
3208 },
3209 UnregisterExternalRoute {
3216 subnet: fidl_fuchsia_net::Ipv6AddressWithPrefix,
3217 responder: DeviceRouteUnregisterExternalRouteResponder,
3218 },
3219}
3220
3221impl DeviceRouteRequest {
3222 #[allow(irrefutable_let_patterns)]
3223 pub fn into_register_on_mesh_prefix(
3224 self,
3225 ) -> Option<(OnMeshPrefix, DeviceRouteRegisterOnMeshPrefixResponder)> {
3226 if let DeviceRouteRequest::RegisterOnMeshPrefix { prefix, responder } = self {
3227 Some((prefix, responder))
3228 } else {
3229 None
3230 }
3231 }
3232
3233 #[allow(irrefutable_let_patterns)]
3234 pub fn into_unregister_on_mesh_prefix(
3235 self,
3236 ) -> Option<(fidl_fuchsia_net::Ipv6AddressWithPrefix, DeviceRouteUnregisterOnMeshPrefixResponder)>
3237 {
3238 if let DeviceRouteRequest::UnregisterOnMeshPrefix { subnet, responder } = self {
3239 Some((subnet, responder))
3240 } else {
3241 None
3242 }
3243 }
3244
3245 #[allow(irrefutable_let_patterns)]
3246 pub fn into_register_external_route(
3247 self,
3248 ) -> Option<(ExternalRoute, DeviceRouteRegisterExternalRouteResponder)> {
3249 if let DeviceRouteRequest::RegisterExternalRoute { external_route, responder } = self {
3250 Some((external_route, responder))
3251 } else {
3252 None
3253 }
3254 }
3255
3256 #[allow(irrefutable_let_patterns)]
3257 pub fn into_unregister_external_route(
3258 self,
3259 ) -> Option<(
3260 fidl_fuchsia_net::Ipv6AddressWithPrefix,
3261 DeviceRouteUnregisterExternalRouteResponder,
3262 )> {
3263 if let DeviceRouteRequest::UnregisterExternalRoute { subnet, responder } = self {
3264 Some((subnet, responder))
3265 } else {
3266 None
3267 }
3268 }
3269
3270 pub fn method_name(&self) -> &'static str {
3272 match *self {
3273 DeviceRouteRequest::RegisterOnMeshPrefix { .. } => "register_on_mesh_prefix",
3274 DeviceRouteRequest::UnregisterOnMeshPrefix { .. } => "unregister_on_mesh_prefix",
3275 DeviceRouteRequest::RegisterExternalRoute { .. } => "register_external_route",
3276 DeviceRouteRequest::UnregisterExternalRoute { .. } => "unregister_external_route",
3277 }
3278 }
3279}
3280
3281#[derive(Debug, Clone)]
3282pub struct DeviceRouteControlHandle {
3283 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3284}
3285
3286impl fidl::endpoints::ControlHandle for DeviceRouteControlHandle {
3287 fn shutdown(&self) {
3288 self.inner.shutdown()
3289 }
3290 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3291 self.inner.shutdown_with_epitaph(status)
3292 }
3293
3294 fn is_closed(&self) -> bool {
3295 self.inner.channel().is_closed()
3296 }
3297 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3298 self.inner.channel().on_closed()
3299 }
3300
3301 #[cfg(target_os = "fuchsia")]
3302 fn signal_peer(
3303 &self,
3304 clear_mask: zx::Signals,
3305 set_mask: zx::Signals,
3306 ) -> Result<(), zx_status::Status> {
3307 use fidl::Peered;
3308 self.inner.channel().signal_peer(clear_mask, set_mask)
3309 }
3310}
3311
3312impl DeviceRouteControlHandle {}
3313
3314#[must_use = "FIDL methods require a response to be sent"]
3315#[derive(Debug)]
3316pub struct DeviceRouteRegisterOnMeshPrefixResponder {
3317 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3318 tx_id: u32,
3319}
3320
3321impl std::ops::Drop for DeviceRouteRegisterOnMeshPrefixResponder {
3325 fn drop(&mut self) {
3326 self.control_handle.shutdown();
3327 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3329 }
3330}
3331
3332impl fidl::endpoints::Responder for DeviceRouteRegisterOnMeshPrefixResponder {
3333 type ControlHandle = DeviceRouteControlHandle;
3334
3335 fn control_handle(&self) -> &DeviceRouteControlHandle {
3336 &self.control_handle
3337 }
3338
3339 fn drop_without_shutdown(mut self) {
3340 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3342 std::mem::forget(self);
3344 }
3345}
3346
3347impl DeviceRouteRegisterOnMeshPrefixResponder {
3348 pub fn send(self) -> Result<(), fidl::Error> {
3352 let _result = self.send_raw();
3353 if _result.is_err() {
3354 self.control_handle.shutdown();
3355 }
3356 self.drop_without_shutdown();
3357 _result
3358 }
3359
3360 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3362 let _result = self.send_raw();
3363 self.drop_without_shutdown();
3364 _result
3365 }
3366
3367 fn send_raw(&self) -> Result<(), fidl::Error> {
3368 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3369 (),
3370 self.tx_id,
3371 0x2c4135231eb97f61,
3372 fidl::encoding::DynamicFlags::empty(),
3373 )
3374 }
3375}
3376
3377#[must_use = "FIDL methods require a response to be sent"]
3378#[derive(Debug)]
3379pub struct DeviceRouteUnregisterOnMeshPrefixResponder {
3380 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3381 tx_id: u32,
3382}
3383
3384impl std::ops::Drop for DeviceRouteUnregisterOnMeshPrefixResponder {
3388 fn drop(&mut self) {
3389 self.control_handle.shutdown();
3390 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3392 }
3393}
3394
3395impl fidl::endpoints::Responder for DeviceRouteUnregisterOnMeshPrefixResponder {
3396 type ControlHandle = DeviceRouteControlHandle;
3397
3398 fn control_handle(&self) -> &DeviceRouteControlHandle {
3399 &self.control_handle
3400 }
3401
3402 fn drop_without_shutdown(mut self) {
3403 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3405 std::mem::forget(self);
3407 }
3408}
3409
3410impl DeviceRouteUnregisterOnMeshPrefixResponder {
3411 pub fn send(self) -> Result<(), fidl::Error> {
3415 let _result = self.send_raw();
3416 if _result.is_err() {
3417 self.control_handle.shutdown();
3418 }
3419 self.drop_without_shutdown();
3420 _result
3421 }
3422
3423 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3425 let _result = self.send_raw();
3426 self.drop_without_shutdown();
3427 _result
3428 }
3429
3430 fn send_raw(&self) -> Result<(), fidl::Error> {
3431 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3432 (),
3433 self.tx_id,
3434 0x82d5184028b797f,
3435 fidl::encoding::DynamicFlags::empty(),
3436 )
3437 }
3438}
3439
3440#[must_use = "FIDL methods require a response to be sent"]
3441#[derive(Debug)]
3442pub struct DeviceRouteRegisterExternalRouteResponder {
3443 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3444 tx_id: u32,
3445}
3446
3447impl std::ops::Drop for DeviceRouteRegisterExternalRouteResponder {
3451 fn drop(&mut self) {
3452 self.control_handle.shutdown();
3453 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3455 }
3456}
3457
3458impl fidl::endpoints::Responder for DeviceRouteRegisterExternalRouteResponder {
3459 type ControlHandle = DeviceRouteControlHandle;
3460
3461 fn control_handle(&self) -> &DeviceRouteControlHandle {
3462 &self.control_handle
3463 }
3464
3465 fn drop_without_shutdown(mut self) {
3466 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3468 std::mem::forget(self);
3470 }
3471}
3472
3473impl DeviceRouteRegisterExternalRouteResponder {
3474 pub fn send(self) -> Result<(), fidl::Error> {
3478 let _result = self.send_raw();
3479 if _result.is_err() {
3480 self.control_handle.shutdown();
3481 }
3482 self.drop_without_shutdown();
3483 _result
3484 }
3485
3486 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3488 let _result = self.send_raw();
3489 self.drop_without_shutdown();
3490 _result
3491 }
3492
3493 fn send_raw(&self) -> Result<(), fidl::Error> {
3494 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3495 (),
3496 self.tx_id,
3497 0x75f70f0fc34a5a73,
3498 fidl::encoding::DynamicFlags::empty(),
3499 )
3500 }
3501}
3502
3503#[must_use = "FIDL methods require a response to be sent"]
3504#[derive(Debug)]
3505pub struct DeviceRouteUnregisterExternalRouteResponder {
3506 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3507 tx_id: u32,
3508}
3509
3510impl std::ops::Drop for DeviceRouteUnregisterExternalRouteResponder {
3514 fn drop(&mut self) {
3515 self.control_handle.shutdown();
3516 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3518 }
3519}
3520
3521impl fidl::endpoints::Responder for DeviceRouteUnregisterExternalRouteResponder {
3522 type ControlHandle = DeviceRouteControlHandle;
3523
3524 fn control_handle(&self) -> &DeviceRouteControlHandle {
3525 &self.control_handle
3526 }
3527
3528 fn drop_without_shutdown(mut self) {
3529 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3531 std::mem::forget(self);
3533 }
3534}
3535
3536impl DeviceRouteUnregisterExternalRouteResponder {
3537 pub fn send(self) -> Result<(), fidl::Error> {
3541 let _result = self.send_raw();
3542 if _result.is_err() {
3543 self.control_handle.shutdown();
3544 }
3545 self.drop_without_shutdown();
3546 _result
3547 }
3548
3549 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3551 let _result = self.send_raw();
3552 self.drop_without_shutdown();
3553 _result
3554 }
3555
3556 fn send_raw(&self) -> Result<(), fidl::Error> {
3557 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3558 (),
3559 self.tx_id,
3560 0x3769be353b1d7088,
3561 fidl::encoding::DynamicFlags::empty(),
3562 )
3563 }
3564}
3565
3566#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3567pub struct DeviceRouteConnectorMarker;
3568
3569impl fidl::endpoints::ProtocolMarker for DeviceRouteConnectorMarker {
3570 type Proxy = DeviceRouteConnectorProxy;
3571 type RequestStream = DeviceRouteConnectorRequestStream;
3572 #[cfg(target_os = "fuchsia")]
3573 type SynchronousProxy = DeviceRouteConnectorSynchronousProxy;
3574
3575 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceRouteConnector";
3576}
3577impl fidl::endpoints::DiscoverableProtocolMarker for DeviceRouteConnectorMarker {}
3578
3579pub trait DeviceRouteConnectorProxyInterface: Send + Sync {
3580 fn r#connect(
3581 &self,
3582 name: &str,
3583 server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3584 ) -> Result<(), fidl::Error>;
3585}
3586#[derive(Debug)]
3587#[cfg(target_os = "fuchsia")]
3588pub struct DeviceRouteConnectorSynchronousProxy {
3589 client: fidl::client::sync::Client,
3590}
3591
3592#[cfg(target_os = "fuchsia")]
3593impl fidl::endpoints::SynchronousProxy for DeviceRouteConnectorSynchronousProxy {
3594 type Proxy = DeviceRouteConnectorProxy;
3595 type Protocol = DeviceRouteConnectorMarker;
3596
3597 fn from_channel(inner: fidl::Channel) -> Self {
3598 Self::new(inner)
3599 }
3600
3601 fn into_channel(self) -> fidl::Channel {
3602 self.client.into_channel()
3603 }
3604
3605 fn as_channel(&self) -> &fidl::Channel {
3606 self.client.as_channel()
3607 }
3608}
3609
3610#[cfg(target_os = "fuchsia")]
3611impl DeviceRouteConnectorSynchronousProxy {
3612 pub fn new(channel: fidl::Channel) -> Self {
3613 let protocol_name =
3614 <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3615 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3616 }
3617
3618 pub fn into_channel(self) -> fidl::Channel {
3619 self.client.into_channel()
3620 }
3621
3622 pub fn wait_for_event(
3625 &self,
3626 deadline: zx::MonotonicInstant,
3627 ) -> Result<DeviceRouteConnectorEvent, fidl::Error> {
3628 DeviceRouteConnectorEvent::decode(self.client.wait_for_event(deadline)?)
3629 }
3630
3631 pub fn r#connect(
3648 &self,
3649 mut name: &str,
3650 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3651 ) -> Result<(), fidl::Error> {
3652 self.client.send::<DeviceRouteConnectorConnectRequest>(
3653 (name, server_end),
3654 0x19cd5fdcb971f4ac,
3655 fidl::encoding::DynamicFlags::empty(),
3656 )
3657 }
3658}
3659
3660#[cfg(target_os = "fuchsia")]
3661impl From<DeviceRouteConnectorSynchronousProxy> for zx::Handle {
3662 fn from(value: DeviceRouteConnectorSynchronousProxy) -> Self {
3663 value.into_channel().into()
3664 }
3665}
3666
3667#[cfg(target_os = "fuchsia")]
3668impl From<fidl::Channel> for DeviceRouteConnectorSynchronousProxy {
3669 fn from(value: fidl::Channel) -> Self {
3670 Self::new(value)
3671 }
3672}
3673
3674#[derive(Debug, Clone)]
3675pub struct DeviceRouteConnectorProxy {
3676 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3677}
3678
3679impl fidl::endpoints::Proxy for DeviceRouteConnectorProxy {
3680 type Protocol = DeviceRouteConnectorMarker;
3681
3682 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3683 Self::new(inner)
3684 }
3685
3686 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3687 self.client.into_channel().map_err(|client| Self { client })
3688 }
3689
3690 fn as_channel(&self) -> &::fidl::AsyncChannel {
3691 self.client.as_channel()
3692 }
3693}
3694
3695impl DeviceRouteConnectorProxy {
3696 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3698 let protocol_name =
3699 <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3700 Self { client: fidl::client::Client::new(channel, protocol_name) }
3701 }
3702
3703 pub fn take_event_stream(&self) -> DeviceRouteConnectorEventStream {
3709 DeviceRouteConnectorEventStream { event_receiver: self.client.take_event_receiver() }
3710 }
3711
3712 pub fn r#connect(
3729 &self,
3730 mut name: &str,
3731 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3732 ) -> Result<(), fidl::Error> {
3733 DeviceRouteConnectorProxyInterface::r#connect(self, name, server_end)
3734 }
3735}
3736
3737impl DeviceRouteConnectorProxyInterface for DeviceRouteConnectorProxy {
3738 fn r#connect(
3739 &self,
3740 mut name: &str,
3741 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3742 ) -> Result<(), fidl::Error> {
3743 self.client.send::<DeviceRouteConnectorConnectRequest>(
3744 (name, server_end),
3745 0x19cd5fdcb971f4ac,
3746 fidl::encoding::DynamicFlags::empty(),
3747 )
3748 }
3749}
3750
3751pub struct DeviceRouteConnectorEventStream {
3752 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3753}
3754
3755impl std::marker::Unpin for DeviceRouteConnectorEventStream {}
3756
3757impl futures::stream::FusedStream for DeviceRouteConnectorEventStream {
3758 fn is_terminated(&self) -> bool {
3759 self.event_receiver.is_terminated()
3760 }
3761}
3762
3763impl futures::Stream for DeviceRouteConnectorEventStream {
3764 type Item = Result<DeviceRouteConnectorEvent, fidl::Error>;
3765
3766 fn poll_next(
3767 mut self: std::pin::Pin<&mut Self>,
3768 cx: &mut std::task::Context<'_>,
3769 ) -> std::task::Poll<Option<Self::Item>> {
3770 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3771 &mut self.event_receiver,
3772 cx
3773 )?) {
3774 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteConnectorEvent::decode(buf))),
3775 None => std::task::Poll::Ready(None),
3776 }
3777 }
3778}
3779
3780#[derive(Debug)]
3781pub enum DeviceRouteConnectorEvent {}
3782
3783impl DeviceRouteConnectorEvent {
3784 fn decode(
3786 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3787 ) -> Result<DeviceRouteConnectorEvent, fidl::Error> {
3788 let (bytes, _handles) = buf.split_mut();
3789 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3790 debug_assert_eq!(tx_header.tx_id, 0);
3791 match tx_header.ordinal {
3792 _ => Err(fidl::Error::UnknownOrdinal {
3793 ordinal: tx_header.ordinal,
3794 protocol_name:
3795 <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3796 }),
3797 }
3798 }
3799}
3800
3801pub struct DeviceRouteConnectorRequestStream {
3803 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3804 is_terminated: bool,
3805}
3806
3807impl std::marker::Unpin for DeviceRouteConnectorRequestStream {}
3808
3809impl futures::stream::FusedStream for DeviceRouteConnectorRequestStream {
3810 fn is_terminated(&self) -> bool {
3811 self.is_terminated
3812 }
3813}
3814
3815impl fidl::endpoints::RequestStream for DeviceRouteConnectorRequestStream {
3816 type Protocol = DeviceRouteConnectorMarker;
3817 type ControlHandle = DeviceRouteConnectorControlHandle;
3818
3819 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3820 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3821 }
3822
3823 fn control_handle(&self) -> Self::ControlHandle {
3824 DeviceRouteConnectorControlHandle { inner: self.inner.clone() }
3825 }
3826
3827 fn into_inner(
3828 self,
3829 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3830 {
3831 (self.inner, self.is_terminated)
3832 }
3833
3834 fn from_inner(
3835 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3836 is_terminated: bool,
3837 ) -> Self {
3838 Self { inner, is_terminated }
3839 }
3840}
3841
3842impl futures::Stream for DeviceRouteConnectorRequestStream {
3843 type Item = Result<DeviceRouteConnectorRequest, fidl::Error>;
3844
3845 fn poll_next(
3846 mut self: std::pin::Pin<&mut Self>,
3847 cx: &mut std::task::Context<'_>,
3848 ) -> std::task::Poll<Option<Self::Item>> {
3849 let this = &mut *self;
3850 if this.inner.check_shutdown(cx) {
3851 this.is_terminated = true;
3852 return std::task::Poll::Ready(None);
3853 }
3854 if this.is_terminated {
3855 panic!("polled DeviceRouteConnectorRequestStream after completion");
3856 }
3857 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3858 |bytes, handles| {
3859 match this.inner.channel().read_etc(cx, bytes, handles) {
3860 std::task::Poll::Ready(Ok(())) => {}
3861 std::task::Poll::Pending => return std::task::Poll::Pending,
3862 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3863 this.is_terminated = true;
3864 return std::task::Poll::Ready(None);
3865 }
3866 std::task::Poll::Ready(Err(e)) => {
3867 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3868 e.into(),
3869 ))))
3870 }
3871 }
3872
3873 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3875
3876 std::task::Poll::Ready(Some(match header.ordinal {
3877 0x19cd5fdcb971f4ac => {
3878 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3879 let mut req = fidl::new_empty!(DeviceRouteConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3880 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
3881 let control_handle = DeviceRouteConnectorControlHandle {
3882 inner: this.inner.clone(),
3883 };
3884 Ok(DeviceRouteConnectorRequest::Connect {name: req.name,
3885server_end: req.server_end,
3886
3887 control_handle,
3888 })
3889 }
3890 _ => Err(fidl::Error::UnknownOrdinal {
3891 ordinal: header.ordinal,
3892 protocol_name: <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3893 }),
3894 }))
3895 },
3896 )
3897 }
3898}
3899
3900#[derive(Debug)]
3903pub enum DeviceRouteConnectorRequest {
3904 Connect {
3921 name: String,
3922 server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3923 control_handle: DeviceRouteConnectorControlHandle,
3924 },
3925}
3926
3927impl DeviceRouteConnectorRequest {
3928 #[allow(irrefutable_let_patterns)]
3929 pub fn into_connect(
3930 self,
3931 ) -> Option<(
3932 String,
3933 fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3934 DeviceRouteConnectorControlHandle,
3935 )> {
3936 if let DeviceRouteConnectorRequest::Connect { name, server_end, control_handle } = self {
3937 Some((name, server_end, control_handle))
3938 } else {
3939 None
3940 }
3941 }
3942
3943 pub fn method_name(&self) -> &'static str {
3945 match *self {
3946 DeviceRouteConnectorRequest::Connect { .. } => "connect",
3947 }
3948 }
3949}
3950
3951#[derive(Debug, Clone)]
3952pub struct DeviceRouteConnectorControlHandle {
3953 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3954}
3955
3956impl fidl::endpoints::ControlHandle for DeviceRouteConnectorControlHandle {
3957 fn shutdown(&self) {
3958 self.inner.shutdown()
3959 }
3960 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3961 self.inner.shutdown_with_epitaph(status)
3962 }
3963
3964 fn is_closed(&self) -> bool {
3965 self.inner.channel().is_closed()
3966 }
3967 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3968 self.inner.channel().on_closed()
3969 }
3970
3971 #[cfg(target_os = "fuchsia")]
3972 fn signal_peer(
3973 &self,
3974 clear_mask: zx::Signals,
3975 set_mask: zx::Signals,
3976 ) -> Result<(), zx_status::Status> {
3977 use fidl::Peered;
3978 self.inner.channel().signal_peer(clear_mask, set_mask)
3979 }
3980}
3981
3982impl DeviceRouteConnectorControlHandle {}
3983
3984#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3985pub struct DeviceRouteExtraMarker;
3986
3987impl fidl::endpoints::ProtocolMarker for DeviceRouteExtraMarker {
3988 type Proxy = DeviceRouteExtraProxy;
3989 type RequestStream = DeviceRouteExtraRequestStream;
3990 #[cfg(target_os = "fuchsia")]
3991 type SynchronousProxy = DeviceRouteExtraSynchronousProxy;
3992
3993 const DEBUG_NAME: &'static str = "(anonymous) DeviceRouteExtra";
3994}
3995
3996pub trait DeviceRouteExtraProxyInterface: Send + Sync {
3997 type GetLocalOnMeshPrefixesResponseFut: std::future::Future<Output = Result<Vec<OnMeshPrefix>, fidl::Error>>
3998 + Send;
3999 fn r#get_local_on_mesh_prefixes(&self) -> Self::GetLocalOnMeshPrefixesResponseFut;
4000 type GetLocalExternalRoutesResponseFut: std::future::Future<Output = Result<Vec<ExternalRoute>, fidl::Error>>
4001 + Send;
4002 fn r#get_local_external_routes(&self) -> Self::GetLocalExternalRoutesResponseFut;
4003}
4004#[derive(Debug)]
4005#[cfg(target_os = "fuchsia")]
4006pub struct DeviceRouteExtraSynchronousProxy {
4007 client: fidl::client::sync::Client,
4008}
4009
4010#[cfg(target_os = "fuchsia")]
4011impl fidl::endpoints::SynchronousProxy for DeviceRouteExtraSynchronousProxy {
4012 type Proxy = DeviceRouteExtraProxy;
4013 type Protocol = DeviceRouteExtraMarker;
4014
4015 fn from_channel(inner: fidl::Channel) -> Self {
4016 Self::new(inner)
4017 }
4018
4019 fn into_channel(self) -> fidl::Channel {
4020 self.client.into_channel()
4021 }
4022
4023 fn as_channel(&self) -> &fidl::Channel {
4024 self.client.as_channel()
4025 }
4026}
4027
4028#[cfg(target_os = "fuchsia")]
4029impl DeviceRouteExtraSynchronousProxy {
4030 pub fn new(channel: fidl::Channel) -> Self {
4031 let protocol_name = <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4032 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4033 }
4034
4035 pub fn into_channel(self) -> fidl::Channel {
4036 self.client.into_channel()
4037 }
4038
4039 pub fn wait_for_event(
4042 &self,
4043 deadline: zx::MonotonicInstant,
4044 ) -> Result<DeviceRouteExtraEvent, fidl::Error> {
4045 DeviceRouteExtraEvent::decode(self.client.wait_for_event(deadline)?)
4046 }
4047
4048 pub fn r#get_local_on_mesh_prefixes(
4053 &self,
4054 ___deadline: zx::MonotonicInstant,
4055 ) -> Result<Vec<OnMeshPrefix>, fidl::Error> {
4056 let _response = self.client.send_query::<
4057 fidl::encoding::EmptyPayload,
4058 DeviceRouteExtraGetLocalOnMeshPrefixesResponse,
4059 >(
4060 (),
4061 0xf192c43311c811,
4062 fidl::encoding::DynamicFlags::empty(),
4063 ___deadline,
4064 )?;
4065 Ok(_response.prefixes)
4066 }
4067
4068 pub fn r#get_local_external_routes(
4073 &self,
4074 ___deadline: zx::MonotonicInstant,
4075 ) -> Result<Vec<ExternalRoute>, fidl::Error> {
4076 let _response = self.client.send_query::<
4077 fidl::encoding::EmptyPayload,
4078 DeviceRouteExtraGetLocalExternalRoutesResponse,
4079 >(
4080 (),
4081 0x5a688c2e62c766a6,
4082 fidl::encoding::DynamicFlags::empty(),
4083 ___deadline,
4084 )?;
4085 Ok(_response.external_routes)
4086 }
4087}
4088
4089#[cfg(target_os = "fuchsia")]
4090impl From<DeviceRouteExtraSynchronousProxy> for zx::Handle {
4091 fn from(value: DeviceRouteExtraSynchronousProxy) -> Self {
4092 value.into_channel().into()
4093 }
4094}
4095
4096#[cfg(target_os = "fuchsia")]
4097impl From<fidl::Channel> for DeviceRouteExtraSynchronousProxy {
4098 fn from(value: fidl::Channel) -> Self {
4099 Self::new(value)
4100 }
4101}
4102
4103#[derive(Debug, Clone)]
4104pub struct DeviceRouteExtraProxy {
4105 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4106}
4107
4108impl fidl::endpoints::Proxy for DeviceRouteExtraProxy {
4109 type Protocol = DeviceRouteExtraMarker;
4110
4111 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4112 Self::new(inner)
4113 }
4114
4115 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4116 self.client.into_channel().map_err(|client| Self { client })
4117 }
4118
4119 fn as_channel(&self) -> &::fidl::AsyncChannel {
4120 self.client.as_channel()
4121 }
4122}
4123
4124impl DeviceRouteExtraProxy {
4125 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4127 let protocol_name = <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4128 Self { client: fidl::client::Client::new(channel, protocol_name) }
4129 }
4130
4131 pub fn take_event_stream(&self) -> DeviceRouteExtraEventStream {
4137 DeviceRouteExtraEventStream { event_receiver: self.client.take_event_receiver() }
4138 }
4139
4140 pub fn r#get_local_on_mesh_prefixes(
4145 &self,
4146 ) -> fidl::client::QueryResponseFut<
4147 Vec<OnMeshPrefix>,
4148 fidl::encoding::DefaultFuchsiaResourceDialect,
4149 > {
4150 DeviceRouteExtraProxyInterface::r#get_local_on_mesh_prefixes(self)
4151 }
4152
4153 pub fn r#get_local_external_routes(
4158 &self,
4159 ) -> fidl::client::QueryResponseFut<
4160 Vec<ExternalRoute>,
4161 fidl::encoding::DefaultFuchsiaResourceDialect,
4162 > {
4163 DeviceRouteExtraProxyInterface::r#get_local_external_routes(self)
4164 }
4165}
4166
4167impl DeviceRouteExtraProxyInterface for DeviceRouteExtraProxy {
4168 type GetLocalOnMeshPrefixesResponseFut = fidl::client::QueryResponseFut<
4169 Vec<OnMeshPrefix>,
4170 fidl::encoding::DefaultFuchsiaResourceDialect,
4171 >;
4172 fn r#get_local_on_mesh_prefixes(&self) -> Self::GetLocalOnMeshPrefixesResponseFut {
4173 fn _decode(
4174 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4175 ) -> Result<Vec<OnMeshPrefix>, fidl::Error> {
4176 let _response = fidl::client::decode_transaction_body::<
4177 DeviceRouteExtraGetLocalOnMeshPrefixesResponse,
4178 fidl::encoding::DefaultFuchsiaResourceDialect,
4179 0xf192c43311c811,
4180 >(_buf?)?;
4181 Ok(_response.prefixes)
4182 }
4183 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<OnMeshPrefix>>(
4184 (),
4185 0xf192c43311c811,
4186 fidl::encoding::DynamicFlags::empty(),
4187 _decode,
4188 )
4189 }
4190
4191 type GetLocalExternalRoutesResponseFut = fidl::client::QueryResponseFut<
4192 Vec<ExternalRoute>,
4193 fidl::encoding::DefaultFuchsiaResourceDialect,
4194 >;
4195 fn r#get_local_external_routes(&self) -> Self::GetLocalExternalRoutesResponseFut {
4196 fn _decode(
4197 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4198 ) -> Result<Vec<ExternalRoute>, fidl::Error> {
4199 let _response = fidl::client::decode_transaction_body::<
4200 DeviceRouteExtraGetLocalExternalRoutesResponse,
4201 fidl::encoding::DefaultFuchsiaResourceDialect,
4202 0x5a688c2e62c766a6,
4203 >(_buf?)?;
4204 Ok(_response.external_routes)
4205 }
4206 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ExternalRoute>>(
4207 (),
4208 0x5a688c2e62c766a6,
4209 fidl::encoding::DynamicFlags::empty(),
4210 _decode,
4211 )
4212 }
4213}
4214
4215pub struct DeviceRouteExtraEventStream {
4216 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4217}
4218
4219impl std::marker::Unpin for DeviceRouteExtraEventStream {}
4220
4221impl futures::stream::FusedStream for DeviceRouteExtraEventStream {
4222 fn is_terminated(&self) -> bool {
4223 self.event_receiver.is_terminated()
4224 }
4225}
4226
4227impl futures::Stream for DeviceRouteExtraEventStream {
4228 type Item = Result<DeviceRouteExtraEvent, fidl::Error>;
4229
4230 fn poll_next(
4231 mut self: std::pin::Pin<&mut Self>,
4232 cx: &mut std::task::Context<'_>,
4233 ) -> std::task::Poll<Option<Self::Item>> {
4234 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4235 &mut self.event_receiver,
4236 cx
4237 )?) {
4238 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteExtraEvent::decode(buf))),
4239 None => std::task::Poll::Ready(None),
4240 }
4241 }
4242}
4243
4244#[derive(Debug)]
4245pub enum DeviceRouteExtraEvent {}
4246
4247impl DeviceRouteExtraEvent {
4248 fn decode(
4250 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4251 ) -> Result<DeviceRouteExtraEvent, fidl::Error> {
4252 let (bytes, _handles) = buf.split_mut();
4253 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4254 debug_assert_eq!(tx_header.tx_id, 0);
4255 match tx_header.ordinal {
4256 _ => Err(fidl::Error::UnknownOrdinal {
4257 ordinal: tx_header.ordinal,
4258 protocol_name:
4259 <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4260 }),
4261 }
4262 }
4263}
4264
4265pub struct DeviceRouteExtraRequestStream {
4267 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4268 is_terminated: bool,
4269}
4270
4271impl std::marker::Unpin for DeviceRouteExtraRequestStream {}
4272
4273impl futures::stream::FusedStream for DeviceRouteExtraRequestStream {
4274 fn is_terminated(&self) -> bool {
4275 self.is_terminated
4276 }
4277}
4278
4279impl fidl::endpoints::RequestStream for DeviceRouteExtraRequestStream {
4280 type Protocol = DeviceRouteExtraMarker;
4281 type ControlHandle = DeviceRouteExtraControlHandle;
4282
4283 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4284 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4285 }
4286
4287 fn control_handle(&self) -> Self::ControlHandle {
4288 DeviceRouteExtraControlHandle { inner: self.inner.clone() }
4289 }
4290
4291 fn into_inner(
4292 self,
4293 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4294 {
4295 (self.inner, self.is_terminated)
4296 }
4297
4298 fn from_inner(
4299 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4300 is_terminated: bool,
4301 ) -> Self {
4302 Self { inner, is_terminated }
4303 }
4304}
4305
4306impl futures::Stream for DeviceRouteExtraRequestStream {
4307 type Item = Result<DeviceRouteExtraRequest, fidl::Error>;
4308
4309 fn poll_next(
4310 mut self: std::pin::Pin<&mut Self>,
4311 cx: &mut std::task::Context<'_>,
4312 ) -> std::task::Poll<Option<Self::Item>> {
4313 let this = &mut *self;
4314 if this.inner.check_shutdown(cx) {
4315 this.is_terminated = true;
4316 return std::task::Poll::Ready(None);
4317 }
4318 if this.is_terminated {
4319 panic!("polled DeviceRouteExtraRequestStream after completion");
4320 }
4321 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4322 |bytes, handles| {
4323 match this.inner.channel().read_etc(cx, bytes, handles) {
4324 std::task::Poll::Ready(Ok(())) => {}
4325 std::task::Poll::Pending => return std::task::Poll::Pending,
4326 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4327 this.is_terminated = true;
4328 return std::task::Poll::Ready(None);
4329 }
4330 std::task::Poll::Ready(Err(e)) => {
4331 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4332 e.into(),
4333 ))))
4334 }
4335 }
4336
4337 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4339
4340 std::task::Poll::Ready(Some(match header.ordinal {
4341 0xf192c43311c811 => {
4342 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4343 let mut req = fidl::new_empty!(
4344 fidl::encoding::EmptyPayload,
4345 fidl::encoding::DefaultFuchsiaResourceDialect
4346 );
4347 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4348 let control_handle =
4349 DeviceRouteExtraControlHandle { inner: this.inner.clone() };
4350 Ok(DeviceRouteExtraRequest::GetLocalOnMeshPrefixes {
4351 responder: DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4352 control_handle: std::mem::ManuallyDrop::new(control_handle),
4353 tx_id: header.tx_id,
4354 },
4355 })
4356 }
4357 0x5a688c2e62c766a6 => {
4358 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4359 let mut req = fidl::new_empty!(
4360 fidl::encoding::EmptyPayload,
4361 fidl::encoding::DefaultFuchsiaResourceDialect
4362 );
4363 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4364 let control_handle =
4365 DeviceRouteExtraControlHandle { inner: this.inner.clone() };
4366 Ok(DeviceRouteExtraRequest::GetLocalExternalRoutes {
4367 responder: DeviceRouteExtraGetLocalExternalRoutesResponder {
4368 control_handle: std::mem::ManuallyDrop::new(control_handle),
4369 tx_id: header.tx_id,
4370 },
4371 })
4372 }
4373 _ => Err(fidl::Error::UnknownOrdinal {
4374 ordinal: header.ordinal,
4375 protocol_name:
4376 <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4377 }),
4378 }))
4379 },
4380 )
4381 }
4382}
4383
4384#[derive(Debug)]
4390pub enum DeviceRouteExtraRequest {
4391 GetLocalOnMeshPrefixes { responder: DeviceRouteExtraGetLocalOnMeshPrefixesResponder },
4396 GetLocalExternalRoutes { responder: DeviceRouteExtraGetLocalExternalRoutesResponder },
4401}
4402
4403impl DeviceRouteExtraRequest {
4404 #[allow(irrefutable_let_patterns)]
4405 pub fn into_get_local_on_mesh_prefixes(
4406 self,
4407 ) -> Option<(DeviceRouteExtraGetLocalOnMeshPrefixesResponder)> {
4408 if let DeviceRouteExtraRequest::GetLocalOnMeshPrefixes { responder } = self {
4409 Some((responder))
4410 } else {
4411 None
4412 }
4413 }
4414
4415 #[allow(irrefutable_let_patterns)]
4416 pub fn into_get_local_external_routes(
4417 self,
4418 ) -> Option<(DeviceRouteExtraGetLocalExternalRoutesResponder)> {
4419 if let DeviceRouteExtraRequest::GetLocalExternalRoutes { responder } = self {
4420 Some((responder))
4421 } else {
4422 None
4423 }
4424 }
4425
4426 pub fn method_name(&self) -> &'static str {
4428 match *self {
4429 DeviceRouteExtraRequest::GetLocalOnMeshPrefixes { .. } => "get_local_on_mesh_prefixes",
4430 DeviceRouteExtraRequest::GetLocalExternalRoutes { .. } => "get_local_external_routes",
4431 }
4432 }
4433}
4434
4435#[derive(Debug, Clone)]
4436pub struct DeviceRouteExtraControlHandle {
4437 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4438}
4439
4440impl fidl::endpoints::ControlHandle for DeviceRouteExtraControlHandle {
4441 fn shutdown(&self) {
4442 self.inner.shutdown()
4443 }
4444 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4445 self.inner.shutdown_with_epitaph(status)
4446 }
4447
4448 fn is_closed(&self) -> bool {
4449 self.inner.channel().is_closed()
4450 }
4451 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4452 self.inner.channel().on_closed()
4453 }
4454
4455 #[cfg(target_os = "fuchsia")]
4456 fn signal_peer(
4457 &self,
4458 clear_mask: zx::Signals,
4459 set_mask: zx::Signals,
4460 ) -> Result<(), zx_status::Status> {
4461 use fidl::Peered;
4462 self.inner.channel().signal_peer(clear_mask, set_mask)
4463 }
4464}
4465
4466impl DeviceRouteExtraControlHandle {}
4467
4468#[must_use = "FIDL methods require a response to be sent"]
4469#[derive(Debug)]
4470pub struct DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4471 control_handle: std::mem::ManuallyDrop<DeviceRouteExtraControlHandle>,
4472 tx_id: u32,
4473}
4474
4475impl std::ops::Drop for DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4479 fn drop(&mut self) {
4480 self.control_handle.shutdown();
4481 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4483 }
4484}
4485
4486impl fidl::endpoints::Responder for DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4487 type ControlHandle = DeviceRouteExtraControlHandle;
4488
4489 fn control_handle(&self) -> &DeviceRouteExtraControlHandle {
4490 &self.control_handle
4491 }
4492
4493 fn drop_without_shutdown(mut self) {
4494 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4496 std::mem::forget(self);
4498 }
4499}
4500
4501impl DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4502 pub fn send(self, mut prefixes: &[OnMeshPrefix]) -> Result<(), fidl::Error> {
4506 let _result = self.send_raw(prefixes);
4507 if _result.is_err() {
4508 self.control_handle.shutdown();
4509 }
4510 self.drop_without_shutdown();
4511 _result
4512 }
4513
4514 pub fn send_no_shutdown_on_err(self, mut prefixes: &[OnMeshPrefix]) -> Result<(), fidl::Error> {
4516 let _result = self.send_raw(prefixes);
4517 self.drop_without_shutdown();
4518 _result
4519 }
4520
4521 fn send_raw(&self, mut prefixes: &[OnMeshPrefix]) -> Result<(), fidl::Error> {
4522 self.control_handle.inner.send::<DeviceRouteExtraGetLocalOnMeshPrefixesResponse>(
4523 (prefixes,),
4524 self.tx_id,
4525 0xf192c43311c811,
4526 fidl::encoding::DynamicFlags::empty(),
4527 )
4528 }
4529}
4530
4531#[must_use = "FIDL methods require a response to be sent"]
4532#[derive(Debug)]
4533pub struct DeviceRouteExtraGetLocalExternalRoutesResponder {
4534 control_handle: std::mem::ManuallyDrop<DeviceRouteExtraControlHandle>,
4535 tx_id: u32,
4536}
4537
4538impl std::ops::Drop for DeviceRouteExtraGetLocalExternalRoutesResponder {
4542 fn drop(&mut self) {
4543 self.control_handle.shutdown();
4544 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4546 }
4547}
4548
4549impl fidl::endpoints::Responder for DeviceRouteExtraGetLocalExternalRoutesResponder {
4550 type ControlHandle = DeviceRouteExtraControlHandle;
4551
4552 fn control_handle(&self) -> &DeviceRouteExtraControlHandle {
4553 &self.control_handle
4554 }
4555
4556 fn drop_without_shutdown(mut self) {
4557 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4559 std::mem::forget(self);
4561 }
4562}
4563
4564impl DeviceRouteExtraGetLocalExternalRoutesResponder {
4565 pub fn send(self, mut external_routes: &[ExternalRoute]) -> Result<(), fidl::Error> {
4569 let _result = self.send_raw(external_routes);
4570 if _result.is_err() {
4571 self.control_handle.shutdown();
4572 }
4573 self.drop_without_shutdown();
4574 _result
4575 }
4576
4577 pub fn send_no_shutdown_on_err(
4579 self,
4580 mut external_routes: &[ExternalRoute],
4581 ) -> Result<(), fidl::Error> {
4582 let _result = self.send_raw(external_routes);
4583 self.drop_without_shutdown();
4584 _result
4585 }
4586
4587 fn send_raw(&self, mut external_routes: &[ExternalRoute]) -> Result<(), fidl::Error> {
4588 self.control_handle.inner.send::<DeviceRouteExtraGetLocalExternalRoutesResponse>(
4589 (external_routes,),
4590 self.tx_id,
4591 0x5a688c2e62c766a6,
4592 fidl::encoding::DynamicFlags::empty(),
4593 )
4594 }
4595}
4596
4597#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4598pub struct DeviceRouteExtraConnectorMarker;
4599
4600impl fidl::endpoints::ProtocolMarker for DeviceRouteExtraConnectorMarker {
4601 type Proxy = DeviceRouteExtraConnectorProxy;
4602 type RequestStream = DeviceRouteExtraConnectorRequestStream;
4603 #[cfg(target_os = "fuchsia")]
4604 type SynchronousProxy = DeviceRouteExtraConnectorSynchronousProxy;
4605
4606 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceRouteExtraConnector";
4607}
4608impl fidl::endpoints::DiscoverableProtocolMarker for DeviceRouteExtraConnectorMarker {}
4609
4610pub trait DeviceRouteExtraConnectorProxyInterface: Send + Sync {
4611 fn r#connect(
4612 &self,
4613 name: &str,
4614 server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4615 ) -> Result<(), fidl::Error>;
4616}
4617#[derive(Debug)]
4618#[cfg(target_os = "fuchsia")]
4619pub struct DeviceRouteExtraConnectorSynchronousProxy {
4620 client: fidl::client::sync::Client,
4621}
4622
4623#[cfg(target_os = "fuchsia")]
4624impl fidl::endpoints::SynchronousProxy for DeviceRouteExtraConnectorSynchronousProxy {
4625 type Proxy = DeviceRouteExtraConnectorProxy;
4626 type Protocol = DeviceRouteExtraConnectorMarker;
4627
4628 fn from_channel(inner: fidl::Channel) -> Self {
4629 Self::new(inner)
4630 }
4631
4632 fn into_channel(self) -> fidl::Channel {
4633 self.client.into_channel()
4634 }
4635
4636 fn as_channel(&self) -> &fidl::Channel {
4637 self.client.as_channel()
4638 }
4639}
4640
4641#[cfg(target_os = "fuchsia")]
4642impl DeviceRouteExtraConnectorSynchronousProxy {
4643 pub fn new(channel: fidl::Channel) -> Self {
4644 let protocol_name =
4645 <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4646 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4647 }
4648
4649 pub fn into_channel(self) -> fidl::Channel {
4650 self.client.into_channel()
4651 }
4652
4653 pub fn wait_for_event(
4656 &self,
4657 deadline: zx::MonotonicInstant,
4658 ) -> Result<DeviceRouteExtraConnectorEvent, fidl::Error> {
4659 DeviceRouteExtraConnectorEvent::decode(self.client.wait_for_event(deadline)?)
4660 }
4661
4662 pub fn r#connect(
4679 &self,
4680 mut name: &str,
4681 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4682 ) -> Result<(), fidl::Error> {
4683 self.client.send::<DeviceRouteExtraConnectorConnectRequest>(
4684 (name, server_end),
4685 0x12f72df7b1348fe2,
4686 fidl::encoding::DynamicFlags::empty(),
4687 )
4688 }
4689}
4690
4691#[cfg(target_os = "fuchsia")]
4692impl From<DeviceRouteExtraConnectorSynchronousProxy> for zx::Handle {
4693 fn from(value: DeviceRouteExtraConnectorSynchronousProxy) -> Self {
4694 value.into_channel().into()
4695 }
4696}
4697
4698#[cfg(target_os = "fuchsia")]
4699impl From<fidl::Channel> for DeviceRouteExtraConnectorSynchronousProxy {
4700 fn from(value: fidl::Channel) -> Self {
4701 Self::new(value)
4702 }
4703}
4704
4705#[derive(Debug, Clone)]
4706pub struct DeviceRouteExtraConnectorProxy {
4707 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4708}
4709
4710impl fidl::endpoints::Proxy for DeviceRouteExtraConnectorProxy {
4711 type Protocol = DeviceRouteExtraConnectorMarker;
4712
4713 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4714 Self::new(inner)
4715 }
4716
4717 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4718 self.client.into_channel().map_err(|client| Self { client })
4719 }
4720
4721 fn as_channel(&self) -> &::fidl::AsyncChannel {
4722 self.client.as_channel()
4723 }
4724}
4725
4726impl DeviceRouteExtraConnectorProxy {
4727 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4729 let protocol_name =
4730 <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4731 Self { client: fidl::client::Client::new(channel, protocol_name) }
4732 }
4733
4734 pub fn take_event_stream(&self) -> DeviceRouteExtraConnectorEventStream {
4740 DeviceRouteExtraConnectorEventStream { event_receiver: self.client.take_event_receiver() }
4741 }
4742
4743 pub fn r#connect(
4760 &self,
4761 mut name: &str,
4762 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4763 ) -> Result<(), fidl::Error> {
4764 DeviceRouteExtraConnectorProxyInterface::r#connect(self, name, server_end)
4765 }
4766}
4767
4768impl DeviceRouteExtraConnectorProxyInterface for DeviceRouteExtraConnectorProxy {
4769 fn r#connect(
4770 &self,
4771 mut name: &str,
4772 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4773 ) -> Result<(), fidl::Error> {
4774 self.client.send::<DeviceRouteExtraConnectorConnectRequest>(
4775 (name, server_end),
4776 0x12f72df7b1348fe2,
4777 fidl::encoding::DynamicFlags::empty(),
4778 )
4779 }
4780}
4781
4782pub struct DeviceRouteExtraConnectorEventStream {
4783 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4784}
4785
4786impl std::marker::Unpin for DeviceRouteExtraConnectorEventStream {}
4787
4788impl futures::stream::FusedStream for DeviceRouteExtraConnectorEventStream {
4789 fn is_terminated(&self) -> bool {
4790 self.event_receiver.is_terminated()
4791 }
4792}
4793
4794impl futures::Stream for DeviceRouteExtraConnectorEventStream {
4795 type Item = Result<DeviceRouteExtraConnectorEvent, fidl::Error>;
4796
4797 fn poll_next(
4798 mut self: std::pin::Pin<&mut Self>,
4799 cx: &mut std::task::Context<'_>,
4800 ) -> std::task::Poll<Option<Self::Item>> {
4801 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4802 &mut self.event_receiver,
4803 cx
4804 )?) {
4805 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteExtraConnectorEvent::decode(buf))),
4806 None => std::task::Poll::Ready(None),
4807 }
4808 }
4809}
4810
4811#[derive(Debug)]
4812pub enum DeviceRouteExtraConnectorEvent {}
4813
4814impl DeviceRouteExtraConnectorEvent {
4815 fn decode(
4817 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4818 ) -> Result<DeviceRouteExtraConnectorEvent, fidl::Error> {
4819 let (bytes, _handles) = buf.split_mut();
4820 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4821 debug_assert_eq!(tx_header.tx_id, 0);
4822 match tx_header.ordinal {
4823 _ => Err(fidl::Error::UnknownOrdinal {
4824 ordinal: tx_header.ordinal,
4825 protocol_name:
4826 <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4827 }),
4828 }
4829 }
4830}
4831
4832pub struct DeviceRouteExtraConnectorRequestStream {
4834 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4835 is_terminated: bool,
4836}
4837
4838impl std::marker::Unpin for DeviceRouteExtraConnectorRequestStream {}
4839
4840impl futures::stream::FusedStream for DeviceRouteExtraConnectorRequestStream {
4841 fn is_terminated(&self) -> bool {
4842 self.is_terminated
4843 }
4844}
4845
4846impl fidl::endpoints::RequestStream for DeviceRouteExtraConnectorRequestStream {
4847 type Protocol = DeviceRouteExtraConnectorMarker;
4848 type ControlHandle = DeviceRouteExtraConnectorControlHandle;
4849
4850 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4851 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4852 }
4853
4854 fn control_handle(&self) -> Self::ControlHandle {
4855 DeviceRouteExtraConnectorControlHandle { inner: self.inner.clone() }
4856 }
4857
4858 fn into_inner(
4859 self,
4860 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4861 {
4862 (self.inner, self.is_terminated)
4863 }
4864
4865 fn from_inner(
4866 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4867 is_terminated: bool,
4868 ) -> Self {
4869 Self { inner, is_terminated }
4870 }
4871}
4872
4873impl futures::Stream for DeviceRouteExtraConnectorRequestStream {
4874 type Item = Result<DeviceRouteExtraConnectorRequest, fidl::Error>;
4875
4876 fn poll_next(
4877 mut self: std::pin::Pin<&mut Self>,
4878 cx: &mut std::task::Context<'_>,
4879 ) -> std::task::Poll<Option<Self::Item>> {
4880 let this = &mut *self;
4881 if this.inner.check_shutdown(cx) {
4882 this.is_terminated = true;
4883 return std::task::Poll::Ready(None);
4884 }
4885 if this.is_terminated {
4886 panic!("polled DeviceRouteExtraConnectorRequestStream after completion");
4887 }
4888 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4889 |bytes, handles| {
4890 match this.inner.channel().read_etc(cx, bytes, handles) {
4891 std::task::Poll::Ready(Ok(())) => {}
4892 std::task::Poll::Pending => return std::task::Poll::Pending,
4893 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4894 this.is_terminated = true;
4895 return std::task::Poll::Ready(None);
4896 }
4897 std::task::Poll::Ready(Err(e)) => {
4898 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4899 e.into(),
4900 ))))
4901 }
4902 }
4903
4904 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4906
4907 std::task::Poll::Ready(Some(match header.ordinal {
4908 0x12f72df7b1348fe2 => {
4909 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4910 let mut req = fidl::new_empty!(DeviceRouteExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4911 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteExtraConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
4912 let control_handle = DeviceRouteExtraConnectorControlHandle {
4913 inner: this.inner.clone(),
4914 };
4915 Ok(DeviceRouteExtraConnectorRequest::Connect {name: req.name,
4916server_end: req.server_end,
4917
4918 control_handle,
4919 })
4920 }
4921 _ => Err(fidl::Error::UnknownOrdinal {
4922 ordinal: header.ordinal,
4923 protocol_name: <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4924 }),
4925 }))
4926 },
4927 )
4928 }
4929}
4930
4931#[derive(Debug)]
4934pub enum DeviceRouteExtraConnectorRequest {
4935 Connect {
4952 name: String,
4953 server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4954 control_handle: DeviceRouteExtraConnectorControlHandle,
4955 },
4956}
4957
4958impl DeviceRouteExtraConnectorRequest {
4959 #[allow(irrefutable_let_patterns)]
4960 pub fn into_connect(
4961 self,
4962 ) -> Option<(
4963 String,
4964 fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4965 DeviceRouteExtraConnectorControlHandle,
4966 )> {
4967 if let DeviceRouteExtraConnectorRequest::Connect { name, server_end, control_handle } = self
4968 {
4969 Some((name, server_end, control_handle))
4970 } else {
4971 None
4972 }
4973 }
4974
4975 pub fn method_name(&self) -> &'static str {
4977 match *self {
4978 DeviceRouteExtraConnectorRequest::Connect { .. } => "connect",
4979 }
4980 }
4981}
4982
4983#[derive(Debug, Clone)]
4984pub struct DeviceRouteExtraConnectorControlHandle {
4985 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4986}
4987
4988impl fidl::endpoints::ControlHandle for DeviceRouteExtraConnectorControlHandle {
4989 fn shutdown(&self) {
4990 self.inner.shutdown()
4991 }
4992 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4993 self.inner.shutdown_with_epitaph(status)
4994 }
4995
4996 fn is_closed(&self) -> bool {
4997 self.inner.channel().is_closed()
4998 }
4999 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5000 self.inner.channel().on_closed()
5001 }
5002
5003 #[cfg(target_os = "fuchsia")]
5004 fn signal_peer(
5005 &self,
5006 clear_mask: zx::Signals,
5007 set_mask: zx::Signals,
5008 ) -> Result<(), zx_status::Status> {
5009 use fidl::Peered;
5010 self.inner.channel().signal_peer(clear_mask, set_mask)
5011 }
5012}
5013
5014impl DeviceRouteExtraConnectorControlHandle {}
5015
5016#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5017pub struct LegacyJoiningMarker;
5018
5019impl fidl::endpoints::ProtocolMarker for LegacyJoiningMarker {
5020 type Proxy = LegacyJoiningProxy;
5021 type RequestStream = LegacyJoiningRequestStream;
5022 #[cfg(target_os = "fuchsia")]
5023 type SynchronousProxy = LegacyJoiningSynchronousProxy;
5024
5025 const DEBUG_NAME: &'static str = "(anonymous) LegacyJoining";
5026}
5027
5028pub trait LegacyJoiningProxyInterface: Send + Sync {
5029 type MakeJoinableResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
5030 fn r#make_joinable(&self, duration: i64, port: u16) -> Self::MakeJoinableResponseFut;
5031}
5032#[derive(Debug)]
5033#[cfg(target_os = "fuchsia")]
5034pub struct LegacyJoiningSynchronousProxy {
5035 client: fidl::client::sync::Client,
5036}
5037
5038#[cfg(target_os = "fuchsia")]
5039impl fidl::endpoints::SynchronousProxy for LegacyJoiningSynchronousProxy {
5040 type Proxy = LegacyJoiningProxy;
5041 type Protocol = LegacyJoiningMarker;
5042
5043 fn from_channel(inner: fidl::Channel) -> Self {
5044 Self::new(inner)
5045 }
5046
5047 fn into_channel(self) -> fidl::Channel {
5048 self.client.into_channel()
5049 }
5050
5051 fn as_channel(&self) -> &fidl::Channel {
5052 self.client.as_channel()
5053 }
5054}
5055
5056#[cfg(target_os = "fuchsia")]
5057impl LegacyJoiningSynchronousProxy {
5058 pub fn new(channel: fidl::Channel) -> Self {
5059 let protocol_name = <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5060 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5061 }
5062
5063 pub fn into_channel(self) -> fidl::Channel {
5064 self.client.into_channel()
5065 }
5066
5067 pub fn wait_for_event(
5070 &self,
5071 deadline: zx::MonotonicInstant,
5072 ) -> Result<LegacyJoiningEvent, fidl::Error> {
5073 LegacyJoiningEvent::decode(self.client.wait_for_event(deadline)?)
5074 }
5075
5076 pub fn r#make_joinable(
5100 &self,
5101 mut duration: i64,
5102 mut port: u16,
5103 ___deadline: zx::MonotonicInstant,
5104 ) -> Result<(), fidl::Error> {
5105 let _response = self
5106 .client
5107 .send_query::<LegacyJoiningMakeJoinableRequest, fidl::encoding::EmptyPayload>(
5108 (duration, port),
5109 0x1739a6ae36d5c5aa,
5110 fidl::encoding::DynamicFlags::empty(),
5111 ___deadline,
5112 )?;
5113 Ok(_response)
5114 }
5115}
5116
5117#[cfg(target_os = "fuchsia")]
5118impl From<LegacyJoiningSynchronousProxy> for zx::Handle {
5119 fn from(value: LegacyJoiningSynchronousProxy) -> Self {
5120 value.into_channel().into()
5121 }
5122}
5123
5124#[cfg(target_os = "fuchsia")]
5125impl From<fidl::Channel> for LegacyJoiningSynchronousProxy {
5126 fn from(value: fidl::Channel) -> Self {
5127 Self::new(value)
5128 }
5129}
5130
5131#[derive(Debug, Clone)]
5132pub struct LegacyJoiningProxy {
5133 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5134}
5135
5136impl fidl::endpoints::Proxy for LegacyJoiningProxy {
5137 type Protocol = LegacyJoiningMarker;
5138
5139 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5140 Self::new(inner)
5141 }
5142
5143 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5144 self.client.into_channel().map_err(|client| Self { client })
5145 }
5146
5147 fn as_channel(&self) -> &::fidl::AsyncChannel {
5148 self.client.as_channel()
5149 }
5150}
5151
5152impl LegacyJoiningProxy {
5153 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5155 let protocol_name = <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5156 Self { client: fidl::client::Client::new(channel, protocol_name) }
5157 }
5158
5159 pub fn take_event_stream(&self) -> LegacyJoiningEventStream {
5165 LegacyJoiningEventStream { event_receiver: self.client.take_event_receiver() }
5166 }
5167
5168 pub fn r#make_joinable(
5192 &self,
5193 mut duration: i64,
5194 mut port: u16,
5195 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5196 LegacyJoiningProxyInterface::r#make_joinable(self, duration, port)
5197 }
5198}
5199
5200impl LegacyJoiningProxyInterface for LegacyJoiningProxy {
5201 type MakeJoinableResponseFut =
5202 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5203 fn r#make_joinable(&self, mut duration: i64, mut port: u16) -> Self::MakeJoinableResponseFut {
5204 fn _decode(
5205 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5206 ) -> Result<(), fidl::Error> {
5207 let _response = fidl::client::decode_transaction_body::<
5208 fidl::encoding::EmptyPayload,
5209 fidl::encoding::DefaultFuchsiaResourceDialect,
5210 0x1739a6ae36d5c5aa,
5211 >(_buf?)?;
5212 Ok(_response)
5213 }
5214 self.client.send_query_and_decode::<LegacyJoiningMakeJoinableRequest, ()>(
5215 (duration, port),
5216 0x1739a6ae36d5c5aa,
5217 fidl::encoding::DynamicFlags::empty(),
5218 _decode,
5219 )
5220 }
5221}
5222
5223pub struct LegacyJoiningEventStream {
5224 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5225}
5226
5227impl std::marker::Unpin for LegacyJoiningEventStream {}
5228
5229impl futures::stream::FusedStream for LegacyJoiningEventStream {
5230 fn is_terminated(&self) -> bool {
5231 self.event_receiver.is_terminated()
5232 }
5233}
5234
5235impl futures::Stream for LegacyJoiningEventStream {
5236 type Item = Result<LegacyJoiningEvent, fidl::Error>;
5237
5238 fn poll_next(
5239 mut self: std::pin::Pin<&mut Self>,
5240 cx: &mut std::task::Context<'_>,
5241 ) -> std::task::Poll<Option<Self::Item>> {
5242 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5243 &mut self.event_receiver,
5244 cx
5245 )?) {
5246 Some(buf) => std::task::Poll::Ready(Some(LegacyJoiningEvent::decode(buf))),
5247 None => std::task::Poll::Ready(None),
5248 }
5249 }
5250}
5251
5252#[derive(Debug)]
5253pub enum LegacyJoiningEvent {}
5254
5255impl LegacyJoiningEvent {
5256 fn decode(
5258 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5259 ) -> Result<LegacyJoiningEvent, fidl::Error> {
5260 let (bytes, _handles) = buf.split_mut();
5261 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5262 debug_assert_eq!(tx_header.tx_id, 0);
5263 match tx_header.ordinal {
5264 _ => Err(fidl::Error::UnknownOrdinal {
5265 ordinal: tx_header.ordinal,
5266 protocol_name: <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5267 }),
5268 }
5269 }
5270}
5271
5272pub struct LegacyJoiningRequestStream {
5274 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5275 is_terminated: bool,
5276}
5277
5278impl std::marker::Unpin for LegacyJoiningRequestStream {}
5279
5280impl futures::stream::FusedStream for LegacyJoiningRequestStream {
5281 fn is_terminated(&self) -> bool {
5282 self.is_terminated
5283 }
5284}
5285
5286impl fidl::endpoints::RequestStream for LegacyJoiningRequestStream {
5287 type Protocol = LegacyJoiningMarker;
5288 type ControlHandle = LegacyJoiningControlHandle;
5289
5290 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5291 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5292 }
5293
5294 fn control_handle(&self) -> Self::ControlHandle {
5295 LegacyJoiningControlHandle { inner: self.inner.clone() }
5296 }
5297
5298 fn into_inner(
5299 self,
5300 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5301 {
5302 (self.inner, self.is_terminated)
5303 }
5304
5305 fn from_inner(
5306 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5307 is_terminated: bool,
5308 ) -> Self {
5309 Self { inner, is_terminated }
5310 }
5311}
5312
5313impl futures::Stream for LegacyJoiningRequestStream {
5314 type Item = Result<LegacyJoiningRequest, fidl::Error>;
5315
5316 fn poll_next(
5317 mut self: std::pin::Pin<&mut Self>,
5318 cx: &mut std::task::Context<'_>,
5319 ) -> std::task::Poll<Option<Self::Item>> {
5320 let this = &mut *self;
5321 if this.inner.check_shutdown(cx) {
5322 this.is_terminated = true;
5323 return std::task::Poll::Ready(None);
5324 }
5325 if this.is_terminated {
5326 panic!("polled LegacyJoiningRequestStream after completion");
5327 }
5328 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5329 |bytes, handles| {
5330 match this.inner.channel().read_etc(cx, bytes, handles) {
5331 std::task::Poll::Ready(Ok(())) => {}
5332 std::task::Poll::Pending => return std::task::Poll::Pending,
5333 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5334 this.is_terminated = true;
5335 return std::task::Poll::Ready(None);
5336 }
5337 std::task::Poll::Ready(Err(e)) => {
5338 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5339 e.into(),
5340 ))))
5341 }
5342 }
5343
5344 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5346
5347 std::task::Poll::Ready(Some(match header.ordinal {
5348 0x1739a6ae36d5c5aa => {
5349 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5350 let mut req = fidl::new_empty!(
5351 LegacyJoiningMakeJoinableRequest,
5352 fidl::encoding::DefaultFuchsiaResourceDialect
5353 );
5354 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LegacyJoiningMakeJoinableRequest>(&header, _body_bytes, handles, &mut req)?;
5355 let control_handle =
5356 LegacyJoiningControlHandle { inner: this.inner.clone() };
5357 Ok(LegacyJoiningRequest::MakeJoinable {
5358 duration: req.duration,
5359 port: req.port,
5360
5361 responder: LegacyJoiningMakeJoinableResponder {
5362 control_handle: std::mem::ManuallyDrop::new(control_handle),
5363 tx_id: header.tx_id,
5364 },
5365 })
5366 }
5367 _ => Err(fidl::Error::UnknownOrdinal {
5368 ordinal: header.ordinal,
5369 protocol_name:
5370 <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5371 }),
5372 }))
5373 },
5374 )
5375 }
5376}
5377
5378#[derive(Debug)]
5383pub enum LegacyJoiningRequest {
5384 MakeJoinable { duration: i64, port: u16, responder: LegacyJoiningMakeJoinableResponder },
5408}
5409
5410impl LegacyJoiningRequest {
5411 #[allow(irrefutable_let_patterns)]
5412 pub fn into_make_joinable(self) -> Option<(i64, u16, LegacyJoiningMakeJoinableResponder)> {
5413 if let LegacyJoiningRequest::MakeJoinable { duration, port, responder } = self {
5414 Some((duration, port, responder))
5415 } else {
5416 None
5417 }
5418 }
5419
5420 pub fn method_name(&self) -> &'static str {
5422 match *self {
5423 LegacyJoiningRequest::MakeJoinable { .. } => "make_joinable",
5424 }
5425 }
5426}
5427
5428#[derive(Debug, Clone)]
5429pub struct LegacyJoiningControlHandle {
5430 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5431}
5432
5433impl fidl::endpoints::ControlHandle for LegacyJoiningControlHandle {
5434 fn shutdown(&self) {
5435 self.inner.shutdown()
5436 }
5437 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5438 self.inner.shutdown_with_epitaph(status)
5439 }
5440
5441 fn is_closed(&self) -> bool {
5442 self.inner.channel().is_closed()
5443 }
5444 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5445 self.inner.channel().on_closed()
5446 }
5447
5448 #[cfg(target_os = "fuchsia")]
5449 fn signal_peer(
5450 &self,
5451 clear_mask: zx::Signals,
5452 set_mask: zx::Signals,
5453 ) -> Result<(), zx_status::Status> {
5454 use fidl::Peered;
5455 self.inner.channel().signal_peer(clear_mask, set_mask)
5456 }
5457}
5458
5459impl LegacyJoiningControlHandle {}
5460
5461#[must_use = "FIDL methods require a response to be sent"]
5462#[derive(Debug)]
5463pub struct LegacyJoiningMakeJoinableResponder {
5464 control_handle: std::mem::ManuallyDrop<LegacyJoiningControlHandle>,
5465 tx_id: u32,
5466}
5467
5468impl std::ops::Drop for LegacyJoiningMakeJoinableResponder {
5472 fn drop(&mut self) {
5473 self.control_handle.shutdown();
5474 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5476 }
5477}
5478
5479impl fidl::endpoints::Responder for LegacyJoiningMakeJoinableResponder {
5480 type ControlHandle = LegacyJoiningControlHandle;
5481
5482 fn control_handle(&self) -> &LegacyJoiningControlHandle {
5483 &self.control_handle
5484 }
5485
5486 fn drop_without_shutdown(mut self) {
5487 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5489 std::mem::forget(self);
5491 }
5492}
5493
5494impl LegacyJoiningMakeJoinableResponder {
5495 pub fn send(self) -> Result<(), fidl::Error> {
5499 let _result = self.send_raw();
5500 if _result.is_err() {
5501 self.control_handle.shutdown();
5502 }
5503 self.drop_without_shutdown();
5504 _result
5505 }
5506
5507 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5509 let _result = self.send_raw();
5510 self.drop_without_shutdown();
5511 _result
5512 }
5513
5514 fn send_raw(&self) -> Result<(), fidl::Error> {
5515 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5516 (),
5517 self.tx_id,
5518 0x1739a6ae36d5c5aa,
5519 fidl::encoding::DynamicFlags::empty(),
5520 )
5521 }
5522}
5523
5524#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5525pub struct LegacyJoiningConnectorMarker;
5526
5527impl fidl::endpoints::ProtocolMarker for LegacyJoiningConnectorMarker {
5528 type Proxy = LegacyJoiningConnectorProxy;
5529 type RequestStream = LegacyJoiningConnectorRequestStream;
5530 #[cfg(target_os = "fuchsia")]
5531 type SynchronousProxy = LegacyJoiningConnectorSynchronousProxy;
5532
5533 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.LegacyJoiningConnector";
5534}
5535impl fidl::endpoints::DiscoverableProtocolMarker for LegacyJoiningConnectorMarker {}
5536
5537pub trait LegacyJoiningConnectorProxyInterface: Send + Sync {
5538 fn r#connect(
5539 &self,
5540 name: &str,
5541 server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5542 ) -> Result<(), fidl::Error>;
5543}
5544#[derive(Debug)]
5545#[cfg(target_os = "fuchsia")]
5546pub struct LegacyJoiningConnectorSynchronousProxy {
5547 client: fidl::client::sync::Client,
5548}
5549
5550#[cfg(target_os = "fuchsia")]
5551impl fidl::endpoints::SynchronousProxy for LegacyJoiningConnectorSynchronousProxy {
5552 type Proxy = LegacyJoiningConnectorProxy;
5553 type Protocol = LegacyJoiningConnectorMarker;
5554
5555 fn from_channel(inner: fidl::Channel) -> Self {
5556 Self::new(inner)
5557 }
5558
5559 fn into_channel(self) -> fidl::Channel {
5560 self.client.into_channel()
5561 }
5562
5563 fn as_channel(&self) -> &fidl::Channel {
5564 self.client.as_channel()
5565 }
5566}
5567
5568#[cfg(target_os = "fuchsia")]
5569impl LegacyJoiningConnectorSynchronousProxy {
5570 pub fn new(channel: fidl::Channel) -> Self {
5571 let protocol_name =
5572 <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5573 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5574 }
5575
5576 pub fn into_channel(self) -> fidl::Channel {
5577 self.client.into_channel()
5578 }
5579
5580 pub fn wait_for_event(
5583 &self,
5584 deadline: zx::MonotonicInstant,
5585 ) -> Result<LegacyJoiningConnectorEvent, fidl::Error> {
5586 LegacyJoiningConnectorEvent::decode(self.client.wait_for_event(deadline)?)
5587 }
5588
5589 pub fn r#connect(
5606 &self,
5607 mut name: &str,
5608 mut server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5609 ) -> Result<(), fidl::Error> {
5610 self.client.send::<LegacyJoiningConnectorConnectRequest>(
5611 (name, server_end),
5612 0x3c8dfeb943bb8d06,
5613 fidl::encoding::DynamicFlags::empty(),
5614 )
5615 }
5616}
5617
5618#[cfg(target_os = "fuchsia")]
5619impl From<LegacyJoiningConnectorSynchronousProxy> for zx::Handle {
5620 fn from(value: LegacyJoiningConnectorSynchronousProxy) -> Self {
5621 value.into_channel().into()
5622 }
5623}
5624
5625#[cfg(target_os = "fuchsia")]
5626impl From<fidl::Channel> for LegacyJoiningConnectorSynchronousProxy {
5627 fn from(value: fidl::Channel) -> Self {
5628 Self::new(value)
5629 }
5630}
5631
5632#[derive(Debug, Clone)]
5633pub struct LegacyJoiningConnectorProxy {
5634 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5635}
5636
5637impl fidl::endpoints::Proxy for LegacyJoiningConnectorProxy {
5638 type Protocol = LegacyJoiningConnectorMarker;
5639
5640 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5641 Self::new(inner)
5642 }
5643
5644 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5645 self.client.into_channel().map_err(|client| Self { client })
5646 }
5647
5648 fn as_channel(&self) -> &::fidl::AsyncChannel {
5649 self.client.as_channel()
5650 }
5651}
5652
5653impl LegacyJoiningConnectorProxy {
5654 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5656 let protocol_name =
5657 <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5658 Self { client: fidl::client::Client::new(channel, protocol_name) }
5659 }
5660
5661 pub fn take_event_stream(&self) -> LegacyJoiningConnectorEventStream {
5667 LegacyJoiningConnectorEventStream { event_receiver: self.client.take_event_receiver() }
5668 }
5669
5670 pub fn r#connect(
5687 &self,
5688 mut name: &str,
5689 mut server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5690 ) -> Result<(), fidl::Error> {
5691 LegacyJoiningConnectorProxyInterface::r#connect(self, name, server_end)
5692 }
5693}
5694
5695impl LegacyJoiningConnectorProxyInterface for LegacyJoiningConnectorProxy {
5696 fn r#connect(
5697 &self,
5698 mut name: &str,
5699 mut server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5700 ) -> Result<(), fidl::Error> {
5701 self.client.send::<LegacyJoiningConnectorConnectRequest>(
5702 (name, server_end),
5703 0x3c8dfeb943bb8d06,
5704 fidl::encoding::DynamicFlags::empty(),
5705 )
5706 }
5707}
5708
5709pub struct LegacyJoiningConnectorEventStream {
5710 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5711}
5712
5713impl std::marker::Unpin for LegacyJoiningConnectorEventStream {}
5714
5715impl futures::stream::FusedStream for LegacyJoiningConnectorEventStream {
5716 fn is_terminated(&self) -> bool {
5717 self.event_receiver.is_terminated()
5718 }
5719}
5720
5721impl futures::Stream for LegacyJoiningConnectorEventStream {
5722 type Item = Result<LegacyJoiningConnectorEvent, fidl::Error>;
5723
5724 fn poll_next(
5725 mut self: std::pin::Pin<&mut Self>,
5726 cx: &mut std::task::Context<'_>,
5727 ) -> std::task::Poll<Option<Self::Item>> {
5728 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5729 &mut self.event_receiver,
5730 cx
5731 )?) {
5732 Some(buf) => std::task::Poll::Ready(Some(LegacyJoiningConnectorEvent::decode(buf))),
5733 None => std::task::Poll::Ready(None),
5734 }
5735 }
5736}
5737
5738#[derive(Debug)]
5739pub enum LegacyJoiningConnectorEvent {}
5740
5741impl LegacyJoiningConnectorEvent {
5742 fn decode(
5744 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5745 ) -> Result<LegacyJoiningConnectorEvent, fidl::Error> {
5746 let (bytes, _handles) = buf.split_mut();
5747 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5748 debug_assert_eq!(tx_header.tx_id, 0);
5749 match tx_header.ordinal {
5750 _ => Err(fidl::Error::UnknownOrdinal {
5751 ordinal: tx_header.ordinal,
5752 protocol_name:
5753 <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5754 }),
5755 }
5756 }
5757}
5758
5759pub struct LegacyJoiningConnectorRequestStream {
5761 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5762 is_terminated: bool,
5763}
5764
5765impl std::marker::Unpin for LegacyJoiningConnectorRequestStream {}
5766
5767impl futures::stream::FusedStream for LegacyJoiningConnectorRequestStream {
5768 fn is_terminated(&self) -> bool {
5769 self.is_terminated
5770 }
5771}
5772
5773impl fidl::endpoints::RequestStream for LegacyJoiningConnectorRequestStream {
5774 type Protocol = LegacyJoiningConnectorMarker;
5775 type ControlHandle = LegacyJoiningConnectorControlHandle;
5776
5777 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5778 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5779 }
5780
5781 fn control_handle(&self) -> Self::ControlHandle {
5782 LegacyJoiningConnectorControlHandle { inner: self.inner.clone() }
5783 }
5784
5785 fn into_inner(
5786 self,
5787 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5788 {
5789 (self.inner, self.is_terminated)
5790 }
5791
5792 fn from_inner(
5793 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5794 is_terminated: bool,
5795 ) -> Self {
5796 Self { inner, is_terminated }
5797 }
5798}
5799
5800impl futures::Stream for LegacyJoiningConnectorRequestStream {
5801 type Item = Result<LegacyJoiningConnectorRequest, fidl::Error>;
5802
5803 fn poll_next(
5804 mut self: std::pin::Pin<&mut Self>,
5805 cx: &mut std::task::Context<'_>,
5806 ) -> std::task::Poll<Option<Self::Item>> {
5807 let this = &mut *self;
5808 if this.inner.check_shutdown(cx) {
5809 this.is_terminated = true;
5810 return std::task::Poll::Ready(None);
5811 }
5812 if this.is_terminated {
5813 panic!("polled LegacyJoiningConnectorRequestStream after completion");
5814 }
5815 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5816 |bytes, handles| {
5817 match this.inner.channel().read_etc(cx, bytes, handles) {
5818 std::task::Poll::Ready(Ok(())) => {}
5819 std::task::Poll::Pending => return std::task::Poll::Pending,
5820 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5821 this.is_terminated = true;
5822 return std::task::Poll::Ready(None);
5823 }
5824 std::task::Poll::Ready(Err(e)) => {
5825 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5826 e.into(),
5827 ))))
5828 }
5829 }
5830
5831 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5833
5834 std::task::Poll::Ready(Some(match header.ordinal {
5835 0x3c8dfeb943bb8d06 => {
5836 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5837 let mut req = fidl::new_empty!(LegacyJoiningConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5838 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LegacyJoiningConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
5839 let control_handle = LegacyJoiningConnectorControlHandle {
5840 inner: this.inner.clone(),
5841 };
5842 Ok(LegacyJoiningConnectorRequest::Connect {name: req.name,
5843server_end: req.server_end,
5844
5845 control_handle,
5846 })
5847 }
5848 _ => Err(fidl::Error::UnknownOrdinal {
5849 ordinal: header.ordinal,
5850 protocol_name: <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5851 }),
5852 }))
5853 },
5854 )
5855 }
5856}
5857
5858#[derive(Debug)]
5861pub enum LegacyJoiningConnectorRequest {
5862 Connect {
5879 name: String,
5880 server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5881 control_handle: LegacyJoiningConnectorControlHandle,
5882 },
5883}
5884
5885impl LegacyJoiningConnectorRequest {
5886 #[allow(irrefutable_let_patterns)]
5887 pub fn into_connect(
5888 self,
5889 ) -> Option<(
5890 String,
5891 fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5892 LegacyJoiningConnectorControlHandle,
5893 )> {
5894 if let LegacyJoiningConnectorRequest::Connect { name, server_end, control_handle } = self {
5895 Some((name, server_end, control_handle))
5896 } else {
5897 None
5898 }
5899 }
5900
5901 pub fn method_name(&self) -> &'static str {
5903 match *self {
5904 LegacyJoiningConnectorRequest::Connect { .. } => "connect",
5905 }
5906 }
5907}
5908
5909#[derive(Debug, Clone)]
5910pub struct LegacyJoiningConnectorControlHandle {
5911 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5912}
5913
5914impl fidl::endpoints::ControlHandle for LegacyJoiningConnectorControlHandle {
5915 fn shutdown(&self) {
5916 self.inner.shutdown()
5917 }
5918 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5919 self.inner.shutdown_with_epitaph(status)
5920 }
5921
5922 fn is_closed(&self) -> bool {
5923 self.inner.channel().is_closed()
5924 }
5925 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5926 self.inner.channel().on_closed()
5927 }
5928
5929 #[cfg(target_os = "fuchsia")]
5930 fn signal_peer(
5931 &self,
5932 clear_mask: zx::Signals,
5933 set_mask: zx::Signals,
5934 ) -> Result<(), zx_status::Status> {
5935 use fidl::Peered;
5936 self.inner.channel().signal_peer(clear_mask, set_mask)
5937 }
5938}
5939
5940impl LegacyJoiningConnectorControlHandle {}
5941
5942#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5943pub struct ProvisioningMonitorMarker;
5944
5945impl fidl::endpoints::ProtocolMarker for ProvisioningMonitorMarker {
5946 type Proxy = ProvisioningMonitorProxy;
5947 type RequestStream = ProvisioningMonitorRequestStream;
5948 #[cfg(target_os = "fuchsia")]
5949 type SynchronousProxy = ProvisioningMonitorSynchronousProxy;
5950
5951 const DEBUG_NAME: &'static str = "(anonymous) ProvisioningMonitor";
5952}
5953pub type ProvisioningMonitorWatchProgressResult = Result<ProvisioningProgress, ProvisionError>;
5954
5955pub trait ProvisioningMonitorProxyInterface: Send + Sync {
5956 type WatchProgressResponseFut: std::future::Future<Output = Result<ProvisioningMonitorWatchProgressResult, fidl::Error>>
5957 + Send;
5958 fn r#watch_progress(&self) -> Self::WatchProgressResponseFut;
5959}
5960#[derive(Debug)]
5961#[cfg(target_os = "fuchsia")]
5962pub struct ProvisioningMonitorSynchronousProxy {
5963 client: fidl::client::sync::Client,
5964}
5965
5966#[cfg(target_os = "fuchsia")]
5967impl fidl::endpoints::SynchronousProxy for ProvisioningMonitorSynchronousProxy {
5968 type Proxy = ProvisioningMonitorProxy;
5969 type Protocol = ProvisioningMonitorMarker;
5970
5971 fn from_channel(inner: fidl::Channel) -> Self {
5972 Self::new(inner)
5973 }
5974
5975 fn into_channel(self) -> fidl::Channel {
5976 self.client.into_channel()
5977 }
5978
5979 fn as_channel(&self) -> &fidl::Channel {
5980 self.client.as_channel()
5981 }
5982}
5983
5984#[cfg(target_os = "fuchsia")]
5985impl ProvisioningMonitorSynchronousProxy {
5986 pub fn new(channel: fidl::Channel) -> Self {
5987 let protocol_name =
5988 <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5989 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5990 }
5991
5992 pub fn into_channel(self) -> fidl::Channel {
5993 self.client.into_channel()
5994 }
5995
5996 pub fn wait_for_event(
5999 &self,
6000 deadline: zx::MonotonicInstant,
6001 ) -> Result<ProvisioningMonitorEvent, fidl::Error> {
6002 ProvisioningMonitorEvent::decode(self.client.wait_for_event(deadline)?)
6003 }
6004
6005 pub fn r#watch_progress(
6018 &self,
6019 ___deadline: zx::MonotonicInstant,
6020 ) -> Result<ProvisioningMonitorWatchProgressResult, fidl::Error> {
6021 let _response =
6022 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
6023 ProvisioningMonitorWatchProgressResponse,
6024 ProvisionError,
6025 >>(
6026 (),
6027 0xc35336fc43ac0c,
6028 fidl::encoding::DynamicFlags::empty(),
6029 ___deadline,
6030 )?;
6031 Ok(_response.map(|x| x.progress))
6032 }
6033}
6034
6035#[cfg(target_os = "fuchsia")]
6036impl From<ProvisioningMonitorSynchronousProxy> for zx::Handle {
6037 fn from(value: ProvisioningMonitorSynchronousProxy) -> Self {
6038 value.into_channel().into()
6039 }
6040}
6041
6042#[cfg(target_os = "fuchsia")]
6043impl From<fidl::Channel> for ProvisioningMonitorSynchronousProxy {
6044 fn from(value: fidl::Channel) -> Self {
6045 Self::new(value)
6046 }
6047}
6048
6049#[derive(Debug, Clone)]
6050pub struct ProvisioningMonitorProxy {
6051 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6052}
6053
6054impl fidl::endpoints::Proxy for ProvisioningMonitorProxy {
6055 type Protocol = ProvisioningMonitorMarker;
6056
6057 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6058 Self::new(inner)
6059 }
6060
6061 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6062 self.client.into_channel().map_err(|client| Self { client })
6063 }
6064
6065 fn as_channel(&self) -> &::fidl::AsyncChannel {
6066 self.client.as_channel()
6067 }
6068}
6069
6070impl ProvisioningMonitorProxy {
6071 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6073 let protocol_name =
6074 <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6075 Self { client: fidl::client::Client::new(channel, protocol_name) }
6076 }
6077
6078 pub fn take_event_stream(&self) -> ProvisioningMonitorEventStream {
6084 ProvisioningMonitorEventStream { event_receiver: self.client.take_event_receiver() }
6085 }
6086
6087 pub fn r#watch_progress(
6100 &self,
6101 ) -> fidl::client::QueryResponseFut<
6102 ProvisioningMonitorWatchProgressResult,
6103 fidl::encoding::DefaultFuchsiaResourceDialect,
6104 > {
6105 ProvisioningMonitorProxyInterface::r#watch_progress(self)
6106 }
6107}
6108
6109impl ProvisioningMonitorProxyInterface for ProvisioningMonitorProxy {
6110 type WatchProgressResponseFut = fidl::client::QueryResponseFut<
6111 ProvisioningMonitorWatchProgressResult,
6112 fidl::encoding::DefaultFuchsiaResourceDialect,
6113 >;
6114 fn r#watch_progress(&self) -> Self::WatchProgressResponseFut {
6115 fn _decode(
6116 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6117 ) -> Result<ProvisioningMonitorWatchProgressResult, fidl::Error> {
6118 let _response = fidl::client::decode_transaction_body::<
6119 fidl::encoding::ResultType<
6120 ProvisioningMonitorWatchProgressResponse,
6121 ProvisionError,
6122 >,
6123 fidl::encoding::DefaultFuchsiaResourceDialect,
6124 0xc35336fc43ac0c,
6125 >(_buf?)?;
6126 Ok(_response.map(|x| x.progress))
6127 }
6128 self.client.send_query_and_decode::<
6129 fidl::encoding::EmptyPayload,
6130 ProvisioningMonitorWatchProgressResult,
6131 >(
6132 (),
6133 0xc35336fc43ac0c,
6134 fidl::encoding::DynamicFlags::empty(),
6135 _decode,
6136 )
6137 }
6138}
6139
6140pub struct ProvisioningMonitorEventStream {
6141 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6142}
6143
6144impl std::marker::Unpin for ProvisioningMonitorEventStream {}
6145
6146impl futures::stream::FusedStream for ProvisioningMonitorEventStream {
6147 fn is_terminated(&self) -> bool {
6148 self.event_receiver.is_terminated()
6149 }
6150}
6151
6152impl futures::Stream for ProvisioningMonitorEventStream {
6153 type Item = Result<ProvisioningMonitorEvent, fidl::Error>;
6154
6155 fn poll_next(
6156 mut self: std::pin::Pin<&mut Self>,
6157 cx: &mut std::task::Context<'_>,
6158 ) -> std::task::Poll<Option<Self::Item>> {
6159 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6160 &mut self.event_receiver,
6161 cx
6162 )?) {
6163 Some(buf) => std::task::Poll::Ready(Some(ProvisioningMonitorEvent::decode(buf))),
6164 None => std::task::Poll::Ready(None),
6165 }
6166 }
6167}
6168
6169#[derive(Debug)]
6170pub enum ProvisioningMonitorEvent {}
6171
6172impl ProvisioningMonitorEvent {
6173 fn decode(
6175 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6176 ) -> Result<ProvisioningMonitorEvent, fidl::Error> {
6177 let (bytes, _handles) = buf.split_mut();
6178 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6179 debug_assert_eq!(tx_header.tx_id, 0);
6180 match tx_header.ordinal {
6181 _ => Err(fidl::Error::UnknownOrdinal {
6182 ordinal: tx_header.ordinal,
6183 protocol_name:
6184 <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6185 }),
6186 }
6187 }
6188}
6189
6190pub struct ProvisioningMonitorRequestStream {
6192 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6193 is_terminated: bool,
6194}
6195
6196impl std::marker::Unpin for ProvisioningMonitorRequestStream {}
6197
6198impl futures::stream::FusedStream for ProvisioningMonitorRequestStream {
6199 fn is_terminated(&self) -> bool {
6200 self.is_terminated
6201 }
6202}
6203
6204impl fidl::endpoints::RequestStream for ProvisioningMonitorRequestStream {
6205 type Protocol = ProvisioningMonitorMarker;
6206 type ControlHandle = ProvisioningMonitorControlHandle;
6207
6208 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6209 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6210 }
6211
6212 fn control_handle(&self) -> Self::ControlHandle {
6213 ProvisioningMonitorControlHandle { inner: self.inner.clone() }
6214 }
6215
6216 fn into_inner(
6217 self,
6218 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6219 {
6220 (self.inner, self.is_terminated)
6221 }
6222
6223 fn from_inner(
6224 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6225 is_terminated: bool,
6226 ) -> Self {
6227 Self { inner, is_terminated }
6228 }
6229}
6230
6231impl futures::Stream for ProvisioningMonitorRequestStream {
6232 type Item = Result<ProvisioningMonitorRequest, fidl::Error>;
6233
6234 fn poll_next(
6235 mut self: std::pin::Pin<&mut Self>,
6236 cx: &mut std::task::Context<'_>,
6237 ) -> std::task::Poll<Option<Self::Item>> {
6238 let this = &mut *self;
6239 if this.inner.check_shutdown(cx) {
6240 this.is_terminated = true;
6241 return std::task::Poll::Ready(None);
6242 }
6243 if this.is_terminated {
6244 panic!("polled ProvisioningMonitorRequestStream after completion");
6245 }
6246 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6247 |bytes, handles| {
6248 match this.inner.channel().read_etc(cx, bytes, handles) {
6249 std::task::Poll::Ready(Ok(())) => {}
6250 std::task::Poll::Pending => return std::task::Poll::Pending,
6251 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6252 this.is_terminated = true;
6253 return std::task::Poll::Ready(None);
6254 }
6255 std::task::Poll::Ready(Err(e)) => {
6256 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6257 e.into(),
6258 ))))
6259 }
6260 }
6261
6262 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6264
6265 std::task::Poll::Ready(Some(match header.ordinal {
6266 0xc35336fc43ac0c => {
6267 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6268 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6269 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6270 let control_handle = ProvisioningMonitorControlHandle {
6271 inner: this.inner.clone(),
6272 };
6273 Ok(ProvisioningMonitorRequest::WatchProgress {
6274 responder: ProvisioningMonitorWatchProgressResponder {
6275 control_handle: std::mem::ManuallyDrop::new(control_handle),
6276 tx_id: header.tx_id,
6277 },
6278 })
6279 }
6280 _ => Err(fidl::Error::UnknownOrdinal {
6281 ordinal: header.ordinal,
6282 protocol_name: <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6283 }),
6284 }))
6285 },
6286 )
6287 }
6288}
6289
6290#[derive(Debug)]
6295pub enum ProvisioningMonitorRequest {
6296 WatchProgress { responder: ProvisioningMonitorWatchProgressResponder },
6309}
6310
6311impl ProvisioningMonitorRequest {
6312 #[allow(irrefutable_let_patterns)]
6313 pub fn into_watch_progress(self) -> Option<(ProvisioningMonitorWatchProgressResponder)> {
6314 if let ProvisioningMonitorRequest::WatchProgress { responder } = self {
6315 Some((responder))
6316 } else {
6317 None
6318 }
6319 }
6320
6321 pub fn method_name(&self) -> &'static str {
6323 match *self {
6324 ProvisioningMonitorRequest::WatchProgress { .. } => "watch_progress",
6325 }
6326 }
6327}
6328
6329#[derive(Debug, Clone)]
6330pub struct ProvisioningMonitorControlHandle {
6331 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6332}
6333
6334impl fidl::endpoints::ControlHandle for ProvisioningMonitorControlHandle {
6335 fn shutdown(&self) {
6336 self.inner.shutdown()
6337 }
6338 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6339 self.inner.shutdown_with_epitaph(status)
6340 }
6341
6342 fn is_closed(&self) -> bool {
6343 self.inner.channel().is_closed()
6344 }
6345 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6346 self.inner.channel().on_closed()
6347 }
6348
6349 #[cfg(target_os = "fuchsia")]
6350 fn signal_peer(
6351 &self,
6352 clear_mask: zx::Signals,
6353 set_mask: zx::Signals,
6354 ) -> Result<(), zx_status::Status> {
6355 use fidl::Peered;
6356 self.inner.channel().signal_peer(clear_mask, set_mask)
6357 }
6358}
6359
6360impl ProvisioningMonitorControlHandle {}
6361
6362#[must_use = "FIDL methods require a response to be sent"]
6363#[derive(Debug)]
6364pub struct ProvisioningMonitorWatchProgressResponder {
6365 control_handle: std::mem::ManuallyDrop<ProvisioningMonitorControlHandle>,
6366 tx_id: u32,
6367}
6368
6369impl std::ops::Drop for ProvisioningMonitorWatchProgressResponder {
6373 fn drop(&mut self) {
6374 self.control_handle.shutdown();
6375 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6377 }
6378}
6379
6380impl fidl::endpoints::Responder for ProvisioningMonitorWatchProgressResponder {
6381 type ControlHandle = ProvisioningMonitorControlHandle;
6382
6383 fn control_handle(&self) -> &ProvisioningMonitorControlHandle {
6384 &self.control_handle
6385 }
6386
6387 fn drop_without_shutdown(mut self) {
6388 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6390 std::mem::forget(self);
6392 }
6393}
6394
6395impl ProvisioningMonitorWatchProgressResponder {
6396 pub fn send(
6400 self,
6401 mut result: Result<&ProvisioningProgress, ProvisionError>,
6402 ) -> Result<(), fidl::Error> {
6403 let _result = self.send_raw(result);
6404 if _result.is_err() {
6405 self.control_handle.shutdown();
6406 }
6407 self.drop_without_shutdown();
6408 _result
6409 }
6410
6411 pub fn send_no_shutdown_on_err(
6413 self,
6414 mut result: Result<&ProvisioningProgress, ProvisionError>,
6415 ) -> Result<(), fidl::Error> {
6416 let _result = self.send_raw(result);
6417 self.drop_without_shutdown();
6418 _result
6419 }
6420
6421 fn send_raw(
6422 &self,
6423 mut result: Result<&ProvisioningProgress, ProvisionError>,
6424 ) -> Result<(), fidl::Error> {
6425 self.control_handle.inner.send::<fidl::encoding::ResultType<
6426 ProvisioningMonitorWatchProgressResponse,
6427 ProvisionError,
6428 >>(
6429 result.map(|progress| (progress,)),
6430 self.tx_id,
6431 0xc35336fc43ac0c,
6432 fidl::encoding::DynamicFlags::empty(),
6433 )
6434 }
6435}
6436
6437#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6438pub struct TelemetryProviderMarker;
6439
6440impl fidl::endpoints::ProtocolMarker for TelemetryProviderMarker {
6441 type Proxy = TelemetryProviderProxy;
6442 type RequestStream = TelemetryProviderRequestStream;
6443 #[cfg(target_os = "fuchsia")]
6444 type SynchronousProxy = TelemetryProviderSynchronousProxy;
6445
6446 const DEBUG_NAME: &'static str = "(anonymous) TelemetryProvider";
6447}
6448
6449pub trait TelemetryProviderProxyInterface: Send + Sync {
6450 type GetTelemetryResponseFut: std::future::Future<Output = Result<Telemetry, fidl::Error>>
6451 + Send;
6452 fn r#get_telemetry(&self) -> Self::GetTelemetryResponseFut;
6453}
6454#[derive(Debug)]
6455#[cfg(target_os = "fuchsia")]
6456pub struct TelemetryProviderSynchronousProxy {
6457 client: fidl::client::sync::Client,
6458}
6459
6460#[cfg(target_os = "fuchsia")]
6461impl fidl::endpoints::SynchronousProxy for TelemetryProviderSynchronousProxy {
6462 type Proxy = TelemetryProviderProxy;
6463 type Protocol = TelemetryProviderMarker;
6464
6465 fn from_channel(inner: fidl::Channel) -> Self {
6466 Self::new(inner)
6467 }
6468
6469 fn into_channel(self) -> fidl::Channel {
6470 self.client.into_channel()
6471 }
6472
6473 fn as_channel(&self) -> &fidl::Channel {
6474 self.client.as_channel()
6475 }
6476}
6477
6478#[cfg(target_os = "fuchsia")]
6479impl TelemetryProviderSynchronousProxy {
6480 pub fn new(channel: fidl::Channel) -> Self {
6481 let protocol_name =
6482 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6483 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6484 }
6485
6486 pub fn into_channel(self) -> fidl::Channel {
6487 self.client.into_channel()
6488 }
6489
6490 pub fn wait_for_event(
6493 &self,
6494 deadline: zx::MonotonicInstant,
6495 ) -> Result<TelemetryProviderEvent, fidl::Error> {
6496 TelemetryProviderEvent::decode(self.client.wait_for_event(deadline)?)
6497 }
6498
6499 pub fn r#get_telemetry(
6501 &self,
6502 ___deadline: zx::MonotonicInstant,
6503 ) -> Result<Telemetry, fidl::Error> {
6504 let _response = self
6505 .client
6506 .send_query::<fidl::encoding::EmptyPayload, TelemetryProviderGetTelemetryResponse>(
6507 (),
6508 0xc34f2fff7dacc41,
6509 fidl::encoding::DynamicFlags::empty(),
6510 ___deadline,
6511 )?;
6512 Ok(_response.telemetry)
6513 }
6514}
6515
6516#[cfg(target_os = "fuchsia")]
6517impl From<TelemetryProviderSynchronousProxy> for zx::Handle {
6518 fn from(value: TelemetryProviderSynchronousProxy) -> Self {
6519 value.into_channel().into()
6520 }
6521}
6522
6523#[cfg(target_os = "fuchsia")]
6524impl From<fidl::Channel> for TelemetryProviderSynchronousProxy {
6525 fn from(value: fidl::Channel) -> Self {
6526 Self::new(value)
6527 }
6528}
6529
6530#[derive(Debug, Clone)]
6531pub struct TelemetryProviderProxy {
6532 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6533}
6534
6535impl fidl::endpoints::Proxy for TelemetryProviderProxy {
6536 type Protocol = TelemetryProviderMarker;
6537
6538 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6539 Self::new(inner)
6540 }
6541
6542 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6543 self.client.into_channel().map_err(|client| Self { client })
6544 }
6545
6546 fn as_channel(&self) -> &::fidl::AsyncChannel {
6547 self.client.as_channel()
6548 }
6549}
6550
6551impl TelemetryProviderProxy {
6552 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6554 let protocol_name =
6555 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6556 Self { client: fidl::client::Client::new(channel, protocol_name) }
6557 }
6558
6559 pub fn take_event_stream(&self) -> TelemetryProviderEventStream {
6565 TelemetryProviderEventStream { event_receiver: self.client.take_event_receiver() }
6566 }
6567
6568 pub fn r#get_telemetry(
6570 &self,
6571 ) -> fidl::client::QueryResponseFut<Telemetry, fidl::encoding::DefaultFuchsiaResourceDialect>
6572 {
6573 TelemetryProviderProxyInterface::r#get_telemetry(self)
6574 }
6575}
6576
6577impl TelemetryProviderProxyInterface for TelemetryProviderProxy {
6578 type GetTelemetryResponseFut =
6579 fidl::client::QueryResponseFut<Telemetry, fidl::encoding::DefaultFuchsiaResourceDialect>;
6580 fn r#get_telemetry(&self) -> Self::GetTelemetryResponseFut {
6581 fn _decode(
6582 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6583 ) -> Result<Telemetry, fidl::Error> {
6584 let _response = fidl::client::decode_transaction_body::<
6585 TelemetryProviderGetTelemetryResponse,
6586 fidl::encoding::DefaultFuchsiaResourceDialect,
6587 0xc34f2fff7dacc41,
6588 >(_buf?)?;
6589 Ok(_response.telemetry)
6590 }
6591 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Telemetry>(
6592 (),
6593 0xc34f2fff7dacc41,
6594 fidl::encoding::DynamicFlags::empty(),
6595 _decode,
6596 )
6597 }
6598}
6599
6600pub struct TelemetryProviderEventStream {
6601 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6602}
6603
6604impl std::marker::Unpin for TelemetryProviderEventStream {}
6605
6606impl futures::stream::FusedStream for TelemetryProviderEventStream {
6607 fn is_terminated(&self) -> bool {
6608 self.event_receiver.is_terminated()
6609 }
6610}
6611
6612impl futures::Stream for TelemetryProviderEventStream {
6613 type Item = Result<TelemetryProviderEvent, fidl::Error>;
6614
6615 fn poll_next(
6616 mut self: std::pin::Pin<&mut Self>,
6617 cx: &mut std::task::Context<'_>,
6618 ) -> std::task::Poll<Option<Self::Item>> {
6619 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6620 &mut self.event_receiver,
6621 cx
6622 )?) {
6623 Some(buf) => std::task::Poll::Ready(Some(TelemetryProviderEvent::decode(buf))),
6624 None => std::task::Poll::Ready(None),
6625 }
6626 }
6627}
6628
6629#[derive(Debug)]
6630pub enum TelemetryProviderEvent {}
6631
6632impl TelemetryProviderEvent {
6633 fn decode(
6635 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6636 ) -> Result<TelemetryProviderEvent, fidl::Error> {
6637 let (bytes, _handles) = buf.split_mut();
6638 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6639 debug_assert_eq!(tx_header.tx_id, 0);
6640 match tx_header.ordinal {
6641 _ => Err(fidl::Error::UnknownOrdinal {
6642 ordinal: tx_header.ordinal,
6643 protocol_name:
6644 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6645 }),
6646 }
6647 }
6648}
6649
6650pub struct TelemetryProviderRequestStream {
6652 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6653 is_terminated: bool,
6654}
6655
6656impl std::marker::Unpin for TelemetryProviderRequestStream {}
6657
6658impl futures::stream::FusedStream for TelemetryProviderRequestStream {
6659 fn is_terminated(&self) -> bool {
6660 self.is_terminated
6661 }
6662}
6663
6664impl fidl::endpoints::RequestStream for TelemetryProviderRequestStream {
6665 type Protocol = TelemetryProviderMarker;
6666 type ControlHandle = TelemetryProviderControlHandle;
6667
6668 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6669 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6670 }
6671
6672 fn control_handle(&self) -> Self::ControlHandle {
6673 TelemetryProviderControlHandle { inner: self.inner.clone() }
6674 }
6675
6676 fn into_inner(
6677 self,
6678 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6679 {
6680 (self.inner, self.is_terminated)
6681 }
6682
6683 fn from_inner(
6684 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6685 is_terminated: bool,
6686 ) -> Self {
6687 Self { inner, is_terminated }
6688 }
6689}
6690
6691impl futures::Stream for TelemetryProviderRequestStream {
6692 type Item = Result<TelemetryProviderRequest, fidl::Error>;
6693
6694 fn poll_next(
6695 mut self: std::pin::Pin<&mut Self>,
6696 cx: &mut std::task::Context<'_>,
6697 ) -> std::task::Poll<Option<Self::Item>> {
6698 let this = &mut *self;
6699 if this.inner.check_shutdown(cx) {
6700 this.is_terminated = true;
6701 return std::task::Poll::Ready(None);
6702 }
6703 if this.is_terminated {
6704 panic!("polled TelemetryProviderRequestStream after completion");
6705 }
6706 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6707 |bytes, handles| {
6708 match this.inner.channel().read_etc(cx, bytes, handles) {
6709 std::task::Poll::Ready(Ok(())) => {}
6710 std::task::Poll::Pending => return std::task::Poll::Pending,
6711 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6712 this.is_terminated = true;
6713 return std::task::Poll::Ready(None);
6714 }
6715 std::task::Poll::Ready(Err(e)) => {
6716 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6717 e.into(),
6718 ))))
6719 }
6720 }
6721
6722 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6724
6725 std::task::Poll::Ready(Some(match header.ordinal {
6726 0xc34f2fff7dacc41 => {
6727 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6728 let mut req = fidl::new_empty!(
6729 fidl::encoding::EmptyPayload,
6730 fidl::encoding::DefaultFuchsiaResourceDialect
6731 );
6732 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6733 let control_handle =
6734 TelemetryProviderControlHandle { inner: this.inner.clone() };
6735 Ok(TelemetryProviderRequest::GetTelemetry {
6736 responder: TelemetryProviderGetTelemetryResponder {
6737 control_handle: std::mem::ManuallyDrop::new(control_handle),
6738 tx_id: header.tx_id,
6739 },
6740 })
6741 }
6742 _ => Err(fidl::Error::UnknownOrdinal {
6743 ordinal: header.ordinal,
6744 protocol_name:
6745 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6746 }),
6747 }))
6748 },
6749 )
6750 }
6751}
6752
6753#[derive(Debug)]
6755pub enum TelemetryProviderRequest {
6756 GetTelemetry { responder: TelemetryProviderGetTelemetryResponder },
6758}
6759
6760impl TelemetryProviderRequest {
6761 #[allow(irrefutable_let_patterns)]
6762 pub fn into_get_telemetry(self) -> Option<(TelemetryProviderGetTelemetryResponder)> {
6763 if let TelemetryProviderRequest::GetTelemetry { responder } = self {
6764 Some((responder))
6765 } else {
6766 None
6767 }
6768 }
6769
6770 pub fn method_name(&self) -> &'static str {
6772 match *self {
6773 TelemetryProviderRequest::GetTelemetry { .. } => "get_telemetry",
6774 }
6775 }
6776}
6777
6778#[derive(Debug, Clone)]
6779pub struct TelemetryProviderControlHandle {
6780 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6781}
6782
6783impl fidl::endpoints::ControlHandle for TelemetryProviderControlHandle {
6784 fn shutdown(&self) {
6785 self.inner.shutdown()
6786 }
6787 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6788 self.inner.shutdown_with_epitaph(status)
6789 }
6790
6791 fn is_closed(&self) -> bool {
6792 self.inner.channel().is_closed()
6793 }
6794 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6795 self.inner.channel().on_closed()
6796 }
6797
6798 #[cfg(target_os = "fuchsia")]
6799 fn signal_peer(
6800 &self,
6801 clear_mask: zx::Signals,
6802 set_mask: zx::Signals,
6803 ) -> Result<(), zx_status::Status> {
6804 use fidl::Peered;
6805 self.inner.channel().signal_peer(clear_mask, set_mask)
6806 }
6807}
6808
6809impl TelemetryProviderControlHandle {}
6810
6811#[must_use = "FIDL methods require a response to be sent"]
6812#[derive(Debug)]
6813pub struct TelemetryProviderGetTelemetryResponder {
6814 control_handle: std::mem::ManuallyDrop<TelemetryProviderControlHandle>,
6815 tx_id: u32,
6816}
6817
6818impl std::ops::Drop for TelemetryProviderGetTelemetryResponder {
6822 fn drop(&mut self) {
6823 self.control_handle.shutdown();
6824 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6826 }
6827}
6828
6829impl fidl::endpoints::Responder for TelemetryProviderGetTelemetryResponder {
6830 type ControlHandle = TelemetryProviderControlHandle;
6831
6832 fn control_handle(&self) -> &TelemetryProviderControlHandle {
6833 &self.control_handle
6834 }
6835
6836 fn drop_without_shutdown(mut self) {
6837 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6839 std::mem::forget(self);
6841 }
6842}
6843
6844impl TelemetryProviderGetTelemetryResponder {
6845 pub fn send(self, mut telemetry: &Telemetry) -> Result<(), fidl::Error> {
6849 let _result = self.send_raw(telemetry);
6850 if _result.is_err() {
6851 self.control_handle.shutdown();
6852 }
6853 self.drop_without_shutdown();
6854 _result
6855 }
6856
6857 pub fn send_no_shutdown_on_err(self, mut telemetry: &Telemetry) -> Result<(), fidl::Error> {
6859 let _result = self.send_raw(telemetry);
6860 self.drop_without_shutdown();
6861 _result
6862 }
6863
6864 fn send_raw(&self, mut telemetry: &Telemetry) -> Result<(), fidl::Error> {
6865 self.control_handle.inner.send::<TelemetryProviderGetTelemetryResponse>(
6866 (telemetry,),
6867 self.tx_id,
6868 0xc34f2fff7dacc41,
6869 fidl::encoding::DynamicFlags::empty(),
6870 )
6871 }
6872}
6873
6874#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6875pub struct TelemetryProviderConnectorMarker;
6876
6877impl fidl::endpoints::ProtocolMarker for TelemetryProviderConnectorMarker {
6878 type Proxy = TelemetryProviderConnectorProxy;
6879 type RequestStream = TelemetryProviderConnectorRequestStream;
6880 #[cfg(target_os = "fuchsia")]
6881 type SynchronousProxy = TelemetryProviderConnectorSynchronousProxy;
6882
6883 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.TelemetryProviderConnector";
6884}
6885impl fidl::endpoints::DiscoverableProtocolMarker for TelemetryProviderConnectorMarker {}
6886
6887pub trait TelemetryProviderConnectorProxyInterface: Send + Sync {
6888 fn r#connect(
6889 &self,
6890 name: &str,
6891 server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
6892 ) -> Result<(), fidl::Error>;
6893}
6894#[derive(Debug)]
6895#[cfg(target_os = "fuchsia")]
6896pub struct TelemetryProviderConnectorSynchronousProxy {
6897 client: fidl::client::sync::Client,
6898}
6899
6900#[cfg(target_os = "fuchsia")]
6901impl fidl::endpoints::SynchronousProxy for TelemetryProviderConnectorSynchronousProxy {
6902 type Proxy = TelemetryProviderConnectorProxy;
6903 type Protocol = TelemetryProviderConnectorMarker;
6904
6905 fn from_channel(inner: fidl::Channel) -> Self {
6906 Self::new(inner)
6907 }
6908
6909 fn into_channel(self) -> fidl::Channel {
6910 self.client.into_channel()
6911 }
6912
6913 fn as_channel(&self) -> &fidl::Channel {
6914 self.client.as_channel()
6915 }
6916}
6917
6918#[cfg(target_os = "fuchsia")]
6919impl TelemetryProviderConnectorSynchronousProxy {
6920 pub fn new(channel: fidl::Channel) -> Self {
6921 let protocol_name =
6922 <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6923 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6924 }
6925
6926 pub fn into_channel(self) -> fidl::Channel {
6927 self.client.into_channel()
6928 }
6929
6930 pub fn wait_for_event(
6933 &self,
6934 deadline: zx::MonotonicInstant,
6935 ) -> Result<TelemetryProviderConnectorEvent, fidl::Error> {
6936 TelemetryProviderConnectorEvent::decode(self.client.wait_for_event(deadline)?)
6937 }
6938
6939 pub fn r#connect(
6951 &self,
6952 mut name: &str,
6953 mut server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
6954 ) -> Result<(), fidl::Error> {
6955 self.client.send::<TelemetryProviderConnectorConnectRequest>(
6956 (name, server_end),
6957 0x24a5bf1be73e2fad,
6958 fidl::encoding::DynamicFlags::empty(),
6959 )
6960 }
6961}
6962
6963#[cfg(target_os = "fuchsia")]
6964impl From<TelemetryProviderConnectorSynchronousProxy> for zx::Handle {
6965 fn from(value: TelemetryProviderConnectorSynchronousProxy) -> Self {
6966 value.into_channel().into()
6967 }
6968}
6969
6970#[cfg(target_os = "fuchsia")]
6971impl From<fidl::Channel> for TelemetryProviderConnectorSynchronousProxy {
6972 fn from(value: fidl::Channel) -> Self {
6973 Self::new(value)
6974 }
6975}
6976
6977#[derive(Debug, Clone)]
6978pub struct TelemetryProviderConnectorProxy {
6979 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6980}
6981
6982impl fidl::endpoints::Proxy for TelemetryProviderConnectorProxy {
6983 type Protocol = TelemetryProviderConnectorMarker;
6984
6985 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6986 Self::new(inner)
6987 }
6988
6989 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6990 self.client.into_channel().map_err(|client| Self { client })
6991 }
6992
6993 fn as_channel(&self) -> &::fidl::AsyncChannel {
6994 self.client.as_channel()
6995 }
6996}
6997
6998impl TelemetryProviderConnectorProxy {
6999 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7001 let protocol_name =
7002 <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7003 Self { client: fidl::client::Client::new(channel, protocol_name) }
7004 }
7005
7006 pub fn take_event_stream(&self) -> TelemetryProviderConnectorEventStream {
7012 TelemetryProviderConnectorEventStream { event_receiver: self.client.take_event_receiver() }
7013 }
7014
7015 pub fn r#connect(
7027 &self,
7028 mut name: &str,
7029 mut server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7030 ) -> Result<(), fidl::Error> {
7031 TelemetryProviderConnectorProxyInterface::r#connect(self, name, server_end)
7032 }
7033}
7034
7035impl TelemetryProviderConnectorProxyInterface for TelemetryProviderConnectorProxy {
7036 fn r#connect(
7037 &self,
7038 mut name: &str,
7039 mut server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7040 ) -> Result<(), fidl::Error> {
7041 self.client.send::<TelemetryProviderConnectorConnectRequest>(
7042 (name, server_end),
7043 0x24a5bf1be73e2fad,
7044 fidl::encoding::DynamicFlags::empty(),
7045 )
7046 }
7047}
7048
7049pub struct TelemetryProviderConnectorEventStream {
7050 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7051}
7052
7053impl std::marker::Unpin for TelemetryProviderConnectorEventStream {}
7054
7055impl futures::stream::FusedStream for TelemetryProviderConnectorEventStream {
7056 fn is_terminated(&self) -> bool {
7057 self.event_receiver.is_terminated()
7058 }
7059}
7060
7061impl futures::Stream for TelemetryProviderConnectorEventStream {
7062 type Item = Result<TelemetryProviderConnectorEvent, fidl::Error>;
7063
7064 fn poll_next(
7065 mut self: std::pin::Pin<&mut Self>,
7066 cx: &mut std::task::Context<'_>,
7067 ) -> std::task::Poll<Option<Self::Item>> {
7068 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7069 &mut self.event_receiver,
7070 cx
7071 )?) {
7072 Some(buf) => std::task::Poll::Ready(Some(TelemetryProviderConnectorEvent::decode(buf))),
7073 None => std::task::Poll::Ready(None),
7074 }
7075 }
7076}
7077
7078#[derive(Debug)]
7079pub enum TelemetryProviderConnectorEvent {}
7080
7081impl TelemetryProviderConnectorEvent {
7082 fn decode(
7084 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7085 ) -> Result<TelemetryProviderConnectorEvent, fidl::Error> {
7086 let (bytes, _handles) = buf.split_mut();
7087 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7088 debug_assert_eq!(tx_header.tx_id, 0);
7089 match tx_header.ordinal {
7090 _ => Err(fidl::Error::UnknownOrdinal {
7091 ordinal: tx_header.ordinal,
7092 protocol_name: <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7093 })
7094 }
7095 }
7096}
7097
7098pub struct TelemetryProviderConnectorRequestStream {
7100 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7101 is_terminated: bool,
7102}
7103
7104impl std::marker::Unpin for TelemetryProviderConnectorRequestStream {}
7105
7106impl futures::stream::FusedStream for TelemetryProviderConnectorRequestStream {
7107 fn is_terminated(&self) -> bool {
7108 self.is_terminated
7109 }
7110}
7111
7112impl fidl::endpoints::RequestStream for TelemetryProviderConnectorRequestStream {
7113 type Protocol = TelemetryProviderConnectorMarker;
7114 type ControlHandle = TelemetryProviderConnectorControlHandle;
7115
7116 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7117 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7118 }
7119
7120 fn control_handle(&self) -> Self::ControlHandle {
7121 TelemetryProviderConnectorControlHandle { inner: self.inner.clone() }
7122 }
7123
7124 fn into_inner(
7125 self,
7126 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7127 {
7128 (self.inner, self.is_terminated)
7129 }
7130
7131 fn from_inner(
7132 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7133 is_terminated: bool,
7134 ) -> Self {
7135 Self { inner, is_terminated }
7136 }
7137}
7138
7139impl futures::Stream for TelemetryProviderConnectorRequestStream {
7140 type Item = Result<TelemetryProviderConnectorRequest, fidl::Error>;
7141
7142 fn poll_next(
7143 mut self: std::pin::Pin<&mut Self>,
7144 cx: &mut std::task::Context<'_>,
7145 ) -> std::task::Poll<Option<Self::Item>> {
7146 let this = &mut *self;
7147 if this.inner.check_shutdown(cx) {
7148 this.is_terminated = true;
7149 return std::task::Poll::Ready(None);
7150 }
7151 if this.is_terminated {
7152 panic!("polled TelemetryProviderConnectorRequestStream after completion");
7153 }
7154 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7155 |bytes, handles| {
7156 match this.inner.channel().read_etc(cx, bytes, handles) {
7157 std::task::Poll::Ready(Ok(())) => {}
7158 std::task::Poll::Pending => return std::task::Poll::Pending,
7159 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7160 this.is_terminated = true;
7161 return std::task::Poll::Ready(None);
7162 }
7163 std::task::Poll::Ready(Err(e)) => {
7164 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7165 e.into(),
7166 ))))
7167 }
7168 }
7169
7170 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7172
7173 std::task::Poll::Ready(Some(match header.ordinal {
7174 0x24a5bf1be73e2fad => {
7175 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7176 let mut req = fidl::new_empty!(TelemetryProviderConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7177 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TelemetryProviderConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
7178 let control_handle = TelemetryProviderConnectorControlHandle {
7179 inner: this.inner.clone(),
7180 };
7181 Ok(TelemetryProviderConnectorRequest::Connect {name: req.name,
7182server_end: req.server_end,
7183
7184 control_handle,
7185 })
7186 }
7187 _ => Err(fidl::Error::UnknownOrdinal {
7188 ordinal: header.ordinal,
7189 protocol_name: <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7190 }),
7191 }))
7192 },
7193 )
7194 }
7195}
7196
7197#[derive(Debug)]
7199pub enum TelemetryProviderConnectorRequest {
7200 Connect {
7212 name: String,
7213 server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7214 control_handle: TelemetryProviderConnectorControlHandle,
7215 },
7216}
7217
7218impl TelemetryProviderConnectorRequest {
7219 #[allow(irrefutable_let_patterns)]
7220 pub fn into_connect(
7221 self,
7222 ) -> Option<(
7223 String,
7224 fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7225 TelemetryProviderConnectorControlHandle,
7226 )> {
7227 if let TelemetryProviderConnectorRequest::Connect { name, server_end, control_handle } =
7228 self
7229 {
7230 Some((name, server_end, control_handle))
7231 } else {
7232 None
7233 }
7234 }
7235
7236 pub fn method_name(&self) -> &'static str {
7238 match *self {
7239 TelemetryProviderConnectorRequest::Connect { .. } => "connect",
7240 }
7241 }
7242}
7243
7244#[derive(Debug, Clone)]
7245pub struct TelemetryProviderConnectorControlHandle {
7246 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7247}
7248
7249impl fidl::endpoints::ControlHandle for TelemetryProviderConnectorControlHandle {
7250 fn shutdown(&self) {
7251 self.inner.shutdown()
7252 }
7253 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7254 self.inner.shutdown_with_epitaph(status)
7255 }
7256
7257 fn is_closed(&self) -> bool {
7258 self.inner.channel().is_closed()
7259 }
7260 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7261 self.inner.channel().on_closed()
7262 }
7263
7264 #[cfg(target_os = "fuchsia")]
7265 fn signal_peer(
7266 &self,
7267 clear_mask: zx::Signals,
7268 set_mask: zx::Signals,
7269 ) -> Result<(), zx_status::Status> {
7270 use fidl::Peered;
7271 self.inner.channel().signal_peer(clear_mask, set_mask)
7272 }
7273}
7274
7275impl TelemetryProviderConnectorControlHandle {}
7276
7277mod internal {
7278 use super::*;
7279
7280 impl fidl::encoding::ResourceTypeMarker for DeviceConnectorConnectRequest {
7281 type Borrowed<'a> = &'a mut Self;
7282 fn take_or_borrow<'a>(
7283 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7284 ) -> Self::Borrowed<'a> {
7285 value
7286 }
7287 }
7288
7289 unsafe impl fidl::encoding::TypeMarker for DeviceConnectorConnectRequest {
7290 type Owned = Self;
7291
7292 #[inline(always)]
7293 fn inline_align(_context: fidl::encoding::Context) -> usize {
7294 8
7295 }
7296
7297 #[inline(always)]
7298 fn inline_size(_context: fidl::encoding::Context) -> usize {
7299 24
7300 }
7301 }
7302
7303 unsafe impl
7304 fidl::encoding::Encode<
7305 DeviceConnectorConnectRequest,
7306 fidl::encoding::DefaultFuchsiaResourceDialect,
7307 > for &mut DeviceConnectorConnectRequest
7308 {
7309 #[inline]
7310 unsafe fn encode(
7311 self,
7312 encoder: &mut fidl::encoding::Encoder<
7313 '_,
7314 fidl::encoding::DefaultFuchsiaResourceDialect,
7315 >,
7316 offset: usize,
7317 _depth: fidl::encoding::Depth,
7318 ) -> fidl::Result<()> {
7319 encoder.debug_check_bounds::<DeviceConnectorConnectRequest>(offset);
7320 fidl::encoding::Encode::<DeviceConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7322 (
7323 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
7324 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
7325 ),
7326 encoder, offset, _depth
7327 )
7328 }
7329 }
7330 unsafe impl<
7331 T0: fidl::encoding::Encode<
7332 fidl::encoding::BoundedString<32>,
7333 fidl::encoding::DefaultFuchsiaResourceDialect,
7334 >,
7335 T1: fidl::encoding::Encode<
7336 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
7337 fidl::encoding::DefaultFuchsiaResourceDialect,
7338 >,
7339 >
7340 fidl::encoding::Encode<
7341 DeviceConnectorConnectRequest,
7342 fidl::encoding::DefaultFuchsiaResourceDialect,
7343 > for (T0, T1)
7344 {
7345 #[inline]
7346 unsafe fn encode(
7347 self,
7348 encoder: &mut fidl::encoding::Encoder<
7349 '_,
7350 fidl::encoding::DefaultFuchsiaResourceDialect,
7351 >,
7352 offset: usize,
7353 depth: fidl::encoding::Depth,
7354 ) -> fidl::Result<()> {
7355 encoder.debug_check_bounds::<DeviceConnectorConnectRequest>(offset);
7356 unsafe {
7359 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7360 (ptr as *mut u64).write_unaligned(0);
7361 }
7362 self.0.encode(encoder, offset + 0, depth)?;
7364 self.1.encode(encoder, offset + 16, depth)?;
7365 Ok(())
7366 }
7367 }
7368
7369 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7370 for DeviceConnectorConnectRequest
7371 {
7372 #[inline(always)]
7373 fn new_empty() -> Self {
7374 Self {
7375 name: fidl::new_empty!(
7376 fidl::encoding::BoundedString<32>,
7377 fidl::encoding::DefaultFuchsiaResourceDialect
7378 ),
7379 server_end: fidl::new_empty!(
7380 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
7381 fidl::encoding::DefaultFuchsiaResourceDialect
7382 ),
7383 }
7384 }
7385
7386 #[inline]
7387 unsafe fn decode(
7388 &mut self,
7389 decoder: &mut fidl::encoding::Decoder<
7390 '_,
7391 fidl::encoding::DefaultFuchsiaResourceDialect,
7392 >,
7393 offset: usize,
7394 _depth: fidl::encoding::Depth,
7395 ) -> fidl::Result<()> {
7396 decoder.debug_check_bounds::<Self>(offset);
7397 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7399 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7400 let mask = 0xffffffff00000000u64;
7401 let maskedval = padval & mask;
7402 if maskedval != 0 {
7403 return Err(fidl::Error::NonZeroPadding {
7404 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7405 });
7406 }
7407 fidl::decode!(
7408 fidl::encoding::BoundedString<32>,
7409 fidl::encoding::DefaultFuchsiaResourceDialect,
7410 &mut self.name,
7411 decoder,
7412 offset + 0,
7413 _depth
7414 )?;
7415 fidl::decode!(
7416 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
7417 fidl::encoding::DefaultFuchsiaResourceDialect,
7418 &mut self.server_end,
7419 decoder,
7420 offset + 16,
7421 _depth
7422 )?;
7423 Ok(())
7424 }
7425 }
7426
7427 impl fidl::encoding::ResourceTypeMarker for DeviceExtraConnectorConnectRequest {
7428 type Borrowed<'a> = &'a mut Self;
7429 fn take_or_borrow<'a>(
7430 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7431 ) -> Self::Borrowed<'a> {
7432 value
7433 }
7434 }
7435
7436 unsafe impl fidl::encoding::TypeMarker for DeviceExtraConnectorConnectRequest {
7437 type Owned = Self;
7438
7439 #[inline(always)]
7440 fn inline_align(_context: fidl::encoding::Context) -> usize {
7441 8
7442 }
7443
7444 #[inline(always)]
7445 fn inline_size(_context: fidl::encoding::Context) -> usize {
7446 24
7447 }
7448 }
7449
7450 unsafe impl
7451 fidl::encoding::Encode<
7452 DeviceExtraConnectorConnectRequest,
7453 fidl::encoding::DefaultFuchsiaResourceDialect,
7454 > for &mut DeviceExtraConnectorConnectRequest
7455 {
7456 #[inline]
7457 unsafe fn encode(
7458 self,
7459 encoder: &mut fidl::encoding::Encoder<
7460 '_,
7461 fidl::encoding::DefaultFuchsiaResourceDialect,
7462 >,
7463 offset: usize,
7464 _depth: fidl::encoding::Depth,
7465 ) -> fidl::Result<()> {
7466 encoder.debug_check_bounds::<DeviceExtraConnectorConnectRequest>(offset);
7467 fidl::encoding::Encode::<DeviceExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7469 (
7470 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
7471 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
7472 ),
7473 encoder, offset, _depth
7474 )
7475 }
7476 }
7477 unsafe impl<
7478 T0: fidl::encoding::Encode<
7479 fidl::encoding::BoundedString<32>,
7480 fidl::encoding::DefaultFuchsiaResourceDialect,
7481 >,
7482 T1: fidl::encoding::Encode<
7483 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>>,
7484 fidl::encoding::DefaultFuchsiaResourceDialect,
7485 >,
7486 >
7487 fidl::encoding::Encode<
7488 DeviceExtraConnectorConnectRequest,
7489 fidl::encoding::DefaultFuchsiaResourceDialect,
7490 > for (T0, T1)
7491 {
7492 #[inline]
7493 unsafe fn encode(
7494 self,
7495 encoder: &mut fidl::encoding::Encoder<
7496 '_,
7497 fidl::encoding::DefaultFuchsiaResourceDialect,
7498 >,
7499 offset: usize,
7500 depth: fidl::encoding::Depth,
7501 ) -> fidl::Result<()> {
7502 encoder.debug_check_bounds::<DeviceExtraConnectorConnectRequest>(offset);
7503 unsafe {
7506 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7507 (ptr as *mut u64).write_unaligned(0);
7508 }
7509 self.0.encode(encoder, offset + 0, depth)?;
7511 self.1.encode(encoder, offset + 16, depth)?;
7512 Ok(())
7513 }
7514 }
7515
7516 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7517 for DeviceExtraConnectorConnectRequest
7518 {
7519 #[inline(always)]
7520 fn new_empty() -> Self {
7521 Self {
7522 name: fidl::new_empty!(
7523 fidl::encoding::BoundedString<32>,
7524 fidl::encoding::DefaultFuchsiaResourceDialect
7525 ),
7526 server_end: fidl::new_empty!(
7527 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>>,
7528 fidl::encoding::DefaultFuchsiaResourceDialect
7529 ),
7530 }
7531 }
7532
7533 #[inline]
7534 unsafe fn decode(
7535 &mut self,
7536 decoder: &mut fidl::encoding::Decoder<
7537 '_,
7538 fidl::encoding::DefaultFuchsiaResourceDialect,
7539 >,
7540 offset: usize,
7541 _depth: fidl::encoding::Depth,
7542 ) -> fidl::Result<()> {
7543 decoder.debug_check_bounds::<Self>(offset);
7544 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7546 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7547 let mask = 0xffffffff00000000u64;
7548 let maskedval = padval & mask;
7549 if maskedval != 0 {
7550 return Err(fidl::Error::NonZeroPadding {
7551 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7552 });
7553 }
7554 fidl::decode!(
7555 fidl::encoding::BoundedString<32>,
7556 fidl::encoding::DefaultFuchsiaResourceDialect,
7557 &mut self.name,
7558 decoder,
7559 offset + 0,
7560 _depth
7561 )?;
7562 fidl::decode!(
7563 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>>,
7564 fidl::encoding::DefaultFuchsiaResourceDialect,
7565 &mut self.server_end,
7566 decoder,
7567 offset + 16,
7568 _depth
7569 )?;
7570 Ok(())
7571 }
7572 }
7573
7574 impl fidl::encoding::ResourceTypeMarker for DeviceExtraFormNetworkRequest {
7575 type Borrowed<'a> = &'a mut Self;
7576 fn take_or_borrow<'a>(
7577 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7578 ) -> Self::Borrowed<'a> {
7579 value
7580 }
7581 }
7582
7583 unsafe impl fidl::encoding::TypeMarker for DeviceExtraFormNetworkRequest {
7584 type Owned = Self;
7585
7586 #[inline(always)]
7587 fn inline_align(_context: fidl::encoding::Context) -> usize {
7588 8
7589 }
7590
7591 #[inline(always)]
7592 fn inline_size(_context: fidl::encoding::Context) -> usize {
7593 40
7594 }
7595 }
7596
7597 unsafe impl
7598 fidl::encoding::Encode<
7599 DeviceExtraFormNetworkRequest,
7600 fidl::encoding::DefaultFuchsiaResourceDialect,
7601 > for &mut DeviceExtraFormNetworkRequest
7602 {
7603 #[inline]
7604 unsafe fn encode(
7605 self,
7606 encoder: &mut fidl::encoding::Encoder<
7607 '_,
7608 fidl::encoding::DefaultFuchsiaResourceDialect,
7609 >,
7610 offset: usize,
7611 _depth: fidl::encoding::Depth,
7612 ) -> fidl::Result<()> {
7613 encoder.debug_check_bounds::<DeviceExtraFormNetworkRequest>(offset);
7614 fidl::encoding::Encode::<DeviceExtraFormNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7616 (
7617 <fidl_fuchsia_lowpan_device::ProvisioningParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
7618 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.progress),
7619 ),
7620 encoder, offset, _depth
7621 )
7622 }
7623 }
7624 unsafe impl<
7625 T0: fidl::encoding::Encode<
7626 fidl_fuchsia_lowpan_device::ProvisioningParams,
7627 fidl::encoding::DefaultFuchsiaResourceDialect,
7628 >,
7629 T1: fidl::encoding::Encode<
7630 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7631 fidl::encoding::DefaultFuchsiaResourceDialect,
7632 >,
7633 >
7634 fidl::encoding::Encode<
7635 DeviceExtraFormNetworkRequest,
7636 fidl::encoding::DefaultFuchsiaResourceDialect,
7637 > for (T0, T1)
7638 {
7639 #[inline]
7640 unsafe fn encode(
7641 self,
7642 encoder: &mut fidl::encoding::Encoder<
7643 '_,
7644 fidl::encoding::DefaultFuchsiaResourceDialect,
7645 >,
7646 offset: usize,
7647 depth: fidl::encoding::Depth,
7648 ) -> fidl::Result<()> {
7649 encoder.debug_check_bounds::<DeviceExtraFormNetworkRequest>(offset);
7650 unsafe {
7653 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7654 (ptr as *mut u64).write_unaligned(0);
7655 }
7656 self.0.encode(encoder, offset + 0, depth)?;
7658 self.1.encode(encoder, offset + 32, depth)?;
7659 Ok(())
7660 }
7661 }
7662
7663 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7664 for DeviceExtraFormNetworkRequest
7665 {
7666 #[inline(always)]
7667 fn new_empty() -> Self {
7668 Self {
7669 params: fidl::new_empty!(
7670 fidl_fuchsia_lowpan_device::ProvisioningParams,
7671 fidl::encoding::DefaultFuchsiaResourceDialect
7672 ),
7673 progress: fidl::new_empty!(
7674 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7675 fidl::encoding::DefaultFuchsiaResourceDialect
7676 ),
7677 }
7678 }
7679
7680 #[inline]
7681 unsafe fn decode(
7682 &mut self,
7683 decoder: &mut fidl::encoding::Decoder<
7684 '_,
7685 fidl::encoding::DefaultFuchsiaResourceDialect,
7686 >,
7687 offset: usize,
7688 _depth: fidl::encoding::Depth,
7689 ) -> fidl::Result<()> {
7690 decoder.debug_check_bounds::<Self>(offset);
7691 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7693 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7694 let mask = 0xffffffff00000000u64;
7695 let maskedval = padval & mask;
7696 if maskedval != 0 {
7697 return Err(fidl::Error::NonZeroPadding {
7698 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7699 });
7700 }
7701 fidl::decode!(
7702 fidl_fuchsia_lowpan_device::ProvisioningParams,
7703 fidl::encoding::DefaultFuchsiaResourceDialect,
7704 &mut self.params,
7705 decoder,
7706 offset + 0,
7707 _depth
7708 )?;
7709 fidl::decode!(
7710 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7711 fidl::encoding::DefaultFuchsiaResourceDialect,
7712 &mut self.progress,
7713 decoder,
7714 offset + 32,
7715 _depth
7716 )?;
7717 Ok(())
7718 }
7719 }
7720
7721 impl fidl::encoding::ResourceTypeMarker for DeviceExtraJoinNetworkRequest {
7722 type Borrowed<'a> = &'a mut Self;
7723 fn take_or_borrow<'a>(
7724 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7725 ) -> Self::Borrowed<'a> {
7726 value
7727 }
7728 }
7729
7730 unsafe impl fidl::encoding::TypeMarker for DeviceExtraJoinNetworkRequest {
7731 type Owned = Self;
7732
7733 #[inline(always)]
7734 fn inline_align(_context: fidl::encoding::Context) -> usize {
7735 8
7736 }
7737
7738 #[inline(always)]
7739 fn inline_size(_context: fidl::encoding::Context) -> usize {
7740 24
7741 }
7742 }
7743
7744 unsafe impl
7745 fidl::encoding::Encode<
7746 DeviceExtraJoinNetworkRequest,
7747 fidl::encoding::DefaultFuchsiaResourceDialect,
7748 > for &mut DeviceExtraJoinNetworkRequest
7749 {
7750 #[inline]
7751 unsafe fn encode(
7752 self,
7753 encoder: &mut fidl::encoding::Encoder<
7754 '_,
7755 fidl::encoding::DefaultFuchsiaResourceDialect,
7756 >,
7757 offset: usize,
7758 _depth: fidl::encoding::Depth,
7759 ) -> fidl::Result<()> {
7760 encoder.debug_check_bounds::<DeviceExtraJoinNetworkRequest>(offset);
7761 fidl::encoding::Encode::<DeviceExtraJoinNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7763 (
7764 <JoinParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
7765 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.progress),
7766 ),
7767 encoder, offset, _depth
7768 )
7769 }
7770 }
7771 unsafe impl<
7772 T0: fidl::encoding::Encode<JoinParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
7773 T1: fidl::encoding::Encode<
7774 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7775 fidl::encoding::DefaultFuchsiaResourceDialect,
7776 >,
7777 >
7778 fidl::encoding::Encode<
7779 DeviceExtraJoinNetworkRequest,
7780 fidl::encoding::DefaultFuchsiaResourceDialect,
7781 > for (T0, T1)
7782 {
7783 #[inline]
7784 unsafe fn encode(
7785 self,
7786 encoder: &mut fidl::encoding::Encoder<
7787 '_,
7788 fidl::encoding::DefaultFuchsiaResourceDialect,
7789 >,
7790 offset: usize,
7791 depth: fidl::encoding::Depth,
7792 ) -> fidl::Result<()> {
7793 encoder.debug_check_bounds::<DeviceExtraJoinNetworkRequest>(offset);
7794 unsafe {
7797 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7798 (ptr as *mut u64).write_unaligned(0);
7799 }
7800 self.0.encode(encoder, offset + 0, depth)?;
7802 self.1.encode(encoder, offset + 16, depth)?;
7803 Ok(())
7804 }
7805 }
7806
7807 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7808 for DeviceExtraJoinNetworkRequest
7809 {
7810 #[inline(always)]
7811 fn new_empty() -> Self {
7812 Self {
7813 params: fidl::new_empty!(JoinParams, fidl::encoding::DefaultFuchsiaResourceDialect),
7814 progress: fidl::new_empty!(
7815 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7816 fidl::encoding::DefaultFuchsiaResourceDialect
7817 ),
7818 }
7819 }
7820
7821 #[inline]
7822 unsafe fn decode(
7823 &mut self,
7824 decoder: &mut fidl::encoding::Decoder<
7825 '_,
7826 fidl::encoding::DefaultFuchsiaResourceDialect,
7827 >,
7828 offset: usize,
7829 _depth: fidl::encoding::Depth,
7830 ) -> fidl::Result<()> {
7831 decoder.debug_check_bounds::<Self>(offset);
7832 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7834 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7835 let mask = 0xffffffff00000000u64;
7836 let maskedval = padval & mask;
7837 if maskedval != 0 {
7838 return Err(fidl::Error::NonZeroPadding {
7839 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7840 });
7841 }
7842 fidl::decode!(
7843 JoinParams,
7844 fidl::encoding::DefaultFuchsiaResourceDialect,
7845 &mut self.params,
7846 decoder,
7847 offset + 0,
7848 _depth
7849 )?;
7850 fidl::decode!(
7851 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7852 fidl::encoding::DefaultFuchsiaResourceDialect,
7853 &mut self.progress,
7854 decoder,
7855 offset + 16,
7856 _depth
7857 )?;
7858 Ok(())
7859 }
7860 }
7861
7862 impl fidl::encoding::ResourceTypeMarker for DeviceExtraStartNetworkScanRequest {
7863 type Borrowed<'a> = &'a mut Self;
7864 fn take_or_borrow<'a>(
7865 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7866 ) -> Self::Borrowed<'a> {
7867 value
7868 }
7869 }
7870
7871 unsafe impl fidl::encoding::TypeMarker for DeviceExtraStartNetworkScanRequest {
7872 type Owned = Self;
7873
7874 #[inline(always)]
7875 fn inline_align(_context: fidl::encoding::Context) -> usize {
7876 8
7877 }
7878
7879 #[inline(always)]
7880 fn inline_size(_context: fidl::encoding::Context) -> usize {
7881 24
7882 }
7883 }
7884
7885 unsafe impl
7886 fidl::encoding::Encode<
7887 DeviceExtraStartNetworkScanRequest,
7888 fidl::encoding::DefaultFuchsiaResourceDialect,
7889 > for &mut DeviceExtraStartNetworkScanRequest
7890 {
7891 #[inline]
7892 unsafe fn encode(
7893 self,
7894 encoder: &mut fidl::encoding::Encoder<
7895 '_,
7896 fidl::encoding::DefaultFuchsiaResourceDialect,
7897 >,
7898 offset: usize,
7899 _depth: fidl::encoding::Depth,
7900 ) -> fidl::Result<()> {
7901 encoder.debug_check_bounds::<DeviceExtraStartNetworkScanRequest>(offset);
7902 fidl::encoding::Encode::<DeviceExtraStartNetworkScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7904 (
7905 <NetworkScanParameters as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
7906 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
7907 ),
7908 encoder, offset, _depth
7909 )
7910 }
7911 }
7912 unsafe impl<
7913 T0: fidl::encoding::Encode<
7914 NetworkScanParameters,
7915 fidl::encoding::DefaultFuchsiaResourceDialect,
7916 >,
7917 T1: fidl::encoding::Encode<
7918 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>>,
7919 fidl::encoding::DefaultFuchsiaResourceDialect,
7920 >,
7921 >
7922 fidl::encoding::Encode<
7923 DeviceExtraStartNetworkScanRequest,
7924 fidl::encoding::DefaultFuchsiaResourceDialect,
7925 > for (T0, T1)
7926 {
7927 #[inline]
7928 unsafe fn encode(
7929 self,
7930 encoder: &mut fidl::encoding::Encoder<
7931 '_,
7932 fidl::encoding::DefaultFuchsiaResourceDialect,
7933 >,
7934 offset: usize,
7935 depth: fidl::encoding::Depth,
7936 ) -> fidl::Result<()> {
7937 encoder.debug_check_bounds::<DeviceExtraStartNetworkScanRequest>(offset);
7938 unsafe {
7941 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7942 (ptr as *mut u64).write_unaligned(0);
7943 }
7944 self.0.encode(encoder, offset + 0, depth)?;
7946 self.1.encode(encoder, offset + 16, depth)?;
7947 Ok(())
7948 }
7949 }
7950
7951 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7952 for DeviceExtraStartNetworkScanRequest
7953 {
7954 #[inline(always)]
7955 fn new_empty() -> Self {
7956 Self {
7957 params: fidl::new_empty!(
7958 NetworkScanParameters,
7959 fidl::encoding::DefaultFuchsiaResourceDialect
7960 ),
7961 stream: fidl::new_empty!(
7962 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>>,
7963 fidl::encoding::DefaultFuchsiaResourceDialect
7964 ),
7965 }
7966 }
7967
7968 #[inline]
7969 unsafe fn decode(
7970 &mut self,
7971 decoder: &mut fidl::encoding::Decoder<
7972 '_,
7973 fidl::encoding::DefaultFuchsiaResourceDialect,
7974 >,
7975 offset: usize,
7976 _depth: fidl::encoding::Depth,
7977 ) -> fidl::Result<()> {
7978 decoder.debug_check_bounds::<Self>(offset);
7979 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7981 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7982 let mask = 0xffffffff00000000u64;
7983 let maskedval = padval & mask;
7984 if maskedval != 0 {
7985 return Err(fidl::Error::NonZeroPadding {
7986 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7987 });
7988 }
7989 fidl::decode!(
7990 NetworkScanParameters,
7991 fidl::encoding::DefaultFuchsiaResourceDialect,
7992 &mut self.params,
7993 decoder,
7994 offset + 0,
7995 _depth
7996 )?;
7997 fidl::decode!(
7998 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>>,
7999 fidl::encoding::DefaultFuchsiaResourceDialect,
8000 &mut self.stream,
8001 decoder,
8002 offset + 16,
8003 _depth
8004 )?;
8005 Ok(())
8006 }
8007 }
8008
8009 impl fidl::encoding::ResourceTypeMarker for DeviceRouteConnectorConnectRequest {
8010 type Borrowed<'a> = &'a mut Self;
8011 fn take_or_borrow<'a>(
8012 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8013 ) -> Self::Borrowed<'a> {
8014 value
8015 }
8016 }
8017
8018 unsafe impl fidl::encoding::TypeMarker for DeviceRouteConnectorConnectRequest {
8019 type Owned = Self;
8020
8021 #[inline(always)]
8022 fn inline_align(_context: fidl::encoding::Context) -> usize {
8023 8
8024 }
8025
8026 #[inline(always)]
8027 fn inline_size(_context: fidl::encoding::Context) -> usize {
8028 24
8029 }
8030 }
8031
8032 unsafe impl
8033 fidl::encoding::Encode<
8034 DeviceRouteConnectorConnectRequest,
8035 fidl::encoding::DefaultFuchsiaResourceDialect,
8036 > for &mut DeviceRouteConnectorConnectRequest
8037 {
8038 #[inline]
8039 unsafe fn encode(
8040 self,
8041 encoder: &mut fidl::encoding::Encoder<
8042 '_,
8043 fidl::encoding::DefaultFuchsiaResourceDialect,
8044 >,
8045 offset: usize,
8046 _depth: fidl::encoding::Depth,
8047 ) -> fidl::Result<()> {
8048 encoder.debug_check_bounds::<DeviceRouteConnectorConnectRequest>(offset);
8049 fidl::encoding::Encode::<DeviceRouteConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8051 (
8052 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8053 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8054 ),
8055 encoder, offset, _depth
8056 )
8057 }
8058 }
8059 unsafe impl<
8060 T0: fidl::encoding::Encode<
8061 fidl::encoding::BoundedString<32>,
8062 fidl::encoding::DefaultFuchsiaResourceDialect,
8063 >,
8064 T1: fidl::encoding::Encode<
8065 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>>,
8066 fidl::encoding::DefaultFuchsiaResourceDialect,
8067 >,
8068 >
8069 fidl::encoding::Encode<
8070 DeviceRouteConnectorConnectRequest,
8071 fidl::encoding::DefaultFuchsiaResourceDialect,
8072 > for (T0, T1)
8073 {
8074 #[inline]
8075 unsafe fn encode(
8076 self,
8077 encoder: &mut fidl::encoding::Encoder<
8078 '_,
8079 fidl::encoding::DefaultFuchsiaResourceDialect,
8080 >,
8081 offset: usize,
8082 depth: fidl::encoding::Depth,
8083 ) -> fidl::Result<()> {
8084 encoder.debug_check_bounds::<DeviceRouteConnectorConnectRequest>(offset);
8085 unsafe {
8088 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8089 (ptr as *mut u64).write_unaligned(0);
8090 }
8091 self.0.encode(encoder, offset + 0, depth)?;
8093 self.1.encode(encoder, offset + 16, depth)?;
8094 Ok(())
8095 }
8096 }
8097
8098 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8099 for DeviceRouteConnectorConnectRequest
8100 {
8101 #[inline(always)]
8102 fn new_empty() -> Self {
8103 Self {
8104 name: fidl::new_empty!(
8105 fidl::encoding::BoundedString<32>,
8106 fidl::encoding::DefaultFuchsiaResourceDialect
8107 ),
8108 server_end: fidl::new_empty!(
8109 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>>,
8110 fidl::encoding::DefaultFuchsiaResourceDialect
8111 ),
8112 }
8113 }
8114
8115 #[inline]
8116 unsafe fn decode(
8117 &mut self,
8118 decoder: &mut fidl::encoding::Decoder<
8119 '_,
8120 fidl::encoding::DefaultFuchsiaResourceDialect,
8121 >,
8122 offset: usize,
8123 _depth: fidl::encoding::Depth,
8124 ) -> fidl::Result<()> {
8125 decoder.debug_check_bounds::<Self>(offset);
8126 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8128 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8129 let mask = 0xffffffff00000000u64;
8130 let maskedval = padval & mask;
8131 if maskedval != 0 {
8132 return Err(fidl::Error::NonZeroPadding {
8133 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8134 });
8135 }
8136 fidl::decode!(
8137 fidl::encoding::BoundedString<32>,
8138 fidl::encoding::DefaultFuchsiaResourceDialect,
8139 &mut self.name,
8140 decoder,
8141 offset + 0,
8142 _depth
8143 )?;
8144 fidl::decode!(
8145 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>>,
8146 fidl::encoding::DefaultFuchsiaResourceDialect,
8147 &mut self.server_end,
8148 decoder,
8149 offset + 16,
8150 _depth
8151 )?;
8152 Ok(())
8153 }
8154 }
8155
8156 impl fidl::encoding::ResourceTypeMarker for DeviceRouteExtraConnectorConnectRequest {
8157 type Borrowed<'a> = &'a mut Self;
8158 fn take_or_borrow<'a>(
8159 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8160 ) -> Self::Borrowed<'a> {
8161 value
8162 }
8163 }
8164
8165 unsafe impl fidl::encoding::TypeMarker for DeviceRouteExtraConnectorConnectRequest {
8166 type Owned = Self;
8167
8168 #[inline(always)]
8169 fn inline_align(_context: fidl::encoding::Context) -> usize {
8170 8
8171 }
8172
8173 #[inline(always)]
8174 fn inline_size(_context: fidl::encoding::Context) -> usize {
8175 24
8176 }
8177 }
8178
8179 unsafe impl
8180 fidl::encoding::Encode<
8181 DeviceRouteExtraConnectorConnectRequest,
8182 fidl::encoding::DefaultFuchsiaResourceDialect,
8183 > for &mut DeviceRouteExtraConnectorConnectRequest
8184 {
8185 #[inline]
8186 unsafe fn encode(
8187 self,
8188 encoder: &mut fidl::encoding::Encoder<
8189 '_,
8190 fidl::encoding::DefaultFuchsiaResourceDialect,
8191 >,
8192 offset: usize,
8193 _depth: fidl::encoding::Depth,
8194 ) -> fidl::Result<()> {
8195 encoder.debug_check_bounds::<DeviceRouteExtraConnectorConnectRequest>(offset);
8196 fidl::encoding::Encode::<DeviceRouteExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8198 (
8199 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8200 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8201 ),
8202 encoder, offset, _depth
8203 )
8204 }
8205 }
8206 unsafe impl<
8207 T0: fidl::encoding::Encode<
8208 fidl::encoding::BoundedString<32>,
8209 fidl::encoding::DefaultFuchsiaResourceDialect,
8210 >,
8211 T1: fidl::encoding::Encode<
8212 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>>,
8213 fidl::encoding::DefaultFuchsiaResourceDialect,
8214 >,
8215 >
8216 fidl::encoding::Encode<
8217 DeviceRouteExtraConnectorConnectRequest,
8218 fidl::encoding::DefaultFuchsiaResourceDialect,
8219 > for (T0, T1)
8220 {
8221 #[inline]
8222 unsafe fn encode(
8223 self,
8224 encoder: &mut fidl::encoding::Encoder<
8225 '_,
8226 fidl::encoding::DefaultFuchsiaResourceDialect,
8227 >,
8228 offset: usize,
8229 depth: fidl::encoding::Depth,
8230 ) -> fidl::Result<()> {
8231 encoder.debug_check_bounds::<DeviceRouteExtraConnectorConnectRequest>(offset);
8232 unsafe {
8235 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8236 (ptr as *mut u64).write_unaligned(0);
8237 }
8238 self.0.encode(encoder, offset + 0, depth)?;
8240 self.1.encode(encoder, offset + 16, depth)?;
8241 Ok(())
8242 }
8243 }
8244
8245 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8246 for DeviceRouteExtraConnectorConnectRequest
8247 {
8248 #[inline(always)]
8249 fn new_empty() -> Self {
8250 Self {
8251 name: fidl::new_empty!(
8252 fidl::encoding::BoundedString<32>,
8253 fidl::encoding::DefaultFuchsiaResourceDialect
8254 ),
8255 server_end: fidl::new_empty!(
8256 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>>,
8257 fidl::encoding::DefaultFuchsiaResourceDialect
8258 ),
8259 }
8260 }
8261
8262 #[inline]
8263 unsafe fn decode(
8264 &mut self,
8265 decoder: &mut fidl::encoding::Decoder<
8266 '_,
8267 fidl::encoding::DefaultFuchsiaResourceDialect,
8268 >,
8269 offset: usize,
8270 _depth: fidl::encoding::Depth,
8271 ) -> fidl::Result<()> {
8272 decoder.debug_check_bounds::<Self>(offset);
8273 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8275 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8276 let mask = 0xffffffff00000000u64;
8277 let maskedval = padval & mask;
8278 if maskedval != 0 {
8279 return Err(fidl::Error::NonZeroPadding {
8280 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8281 });
8282 }
8283 fidl::decode!(
8284 fidl::encoding::BoundedString<32>,
8285 fidl::encoding::DefaultFuchsiaResourceDialect,
8286 &mut self.name,
8287 decoder,
8288 offset + 0,
8289 _depth
8290 )?;
8291 fidl::decode!(
8292 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>>,
8293 fidl::encoding::DefaultFuchsiaResourceDialect,
8294 &mut self.server_end,
8295 decoder,
8296 offset + 16,
8297 _depth
8298 )?;
8299 Ok(())
8300 }
8301 }
8302
8303 impl fidl::encoding::ResourceTypeMarker for LegacyJoiningConnectorConnectRequest {
8304 type Borrowed<'a> = &'a mut Self;
8305 fn take_or_borrow<'a>(
8306 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8307 ) -> Self::Borrowed<'a> {
8308 value
8309 }
8310 }
8311
8312 unsafe impl fidl::encoding::TypeMarker for LegacyJoiningConnectorConnectRequest {
8313 type Owned = Self;
8314
8315 #[inline(always)]
8316 fn inline_align(_context: fidl::encoding::Context) -> usize {
8317 8
8318 }
8319
8320 #[inline(always)]
8321 fn inline_size(_context: fidl::encoding::Context) -> usize {
8322 24
8323 }
8324 }
8325
8326 unsafe impl
8327 fidl::encoding::Encode<
8328 LegacyJoiningConnectorConnectRequest,
8329 fidl::encoding::DefaultFuchsiaResourceDialect,
8330 > for &mut LegacyJoiningConnectorConnectRequest
8331 {
8332 #[inline]
8333 unsafe fn encode(
8334 self,
8335 encoder: &mut fidl::encoding::Encoder<
8336 '_,
8337 fidl::encoding::DefaultFuchsiaResourceDialect,
8338 >,
8339 offset: usize,
8340 _depth: fidl::encoding::Depth,
8341 ) -> fidl::Result<()> {
8342 encoder.debug_check_bounds::<LegacyJoiningConnectorConnectRequest>(offset);
8343 fidl::encoding::Encode::<LegacyJoiningConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8345 (
8346 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8347 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8348 ),
8349 encoder, offset, _depth
8350 )
8351 }
8352 }
8353 unsafe impl<
8354 T0: fidl::encoding::Encode<
8355 fidl::encoding::BoundedString<32>,
8356 fidl::encoding::DefaultFuchsiaResourceDialect,
8357 >,
8358 T1: fidl::encoding::Encode<
8359 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>>,
8360 fidl::encoding::DefaultFuchsiaResourceDialect,
8361 >,
8362 >
8363 fidl::encoding::Encode<
8364 LegacyJoiningConnectorConnectRequest,
8365 fidl::encoding::DefaultFuchsiaResourceDialect,
8366 > for (T0, T1)
8367 {
8368 #[inline]
8369 unsafe fn encode(
8370 self,
8371 encoder: &mut fidl::encoding::Encoder<
8372 '_,
8373 fidl::encoding::DefaultFuchsiaResourceDialect,
8374 >,
8375 offset: usize,
8376 depth: fidl::encoding::Depth,
8377 ) -> fidl::Result<()> {
8378 encoder.debug_check_bounds::<LegacyJoiningConnectorConnectRequest>(offset);
8379 unsafe {
8382 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8383 (ptr as *mut u64).write_unaligned(0);
8384 }
8385 self.0.encode(encoder, offset + 0, depth)?;
8387 self.1.encode(encoder, offset + 16, depth)?;
8388 Ok(())
8389 }
8390 }
8391
8392 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8393 for LegacyJoiningConnectorConnectRequest
8394 {
8395 #[inline(always)]
8396 fn new_empty() -> Self {
8397 Self {
8398 name: fidl::new_empty!(
8399 fidl::encoding::BoundedString<32>,
8400 fidl::encoding::DefaultFuchsiaResourceDialect
8401 ),
8402 server_end: fidl::new_empty!(
8403 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>>,
8404 fidl::encoding::DefaultFuchsiaResourceDialect
8405 ),
8406 }
8407 }
8408
8409 #[inline]
8410 unsafe fn decode(
8411 &mut self,
8412 decoder: &mut fidl::encoding::Decoder<
8413 '_,
8414 fidl::encoding::DefaultFuchsiaResourceDialect,
8415 >,
8416 offset: usize,
8417 _depth: fidl::encoding::Depth,
8418 ) -> fidl::Result<()> {
8419 decoder.debug_check_bounds::<Self>(offset);
8420 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8422 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8423 let mask = 0xffffffff00000000u64;
8424 let maskedval = padval & mask;
8425 if maskedval != 0 {
8426 return Err(fidl::Error::NonZeroPadding {
8427 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8428 });
8429 }
8430 fidl::decode!(
8431 fidl::encoding::BoundedString<32>,
8432 fidl::encoding::DefaultFuchsiaResourceDialect,
8433 &mut self.name,
8434 decoder,
8435 offset + 0,
8436 _depth
8437 )?;
8438 fidl::decode!(
8439 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>>,
8440 fidl::encoding::DefaultFuchsiaResourceDialect,
8441 &mut self.server_end,
8442 decoder,
8443 offset + 16,
8444 _depth
8445 )?;
8446 Ok(())
8447 }
8448 }
8449
8450 impl fidl::encoding::ResourceTypeMarker for TelemetryProviderConnectorConnectRequest {
8451 type Borrowed<'a> = &'a mut Self;
8452 fn take_or_borrow<'a>(
8453 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8454 ) -> Self::Borrowed<'a> {
8455 value
8456 }
8457 }
8458
8459 unsafe impl fidl::encoding::TypeMarker for TelemetryProviderConnectorConnectRequest {
8460 type Owned = Self;
8461
8462 #[inline(always)]
8463 fn inline_align(_context: fidl::encoding::Context) -> usize {
8464 8
8465 }
8466
8467 #[inline(always)]
8468 fn inline_size(_context: fidl::encoding::Context) -> usize {
8469 24
8470 }
8471 }
8472
8473 unsafe impl
8474 fidl::encoding::Encode<
8475 TelemetryProviderConnectorConnectRequest,
8476 fidl::encoding::DefaultFuchsiaResourceDialect,
8477 > for &mut TelemetryProviderConnectorConnectRequest
8478 {
8479 #[inline]
8480 unsafe fn encode(
8481 self,
8482 encoder: &mut fidl::encoding::Encoder<
8483 '_,
8484 fidl::encoding::DefaultFuchsiaResourceDialect,
8485 >,
8486 offset: usize,
8487 _depth: fidl::encoding::Depth,
8488 ) -> fidl::Result<()> {
8489 encoder.debug_check_bounds::<TelemetryProviderConnectorConnectRequest>(offset);
8490 fidl::encoding::Encode::<TelemetryProviderConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8492 (
8493 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8494 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8495 ),
8496 encoder, offset, _depth
8497 )
8498 }
8499 }
8500 unsafe impl<
8501 T0: fidl::encoding::Encode<
8502 fidl::encoding::BoundedString<32>,
8503 fidl::encoding::DefaultFuchsiaResourceDialect,
8504 >,
8505 T1: fidl::encoding::Encode<
8506 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>>,
8507 fidl::encoding::DefaultFuchsiaResourceDialect,
8508 >,
8509 >
8510 fidl::encoding::Encode<
8511 TelemetryProviderConnectorConnectRequest,
8512 fidl::encoding::DefaultFuchsiaResourceDialect,
8513 > for (T0, T1)
8514 {
8515 #[inline]
8516 unsafe fn encode(
8517 self,
8518 encoder: &mut fidl::encoding::Encoder<
8519 '_,
8520 fidl::encoding::DefaultFuchsiaResourceDialect,
8521 >,
8522 offset: usize,
8523 depth: fidl::encoding::Depth,
8524 ) -> fidl::Result<()> {
8525 encoder.debug_check_bounds::<TelemetryProviderConnectorConnectRequest>(offset);
8526 unsafe {
8529 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8530 (ptr as *mut u64).write_unaligned(0);
8531 }
8532 self.0.encode(encoder, offset + 0, depth)?;
8534 self.1.encode(encoder, offset + 16, depth)?;
8535 Ok(())
8536 }
8537 }
8538
8539 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8540 for TelemetryProviderConnectorConnectRequest
8541 {
8542 #[inline(always)]
8543 fn new_empty() -> Self {
8544 Self {
8545 name: fidl::new_empty!(
8546 fidl::encoding::BoundedString<32>,
8547 fidl::encoding::DefaultFuchsiaResourceDialect
8548 ),
8549 server_end: fidl::new_empty!(
8550 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>>,
8551 fidl::encoding::DefaultFuchsiaResourceDialect
8552 ),
8553 }
8554 }
8555
8556 #[inline]
8557 unsafe fn decode(
8558 &mut self,
8559 decoder: &mut fidl::encoding::Decoder<
8560 '_,
8561 fidl::encoding::DefaultFuchsiaResourceDialect,
8562 >,
8563 offset: usize,
8564 _depth: fidl::encoding::Depth,
8565 ) -> fidl::Result<()> {
8566 decoder.debug_check_bounds::<Self>(offset);
8567 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8569 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8570 let mask = 0xffffffff00000000u64;
8571 let maskedval = padval & mask;
8572 if maskedval != 0 {
8573 return Err(fidl::Error::NonZeroPadding {
8574 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8575 });
8576 }
8577 fidl::decode!(
8578 fidl::encoding::BoundedString<32>,
8579 fidl::encoding::DefaultFuchsiaResourceDialect,
8580 &mut self.name,
8581 decoder,
8582 offset + 0,
8583 _depth
8584 )?;
8585 fidl::decode!(
8586 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>>,
8587 fidl::encoding::DefaultFuchsiaResourceDialect,
8588 &mut self.server_end,
8589 decoder,
8590 offset + 16,
8591 _depth
8592 )?;
8593 Ok(())
8594 }
8595 }
8596}