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#[cfg(target_os = "fuchsia")]
207impl fidl::endpoints::FromClient for BeaconInfoStreamSynchronousProxy {
208 type Protocol = BeaconInfoStreamMarker;
209
210 fn from_client(value: fidl::endpoints::ClientEnd<BeaconInfoStreamMarker>) -> Self {
211 Self::new(value.into_channel())
212 }
213}
214
215#[derive(Debug, Clone)]
216pub struct BeaconInfoStreamProxy {
217 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
218}
219
220impl fidl::endpoints::Proxy for BeaconInfoStreamProxy {
221 type Protocol = BeaconInfoStreamMarker;
222
223 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
224 Self::new(inner)
225 }
226
227 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
228 self.client.into_channel().map_err(|client| Self { client })
229 }
230
231 fn as_channel(&self) -> &::fidl::AsyncChannel {
232 self.client.as_channel()
233 }
234}
235
236impl BeaconInfoStreamProxy {
237 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
239 let protocol_name = <BeaconInfoStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
240 Self { client: fidl::client::Client::new(channel, protocol_name) }
241 }
242
243 pub fn take_event_stream(&self) -> BeaconInfoStreamEventStream {
249 BeaconInfoStreamEventStream { event_receiver: self.client.take_event_receiver() }
250 }
251
252 pub fn r#next(
257 &self,
258 ) -> fidl::client::QueryResponseFut<
259 Vec<BeaconInfo>,
260 fidl::encoding::DefaultFuchsiaResourceDialect,
261 > {
262 BeaconInfoStreamProxyInterface::r#next(self)
263 }
264}
265
266impl BeaconInfoStreamProxyInterface for BeaconInfoStreamProxy {
267 type NextResponseFut = fidl::client::QueryResponseFut<
268 Vec<BeaconInfo>,
269 fidl::encoding::DefaultFuchsiaResourceDialect,
270 >;
271 fn r#next(&self) -> Self::NextResponseFut {
272 fn _decode(
273 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
274 ) -> Result<Vec<BeaconInfo>, fidl::Error> {
275 let _response = fidl::client::decode_transaction_body::<
276 BeaconInfoStreamNextResponse,
277 fidl::encoding::DefaultFuchsiaResourceDialect,
278 0x367a557363a340b6,
279 >(_buf?)?;
280 Ok(_response.beacons)
281 }
282 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<BeaconInfo>>(
283 (),
284 0x367a557363a340b6,
285 fidl::encoding::DynamicFlags::empty(),
286 _decode,
287 )
288 }
289}
290
291pub struct BeaconInfoStreamEventStream {
292 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
293}
294
295impl std::marker::Unpin for BeaconInfoStreamEventStream {}
296
297impl futures::stream::FusedStream for BeaconInfoStreamEventStream {
298 fn is_terminated(&self) -> bool {
299 self.event_receiver.is_terminated()
300 }
301}
302
303impl futures::Stream for BeaconInfoStreamEventStream {
304 type Item = Result<BeaconInfoStreamEvent, fidl::Error>;
305
306 fn poll_next(
307 mut self: std::pin::Pin<&mut Self>,
308 cx: &mut std::task::Context<'_>,
309 ) -> std::task::Poll<Option<Self::Item>> {
310 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
311 &mut self.event_receiver,
312 cx
313 )?) {
314 Some(buf) => std::task::Poll::Ready(Some(BeaconInfoStreamEvent::decode(buf))),
315 None => std::task::Poll::Ready(None),
316 }
317 }
318}
319
320#[derive(Debug)]
321pub enum BeaconInfoStreamEvent {}
322
323impl BeaconInfoStreamEvent {
324 fn decode(
326 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
327 ) -> Result<BeaconInfoStreamEvent, fidl::Error> {
328 let (bytes, _handles) = buf.split_mut();
329 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
330 debug_assert_eq!(tx_header.tx_id, 0);
331 match tx_header.ordinal {
332 _ => Err(fidl::Error::UnknownOrdinal {
333 ordinal: tx_header.ordinal,
334 protocol_name:
335 <BeaconInfoStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
336 }),
337 }
338 }
339}
340
341pub struct BeaconInfoStreamRequestStream {
343 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
344 is_terminated: bool,
345}
346
347impl std::marker::Unpin for BeaconInfoStreamRequestStream {}
348
349impl futures::stream::FusedStream for BeaconInfoStreamRequestStream {
350 fn is_terminated(&self) -> bool {
351 self.is_terminated
352 }
353}
354
355impl fidl::endpoints::RequestStream for BeaconInfoStreamRequestStream {
356 type Protocol = BeaconInfoStreamMarker;
357 type ControlHandle = BeaconInfoStreamControlHandle;
358
359 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
360 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
361 }
362
363 fn control_handle(&self) -> Self::ControlHandle {
364 BeaconInfoStreamControlHandle { inner: self.inner.clone() }
365 }
366
367 fn into_inner(
368 self,
369 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
370 {
371 (self.inner, self.is_terminated)
372 }
373
374 fn from_inner(
375 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
376 is_terminated: bool,
377 ) -> Self {
378 Self { inner, is_terminated }
379 }
380}
381
382impl futures::Stream for BeaconInfoStreamRequestStream {
383 type Item = Result<BeaconInfoStreamRequest, fidl::Error>;
384
385 fn poll_next(
386 mut self: std::pin::Pin<&mut Self>,
387 cx: &mut std::task::Context<'_>,
388 ) -> std::task::Poll<Option<Self::Item>> {
389 let this = &mut *self;
390 if this.inner.check_shutdown(cx) {
391 this.is_terminated = true;
392 return std::task::Poll::Ready(None);
393 }
394 if this.is_terminated {
395 panic!("polled BeaconInfoStreamRequestStream after completion");
396 }
397 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
398 |bytes, handles| {
399 match this.inner.channel().read_etc(cx, bytes, handles) {
400 std::task::Poll::Ready(Ok(())) => {}
401 std::task::Poll::Pending => return std::task::Poll::Pending,
402 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
403 this.is_terminated = true;
404 return std::task::Poll::Ready(None);
405 }
406 std::task::Poll::Ready(Err(e)) => {
407 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
408 e.into(),
409 ))))
410 }
411 }
412
413 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
415
416 std::task::Poll::Ready(Some(match header.ordinal {
417 0x367a557363a340b6 => {
418 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
419 let mut req = fidl::new_empty!(
420 fidl::encoding::EmptyPayload,
421 fidl::encoding::DefaultFuchsiaResourceDialect
422 );
423 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
424 let control_handle =
425 BeaconInfoStreamControlHandle { inner: this.inner.clone() };
426 Ok(BeaconInfoStreamRequest::Next {
427 responder: BeaconInfoStreamNextResponder {
428 control_handle: std::mem::ManuallyDrop::new(control_handle),
429 tx_id: header.tx_id,
430 },
431 })
432 }
433 _ => Err(fidl::Error::UnknownOrdinal {
434 ordinal: header.ordinal,
435 protocol_name:
436 <BeaconInfoStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
437 }),
438 }))
439 },
440 )
441 }
442}
443
444#[derive(Debug)]
449pub enum BeaconInfoStreamRequest {
450 Next { responder: BeaconInfoStreamNextResponder },
455}
456
457impl BeaconInfoStreamRequest {
458 #[allow(irrefutable_let_patterns)]
459 pub fn into_next(self) -> Option<(BeaconInfoStreamNextResponder)> {
460 if let BeaconInfoStreamRequest::Next { responder } = self {
461 Some((responder))
462 } else {
463 None
464 }
465 }
466
467 pub fn method_name(&self) -> &'static str {
469 match *self {
470 BeaconInfoStreamRequest::Next { .. } => "next",
471 }
472 }
473}
474
475#[derive(Debug, Clone)]
476pub struct BeaconInfoStreamControlHandle {
477 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
478}
479
480impl fidl::endpoints::ControlHandle for BeaconInfoStreamControlHandle {
481 fn shutdown(&self) {
482 self.inner.shutdown()
483 }
484 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
485 self.inner.shutdown_with_epitaph(status)
486 }
487
488 fn is_closed(&self) -> bool {
489 self.inner.channel().is_closed()
490 }
491 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
492 self.inner.channel().on_closed()
493 }
494
495 #[cfg(target_os = "fuchsia")]
496 fn signal_peer(
497 &self,
498 clear_mask: zx::Signals,
499 set_mask: zx::Signals,
500 ) -> Result<(), zx_status::Status> {
501 use fidl::Peered;
502 self.inner.channel().signal_peer(clear_mask, set_mask)
503 }
504}
505
506impl BeaconInfoStreamControlHandle {}
507
508#[must_use = "FIDL methods require a response to be sent"]
509#[derive(Debug)]
510pub struct BeaconInfoStreamNextResponder {
511 control_handle: std::mem::ManuallyDrop<BeaconInfoStreamControlHandle>,
512 tx_id: u32,
513}
514
515impl std::ops::Drop for BeaconInfoStreamNextResponder {
519 fn drop(&mut self) {
520 self.control_handle.shutdown();
521 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
523 }
524}
525
526impl fidl::endpoints::Responder for BeaconInfoStreamNextResponder {
527 type ControlHandle = BeaconInfoStreamControlHandle;
528
529 fn control_handle(&self) -> &BeaconInfoStreamControlHandle {
530 &self.control_handle
531 }
532
533 fn drop_without_shutdown(mut self) {
534 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
536 std::mem::forget(self);
538 }
539}
540
541impl BeaconInfoStreamNextResponder {
542 pub fn send(self, mut beacons: &[BeaconInfo]) -> Result<(), fidl::Error> {
546 let _result = self.send_raw(beacons);
547 if _result.is_err() {
548 self.control_handle.shutdown();
549 }
550 self.drop_without_shutdown();
551 _result
552 }
553
554 pub fn send_no_shutdown_on_err(self, mut beacons: &[BeaconInfo]) -> Result<(), fidl::Error> {
556 let _result = self.send_raw(beacons);
557 self.drop_without_shutdown();
558 _result
559 }
560
561 fn send_raw(&self, mut beacons: &[BeaconInfo]) -> Result<(), fidl::Error> {
562 self.control_handle.inner.send::<BeaconInfoStreamNextResponse>(
563 (beacons,),
564 self.tx_id,
565 0x367a557363a340b6,
566 fidl::encoding::DynamicFlags::empty(),
567 )
568 }
569}
570
571#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
572pub struct DeviceMarker;
573
574impl fidl::endpoints::ProtocolMarker for DeviceMarker {
575 type Proxy = DeviceProxy;
576 type RequestStream = DeviceRequestStream;
577 #[cfg(target_os = "fuchsia")]
578 type SynchronousProxy = DeviceSynchronousProxy;
579
580 const DEBUG_NAME: &'static str = "(anonymous) Device";
581}
582
583pub trait DeviceProxyInterface: Send + Sync {
584 type GetSupportedChannelsResponseFut: std::future::Future<Output = Result<Vec<ChannelInfo>, fidl::Error>>
585 + Send;
586 fn r#get_supported_channels(&self) -> Self::GetSupportedChannelsResponseFut;
587}
588#[derive(Debug)]
589#[cfg(target_os = "fuchsia")]
590pub struct DeviceSynchronousProxy {
591 client: fidl::client::sync::Client,
592}
593
594#[cfg(target_os = "fuchsia")]
595impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
596 type Proxy = DeviceProxy;
597 type Protocol = DeviceMarker;
598
599 fn from_channel(inner: fidl::Channel) -> Self {
600 Self::new(inner)
601 }
602
603 fn into_channel(self) -> fidl::Channel {
604 self.client.into_channel()
605 }
606
607 fn as_channel(&self) -> &fidl::Channel {
608 self.client.as_channel()
609 }
610}
611
612#[cfg(target_os = "fuchsia")]
613impl DeviceSynchronousProxy {
614 pub fn new(channel: fidl::Channel) -> Self {
615 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
616 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
617 }
618
619 pub fn into_channel(self) -> fidl::Channel {
620 self.client.into_channel()
621 }
622
623 pub fn wait_for_event(
626 &self,
627 deadline: zx::MonotonicInstant,
628 ) -> Result<DeviceEvent, fidl::Error> {
629 DeviceEvent::decode(self.client.wait_for_event(deadline)?)
630 }
631
632 pub fn r#get_supported_channels(
635 &self,
636 ___deadline: zx::MonotonicInstant,
637 ) -> Result<Vec<ChannelInfo>, fidl::Error> {
638 let _response = self
639 .client
640 .send_query::<fidl::encoding::EmptyPayload, DeviceGetSupportedChannelsResponse>(
641 (),
642 0x2d8b969a9bd70f23,
643 fidl::encoding::DynamicFlags::empty(),
644 ___deadline,
645 )?;
646 Ok(_response.channels_info)
647 }
648}
649
650#[cfg(target_os = "fuchsia")]
651impl From<DeviceSynchronousProxy> for zx::Handle {
652 fn from(value: DeviceSynchronousProxy) -> Self {
653 value.into_channel().into()
654 }
655}
656
657#[cfg(target_os = "fuchsia")]
658impl From<fidl::Channel> for DeviceSynchronousProxy {
659 fn from(value: fidl::Channel) -> Self {
660 Self::new(value)
661 }
662}
663
664#[cfg(target_os = "fuchsia")]
665impl fidl::endpoints::FromClient for DeviceSynchronousProxy {
666 type Protocol = DeviceMarker;
667
668 fn from_client(value: fidl::endpoints::ClientEnd<DeviceMarker>) -> Self {
669 Self::new(value.into_channel())
670 }
671}
672
673#[derive(Debug, Clone)]
674pub struct DeviceProxy {
675 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
676}
677
678impl fidl::endpoints::Proxy for DeviceProxy {
679 type Protocol = DeviceMarker;
680
681 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
682 Self::new(inner)
683 }
684
685 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
686 self.client.into_channel().map_err(|client| Self { client })
687 }
688
689 fn as_channel(&self) -> &::fidl::AsyncChannel {
690 self.client.as_channel()
691 }
692}
693
694impl DeviceProxy {
695 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
697 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
698 Self { client: fidl::client::Client::new(channel, protocol_name) }
699 }
700
701 pub fn take_event_stream(&self) -> DeviceEventStream {
707 DeviceEventStream { event_receiver: self.client.take_event_receiver() }
708 }
709
710 pub fn r#get_supported_channels(
713 &self,
714 ) -> fidl::client::QueryResponseFut<
715 Vec<ChannelInfo>,
716 fidl::encoding::DefaultFuchsiaResourceDialect,
717 > {
718 DeviceProxyInterface::r#get_supported_channels(self)
719 }
720}
721
722impl DeviceProxyInterface for DeviceProxy {
723 type GetSupportedChannelsResponseFut = fidl::client::QueryResponseFut<
724 Vec<ChannelInfo>,
725 fidl::encoding::DefaultFuchsiaResourceDialect,
726 >;
727 fn r#get_supported_channels(&self) -> Self::GetSupportedChannelsResponseFut {
728 fn _decode(
729 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
730 ) -> Result<Vec<ChannelInfo>, fidl::Error> {
731 let _response = fidl::client::decode_transaction_body::<
732 DeviceGetSupportedChannelsResponse,
733 fidl::encoding::DefaultFuchsiaResourceDialect,
734 0x2d8b969a9bd70f23,
735 >(_buf?)?;
736 Ok(_response.channels_info)
737 }
738 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ChannelInfo>>(
739 (),
740 0x2d8b969a9bd70f23,
741 fidl::encoding::DynamicFlags::empty(),
742 _decode,
743 )
744 }
745}
746
747pub struct DeviceEventStream {
748 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
749}
750
751impl std::marker::Unpin for DeviceEventStream {}
752
753impl futures::stream::FusedStream for DeviceEventStream {
754 fn is_terminated(&self) -> bool {
755 self.event_receiver.is_terminated()
756 }
757}
758
759impl futures::Stream for DeviceEventStream {
760 type Item = Result<DeviceEvent, fidl::Error>;
761
762 fn poll_next(
763 mut self: std::pin::Pin<&mut Self>,
764 cx: &mut std::task::Context<'_>,
765 ) -> std::task::Poll<Option<Self::Item>> {
766 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
767 &mut self.event_receiver,
768 cx
769 )?) {
770 Some(buf) => std::task::Poll::Ready(Some(DeviceEvent::decode(buf))),
771 None => std::task::Poll::Ready(None),
772 }
773 }
774}
775
776#[derive(Debug)]
777pub enum DeviceEvent {}
778
779impl DeviceEvent {
780 fn decode(
782 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
783 ) -> Result<DeviceEvent, fidl::Error> {
784 let (bytes, _handles) = buf.split_mut();
785 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
786 debug_assert_eq!(tx_header.tx_id, 0);
787 match tx_header.ordinal {
788 _ => Err(fidl::Error::UnknownOrdinal {
789 ordinal: tx_header.ordinal,
790 protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
791 }),
792 }
793 }
794}
795
796pub struct DeviceRequestStream {
798 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
799 is_terminated: bool,
800}
801
802impl std::marker::Unpin for DeviceRequestStream {}
803
804impl futures::stream::FusedStream for DeviceRequestStream {
805 fn is_terminated(&self) -> bool {
806 self.is_terminated
807 }
808}
809
810impl fidl::endpoints::RequestStream for DeviceRequestStream {
811 type Protocol = DeviceMarker;
812 type ControlHandle = DeviceControlHandle;
813
814 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
815 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
816 }
817
818 fn control_handle(&self) -> Self::ControlHandle {
819 DeviceControlHandle { inner: self.inner.clone() }
820 }
821
822 fn into_inner(
823 self,
824 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
825 {
826 (self.inner, self.is_terminated)
827 }
828
829 fn from_inner(
830 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
831 is_terminated: bool,
832 ) -> Self {
833 Self { inner, is_terminated }
834 }
835}
836
837impl futures::Stream for DeviceRequestStream {
838 type Item = Result<DeviceRequest, fidl::Error>;
839
840 fn poll_next(
841 mut self: std::pin::Pin<&mut Self>,
842 cx: &mut std::task::Context<'_>,
843 ) -> std::task::Poll<Option<Self::Item>> {
844 let this = &mut *self;
845 if this.inner.check_shutdown(cx) {
846 this.is_terminated = true;
847 return std::task::Poll::Ready(None);
848 }
849 if this.is_terminated {
850 panic!("polled DeviceRequestStream after completion");
851 }
852 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
853 |bytes, handles| {
854 match this.inner.channel().read_etc(cx, bytes, handles) {
855 std::task::Poll::Ready(Ok(())) => {}
856 std::task::Poll::Pending => return std::task::Poll::Pending,
857 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
858 this.is_terminated = true;
859 return std::task::Poll::Ready(None);
860 }
861 std::task::Poll::Ready(Err(e)) => {
862 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
863 e.into(),
864 ))))
865 }
866 }
867
868 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
870
871 std::task::Poll::Ready(Some(match header.ordinal {
872 0x2d8b969a9bd70f23 => {
873 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
874 let mut req = fidl::new_empty!(
875 fidl::encoding::EmptyPayload,
876 fidl::encoding::DefaultFuchsiaResourceDialect
877 );
878 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
879 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
880 Ok(DeviceRequest::GetSupportedChannels {
881 responder: DeviceGetSupportedChannelsResponder {
882 control_handle: std::mem::ManuallyDrop::new(control_handle),
883 tx_id: header.tx_id,
884 },
885 })
886 }
887 _ => Err(fidl::Error::UnknownOrdinal {
888 ordinal: header.ordinal,
889 protocol_name:
890 <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
891 }),
892 }))
893 },
894 )
895 }
896}
897
898#[derive(Debug)]
906pub enum DeviceRequest {
907 GetSupportedChannels { responder: DeviceGetSupportedChannelsResponder },
910}
911
912impl DeviceRequest {
913 #[allow(irrefutable_let_patterns)]
914 pub fn into_get_supported_channels(self) -> Option<(DeviceGetSupportedChannelsResponder)> {
915 if let DeviceRequest::GetSupportedChannels { responder } = self {
916 Some((responder))
917 } else {
918 None
919 }
920 }
921
922 pub fn method_name(&self) -> &'static str {
924 match *self {
925 DeviceRequest::GetSupportedChannels { .. } => "get_supported_channels",
926 }
927 }
928}
929
930#[derive(Debug, Clone)]
931pub struct DeviceControlHandle {
932 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
933}
934
935impl fidl::endpoints::ControlHandle for DeviceControlHandle {
936 fn shutdown(&self) {
937 self.inner.shutdown()
938 }
939 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
940 self.inner.shutdown_with_epitaph(status)
941 }
942
943 fn is_closed(&self) -> bool {
944 self.inner.channel().is_closed()
945 }
946 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
947 self.inner.channel().on_closed()
948 }
949
950 #[cfg(target_os = "fuchsia")]
951 fn signal_peer(
952 &self,
953 clear_mask: zx::Signals,
954 set_mask: zx::Signals,
955 ) -> Result<(), zx_status::Status> {
956 use fidl::Peered;
957 self.inner.channel().signal_peer(clear_mask, set_mask)
958 }
959}
960
961impl DeviceControlHandle {}
962
963#[must_use = "FIDL methods require a response to be sent"]
964#[derive(Debug)]
965pub struct DeviceGetSupportedChannelsResponder {
966 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
967 tx_id: u32,
968}
969
970impl std::ops::Drop for DeviceGetSupportedChannelsResponder {
974 fn drop(&mut self) {
975 self.control_handle.shutdown();
976 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
978 }
979}
980
981impl fidl::endpoints::Responder for DeviceGetSupportedChannelsResponder {
982 type ControlHandle = DeviceControlHandle;
983
984 fn control_handle(&self) -> &DeviceControlHandle {
985 &self.control_handle
986 }
987
988 fn drop_without_shutdown(mut self) {
989 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
991 std::mem::forget(self);
993 }
994}
995
996impl DeviceGetSupportedChannelsResponder {
997 pub fn send(self, mut channels_info: &[ChannelInfo]) -> Result<(), fidl::Error> {
1001 let _result = self.send_raw(channels_info);
1002 if _result.is_err() {
1003 self.control_handle.shutdown();
1004 }
1005 self.drop_without_shutdown();
1006 _result
1007 }
1008
1009 pub fn send_no_shutdown_on_err(
1011 self,
1012 mut channels_info: &[ChannelInfo],
1013 ) -> Result<(), fidl::Error> {
1014 let _result = self.send_raw(channels_info);
1015 self.drop_without_shutdown();
1016 _result
1017 }
1018
1019 fn send_raw(&self, mut channels_info: &[ChannelInfo]) -> Result<(), fidl::Error> {
1020 self.control_handle.inner.send::<DeviceGetSupportedChannelsResponse>(
1021 (channels_info,),
1022 self.tx_id,
1023 0x2d8b969a9bd70f23,
1024 fidl::encoding::DynamicFlags::empty(),
1025 )
1026 }
1027}
1028
1029#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1030pub struct DeviceConnectorMarker;
1031
1032impl fidl::endpoints::ProtocolMarker for DeviceConnectorMarker {
1033 type Proxy = DeviceConnectorProxy;
1034 type RequestStream = DeviceConnectorRequestStream;
1035 #[cfg(target_os = "fuchsia")]
1036 type SynchronousProxy = DeviceConnectorSynchronousProxy;
1037
1038 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceConnector";
1039}
1040impl fidl::endpoints::DiscoverableProtocolMarker for DeviceConnectorMarker {}
1041
1042pub trait DeviceConnectorProxyInterface: Send + Sync {
1043 fn r#connect(
1044 &self,
1045 name: &str,
1046 server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1047 ) -> Result<(), fidl::Error>;
1048}
1049#[derive(Debug)]
1050#[cfg(target_os = "fuchsia")]
1051pub struct DeviceConnectorSynchronousProxy {
1052 client: fidl::client::sync::Client,
1053}
1054
1055#[cfg(target_os = "fuchsia")]
1056impl fidl::endpoints::SynchronousProxy for DeviceConnectorSynchronousProxy {
1057 type Proxy = DeviceConnectorProxy;
1058 type Protocol = DeviceConnectorMarker;
1059
1060 fn from_channel(inner: fidl::Channel) -> Self {
1061 Self::new(inner)
1062 }
1063
1064 fn into_channel(self) -> fidl::Channel {
1065 self.client.into_channel()
1066 }
1067
1068 fn as_channel(&self) -> &fidl::Channel {
1069 self.client.as_channel()
1070 }
1071}
1072
1073#[cfg(target_os = "fuchsia")]
1074impl DeviceConnectorSynchronousProxy {
1075 pub fn new(channel: fidl::Channel) -> Self {
1076 let protocol_name = <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1077 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1078 }
1079
1080 pub fn into_channel(self) -> fidl::Channel {
1081 self.client.into_channel()
1082 }
1083
1084 pub fn wait_for_event(
1087 &self,
1088 deadline: zx::MonotonicInstant,
1089 ) -> Result<DeviceConnectorEvent, fidl::Error> {
1090 DeviceConnectorEvent::decode(self.client.wait_for_event(deadline)?)
1091 }
1092
1093 pub fn r#connect(
1110 &self,
1111 mut name: &str,
1112 mut server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1113 ) -> Result<(), fidl::Error> {
1114 self.client.send::<DeviceConnectorConnectRequest>(
1115 (name, server_end),
1116 0x296896c9304836cd,
1117 fidl::encoding::DynamicFlags::empty(),
1118 )
1119 }
1120}
1121
1122#[cfg(target_os = "fuchsia")]
1123impl From<DeviceConnectorSynchronousProxy> for zx::Handle {
1124 fn from(value: DeviceConnectorSynchronousProxy) -> Self {
1125 value.into_channel().into()
1126 }
1127}
1128
1129#[cfg(target_os = "fuchsia")]
1130impl From<fidl::Channel> for DeviceConnectorSynchronousProxy {
1131 fn from(value: fidl::Channel) -> Self {
1132 Self::new(value)
1133 }
1134}
1135
1136#[cfg(target_os = "fuchsia")]
1137impl fidl::endpoints::FromClient for DeviceConnectorSynchronousProxy {
1138 type Protocol = DeviceConnectorMarker;
1139
1140 fn from_client(value: fidl::endpoints::ClientEnd<DeviceConnectorMarker>) -> Self {
1141 Self::new(value.into_channel())
1142 }
1143}
1144
1145#[derive(Debug, Clone)]
1146pub struct DeviceConnectorProxy {
1147 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1148}
1149
1150impl fidl::endpoints::Proxy for DeviceConnectorProxy {
1151 type Protocol = DeviceConnectorMarker;
1152
1153 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1154 Self::new(inner)
1155 }
1156
1157 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1158 self.client.into_channel().map_err(|client| Self { client })
1159 }
1160
1161 fn as_channel(&self) -> &::fidl::AsyncChannel {
1162 self.client.as_channel()
1163 }
1164}
1165
1166impl DeviceConnectorProxy {
1167 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1169 let protocol_name = <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1170 Self { client: fidl::client::Client::new(channel, protocol_name) }
1171 }
1172
1173 pub fn take_event_stream(&self) -> DeviceConnectorEventStream {
1179 DeviceConnectorEventStream { event_receiver: self.client.take_event_receiver() }
1180 }
1181
1182 pub fn r#connect(
1199 &self,
1200 mut name: &str,
1201 mut server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1202 ) -> Result<(), fidl::Error> {
1203 DeviceConnectorProxyInterface::r#connect(self, name, server_end)
1204 }
1205}
1206
1207impl DeviceConnectorProxyInterface for DeviceConnectorProxy {
1208 fn r#connect(
1209 &self,
1210 mut name: &str,
1211 mut server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1212 ) -> Result<(), fidl::Error> {
1213 self.client.send::<DeviceConnectorConnectRequest>(
1214 (name, server_end),
1215 0x296896c9304836cd,
1216 fidl::encoding::DynamicFlags::empty(),
1217 )
1218 }
1219}
1220
1221pub struct DeviceConnectorEventStream {
1222 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1223}
1224
1225impl std::marker::Unpin for DeviceConnectorEventStream {}
1226
1227impl futures::stream::FusedStream for DeviceConnectorEventStream {
1228 fn is_terminated(&self) -> bool {
1229 self.event_receiver.is_terminated()
1230 }
1231}
1232
1233impl futures::Stream for DeviceConnectorEventStream {
1234 type Item = Result<DeviceConnectorEvent, fidl::Error>;
1235
1236 fn poll_next(
1237 mut self: std::pin::Pin<&mut Self>,
1238 cx: &mut std::task::Context<'_>,
1239 ) -> std::task::Poll<Option<Self::Item>> {
1240 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1241 &mut self.event_receiver,
1242 cx
1243 )?) {
1244 Some(buf) => std::task::Poll::Ready(Some(DeviceConnectorEvent::decode(buf))),
1245 None => std::task::Poll::Ready(None),
1246 }
1247 }
1248}
1249
1250#[derive(Debug)]
1251pub enum DeviceConnectorEvent {}
1252
1253impl DeviceConnectorEvent {
1254 fn decode(
1256 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1257 ) -> Result<DeviceConnectorEvent, fidl::Error> {
1258 let (bytes, _handles) = buf.split_mut();
1259 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1260 debug_assert_eq!(tx_header.tx_id, 0);
1261 match tx_header.ordinal {
1262 _ => Err(fidl::Error::UnknownOrdinal {
1263 ordinal: tx_header.ordinal,
1264 protocol_name:
1265 <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1266 }),
1267 }
1268 }
1269}
1270
1271pub struct DeviceConnectorRequestStream {
1273 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1274 is_terminated: bool,
1275}
1276
1277impl std::marker::Unpin for DeviceConnectorRequestStream {}
1278
1279impl futures::stream::FusedStream for DeviceConnectorRequestStream {
1280 fn is_terminated(&self) -> bool {
1281 self.is_terminated
1282 }
1283}
1284
1285impl fidl::endpoints::RequestStream for DeviceConnectorRequestStream {
1286 type Protocol = DeviceConnectorMarker;
1287 type ControlHandle = DeviceConnectorControlHandle;
1288
1289 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1290 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1291 }
1292
1293 fn control_handle(&self) -> Self::ControlHandle {
1294 DeviceConnectorControlHandle { inner: self.inner.clone() }
1295 }
1296
1297 fn into_inner(
1298 self,
1299 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1300 {
1301 (self.inner, self.is_terminated)
1302 }
1303
1304 fn from_inner(
1305 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1306 is_terminated: bool,
1307 ) -> Self {
1308 Self { inner, is_terminated }
1309 }
1310}
1311
1312impl futures::Stream for DeviceConnectorRequestStream {
1313 type Item = Result<DeviceConnectorRequest, fidl::Error>;
1314
1315 fn poll_next(
1316 mut self: std::pin::Pin<&mut Self>,
1317 cx: &mut std::task::Context<'_>,
1318 ) -> std::task::Poll<Option<Self::Item>> {
1319 let this = &mut *self;
1320 if this.inner.check_shutdown(cx) {
1321 this.is_terminated = true;
1322 return std::task::Poll::Ready(None);
1323 }
1324 if this.is_terminated {
1325 panic!("polled DeviceConnectorRequestStream after completion");
1326 }
1327 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1328 |bytes, handles| {
1329 match this.inner.channel().read_etc(cx, bytes, handles) {
1330 std::task::Poll::Ready(Ok(())) => {}
1331 std::task::Poll::Pending => return std::task::Poll::Pending,
1332 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1333 this.is_terminated = true;
1334 return std::task::Poll::Ready(None);
1335 }
1336 std::task::Poll::Ready(Err(e)) => {
1337 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1338 e.into(),
1339 ))))
1340 }
1341 }
1342
1343 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1345
1346 std::task::Poll::Ready(Some(match header.ordinal {
1347 0x296896c9304836cd => {
1348 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1349 let mut req = fidl::new_empty!(
1350 DeviceConnectorConnectRequest,
1351 fidl::encoding::DefaultFuchsiaResourceDialect
1352 );
1353 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
1354 let control_handle =
1355 DeviceConnectorControlHandle { inner: this.inner.clone() };
1356 Ok(DeviceConnectorRequest::Connect {
1357 name: req.name,
1358 server_end: req.server_end,
1359
1360 control_handle,
1361 })
1362 }
1363 _ => Err(fidl::Error::UnknownOrdinal {
1364 ordinal: header.ordinal,
1365 protocol_name:
1366 <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1367 }),
1368 }))
1369 },
1370 )
1371 }
1372}
1373
1374#[derive(Debug)]
1377pub enum DeviceConnectorRequest {
1378 Connect {
1395 name: String,
1396 server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1397 control_handle: DeviceConnectorControlHandle,
1398 },
1399}
1400
1401impl DeviceConnectorRequest {
1402 #[allow(irrefutable_let_patterns)]
1403 pub fn into_connect(
1404 self,
1405 ) -> Option<(String, fidl::endpoints::ServerEnd<DeviceMarker>, DeviceConnectorControlHandle)>
1406 {
1407 if let DeviceConnectorRequest::Connect { name, server_end, control_handle } = self {
1408 Some((name, server_end, control_handle))
1409 } else {
1410 None
1411 }
1412 }
1413
1414 pub fn method_name(&self) -> &'static str {
1416 match *self {
1417 DeviceConnectorRequest::Connect { .. } => "connect",
1418 }
1419 }
1420}
1421
1422#[derive(Debug, Clone)]
1423pub struct DeviceConnectorControlHandle {
1424 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1425}
1426
1427impl fidl::endpoints::ControlHandle for DeviceConnectorControlHandle {
1428 fn shutdown(&self) {
1429 self.inner.shutdown()
1430 }
1431 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1432 self.inner.shutdown_with_epitaph(status)
1433 }
1434
1435 fn is_closed(&self) -> bool {
1436 self.inner.channel().is_closed()
1437 }
1438 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1439 self.inner.channel().on_closed()
1440 }
1441
1442 #[cfg(target_os = "fuchsia")]
1443 fn signal_peer(
1444 &self,
1445 clear_mask: zx::Signals,
1446 set_mask: zx::Signals,
1447 ) -> Result<(), zx_status::Status> {
1448 use fidl::Peered;
1449 self.inner.channel().signal_peer(clear_mask, set_mask)
1450 }
1451}
1452
1453impl DeviceConnectorControlHandle {}
1454
1455#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1456pub struct DeviceExtraMarker;
1457
1458impl fidl::endpoints::ProtocolMarker for DeviceExtraMarker {
1459 type Proxy = DeviceExtraProxy;
1460 type RequestStream = DeviceExtraRequestStream;
1461 #[cfg(target_os = "fuchsia")]
1462 type SynchronousProxy = DeviceExtraSynchronousProxy;
1463
1464 const DEBUG_NAME: &'static str = "(anonymous) DeviceExtra";
1465}
1466
1467pub trait DeviceExtraProxyInterface: Send + Sync {
1468 fn r#form_network(
1469 &self,
1470 params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1471 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1472 ) -> Result<(), fidl::Error>;
1473 fn r#join_network(
1474 &self,
1475 params: &JoinParams,
1476 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1477 ) -> Result<(), fidl::Error>;
1478 fn r#start_network_scan(
1479 &self,
1480 params: &NetworkScanParameters,
1481 stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1482 ) -> Result<(), fidl::Error>;
1483}
1484#[derive(Debug)]
1485#[cfg(target_os = "fuchsia")]
1486pub struct DeviceExtraSynchronousProxy {
1487 client: fidl::client::sync::Client,
1488}
1489
1490#[cfg(target_os = "fuchsia")]
1491impl fidl::endpoints::SynchronousProxy for DeviceExtraSynchronousProxy {
1492 type Proxy = DeviceExtraProxy;
1493 type Protocol = DeviceExtraMarker;
1494
1495 fn from_channel(inner: fidl::Channel) -> Self {
1496 Self::new(inner)
1497 }
1498
1499 fn into_channel(self) -> fidl::Channel {
1500 self.client.into_channel()
1501 }
1502
1503 fn as_channel(&self) -> &fidl::Channel {
1504 self.client.as_channel()
1505 }
1506}
1507
1508#[cfg(target_os = "fuchsia")]
1509impl DeviceExtraSynchronousProxy {
1510 pub fn new(channel: fidl::Channel) -> Self {
1511 let protocol_name = <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1512 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1513 }
1514
1515 pub fn into_channel(self) -> fidl::Channel {
1516 self.client.into_channel()
1517 }
1518
1519 pub fn wait_for_event(
1522 &self,
1523 deadline: zx::MonotonicInstant,
1524 ) -> Result<DeviceExtraEvent, fidl::Error> {
1525 DeviceExtraEvent::decode(self.client.wait_for_event(deadline)?)
1526 }
1527
1528 pub fn r#form_network(
1551 &self,
1552 mut params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1553 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1554 ) -> Result<(), fidl::Error> {
1555 self.client.send::<DeviceExtraFormNetworkRequest>(
1556 (params, progress),
1557 0x6a8135f84bfc90e,
1558 fidl::encoding::DynamicFlags::empty(),
1559 )
1560 }
1561
1562 pub fn r#join_network(
1577 &self,
1578 mut params: &JoinParams,
1579 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1580 ) -> Result<(), fidl::Error> {
1581 self.client.send::<DeviceExtraJoinNetworkRequest>(
1582 (params, progress),
1583 0x3ea583bab79f81c0,
1584 fidl::encoding::DynamicFlags::empty(),
1585 )
1586 }
1587
1588 pub fn r#start_network_scan(
1608 &self,
1609 mut params: &NetworkScanParameters,
1610 mut stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1611 ) -> Result<(), fidl::Error> {
1612 self.client.send::<DeviceExtraStartNetworkScanRequest>(
1613 (params, stream),
1614 0x6288c73b79188b40,
1615 fidl::encoding::DynamicFlags::empty(),
1616 )
1617 }
1618}
1619
1620#[cfg(target_os = "fuchsia")]
1621impl From<DeviceExtraSynchronousProxy> for zx::Handle {
1622 fn from(value: DeviceExtraSynchronousProxy) -> Self {
1623 value.into_channel().into()
1624 }
1625}
1626
1627#[cfg(target_os = "fuchsia")]
1628impl From<fidl::Channel> for DeviceExtraSynchronousProxy {
1629 fn from(value: fidl::Channel) -> Self {
1630 Self::new(value)
1631 }
1632}
1633
1634#[cfg(target_os = "fuchsia")]
1635impl fidl::endpoints::FromClient for DeviceExtraSynchronousProxy {
1636 type Protocol = DeviceExtraMarker;
1637
1638 fn from_client(value: fidl::endpoints::ClientEnd<DeviceExtraMarker>) -> Self {
1639 Self::new(value.into_channel())
1640 }
1641}
1642
1643#[derive(Debug, Clone)]
1644pub struct DeviceExtraProxy {
1645 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1646}
1647
1648impl fidl::endpoints::Proxy for DeviceExtraProxy {
1649 type Protocol = DeviceExtraMarker;
1650
1651 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1652 Self::new(inner)
1653 }
1654
1655 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1656 self.client.into_channel().map_err(|client| Self { client })
1657 }
1658
1659 fn as_channel(&self) -> &::fidl::AsyncChannel {
1660 self.client.as_channel()
1661 }
1662}
1663
1664impl DeviceExtraProxy {
1665 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1667 let protocol_name = <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1668 Self { client: fidl::client::Client::new(channel, protocol_name) }
1669 }
1670
1671 pub fn take_event_stream(&self) -> DeviceExtraEventStream {
1677 DeviceExtraEventStream { event_receiver: self.client.take_event_receiver() }
1678 }
1679
1680 pub fn r#form_network(
1703 &self,
1704 mut params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1705 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1706 ) -> Result<(), fidl::Error> {
1707 DeviceExtraProxyInterface::r#form_network(self, params, progress)
1708 }
1709
1710 pub fn r#join_network(
1725 &self,
1726 mut params: &JoinParams,
1727 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1728 ) -> Result<(), fidl::Error> {
1729 DeviceExtraProxyInterface::r#join_network(self, params, progress)
1730 }
1731
1732 pub fn r#start_network_scan(
1752 &self,
1753 mut params: &NetworkScanParameters,
1754 mut stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1755 ) -> Result<(), fidl::Error> {
1756 DeviceExtraProxyInterface::r#start_network_scan(self, params, stream)
1757 }
1758}
1759
1760impl DeviceExtraProxyInterface for DeviceExtraProxy {
1761 fn r#form_network(
1762 &self,
1763 mut params: &fidl_fuchsia_lowpan_device::ProvisioningParams,
1764 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1765 ) -> Result<(), fidl::Error> {
1766 self.client.send::<DeviceExtraFormNetworkRequest>(
1767 (params, progress),
1768 0x6a8135f84bfc90e,
1769 fidl::encoding::DynamicFlags::empty(),
1770 )
1771 }
1772
1773 fn r#join_network(
1774 &self,
1775 mut params: &JoinParams,
1776 mut progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
1777 ) -> Result<(), fidl::Error> {
1778 self.client.send::<DeviceExtraJoinNetworkRequest>(
1779 (params, progress),
1780 0x3ea583bab79f81c0,
1781 fidl::encoding::DynamicFlags::empty(),
1782 )
1783 }
1784
1785 fn r#start_network_scan(
1786 &self,
1787 mut params: &NetworkScanParameters,
1788 mut stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
1789 ) -> Result<(), fidl::Error> {
1790 self.client.send::<DeviceExtraStartNetworkScanRequest>(
1791 (params, stream),
1792 0x6288c73b79188b40,
1793 fidl::encoding::DynamicFlags::empty(),
1794 )
1795 }
1796}
1797
1798pub struct DeviceExtraEventStream {
1799 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1800}
1801
1802impl std::marker::Unpin for DeviceExtraEventStream {}
1803
1804impl futures::stream::FusedStream for DeviceExtraEventStream {
1805 fn is_terminated(&self) -> bool {
1806 self.event_receiver.is_terminated()
1807 }
1808}
1809
1810impl futures::Stream for DeviceExtraEventStream {
1811 type Item = Result<DeviceExtraEvent, fidl::Error>;
1812
1813 fn poll_next(
1814 mut self: std::pin::Pin<&mut Self>,
1815 cx: &mut std::task::Context<'_>,
1816 ) -> std::task::Poll<Option<Self::Item>> {
1817 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1818 &mut self.event_receiver,
1819 cx
1820 )?) {
1821 Some(buf) => std::task::Poll::Ready(Some(DeviceExtraEvent::decode(buf))),
1822 None => std::task::Poll::Ready(None),
1823 }
1824 }
1825}
1826
1827#[derive(Debug)]
1828pub enum DeviceExtraEvent {}
1829
1830impl DeviceExtraEvent {
1831 fn decode(
1833 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1834 ) -> Result<DeviceExtraEvent, fidl::Error> {
1835 let (bytes, _handles) = buf.split_mut();
1836 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1837 debug_assert_eq!(tx_header.tx_id, 0);
1838 match tx_header.ordinal {
1839 _ => Err(fidl::Error::UnknownOrdinal {
1840 ordinal: tx_header.ordinal,
1841 protocol_name: <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1842 }),
1843 }
1844 }
1845}
1846
1847pub struct DeviceExtraRequestStream {
1849 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1850 is_terminated: bool,
1851}
1852
1853impl std::marker::Unpin for DeviceExtraRequestStream {}
1854
1855impl futures::stream::FusedStream for DeviceExtraRequestStream {
1856 fn is_terminated(&self) -> bool {
1857 self.is_terminated
1858 }
1859}
1860
1861impl fidl::endpoints::RequestStream for DeviceExtraRequestStream {
1862 type Protocol = DeviceExtraMarker;
1863 type ControlHandle = DeviceExtraControlHandle;
1864
1865 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1866 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1867 }
1868
1869 fn control_handle(&self) -> Self::ControlHandle {
1870 DeviceExtraControlHandle { inner: self.inner.clone() }
1871 }
1872
1873 fn into_inner(
1874 self,
1875 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1876 {
1877 (self.inner, self.is_terminated)
1878 }
1879
1880 fn from_inner(
1881 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1882 is_terminated: bool,
1883 ) -> Self {
1884 Self { inner, is_terminated }
1885 }
1886}
1887
1888impl futures::Stream for DeviceExtraRequestStream {
1889 type Item = Result<DeviceExtraRequest, fidl::Error>;
1890
1891 fn poll_next(
1892 mut self: std::pin::Pin<&mut Self>,
1893 cx: &mut std::task::Context<'_>,
1894 ) -> std::task::Poll<Option<Self::Item>> {
1895 let this = &mut *self;
1896 if this.inner.check_shutdown(cx) {
1897 this.is_terminated = true;
1898 return std::task::Poll::Ready(None);
1899 }
1900 if this.is_terminated {
1901 panic!("polled DeviceExtraRequestStream after completion");
1902 }
1903 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1904 |bytes, handles| {
1905 match this.inner.channel().read_etc(cx, bytes, handles) {
1906 std::task::Poll::Ready(Ok(())) => {}
1907 std::task::Poll::Pending => return std::task::Poll::Pending,
1908 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1909 this.is_terminated = true;
1910 return std::task::Poll::Ready(None);
1911 }
1912 std::task::Poll::Ready(Err(e)) => {
1913 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1914 e.into(),
1915 ))))
1916 }
1917 }
1918
1919 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1921
1922 std::task::Poll::Ready(Some(match header.ordinal {
1923 0x6a8135f84bfc90e => {
1924 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1925 let mut req = fidl::new_empty!(
1926 DeviceExtraFormNetworkRequest,
1927 fidl::encoding::DefaultFuchsiaResourceDialect
1928 );
1929 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraFormNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
1930 let control_handle = DeviceExtraControlHandle { inner: this.inner.clone() };
1931 Ok(DeviceExtraRequest::FormNetwork {
1932 params: req.params,
1933 progress: req.progress,
1934
1935 control_handle,
1936 })
1937 }
1938 0x3ea583bab79f81c0 => {
1939 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1940 let mut req = fidl::new_empty!(
1941 DeviceExtraJoinNetworkRequest,
1942 fidl::encoding::DefaultFuchsiaResourceDialect
1943 );
1944 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraJoinNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
1945 let control_handle = DeviceExtraControlHandle { inner: this.inner.clone() };
1946 Ok(DeviceExtraRequest::JoinNetwork {
1947 params: req.params,
1948 progress: req.progress,
1949
1950 control_handle,
1951 })
1952 }
1953 0x6288c73b79188b40 => {
1954 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1955 let mut req = fidl::new_empty!(
1956 DeviceExtraStartNetworkScanRequest,
1957 fidl::encoding::DefaultFuchsiaResourceDialect
1958 );
1959 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraStartNetworkScanRequest>(&header, _body_bytes, handles, &mut req)?;
1960 let control_handle = DeviceExtraControlHandle { inner: this.inner.clone() };
1961 Ok(DeviceExtraRequest::StartNetworkScan {
1962 params: req.params,
1963 stream: req.stream,
1964
1965 control_handle,
1966 })
1967 }
1968 _ => Err(fidl::Error::UnknownOrdinal {
1969 ordinal: header.ordinal,
1970 protocol_name:
1971 <DeviceExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1972 }),
1973 }))
1974 },
1975 )
1976 }
1977}
1978
1979#[derive(Debug)]
1985pub enum DeviceExtraRequest {
1986 FormNetwork {
2009 params: fidl_fuchsia_lowpan_device::ProvisioningParams,
2010 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
2011 control_handle: DeviceExtraControlHandle,
2012 },
2013 JoinNetwork {
2028 params: JoinParams,
2029 progress: fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
2030 control_handle: DeviceExtraControlHandle,
2031 },
2032 StartNetworkScan {
2052 params: NetworkScanParameters,
2053 stream: fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
2054 control_handle: DeviceExtraControlHandle,
2055 },
2056}
2057
2058impl DeviceExtraRequest {
2059 #[allow(irrefutable_let_patterns)]
2060 pub fn into_form_network(
2061 self,
2062 ) -> Option<(
2063 fidl_fuchsia_lowpan_device::ProvisioningParams,
2064 fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
2065 DeviceExtraControlHandle,
2066 )> {
2067 if let DeviceExtraRequest::FormNetwork { params, progress, control_handle } = self {
2068 Some((params, progress, control_handle))
2069 } else {
2070 None
2071 }
2072 }
2073
2074 #[allow(irrefutable_let_patterns)]
2075 pub fn into_join_network(
2076 self,
2077 ) -> Option<(
2078 JoinParams,
2079 fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>,
2080 DeviceExtraControlHandle,
2081 )> {
2082 if let DeviceExtraRequest::JoinNetwork { params, progress, control_handle } = self {
2083 Some((params, progress, control_handle))
2084 } else {
2085 None
2086 }
2087 }
2088
2089 #[allow(irrefutable_let_patterns)]
2090 pub fn into_start_network_scan(
2091 self,
2092 ) -> Option<(
2093 NetworkScanParameters,
2094 fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>,
2095 DeviceExtraControlHandle,
2096 )> {
2097 if let DeviceExtraRequest::StartNetworkScan { params, stream, control_handle } = self {
2098 Some((params, stream, control_handle))
2099 } else {
2100 None
2101 }
2102 }
2103
2104 pub fn method_name(&self) -> &'static str {
2106 match *self {
2107 DeviceExtraRequest::FormNetwork { .. } => "form_network",
2108 DeviceExtraRequest::JoinNetwork { .. } => "join_network",
2109 DeviceExtraRequest::StartNetworkScan { .. } => "start_network_scan",
2110 }
2111 }
2112}
2113
2114#[derive(Debug, Clone)]
2115pub struct DeviceExtraControlHandle {
2116 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2117}
2118
2119impl fidl::endpoints::ControlHandle for DeviceExtraControlHandle {
2120 fn shutdown(&self) {
2121 self.inner.shutdown()
2122 }
2123 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2124 self.inner.shutdown_with_epitaph(status)
2125 }
2126
2127 fn is_closed(&self) -> bool {
2128 self.inner.channel().is_closed()
2129 }
2130 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2131 self.inner.channel().on_closed()
2132 }
2133
2134 #[cfg(target_os = "fuchsia")]
2135 fn signal_peer(
2136 &self,
2137 clear_mask: zx::Signals,
2138 set_mask: zx::Signals,
2139 ) -> Result<(), zx_status::Status> {
2140 use fidl::Peered;
2141 self.inner.channel().signal_peer(clear_mask, set_mask)
2142 }
2143}
2144
2145impl DeviceExtraControlHandle {}
2146
2147#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2148pub struct DeviceExtraConnectorMarker;
2149
2150impl fidl::endpoints::ProtocolMarker for DeviceExtraConnectorMarker {
2151 type Proxy = DeviceExtraConnectorProxy;
2152 type RequestStream = DeviceExtraConnectorRequestStream;
2153 #[cfg(target_os = "fuchsia")]
2154 type SynchronousProxy = DeviceExtraConnectorSynchronousProxy;
2155
2156 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceExtraConnector";
2157}
2158impl fidl::endpoints::DiscoverableProtocolMarker for DeviceExtraConnectorMarker {}
2159
2160pub trait DeviceExtraConnectorProxyInterface: Send + Sync {
2161 fn r#connect(
2162 &self,
2163 name: &str,
2164 server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2165 ) -> Result<(), fidl::Error>;
2166}
2167#[derive(Debug)]
2168#[cfg(target_os = "fuchsia")]
2169pub struct DeviceExtraConnectorSynchronousProxy {
2170 client: fidl::client::sync::Client,
2171}
2172
2173#[cfg(target_os = "fuchsia")]
2174impl fidl::endpoints::SynchronousProxy for DeviceExtraConnectorSynchronousProxy {
2175 type Proxy = DeviceExtraConnectorProxy;
2176 type Protocol = DeviceExtraConnectorMarker;
2177
2178 fn from_channel(inner: fidl::Channel) -> Self {
2179 Self::new(inner)
2180 }
2181
2182 fn into_channel(self) -> fidl::Channel {
2183 self.client.into_channel()
2184 }
2185
2186 fn as_channel(&self) -> &fidl::Channel {
2187 self.client.as_channel()
2188 }
2189}
2190
2191#[cfg(target_os = "fuchsia")]
2192impl DeviceExtraConnectorSynchronousProxy {
2193 pub fn new(channel: fidl::Channel) -> Self {
2194 let protocol_name =
2195 <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2196 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2197 }
2198
2199 pub fn into_channel(self) -> fidl::Channel {
2200 self.client.into_channel()
2201 }
2202
2203 pub fn wait_for_event(
2206 &self,
2207 deadline: zx::MonotonicInstant,
2208 ) -> Result<DeviceExtraConnectorEvent, fidl::Error> {
2209 DeviceExtraConnectorEvent::decode(self.client.wait_for_event(deadline)?)
2210 }
2211
2212 pub fn r#connect(
2229 &self,
2230 mut name: &str,
2231 mut server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2232 ) -> Result<(), fidl::Error> {
2233 self.client.send::<DeviceExtraConnectorConnectRequest>(
2234 (name, server_end),
2235 0x3fcb37e4226c81e9,
2236 fidl::encoding::DynamicFlags::empty(),
2237 )
2238 }
2239}
2240
2241#[cfg(target_os = "fuchsia")]
2242impl From<DeviceExtraConnectorSynchronousProxy> for zx::Handle {
2243 fn from(value: DeviceExtraConnectorSynchronousProxy) -> Self {
2244 value.into_channel().into()
2245 }
2246}
2247
2248#[cfg(target_os = "fuchsia")]
2249impl From<fidl::Channel> for DeviceExtraConnectorSynchronousProxy {
2250 fn from(value: fidl::Channel) -> Self {
2251 Self::new(value)
2252 }
2253}
2254
2255#[cfg(target_os = "fuchsia")]
2256impl fidl::endpoints::FromClient for DeviceExtraConnectorSynchronousProxy {
2257 type Protocol = DeviceExtraConnectorMarker;
2258
2259 fn from_client(value: fidl::endpoints::ClientEnd<DeviceExtraConnectorMarker>) -> Self {
2260 Self::new(value.into_channel())
2261 }
2262}
2263
2264#[derive(Debug, Clone)]
2265pub struct DeviceExtraConnectorProxy {
2266 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2267}
2268
2269impl fidl::endpoints::Proxy for DeviceExtraConnectorProxy {
2270 type Protocol = DeviceExtraConnectorMarker;
2271
2272 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2273 Self::new(inner)
2274 }
2275
2276 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2277 self.client.into_channel().map_err(|client| Self { client })
2278 }
2279
2280 fn as_channel(&self) -> &::fidl::AsyncChannel {
2281 self.client.as_channel()
2282 }
2283}
2284
2285impl DeviceExtraConnectorProxy {
2286 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2288 let protocol_name =
2289 <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2290 Self { client: fidl::client::Client::new(channel, protocol_name) }
2291 }
2292
2293 pub fn take_event_stream(&self) -> DeviceExtraConnectorEventStream {
2299 DeviceExtraConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2300 }
2301
2302 pub fn r#connect(
2319 &self,
2320 mut name: &str,
2321 mut server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2322 ) -> Result<(), fidl::Error> {
2323 DeviceExtraConnectorProxyInterface::r#connect(self, name, server_end)
2324 }
2325}
2326
2327impl DeviceExtraConnectorProxyInterface for DeviceExtraConnectorProxy {
2328 fn r#connect(
2329 &self,
2330 mut name: &str,
2331 mut server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2332 ) -> Result<(), fidl::Error> {
2333 self.client.send::<DeviceExtraConnectorConnectRequest>(
2334 (name, server_end),
2335 0x3fcb37e4226c81e9,
2336 fidl::encoding::DynamicFlags::empty(),
2337 )
2338 }
2339}
2340
2341pub struct DeviceExtraConnectorEventStream {
2342 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2343}
2344
2345impl std::marker::Unpin for DeviceExtraConnectorEventStream {}
2346
2347impl futures::stream::FusedStream for DeviceExtraConnectorEventStream {
2348 fn is_terminated(&self) -> bool {
2349 self.event_receiver.is_terminated()
2350 }
2351}
2352
2353impl futures::Stream for DeviceExtraConnectorEventStream {
2354 type Item = Result<DeviceExtraConnectorEvent, fidl::Error>;
2355
2356 fn poll_next(
2357 mut self: std::pin::Pin<&mut Self>,
2358 cx: &mut std::task::Context<'_>,
2359 ) -> std::task::Poll<Option<Self::Item>> {
2360 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2361 &mut self.event_receiver,
2362 cx
2363 )?) {
2364 Some(buf) => std::task::Poll::Ready(Some(DeviceExtraConnectorEvent::decode(buf))),
2365 None => std::task::Poll::Ready(None),
2366 }
2367 }
2368}
2369
2370#[derive(Debug)]
2371pub enum DeviceExtraConnectorEvent {}
2372
2373impl DeviceExtraConnectorEvent {
2374 fn decode(
2376 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2377 ) -> Result<DeviceExtraConnectorEvent, fidl::Error> {
2378 let (bytes, _handles) = buf.split_mut();
2379 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2380 debug_assert_eq!(tx_header.tx_id, 0);
2381 match tx_header.ordinal {
2382 _ => Err(fidl::Error::UnknownOrdinal {
2383 ordinal: tx_header.ordinal,
2384 protocol_name:
2385 <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2386 }),
2387 }
2388 }
2389}
2390
2391pub struct DeviceExtraConnectorRequestStream {
2393 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2394 is_terminated: bool,
2395}
2396
2397impl std::marker::Unpin for DeviceExtraConnectorRequestStream {}
2398
2399impl futures::stream::FusedStream for DeviceExtraConnectorRequestStream {
2400 fn is_terminated(&self) -> bool {
2401 self.is_terminated
2402 }
2403}
2404
2405impl fidl::endpoints::RequestStream for DeviceExtraConnectorRequestStream {
2406 type Protocol = DeviceExtraConnectorMarker;
2407 type ControlHandle = DeviceExtraConnectorControlHandle;
2408
2409 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2410 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2411 }
2412
2413 fn control_handle(&self) -> Self::ControlHandle {
2414 DeviceExtraConnectorControlHandle { inner: self.inner.clone() }
2415 }
2416
2417 fn into_inner(
2418 self,
2419 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2420 {
2421 (self.inner, self.is_terminated)
2422 }
2423
2424 fn from_inner(
2425 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2426 is_terminated: bool,
2427 ) -> Self {
2428 Self { inner, is_terminated }
2429 }
2430}
2431
2432impl futures::Stream for DeviceExtraConnectorRequestStream {
2433 type Item = Result<DeviceExtraConnectorRequest, fidl::Error>;
2434
2435 fn poll_next(
2436 mut self: std::pin::Pin<&mut Self>,
2437 cx: &mut std::task::Context<'_>,
2438 ) -> std::task::Poll<Option<Self::Item>> {
2439 let this = &mut *self;
2440 if this.inner.check_shutdown(cx) {
2441 this.is_terminated = true;
2442 return std::task::Poll::Ready(None);
2443 }
2444 if this.is_terminated {
2445 panic!("polled DeviceExtraConnectorRequestStream after completion");
2446 }
2447 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2448 |bytes, handles| {
2449 match this.inner.channel().read_etc(cx, bytes, handles) {
2450 std::task::Poll::Ready(Ok(())) => {}
2451 std::task::Poll::Pending => return std::task::Poll::Pending,
2452 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2453 this.is_terminated = true;
2454 return std::task::Poll::Ready(None);
2455 }
2456 std::task::Poll::Ready(Err(e)) => {
2457 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2458 e.into(),
2459 ))))
2460 }
2461 }
2462
2463 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2465
2466 std::task::Poll::Ready(Some(match header.ordinal {
2467 0x3fcb37e4226c81e9 => {
2468 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2469 let mut req = fidl::new_empty!(DeviceExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2470 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceExtraConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2471 let control_handle = DeviceExtraConnectorControlHandle {
2472 inner: this.inner.clone(),
2473 };
2474 Ok(DeviceExtraConnectorRequest::Connect {name: req.name,
2475server_end: req.server_end,
2476
2477 control_handle,
2478 })
2479 }
2480 _ => Err(fidl::Error::UnknownOrdinal {
2481 ordinal: header.ordinal,
2482 protocol_name: <DeviceExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2483 }),
2484 }))
2485 },
2486 )
2487 }
2488}
2489
2490#[derive(Debug)]
2493pub enum DeviceExtraConnectorRequest {
2494 Connect {
2511 name: String,
2512 server_end: fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2513 control_handle: DeviceExtraConnectorControlHandle,
2514 },
2515}
2516
2517impl DeviceExtraConnectorRequest {
2518 #[allow(irrefutable_let_patterns)]
2519 pub fn into_connect(
2520 self,
2521 ) -> Option<(
2522 String,
2523 fidl::endpoints::ServerEnd<DeviceExtraMarker>,
2524 DeviceExtraConnectorControlHandle,
2525 )> {
2526 if let DeviceExtraConnectorRequest::Connect { name, server_end, control_handle } = self {
2527 Some((name, server_end, control_handle))
2528 } else {
2529 None
2530 }
2531 }
2532
2533 pub fn method_name(&self) -> &'static str {
2535 match *self {
2536 DeviceExtraConnectorRequest::Connect { .. } => "connect",
2537 }
2538 }
2539}
2540
2541#[derive(Debug, Clone)]
2542pub struct DeviceExtraConnectorControlHandle {
2543 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2544}
2545
2546impl fidl::endpoints::ControlHandle for DeviceExtraConnectorControlHandle {
2547 fn shutdown(&self) {
2548 self.inner.shutdown()
2549 }
2550 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2551 self.inner.shutdown_with_epitaph(status)
2552 }
2553
2554 fn is_closed(&self) -> bool {
2555 self.inner.channel().is_closed()
2556 }
2557 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2558 self.inner.channel().on_closed()
2559 }
2560
2561 #[cfg(target_os = "fuchsia")]
2562 fn signal_peer(
2563 &self,
2564 clear_mask: zx::Signals,
2565 set_mask: zx::Signals,
2566 ) -> Result<(), zx_status::Status> {
2567 use fidl::Peered;
2568 self.inner.channel().signal_peer(clear_mask, set_mask)
2569 }
2570}
2571
2572impl DeviceExtraConnectorControlHandle {}
2573
2574#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2575pub struct DeviceRouteMarker;
2576
2577impl fidl::endpoints::ProtocolMarker for DeviceRouteMarker {
2578 type Proxy = DeviceRouteProxy;
2579 type RequestStream = DeviceRouteRequestStream;
2580 #[cfg(target_os = "fuchsia")]
2581 type SynchronousProxy = DeviceRouteSynchronousProxy;
2582
2583 const DEBUG_NAME: &'static str = "(anonymous) DeviceRoute";
2584}
2585
2586pub trait DeviceRouteProxyInterface: Send + Sync {
2587 type RegisterOnMeshPrefixResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2588 + Send;
2589 fn r#register_on_mesh_prefix(
2590 &self,
2591 prefix: &OnMeshPrefix,
2592 ) -> Self::RegisterOnMeshPrefixResponseFut;
2593 type UnregisterOnMeshPrefixResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2594 + Send;
2595 fn r#unregister_on_mesh_prefix(
2596 &self,
2597 subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2598 ) -> Self::UnregisterOnMeshPrefixResponseFut;
2599 type RegisterExternalRouteResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2600 + Send;
2601 fn r#register_external_route(
2602 &self,
2603 external_route: &ExternalRoute,
2604 ) -> Self::RegisterExternalRouteResponseFut;
2605 type UnregisterExternalRouteResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2606 + Send;
2607 fn r#unregister_external_route(
2608 &self,
2609 subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2610 ) -> Self::UnregisterExternalRouteResponseFut;
2611}
2612#[derive(Debug)]
2613#[cfg(target_os = "fuchsia")]
2614pub struct DeviceRouteSynchronousProxy {
2615 client: fidl::client::sync::Client,
2616}
2617
2618#[cfg(target_os = "fuchsia")]
2619impl fidl::endpoints::SynchronousProxy for DeviceRouteSynchronousProxy {
2620 type Proxy = DeviceRouteProxy;
2621 type Protocol = DeviceRouteMarker;
2622
2623 fn from_channel(inner: fidl::Channel) -> Self {
2624 Self::new(inner)
2625 }
2626
2627 fn into_channel(self) -> fidl::Channel {
2628 self.client.into_channel()
2629 }
2630
2631 fn as_channel(&self) -> &fidl::Channel {
2632 self.client.as_channel()
2633 }
2634}
2635
2636#[cfg(target_os = "fuchsia")]
2637impl DeviceRouteSynchronousProxy {
2638 pub fn new(channel: fidl::Channel) -> Self {
2639 let protocol_name = <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2640 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2641 }
2642
2643 pub fn into_channel(self) -> fidl::Channel {
2644 self.client.into_channel()
2645 }
2646
2647 pub fn wait_for_event(
2650 &self,
2651 deadline: zx::MonotonicInstant,
2652 ) -> Result<DeviceRouteEvent, fidl::Error> {
2653 DeviceRouteEvent::decode(self.client.wait_for_event(deadline)?)
2654 }
2655
2656 pub fn r#register_on_mesh_prefix(
2674 &self,
2675 mut prefix: &OnMeshPrefix,
2676 ___deadline: zx::MonotonicInstant,
2677 ) -> Result<(), fidl::Error> {
2678 let _response = self
2679 .client
2680 .send_query::<DeviceRouteRegisterOnMeshPrefixRequest, fidl::encoding::EmptyPayload>(
2681 (prefix,),
2682 0x2c4135231eb97f61,
2683 fidl::encoding::DynamicFlags::empty(),
2684 ___deadline,
2685 )?;
2686 Ok(_response)
2687 }
2688
2689 pub fn r#unregister_on_mesh_prefix(
2696 &self,
2697 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2698 ___deadline: zx::MonotonicInstant,
2699 ) -> Result<(), fidl::Error> {
2700 let _response = self
2701 .client
2702 .send_query::<DeviceRouteUnregisterOnMeshPrefixRequest, fidl::encoding::EmptyPayload>(
2703 (subnet,),
2704 0x82d5184028b797f,
2705 fidl::encoding::DynamicFlags::empty(),
2706 ___deadline,
2707 )?;
2708 Ok(_response)
2709 }
2710
2711 pub fn r#register_external_route(
2729 &self,
2730 mut external_route: &ExternalRoute,
2731 ___deadline: zx::MonotonicInstant,
2732 ) -> Result<(), fidl::Error> {
2733 let _response = self
2734 .client
2735 .send_query::<DeviceRouteRegisterExternalRouteRequest, fidl::encoding::EmptyPayload>(
2736 (external_route,),
2737 0x75f70f0fc34a5a73,
2738 fidl::encoding::DynamicFlags::empty(),
2739 ___deadline,
2740 )?;
2741 Ok(_response)
2742 }
2743
2744 pub fn r#unregister_external_route(
2751 &self,
2752 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2753 ___deadline: zx::MonotonicInstant,
2754 ) -> Result<(), fidl::Error> {
2755 let _response = self
2756 .client
2757 .send_query::<DeviceRouteUnregisterExternalRouteRequest, fidl::encoding::EmptyPayload>(
2758 (subnet,),
2759 0x3769be353b1d7088,
2760 fidl::encoding::DynamicFlags::empty(),
2761 ___deadline,
2762 )?;
2763 Ok(_response)
2764 }
2765}
2766
2767#[cfg(target_os = "fuchsia")]
2768impl From<DeviceRouteSynchronousProxy> for zx::Handle {
2769 fn from(value: DeviceRouteSynchronousProxy) -> Self {
2770 value.into_channel().into()
2771 }
2772}
2773
2774#[cfg(target_os = "fuchsia")]
2775impl From<fidl::Channel> for DeviceRouteSynchronousProxy {
2776 fn from(value: fidl::Channel) -> Self {
2777 Self::new(value)
2778 }
2779}
2780
2781#[cfg(target_os = "fuchsia")]
2782impl fidl::endpoints::FromClient for DeviceRouteSynchronousProxy {
2783 type Protocol = DeviceRouteMarker;
2784
2785 fn from_client(value: fidl::endpoints::ClientEnd<DeviceRouteMarker>) -> Self {
2786 Self::new(value.into_channel())
2787 }
2788}
2789
2790#[derive(Debug, Clone)]
2791pub struct DeviceRouteProxy {
2792 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2793}
2794
2795impl fidl::endpoints::Proxy for DeviceRouteProxy {
2796 type Protocol = DeviceRouteMarker;
2797
2798 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2799 Self::new(inner)
2800 }
2801
2802 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2803 self.client.into_channel().map_err(|client| Self { client })
2804 }
2805
2806 fn as_channel(&self) -> &::fidl::AsyncChannel {
2807 self.client.as_channel()
2808 }
2809}
2810
2811impl DeviceRouteProxy {
2812 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2814 let protocol_name = <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2815 Self { client: fidl::client::Client::new(channel, protocol_name) }
2816 }
2817
2818 pub fn take_event_stream(&self) -> DeviceRouteEventStream {
2824 DeviceRouteEventStream { event_receiver: self.client.take_event_receiver() }
2825 }
2826
2827 pub fn r#register_on_mesh_prefix(
2845 &self,
2846 mut prefix: &OnMeshPrefix,
2847 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2848 DeviceRouteProxyInterface::r#register_on_mesh_prefix(self, prefix)
2849 }
2850
2851 pub fn r#unregister_on_mesh_prefix(
2858 &self,
2859 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2860 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2861 DeviceRouteProxyInterface::r#unregister_on_mesh_prefix(self, subnet)
2862 }
2863
2864 pub fn r#register_external_route(
2882 &self,
2883 mut external_route: &ExternalRoute,
2884 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2885 DeviceRouteProxyInterface::r#register_external_route(self, external_route)
2886 }
2887
2888 pub fn r#unregister_external_route(
2895 &self,
2896 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2897 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2898 DeviceRouteProxyInterface::r#unregister_external_route(self, subnet)
2899 }
2900}
2901
2902impl DeviceRouteProxyInterface for DeviceRouteProxy {
2903 type RegisterOnMeshPrefixResponseFut =
2904 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2905 fn r#register_on_mesh_prefix(
2906 &self,
2907 mut prefix: &OnMeshPrefix,
2908 ) -> Self::RegisterOnMeshPrefixResponseFut {
2909 fn _decode(
2910 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2911 ) -> Result<(), fidl::Error> {
2912 let _response = fidl::client::decode_transaction_body::<
2913 fidl::encoding::EmptyPayload,
2914 fidl::encoding::DefaultFuchsiaResourceDialect,
2915 0x2c4135231eb97f61,
2916 >(_buf?)?;
2917 Ok(_response)
2918 }
2919 self.client.send_query_and_decode::<DeviceRouteRegisterOnMeshPrefixRequest, ()>(
2920 (prefix,),
2921 0x2c4135231eb97f61,
2922 fidl::encoding::DynamicFlags::empty(),
2923 _decode,
2924 )
2925 }
2926
2927 type UnregisterOnMeshPrefixResponseFut =
2928 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2929 fn r#unregister_on_mesh_prefix(
2930 &self,
2931 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2932 ) -> Self::UnregisterOnMeshPrefixResponseFut {
2933 fn _decode(
2934 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2935 ) -> Result<(), fidl::Error> {
2936 let _response = fidl::client::decode_transaction_body::<
2937 fidl::encoding::EmptyPayload,
2938 fidl::encoding::DefaultFuchsiaResourceDialect,
2939 0x82d5184028b797f,
2940 >(_buf?)?;
2941 Ok(_response)
2942 }
2943 self.client.send_query_and_decode::<DeviceRouteUnregisterOnMeshPrefixRequest, ()>(
2944 (subnet,),
2945 0x82d5184028b797f,
2946 fidl::encoding::DynamicFlags::empty(),
2947 _decode,
2948 )
2949 }
2950
2951 type RegisterExternalRouteResponseFut =
2952 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2953 fn r#register_external_route(
2954 &self,
2955 mut external_route: &ExternalRoute,
2956 ) -> Self::RegisterExternalRouteResponseFut {
2957 fn _decode(
2958 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2959 ) -> Result<(), fidl::Error> {
2960 let _response = fidl::client::decode_transaction_body::<
2961 fidl::encoding::EmptyPayload,
2962 fidl::encoding::DefaultFuchsiaResourceDialect,
2963 0x75f70f0fc34a5a73,
2964 >(_buf?)?;
2965 Ok(_response)
2966 }
2967 self.client.send_query_and_decode::<DeviceRouteRegisterExternalRouteRequest, ()>(
2968 (external_route,),
2969 0x75f70f0fc34a5a73,
2970 fidl::encoding::DynamicFlags::empty(),
2971 _decode,
2972 )
2973 }
2974
2975 type UnregisterExternalRouteResponseFut =
2976 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2977 fn r#unregister_external_route(
2978 &self,
2979 mut subnet: &fidl_fuchsia_net::Ipv6AddressWithPrefix,
2980 ) -> Self::UnregisterExternalRouteResponseFut {
2981 fn _decode(
2982 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2983 ) -> Result<(), fidl::Error> {
2984 let _response = fidl::client::decode_transaction_body::<
2985 fidl::encoding::EmptyPayload,
2986 fidl::encoding::DefaultFuchsiaResourceDialect,
2987 0x3769be353b1d7088,
2988 >(_buf?)?;
2989 Ok(_response)
2990 }
2991 self.client.send_query_and_decode::<DeviceRouteUnregisterExternalRouteRequest, ()>(
2992 (subnet,),
2993 0x3769be353b1d7088,
2994 fidl::encoding::DynamicFlags::empty(),
2995 _decode,
2996 )
2997 }
2998}
2999
3000pub struct DeviceRouteEventStream {
3001 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3002}
3003
3004impl std::marker::Unpin for DeviceRouteEventStream {}
3005
3006impl futures::stream::FusedStream for DeviceRouteEventStream {
3007 fn is_terminated(&self) -> bool {
3008 self.event_receiver.is_terminated()
3009 }
3010}
3011
3012impl futures::Stream for DeviceRouteEventStream {
3013 type Item = Result<DeviceRouteEvent, fidl::Error>;
3014
3015 fn poll_next(
3016 mut self: std::pin::Pin<&mut Self>,
3017 cx: &mut std::task::Context<'_>,
3018 ) -> std::task::Poll<Option<Self::Item>> {
3019 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3020 &mut self.event_receiver,
3021 cx
3022 )?) {
3023 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteEvent::decode(buf))),
3024 None => std::task::Poll::Ready(None),
3025 }
3026 }
3027}
3028
3029#[derive(Debug)]
3030pub enum DeviceRouteEvent {}
3031
3032impl DeviceRouteEvent {
3033 fn decode(
3035 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3036 ) -> Result<DeviceRouteEvent, fidl::Error> {
3037 let (bytes, _handles) = buf.split_mut();
3038 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3039 debug_assert_eq!(tx_header.tx_id, 0);
3040 match tx_header.ordinal {
3041 _ => Err(fidl::Error::UnknownOrdinal {
3042 ordinal: tx_header.ordinal,
3043 protocol_name: <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3044 }),
3045 }
3046 }
3047}
3048
3049pub struct DeviceRouteRequestStream {
3051 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3052 is_terminated: bool,
3053}
3054
3055impl std::marker::Unpin for DeviceRouteRequestStream {}
3056
3057impl futures::stream::FusedStream for DeviceRouteRequestStream {
3058 fn is_terminated(&self) -> bool {
3059 self.is_terminated
3060 }
3061}
3062
3063impl fidl::endpoints::RequestStream for DeviceRouteRequestStream {
3064 type Protocol = DeviceRouteMarker;
3065 type ControlHandle = DeviceRouteControlHandle;
3066
3067 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3068 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3069 }
3070
3071 fn control_handle(&self) -> Self::ControlHandle {
3072 DeviceRouteControlHandle { inner: self.inner.clone() }
3073 }
3074
3075 fn into_inner(
3076 self,
3077 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3078 {
3079 (self.inner, self.is_terminated)
3080 }
3081
3082 fn from_inner(
3083 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3084 is_terminated: bool,
3085 ) -> Self {
3086 Self { inner, is_terminated }
3087 }
3088}
3089
3090impl futures::Stream for DeviceRouteRequestStream {
3091 type Item = Result<DeviceRouteRequest, fidl::Error>;
3092
3093 fn poll_next(
3094 mut self: std::pin::Pin<&mut Self>,
3095 cx: &mut std::task::Context<'_>,
3096 ) -> std::task::Poll<Option<Self::Item>> {
3097 let this = &mut *self;
3098 if this.inner.check_shutdown(cx) {
3099 this.is_terminated = true;
3100 return std::task::Poll::Ready(None);
3101 }
3102 if this.is_terminated {
3103 panic!("polled DeviceRouteRequestStream after completion");
3104 }
3105 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3106 |bytes, handles| {
3107 match this.inner.channel().read_etc(cx, bytes, handles) {
3108 std::task::Poll::Ready(Ok(())) => {}
3109 std::task::Poll::Pending => return std::task::Poll::Pending,
3110 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3111 this.is_terminated = true;
3112 return std::task::Poll::Ready(None);
3113 }
3114 std::task::Poll::Ready(Err(e)) => {
3115 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3116 e.into(),
3117 ))))
3118 }
3119 }
3120
3121 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3123
3124 std::task::Poll::Ready(Some(match header.ordinal {
3125 0x2c4135231eb97f61 => {
3126 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3127 let mut req = fidl::new_empty!(
3128 DeviceRouteRegisterOnMeshPrefixRequest,
3129 fidl::encoding::DefaultFuchsiaResourceDialect
3130 );
3131 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteRegisterOnMeshPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
3132 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3133 Ok(DeviceRouteRequest::RegisterOnMeshPrefix {
3134 prefix: req.prefix,
3135
3136 responder: DeviceRouteRegisterOnMeshPrefixResponder {
3137 control_handle: std::mem::ManuallyDrop::new(control_handle),
3138 tx_id: header.tx_id,
3139 },
3140 })
3141 }
3142 0x82d5184028b797f => {
3143 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3144 let mut req = fidl::new_empty!(
3145 DeviceRouteUnregisterOnMeshPrefixRequest,
3146 fidl::encoding::DefaultFuchsiaResourceDialect
3147 );
3148 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteUnregisterOnMeshPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
3149 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3150 Ok(DeviceRouteRequest::UnregisterOnMeshPrefix {
3151 subnet: req.subnet,
3152
3153 responder: DeviceRouteUnregisterOnMeshPrefixResponder {
3154 control_handle: std::mem::ManuallyDrop::new(control_handle),
3155 tx_id: header.tx_id,
3156 },
3157 })
3158 }
3159 0x75f70f0fc34a5a73 => {
3160 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3161 let mut req = fidl::new_empty!(
3162 DeviceRouteRegisterExternalRouteRequest,
3163 fidl::encoding::DefaultFuchsiaResourceDialect
3164 );
3165 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteRegisterExternalRouteRequest>(&header, _body_bytes, handles, &mut req)?;
3166 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3167 Ok(DeviceRouteRequest::RegisterExternalRoute {
3168 external_route: req.external_route,
3169
3170 responder: DeviceRouteRegisterExternalRouteResponder {
3171 control_handle: std::mem::ManuallyDrop::new(control_handle),
3172 tx_id: header.tx_id,
3173 },
3174 })
3175 }
3176 0x3769be353b1d7088 => {
3177 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3178 let mut req = fidl::new_empty!(
3179 DeviceRouteUnregisterExternalRouteRequest,
3180 fidl::encoding::DefaultFuchsiaResourceDialect
3181 );
3182 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteUnregisterExternalRouteRequest>(&header, _body_bytes, handles, &mut req)?;
3183 let control_handle = DeviceRouteControlHandle { inner: this.inner.clone() };
3184 Ok(DeviceRouteRequest::UnregisterExternalRoute {
3185 subnet: req.subnet,
3186
3187 responder: DeviceRouteUnregisterExternalRouteResponder {
3188 control_handle: std::mem::ManuallyDrop::new(control_handle),
3189 tx_id: header.tx_id,
3190 },
3191 })
3192 }
3193 _ => Err(fidl::Error::UnknownOrdinal {
3194 ordinal: header.ordinal,
3195 protocol_name:
3196 <DeviceRouteMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3197 }),
3198 }))
3199 },
3200 )
3201 }
3202}
3203
3204#[derive(Debug)]
3210pub enum DeviceRouteRequest {
3211 RegisterOnMeshPrefix {
3229 prefix: OnMeshPrefix,
3230 responder: DeviceRouteRegisterOnMeshPrefixResponder,
3231 },
3232 UnregisterOnMeshPrefix {
3239 subnet: fidl_fuchsia_net::Ipv6AddressWithPrefix,
3240 responder: DeviceRouteUnregisterOnMeshPrefixResponder,
3241 },
3242 RegisterExternalRoute {
3260 external_route: ExternalRoute,
3261 responder: DeviceRouteRegisterExternalRouteResponder,
3262 },
3263 UnregisterExternalRoute {
3270 subnet: fidl_fuchsia_net::Ipv6AddressWithPrefix,
3271 responder: DeviceRouteUnregisterExternalRouteResponder,
3272 },
3273}
3274
3275impl DeviceRouteRequest {
3276 #[allow(irrefutable_let_patterns)]
3277 pub fn into_register_on_mesh_prefix(
3278 self,
3279 ) -> Option<(OnMeshPrefix, DeviceRouteRegisterOnMeshPrefixResponder)> {
3280 if let DeviceRouteRequest::RegisterOnMeshPrefix { prefix, responder } = self {
3281 Some((prefix, responder))
3282 } else {
3283 None
3284 }
3285 }
3286
3287 #[allow(irrefutable_let_patterns)]
3288 pub fn into_unregister_on_mesh_prefix(
3289 self,
3290 ) -> Option<(fidl_fuchsia_net::Ipv6AddressWithPrefix, DeviceRouteUnregisterOnMeshPrefixResponder)>
3291 {
3292 if let DeviceRouteRequest::UnregisterOnMeshPrefix { subnet, responder } = self {
3293 Some((subnet, responder))
3294 } else {
3295 None
3296 }
3297 }
3298
3299 #[allow(irrefutable_let_patterns)]
3300 pub fn into_register_external_route(
3301 self,
3302 ) -> Option<(ExternalRoute, DeviceRouteRegisterExternalRouteResponder)> {
3303 if let DeviceRouteRequest::RegisterExternalRoute { external_route, responder } = self {
3304 Some((external_route, responder))
3305 } else {
3306 None
3307 }
3308 }
3309
3310 #[allow(irrefutable_let_patterns)]
3311 pub fn into_unregister_external_route(
3312 self,
3313 ) -> Option<(
3314 fidl_fuchsia_net::Ipv6AddressWithPrefix,
3315 DeviceRouteUnregisterExternalRouteResponder,
3316 )> {
3317 if let DeviceRouteRequest::UnregisterExternalRoute { subnet, responder } = self {
3318 Some((subnet, responder))
3319 } else {
3320 None
3321 }
3322 }
3323
3324 pub fn method_name(&self) -> &'static str {
3326 match *self {
3327 DeviceRouteRequest::RegisterOnMeshPrefix { .. } => "register_on_mesh_prefix",
3328 DeviceRouteRequest::UnregisterOnMeshPrefix { .. } => "unregister_on_mesh_prefix",
3329 DeviceRouteRequest::RegisterExternalRoute { .. } => "register_external_route",
3330 DeviceRouteRequest::UnregisterExternalRoute { .. } => "unregister_external_route",
3331 }
3332 }
3333}
3334
3335#[derive(Debug, Clone)]
3336pub struct DeviceRouteControlHandle {
3337 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3338}
3339
3340impl fidl::endpoints::ControlHandle for DeviceRouteControlHandle {
3341 fn shutdown(&self) {
3342 self.inner.shutdown()
3343 }
3344 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3345 self.inner.shutdown_with_epitaph(status)
3346 }
3347
3348 fn is_closed(&self) -> bool {
3349 self.inner.channel().is_closed()
3350 }
3351 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3352 self.inner.channel().on_closed()
3353 }
3354
3355 #[cfg(target_os = "fuchsia")]
3356 fn signal_peer(
3357 &self,
3358 clear_mask: zx::Signals,
3359 set_mask: zx::Signals,
3360 ) -> Result<(), zx_status::Status> {
3361 use fidl::Peered;
3362 self.inner.channel().signal_peer(clear_mask, set_mask)
3363 }
3364}
3365
3366impl DeviceRouteControlHandle {}
3367
3368#[must_use = "FIDL methods require a response to be sent"]
3369#[derive(Debug)]
3370pub struct DeviceRouteRegisterOnMeshPrefixResponder {
3371 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3372 tx_id: u32,
3373}
3374
3375impl std::ops::Drop for DeviceRouteRegisterOnMeshPrefixResponder {
3379 fn drop(&mut self) {
3380 self.control_handle.shutdown();
3381 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3383 }
3384}
3385
3386impl fidl::endpoints::Responder for DeviceRouteRegisterOnMeshPrefixResponder {
3387 type ControlHandle = DeviceRouteControlHandle;
3388
3389 fn control_handle(&self) -> &DeviceRouteControlHandle {
3390 &self.control_handle
3391 }
3392
3393 fn drop_without_shutdown(mut self) {
3394 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3396 std::mem::forget(self);
3398 }
3399}
3400
3401impl DeviceRouteRegisterOnMeshPrefixResponder {
3402 pub fn send(self) -> Result<(), fidl::Error> {
3406 let _result = self.send_raw();
3407 if _result.is_err() {
3408 self.control_handle.shutdown();
3409 }
3410 self.drop_without_shutdown();
3411 _result
3412 }
3413
3414 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3416 let _result = self.send_raw();
3417 self.drop_without_shutdown();
3418 _result
3419 }
3420
3421 fn send_raw(&self) -> Result<(), fidl::Error> {
3422 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3423 (),
3424 self.tx_id,
3425 0x2c4135231eb97f61,
3426 fidl::encoding::DynamicFlags::empty(),
3427 )
3428 }
3429}
3430
3431#[must_use = "FIDL methods require a response to be sent"]
3432#[derive(Debug)]
3433pub struct DeviceRouteUnregisterOnMeshPrefixResponder {
3434 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3435 tx_id: u32,
3436}
3437
3438impl std::ops::Drop for DeviceRouteUnregisterOnMeshPrefixResponder {
3442 fn drop(&mut self) {
3443 self.control_handle.shutdown();
3444 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3446 }
3447}
3448
3449impl fidl::endpoints::Responder for DeviceRouteUnregisterOnMeshPrefixResponder {
3450 type ControlHandle = DeviceRouteControlHandle;
3451
3452 fn control_handle(&self) -> &DeviceRouteControlHandle {
3453 &self.control_handle
3454 }
3455
3456 fn drop_without_shutdown(mut self) {
3457 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3459 std::mem::forget(self);
3461 }
3462}
3463
3464impl DeviceRouteUnregisterOnMeshPrefixResponder {
3465 pub fn send(self) -> Result<(), fidl::Error> {
3469 let _result = self.send_raw();
3470 if _result.is_err() {
3471 self.control_handle.shutdown();
3472 }
3473 self.drop_without_shutdown();
3474 _result
3475 }
3476
3477 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3479 let _result = self.send_raw();
3480 self.drop_without_shutdown();
3481 _result
3482 }
3483
3484 fn send_raw(&self) -> Result<(), fidl::Error> {
3485 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3486 (),
3487 self.tx_id,
3488 0x82d5184028b797f,
3489 fidl::encoding::DynamicFlags::empty(),
3490 )
3491 }
3492}
3493
3494#[must_use = "FIDL methods require a response to be sent"]
3495#[derive(Debug)]
3496pub struct DeviceRouteRegisterExternalRouteResponder {
3497 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3498 tx_id: u32,
3499}
3500
3501impl std::ops::Drop for DeviceRouteRegisterExternalRouteResponder {
3505 fn drop(&mut self) {
3506 self.control_handle.shutdown();
3507 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3509 }
3510}
3511
3512impl fidl::endpoints::Responder for DeviceRouteRegisterExternalRouteResponder {
3513 type ControlHandle = DeviceRouteControlHandle;
3514
3515 fn control_handle(&self) -> &DeviceRouteControlHandle {
3516 &self.control_handle
3517 }
3518
3519 fn drop_without_shutdown(mut self) {
3520 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3522 std::mem::forget(self);
3524 }
3525}
3526
3527impl DeviceRouteRegisterExternalRouteResponder {
3528 pub fn send(self) -> Result<(), fidl::Error> {
3532 let _result = self.send_raw();
3533 if _result.is_err() {
3534 self.control_handle.shutdown();
3535 }
3536 self.drop_without_shutdown();
3537 _result
3538 }
3539
3540 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3542 let _result = self.send_raw();
3543 self.drop_without_shutdown();
3544 _result
3545 }
3546
3547 fn send_raw(&self) -> Result<(), fidl::Error> {
3548 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3549 (),
3550 self.tx_id,
3551 0x75f70f0fc34a5a73,
3552 fidl::encoding::DynamicFlags::empty(),
3553 )
3554 }
3555}
3556
3557#[must_use = "FIDL methods require a response to be sent"]
3558#[derive(Debug)]
3559pub struct DeviceRouteUnregisterExternalRouteResponder {
3560 control_handle: std::mem::ManuallyDrop<DeviceRouteControlHandle>,
3561 tx_id: u32,
3562}
3563
3564impl std::ops::Drop for DeviceRouteUnregisterExternalRouteResponder {
3568 fn drop(&mut self) {
3569 self.control_handle.shutdown();
3570 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3572 }
3573}
3574
3575impl fidl::endpoints::Responder for DeviceRouteUnregisterExternalRouteResponder {
3576 type ControlHandle = DeviceRouteControlHandle;
3577
3578 fn control_handle(&self) -> &DeviceRouteControlHandle {
3579 &self.control_handle
3580 }
3581
3582 fn drop_without_shutdown(mut self) {
3583 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3585 std::mem::forget(self);
3587 }
3588}
3589
3590impl DeviceRouteUnregisterExternalRouteResponder {
3591 pub fn send(self) -> Result<(), fidl::Error> {
3595 let _result = self.send_raw();
3596 if _result.is_err() {
3597 self.control_handle.shutdown();
3598 }
3599 self.drop_without_shutdown();
3600 _result
3601 }
3602
3603 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3605 let _result = self.send_raw();
3606 self.drop_without_shutdown();
3607 _result
3608 }
3609
3610 fn send_raw(&self) -> Result<(), fidl::Error> {
3611 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3612 (),
3613 self.tx_id,
3614 0x3769be353b1d7088,
3615 fidl::encoding::DynamicFlags::empty(),
3616 )
3617 }
3618}
3619
3620#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3621pub struct DeviceRouteConnectorMarker;
3622
3623impl fidl::endpoints::ProtocolMarker for DeviceRouteConnectorMarker {
3624 type Proxy = DeviceRouteConnectorProxy;
3625 type RequestStream = DeviceRouteConnectorRequestStream;
3626 #[cfg(target_os = "fuchsia")]
3627 type SynchronousProxy = DeviceRouteConnectorSynchronousProxy;
3628
3629 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceRouteConnector";
3630}
3631impl fidl::endpoints::DiscoverableProtocolMarker for DeviceRouteConnectorMarker {}
3632
3633pub trait DeviceRouteConnectorProxyInterface: Send + Sync {
3634 fn r#connect(
3635 &self,
3636 name: &str,
3637 server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3638 ) -> Result<(), fidl::Error>;
3639}
3640#[derive(Debug)]
3641#[cfg(target_os = "fuchsia")]
3642pub struct DeviceRouteConnectorSynchronousProxy {
3643 client: fidl::client::sync::Client,
3644}
3645
3646#[cfg(target_os = "fuchsia")]
3647impl fidl::endpoints::SynchronousProxy for DeviceRouteConnectorSynchronousProxy {
3648 type Proxy = DeviceRouteConnectorProxy;
3649 type Protocol = DeviceRouteConnectorMarker;
3650
3651 fn from_channel(inner: fidl::Channel) -> Self {
3652 Self::new(inner)
3653 }
3654
3655 fn into_channel(self) -> fidl::Channel {
3656 self.client.into_channel()
3657 }
3658
3659 fn as_channel(&self) -> &fidl::Channel {
3660 self.client.as_channel()
3661 }
3662}
3663
3664#[cfg(target_os = "fuchsia")]
3665impl DeviceRouteConnectorSynchronousProxy {
3666 pub fn new(channel: fidl::Channel) -> Self {
3667 let protocol_name =
3668 <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3669 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3670 }
3671
3672 pub fn into_channel(self) -> fidl::Channel {
3673 self.client.into_channel()
3674 }
3675
3676 pub fn wait_for_event(
3679 &self,
3680 deadline: zx::MonotonicInstant,
3681 ) -> Result<DeviceRouteConnectorEvent, fidl::Error> {
3682 DeviceRouteConnectorEvent::decode(self.client.wait_for_event(deadline)?)
3683 }
3684
3685 pub fn r#connect(
3702 &self,
3703 mut name: &str,
3704 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3705 ) -> Result<(), fidl::Error> {
3706 self.client.send::<DeviceRouteConnectorConnectRequest>(
3707 (name, server_end),
3708 0x19cd5fdcb971f4ac,
3709 fidl::encoding::DynamicFlags::empty(),
3710 )
3711 }
3712}
3713
3714#[cfg(target_os = "fuchsia")]
3715impl From<DeviceRouteConnectorSynchronousProxy> for zx::Handle {
3716 fn from(value: DeviceRouteConnectorSynchronousProxy) -> Self {
3717 value.into_channel().into()
3718 }
3719}
3720
3721#[cfg(target_os = "fuchsia")]
3722impl From<fidl::Channel> for DeviceRouteConnectorSynchronousProxy {
3723 fn from(value: fidl::Channel) -> Self {
3724 Self::new(value)
3725 }
3726}
3727
3728#[cfg(target_os = "fuchsia")]
3729impl fidl::endpoints::FromClient for DeviceRouteConnectorSynchronousProxy {
3730 type Protocol = DeviceRouteConnectorMarker;
3731
3732 fn from_client(value: fidl::endpoints::ClientEnd<DeviceRouteConnectorMarker>) -> Self {
3733 Self::new(value.into_channel())
3734 }
3735}
3736
3737#[derive(Debug, Clone)]
3738pub struct DeviceRouteConnectorProxy {
3739 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3740}
3741
3742impl fidl::endpoints::Proxy for DeviceRouteConnectorProxy {
3743 type Protocol = DeviceRouteConnectorMarker;
3744
3745 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3746 Self::new(inner)
3747 }
3748
3749 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3750 self.client.into_channel().map_err(|client| Self { client })
3751 }
3752
3753 fn as_channel(&self) -> &::fidl::AsyncChannel {
3754 self.client.as_channel()
3755 }
3756}
3757
3758impl DeviceRouteConnectorProxy {
3759 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3761 let protocol_name =
3762 <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3763 Self { client: fidl::client::Client::new(channel, protocol_name) }
3764 }
3765
3766 pub fn take_event_stream(&self) -> DeviceRouteConnectorEventStream {
3772 DeviceRouteConnectorEventStream { event_receiver: self.client.take_event_receiver() }
3773 }
3774
3775 pub fn r#connect(
3792 &self,
3793 mut name: &str,
3794 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3795 ) -> Result<(), fidl::Error> {
3796 DeviceRouteConnectorProxyInterface::r#connect(self, name, server_end)
3797 }
3798}
3799
3800impl DeviceRouteConnectorProxyInterface for DeviceRouteConnectorProxy {
3801 fn r#connect(
3802 &self,
3803 mut name: &str,
3804 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3805 ) -> Result<(), fidl::Error> {
3806 self.client.send::<DeviceRouteConnectorConnectRequest>(
3807 (name, server_end),
3808 0x19cd5fdcb971f4ac,
3809 fidl::encoding::DynamicFlags::empty(),
3810 )
3811 }
3812}
3813
3814pub struct DeviceRouteConnectorEventStream {
3815 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3816}
3817
3818impl std::marker::Unpin for DeviceRouteConnectorEventStream {}
3819
3820impl futures::stream::FusedStream for DeviceRouteConnectorEventStream {
3821 fn is_terminated(&self) -> bool {
3822 self.event_receiver.is_terminated()
3823 }
3824}
3825
3826impl futures::Stream for DeviceRouteConnectorEventStream {
3827 type Item = Result<DeviceRouteConnectorEvent, fidl::Error>;
3828
3829 fn poll_next(
3830 mut self: std::pin::Pin<&mut Self>,
3831 cx: &mut std::task::Context<'_>,
3832 ) -> std::task::Poll<Option<Self::Item>> {
3833 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3834 &mut self.event_receiver,
3835 cx
3836 )?) {
3837 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteConnectorEvent::decode(buf))),
3838 None => std::task::Poll::Ready(None),
3839 }
3840 }
3841}
3842
3843#[derive(Debug)]
3844pub enum DeviceRouteConnectorEvent {}
3845
3846impl DeviceRouteConnectorEvent {
3847 fn decode(
3849 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3850 ) -> Result<DeviceRouteConnectorEvent, fidl::Error> {
3851 let (bytes, _handles) = buf.split_mut();
3852 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3853 debug_assert_eq!(tx_header.tx_id, 0);
3854 match tx_header.ordinal {
3855 _ => Err(fidl::Error::UnknownOrdinal {
3856 ordinal: tx_header.ordinal,
3857 protocol_name:
3858 <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3859 }),
3860 }
3861 }
3862}
3863
3864pub struct DeviceRouteConnectorRequestStream {
3866 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3867 is_terminated: bool,
3868}
3869
3870impl std::marker::Unpin for DeviceRouteConnectorRequestStream {}
3871
3872impl futures::stream::FusedStream for DeviceRouteConnectorRequestStream {
3873 fn is_terminated(&self) -> bool {
3874 self.is_terminated
3875 }
3876}
3877
3878impl fidl::endpoints::RequestStream for DeviceRouteConnectorRequestStream {
3879 type Protocol = DeviceRouteConnectorMarker;
3880 type ControlHandle = DeviceRouteConnectorControlHandle;
3881
3882 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3883 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3884 }
3885
3886 fn control_handle(&self) -> Self::ControlHandle {
3887 DeviceRouteConnectorControlHandle { inner: self.inner.clone() }
3888 }
3889
3890 fn into_inner(
3891 self,
3892 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3893 {
3894 (self.inner, self.is_terminated)
3895 }
3896
3897 fn from_inner(
3898 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3899 is_terminated: bool,
3900 ) -> Self {
3901 Self { inner, is_terminated }
3902 }
3903}
3904
3905impl futures::Stream for DeviceRouteConnectorRequestStream {
3906 type Item = Result<DeviceRouteConnectorRequest, fidl::Error>;
3907
3908 fn poll_next(
3909 mut self: std::pin::Pin<&mut Self>,
3910 cx: &mut std::task::Context<'_>,
3911 ) -> std::task::Poll<Option<Self::Item>> {
3912 let this = &mut *self;
3913 if this.inner.check_shutdown(cx) {
3914 this.is_terminated = true;
3915 return std::task::Poll::Ready(None);
3916 }
3917 if this.is_terminated {
3918 panic!("polled DeviceRouteConnectorRequestStream after completion");
3919 }
3920 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3921 |bytes, handles| {
3922 match this.inner.channel().read_etc(cx, bytes, handles) {
3923 std::task::Poll::Ready(Ok(())) => {}
3924 std::task::Poll::Pending => return std::task::Poll::Pending,
3925 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3926 this.is_terminated = true;
3927 return std::task::Poll::Ready(None);
3928 }
3929 std::task::Poll::Ready(Err(e)) => {
3930 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3931 e.into(),
3932 ))))
3933 }
3934 }
3935
3936 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3938
3939 std::task::Poll::Ready(Some(match header.ordinal {
3940 0x19cd5fdcb971f4ac => {
3941 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3942 let mut req = fidl::new_empty!(DeviceRouteConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3943 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
3944 let control_handle = DeviceRouteConnectorControlHandle {
3945 inner: this.inner.clone(),
3946 };
3947 Ok(DeviceRouteConnectorRequest::Connect {name: req.name,
3948server_end: req.server_end,
3949
3950 control_handle,
3951 })
3952 }
3953 _ => Err(fidl::Error::UnknownOrdinal {
3954 ordinal: header.ordinal,
3955 protocol_name: <DeviceRouteConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3956 }),
3957 }))
3958 },
3959 )
3960 }
3961}
3962
3963#[derive(Debug)]
3966pub enum DeviceRouteConnectorRequest {
3967 Connect {
3984 name: String,
3985 server_end: fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3986 control_handle: DeviceRouteConnectorControlHandle,
3987 },
3988}
3989
3990impl DeviceRouteConnectorRequest {
3991 #[allow(irrefutable_let_patterns)]
3992 pub fn into_connect(
3993 self,
3994 ) -> Option<(
3995 String,
3996 fidl::endpoints::ServerEnd<DeviceRouteMarker>,
3997 DeviceRouteConnectorControlHandle,
3998 )> {
3999 if let DeviceRouteConnectorRequest::Connect { name, server_end, control_handle } = self {
4000 Some((name, server_end, control_handle))
4001 } else {
4002 None
4003 }
4004 }
4005
4006 pub fn method_name(&self) -> &'static str {
4008 match *self {
4009 DeviceRouteConnectorRequest::Connect { .. } => "connect",
4010 }
4011 }
4012}
4013
4014#[derive(Debug, Clone)]
4015pub struct DeviceRouteConnectorControlHandle {
4016 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4017}
4018
4019impl fidl::endpoints::ControlHandle for DeviceRouteConnectorControlHandle {
4020 fn shutdown(&self) {
4021 self.inner.shutdown()
4022 }
4023 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4024 self.inner.shutdown_with_epitaph(status)
4025 }
4026
4027 fn is_closed(&self) -> bool {
4028 self.inner.channel().is_closed()
4029 }
4030 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4031 self.inner.channel().on_closed()
4032 }
4033
4034 #[cfg(target_os = "fuchsia")]
4035 fn signal_peer(
4036 &self,
4037 clear_mask: zx::Signals,
4038 set_mask: zx::Signals,
4039 ) -> Result<(), zx_status::Status> {
4040 use fidl::Peered;
4041 self.inner.channel().signal_peer(clear_mask, set_mask)
4042 }
4043}
4044
4045impl DeviceRouteConnectorControlHandle {}
4046
4047#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4048pub struct DeviceRouteExtraMarker;
4049
4050impl fidl::endpoints::ProtocolMarker for DeviceRouteExtraMarker {
4051 type Proxy = DeviceRouteExtraProxy;
4052 type RequestStream = DeviceRouteExtraRequestStream;
4053 #[cfg(target_os = "fuchsia")]
4054 type SynchronousProxy = DeviceRouteExtraSynchronousProxy;
4055
4056 const DEBUG_NAME: &'static str = "(anonymous) DeviceRouteExtra";
4057}
4058
4059pub trait DeviceRouteExtraProxyInterface: Send + Sync {
4060 type GetLocalOnMeshPrefixesResponseFut: std::future::Future<Output = Result<Vec<OnMeshPrefix>, fidl::Error>>
4061 + Send;
4062 fn r#get_local_on_mesh_prefixes(&self) -> Self::GetLocalOnMeshPrefixesResponseFut;
4063 type GetLocalExternalRoutesResponseFut: std::future::Future<Output = Result<Vec<ExternalRoute>, fidl::Error>>
4064 + Send;
4065 fn r#get_local_external_routes(&self) -> Self::GetLocalExternalRoutesResponseFut;
4066}
4067#[derive(Debug)]
4068#[cfg(target_os = "fuchsia")]
4069pub struct DeviceRouteExtraSynchronousProxy {
4070 client: fidl::client::sync::Client,
4071}
4072
4073#[cfg(target_os = "fuchsia")]
4074impl fidl::endpoints::SynchronousProxy for DeviceRouteExtraSynchronousProxy {
4075 type Proxy = DeviceRouteExtraProxy;
4076 type Protocol = DeviceRouteExtraMarker;
4077
4078 fn from_channel(inner: fidl::Channel) -> Self {
4079 Self::new(inner)
4080 }
4081
4082 fn into_channel(self) -> fidl::Channel {
4083 self.client.into_channel()
4084 }
4085
4086 fn as_channel(&self) -> &fidl::Channel {
4087 self.client.as_channel()
4088 }
4089}
4090
4091#[cfg(target_os = "fuchsia")]
4092impl DeviceRouteExtraSynchronousProxy {
4093 pub fn new(channel: fidl::Channel) -> Self {
4094 let protocol_name = <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4095 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4096 }
4097
4098 pub fn into_channel(self) -> fidl::Channel {
4099 self.client.into_channel()
4100 }
4101
4102 pub fn wait_for_event(
4105 &self,
4106 deadline: zx::MonotonicInstant,
4107 ) -> Result<DeviceRouteExtraEvent, fidl::Error> {
4108 DeviceRouteExtraEvent::decode(self.client.wait_for_event(deadline)?)
4109 }
4110
4111 pub fn r#get_local_on_mesh_prefixes(
4116 &self,
4117 ___deadline: zx::MonotonicInstant,
4118 ) -> Result<Vec<OnMeshPrefix>, fidl::Error> {
4119 let _response = self.client.send_query::<
4120 fidl::encoding::EmptyPayload,
4121 DeviceRouteExtraGetLocalOnMeshPrefixesResponse,
4122 >(
4123 (),
4124 0xf192c43311c811,
4125 fidl::encoding::DynamicFlags::empty(),
4126 ___deadline,
4127 )?;
4128 Ok(_response.prefixes)
4129 }
4130
4131 pub fn r#get_local_external_routes(
4136 &self,
4137 ___deadline: zx::MonotonicInstant,
4138 ) -> Result<Vec<ExternalRoute>, fidl::Error> {
4139 let _response = self.client.send_query::<
4140 fidl::encoding::EmptyPayload,
4141 DeviceRouteExtraGetLocalExternalRoutesResponse,
4142 >(
4143 (),
4144 0x5a688c2e62c766a6,
4145 fidl::encoding::DynamicFlags::empty(),
4146 ___deadline,
4147 )?;
4148 Ok(_response.external_routes)
4149 }
4150}
4151
4152#[cfg(target_os = "fuchsia")]
4153impl From<DeviceRouteExtraSynchronousProxy> for zx::Handle {
4154 fn from(value: DeviceRouteExtraSynchronousProxy) -> Self {
4155 value.into_channel().into()
4156 }
4157}
4158
4159#[cfg(target_os = "fuchsia")]
4160impl From<fidl::Channel> for DeviceRouteExtraSynchronousProxy {
4161 fn from(value: fidl::Channel) -> Self {
4162 Self::new(value)
4163 }
4164}
4165
4166#[cfg(target_os = "fuchsia")]
4167impl fidl::endpoints::FromClient for DeviceRouteExtraSynchronousProxy {
4168 type Protocol = DeviceRouteExtraMarker;
4169
4170 fn from_client(value: fidl::endpoints::ClientEnd<DeviceRouteExtraMarker>) -> Self {
4171 Self::new(value.into_channel())
4172 }
4173}
4174
4175#[derive(Debug, Clone)]
4176pub struct DeviceRouteExtraProxy {
4177 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4178}
4179
4180impl fidl::endpoints::Proxy for DeviceRouteExtraProxy {
4181 type Protocol = DeviceRouteExtraMarker;
4182
4183 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4184 Self::new(inner)
4185 }
4186
4187 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4188 self.client.into_channel().map_err(|client| Self { client })
4189 }
4190
4191 fn as_channel(&self) -> &::fidl::AsyncChannel {
4192 self.client.as_channel()
4193 }
4194}
4195
4196impl DeviceRouteExtraProxy {
4197 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4199 let protocol_name = <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4200 Self { client: fidl::client::Client::new(channel, protocol_name) }
4201 }
4202
4203 pub fn take_event_stream(&self) -> DeviceRouteExtraEventStream {
4209 DeviceRouteExtraEventStream { event_receiver: self.client.take_event_receiver() }
4210 }
4211
4212 pub fn r#get_local_on_mesh_prefixes(
4217 &self,
4218 ) -> fidl::client::QueryResponseFut<
4219 Vec<OnMeshPrefix>,
4220 fidl::encoding::DefaultFuchsiaResourceDialect,
4221 > {
4222 DeviceRouteExtraProxyInterface::r#get_local_on_mesh_prefixes(self)
4223 }
4224
4225 pub fn r#get_local_external_routes(
4230 &self,
4231 ) -> fidl::client::QueryResponseFut<
4232 Vec<ExternalRoute>,
4233 fidl::encoding::DefaultFuchsiaResourceDialect,
4234 > {
4235 DeviceRouteExtraProxyInterface::r#get_local_external_routes(self)
4236 }
4237}
4238
4239impl DeviceRouteExtraProxyInterface for DeviceRouteExtraProxy {
4240 type GetLocalOnMeshPrefixesResponseFut = fidl::client::QueryResponseFut<
4241 Vec<OnMeshPrefix>,
4242 fidl::encoding::DefaultFuchsiaResourceDialect,
4243 >;
4244 fn r#get_local_on_mesh_prefixes(&self) -> Self::GetLocalOnMeshPrefixesResponseFut {
4245 fn _decode(
4246 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4247 ) -> Result<Vec<OnMeshPrefix>, fidl::Error> {
4248 let _response = fidl::client::decode_transaction_body::<
4249 DeviceRouteExtraGetLocalOnMeshPrefixesResponse,
4250 fidl::encoding::DefaultFuchsiaResourceDialect,
4251 0xf192c43311c811,
4252 >(_buf?)?;
4253 Ok(_response.prefixes)
4254 }
4255 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<OnMeshPrefix>>(
4256 (),
4257 0xf192c43311c811,
4258 fidl::encoding::DynamicFlags::empty(),
4259 _decode,
4260 )
4261 }
4262
4263 type GetLocalExternalRoutesResponseFut = fidl::client::QueryResponseFut<
4264 Vec<ExternalRoute>,
4265 fidl::encoding::DefaultFuchsiaResourceDialect,
4266 >;
4267 fn r#get_local_external_routes(&self) -> Self::GetLocalExternalRoutesResponseFut {
4268 fn _decode(
4269 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4270 ) -> Result<Vec<ExternalRoute>, fidl::Error> {
4271 let _response = fidl::client::decode_transaction_body::<
4272 DeviceRouteExtraGetLocalExternalRoutesResponse,
4273 fidl::encoding::DefaultFuchsiaResourceDialect,
4274 0x5a688c2e62c766a6,
4275 >(_buf?)?;
4276 Ok(_response.external_routes)
4277 }
4278 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ExternalRoute>>(
4279 (),
4280 0x5a688c2e62c766a6,
4281 fidl::encoding::DynamicFlags::empty(),
4282 _decode,
4283 )
4284 }
4285}
4286
4287pub struct DeviceRouteExtraEventStream {
4288 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4289}
4290
4291impl std::marker::Unpin for DeviceRouteExtraEventStream {}
4292
4293impl futures::stream::FusedStream for DeviceRouteExtraEventStream {
4294 fn is_terminated(&self) -> bool {
4295 self.event_receiver.is_terminated()
4296 }
4297}
4298
4299impl futures::Stream for DeviceRouteExtraEventStream {
4300 type Item = Result<DeviceRouteExtraEvent, fidl::Error>;
4301
4302 fn poll_next(
4303 mut self: std::pin::Pin<&mut Self>,
4304 cx: &mut std::task::Context<'_>,
4305 ) -> std::task::Poll<Option<Self::Item>> {
4306 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4307 &mut self.event_receiver,
4308 cx
4309 )?) {
4310 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteExtraEvent::decode(buf))),
4311 None => std::task::Poll::Ready(None),
4312 }
4313 }
4314}
4315
4316#[derive(Debug)]
4317pub enum DeviceRouteExtraEvent {}
4318
4319impl DeviceRouteExtraEvent {
4320 fn decode(
4322 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4323 ) -> Result<DeviceRouteExtraEvent, fidl::Error> {
4324 let (bytes, _handles) = buf.split_mut();
4325 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4326 debug_assert_eq!(tx_header.tx_id, 0);
4327 match tx_header.ordinal {
4328 _ => Err(fidl::Error::UnknownOrdinal {
4329 ordinal: tx_header.ordinal,
4330 protocol_name:
4331 <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4332 }),
4333 }
4334 }
4335}
4336
4337pub struct DeviceRouteExtraRequestStream {
4339 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4340 is_terminated: bool,
4341}
4342
4343impl std::marker::Unpin for DeviceRouteExtraRequestStream {}
4344
4345impl futures::stream::FusedStream for DeviceRouteExtraRequestStream {
4346 fn is_terminated(&self) -> bool {
4347 self.is_terminated
4348 }
4349}
4350
4351impl fidl::endpoints::RequestStream for DeviceRouteExtraRequestStream {
4352 type Protocol = DeviceRouteExtraMarker;
4353 type ControlHandle = DeviceRouteExtraControlHandle;
4354
4355 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4356 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4357 }
4358
4359 fn control_handle(&self) -> Self::ControlHandle {
4360 DeviceRouteExtraControlHandle { inner: self.inner.clone() }
4361 }
4362
4363 fn into_inner(
4364 self,
4365 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4366 {
4367 (self.inner, self.is_terminated)
4368 }
4369
4370 fn from_inner(
4371 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4372 is_terminated: bool,
4373 ) -> Self {
4374 Self { inner, is_terminated }
4375 }
4376}
4377
4378impl futures::Stream for DeviceRouteExtraRequestStream {
4379 type Item = Result<DeviceRouteExtraRequest, fidl::Error>;
4380
4381 fn poll_next(
4382 mut self: std::pin::Pin<&mut Self>,
4383 cx: &mut std::task::Context<'_>,
4384 ) -> std::task::Poll<Option<Self::Item>> {
4385 let this = &mut *self;
4386 if this.inner.check_shutdown(cx) {
4387 this.is_terminated = true;
4388 return std::task::Poll::Ready(None);
4389 }
4390 if this.is_terminated {
4391 panic!("polled DeviceRouteExtraRequestStream after completion");
4392 }
4393 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4394 |bytes, handles| {
4395 match this.inner.channel().read_etc(cx, bytes, handles) {
4396 std::task::Poll::Ready(Ok(())) => {}
4397 std::task::Poll::Pending => return std::task::Poll::Pending,
4398 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4399 this.is_terminated = true;
4400 return std::task::Poll::Ready(None);
4401 }
4402 std::task::Poll::Ready(Err(e)) => {
4403 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4404 e.into(),
4405 ))))
4406 }
4407 }
4408
4409 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4411
4412 std::task::Poll::Ready(Some(match header.ordinal {
4413 0xf192c43311c811 => {
4414 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4415 let mut req = fidl::new_empty!(
4416 fidl::encoding::EmptyPayload,
4417 fidl::encoding::DefaultFuchsiaResourceDialect
4418 );
4419 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4420 let control_handle =
4421 DeviceRouteExtraControlHandle { inner: this.inner.clone() };
4422 Ok(DeviceRouteExtraRequest::GetLocalOnMeshPrefixes {
4423 responder: DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4424 control_handle: std::mem::ManuallyDrop::new(control_handle),
4425 tx_id: header.tx_id,
4426 },
4427 })
4428 }
4429 0x5a688c2e62c766a6 => {
4430 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4431 let mut req = fidl::new_empty!(
4432 fidl::encoding::EmptyPayload,
4433 fidl::encoding::DefaultFuchsiaResourceDialect
4434 );
4435 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4436 let control_handle =
4437 DeviceRouteExtraControlHandle { inner: this.inner.clone() };
4438 Ok(DeviceRouteExtraRequest::GetLocalExternalRoutes {
4439 responder: DeviceRouteExtraGetLocalExternalRoutesResponder {
4440 control_handle: std::mem::ManuallyDrop::new(control_handle),
4441 tx_id: header.tx_id,
4442 },
4443 })
4444 }
4445 _ => Err(fidl::Error::UnknownOrdinal {
4446 ordinal: header.ordinal,
4447 protocol_name:
4448 <DeviceRouteExtraMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4449 }),
4450 }))
4451 },
4452 )
4453 }
4454}
4455
4456#[derive(Debug)]
4462pub enum DeviceRouteExtraRequest {
4463 GetLocalOnMeshPrefixes { responder: DeviceRouteExtraGetLocalOnMeshPrefixesResponder },
4468 GetLocalExternalRoutes { responder: DeviceRouteExtraGetLocalExternalRoutesResponder },
4473}
4474
4475impl DeviceRouteExtraRequest {
4476 #[allow(irrefutable_let_patterns)]
4477 pub fn into_get_local_on_mesh_prefixes(
4478 self,
4479 ) -> Option<(DeviceRouteExtraGetLocalOnMeshPrefixesResponder)> {
4480 if let DeviceRouteExtraRequest::GetLocalOnMeshPrefixes { responder } = self {
4481 Some((responder))
4482 } else {
4483 None
4484 }
4485 }
4486
4487 #[allow(irrefutable_let_patterns)]
4488 pub fn into_get_local_external_routes(
4489 self,
4490 ) -> Option<(DeviceRouteExtraGetLocalExternalRoutesResponder)> {
4491 if let DeviceRouteExtraRequest::GetLocalExternalRoutes { responder } = self {
4492 Some((responder))
4493 } else {
4494 None
4495 }
4496 }
4497
4498 pub fn method_name(&self) -> &'static str {
4500 match *self {
4501 DeviceRouteExtraRequest::GetLocalOnMeshPrefixes { .. } => "get_local_on_mesh_prefixes",
4502 DeviceRouteExtraRequest::GetLocalExternalRoutes { .. } => "get_local_external_routes",
4503 }
4504 }
4505}
4506
4507#[derive(Debug, Clone)]
4508pub struct DeviceRouteExtraControlHandle {
4509 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4510}
4511
4512impl fidl::endpoints::ControlHandle for DeviceRouteExtraControlHandle {
4513 fn shutdown(&self) {
4514 self.inner.shutdown()
4515 }
4516 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4517 self.inner.shutdown_with_epitaph(status)
4518 }
4519
4520 fn is_closed(&self) -> bool {
4521 self.inner.channel().is_closed()
4522 }
4523 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4524 self.inner.channel().on_closed()
4525 }
4526
4527 #[cfg(target_os = "fuchsia")]
4528 fn signal_peer(
4529 &self,
4530 clear_mask: zx::Signals,
4531 set_mask: zx::Signals,
4532 ) -> Result<(), zx_status::Status> {
4533 use fidl::Peered;
4534 self.inner.channel().signal_peer(clear_mask, set_mask)
4535 }
4536}
4537
4538impl DeviceRouteExtraControlHandle {}
4539
4540#[must_use = "FIDL methods require a response to be sent"]
4541#[derive(Debug)]
4542pub struct DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4543 control_handle: std::mem::ManuallyDrop<DeviceRouteExtraControlHandle>,
4544 tx_id: u32,
4545}
4546
4547impl std::ops::Drop for DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4551 fn drop(&mut self) {
4552 self.control_handle.shutdown();
4553 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4555 }
4556}
4557
4558impl fidl::endpoints::Responder for DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4559 type ControlHandle = DeviceRouteExtraControlHandle;
4560
4561 fn control_handle(&self) -> &DeviceRouteExtraControlHandle {
4562 &self.control_handle
4563 }
4564
4565 fn drop_without_shutdown(mut self) {
4566 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4568 std::mem::forget(self);
4570 }
4571}
4572
4573impl DeviceRouteExtraGetLocalOnMeshPrefixesResponder {
4574 pub fn send(self, mut prefixes: &[OnMeshPrefix]) -> Result<(), fidl::Error> {
4578 let _result = self.send_raw(prefixes);
4579 if _result.is_err() {
4580 self.control_handle.shutdown();
4581 }
4582 self.drop_without_shutdown();
4583 _result
4584 }
4585
4586 pub fn send_no_shutdown_on_err(self, mut prefixes: &[OnMeshPrefix]) -> Result<(), fidl::Error> {
4588 let _result = self.send_raw(prefixes);
4589 self.drop_without_shutdown();
4590 _result
4591 }
4592
4593 fn send_raw(&self, mut prefixes: &[OnMeshPrefix]) -> Result<(), fidl::Error> {
4594 self.control_handle.inner.send::<DeviceRouteExtraGetLocalOnMeshPrefixesResponse>(
4595 (prefixes,),
4596 self.tx_id,
4597 0xf192c43311c811,
4598 fidl::encoding::DynamicFlags::empty(),
4599 )
4600 }
4601}
4602
4603#[must_use = "FIDL methods require a response to be sent"]
4604#[derive(Debug)]
4605pub struct DeviceRouteExtraGetLocalExternalRoutesResponder {
4606 control_handle: std::mem::ManuallyDrop<DeviceRouteExtraControlHandle>,
4607 tx_id: u32,
4608}
4609
4610impl std::ops::Drop for DeviceRouteExtraGetLocalExternalRoutesResponder {
4614 fn drop(&mut self) {
4615 self.control_handle.shutdown();
4616 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4618 }
4619}
4620
4621impl fidl::endpoints::Responder for DeviceRouteExtraGetLocalExternalRoutesResponder {
4622 type ControlHandle = DeviceRouteExtraControlHandle;
4623
4624 fn control_handle(&self) -> &DeviceRouteExtraControlHandle {
4625 &self.control_handle
4626 }
4627
4628 fn drop_without_shutdown(mut self) {
4629 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4631 std::mem::forget(self);
4633 }
4634}
4635
4636impl DeviceRouteExtraGetLocalExternalRoutesResponder {
4637 pub fn send(self, mut external_routes: &[ExternalRoute]) -> Result<(), fidl::Error> {
4641 let _result = self.send_raw(external_routes);
4642 if _result.is_err() {
4643 self.control_handle.shutdown();
4644 }
4645 self.drop_without_shutdown();
4646 _result
4647 }
4648
4649 pub fn send_no_shutdown_on_err(
4651 self,
4652 mut external_routes: &[ExternalRoute],
4653 ) -> Result<(), fidl::Error> {
4654 let _result = self.send_raw(external_routes);
4655 self.drop_without_shutdown();
4656 _result
4657 }
4658
4659 fn send_raw(&self, mut external_routes: &[ExternalRoute]) -> Result<(), fidl::Error> {
4660 self.control_handle.inner.send::<DeviceRouteExtraGetLocalExternalRoutesResponse>(
4661 (external_routes,),
4662 self.tx_id,
4663 0x5a688c2e62c766a6,
4664 fidl::encoding::DynamicFlags::empty(),
4665 )
4666 }
4667}
4668
4669#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4670pub struct DeviceRouteExtraConnectorMarker;
4671
4672impl fidl::endpoints::ProtocolMarker for DeviceRouteExtraConnectorMarker {
4673 type Proxy = DeviceRouteExtraConnectorProxy;
4674 type RequestStream = DeviceRouteExtraConnectorRequestStream;
4675 #[cfg(target_os = "fuchsia")]
4676 type SynchronousProxy = DeviceRouteExtraConnectorSynchronousProxy;
4677
4678 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.DeviceRouteExtraConnector";
4679}
4680impl fidl::endpoints::DiscoverableProtocolMarker for DeviceRouteExtraConnectorMarker {}
4681
4682pub trait DeviceRouteExtraConnectorProxyInterface: Send + Sync {
4683 fn r#connect(
4684 &self,
4685 name: &str,
4686 server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4687 ) -> Result<(), fidl::Error>;
4688}
4689#[derive(Debug)]
4690#[cfg(target_os = "fuchsia")]
4691pub struct DeviceRouteExtraConnectorSynchronousProxy {
4692 client: fidl::client::sync::Client,
4693}
4694
4695#[cfg(target_os = "fuchsia")]
4696impl fidl::endpoints::SynchronousProxy for DeviceRouteExtraConnectorSynchronousProxy {
4697 type Proxy = DeviceRouteExtraConnectorProxy;
4698 type Protocol = DeviceRouteExtraConnectorMarker;
4699
4700 fn from_channel(inner: fidl::Channel) -> Self {
4701 Self::new(inner)
4702 }
4703
4704 fn into_channel(self) -> fidl::Channel {
4705 self.client.into_channel()
4706 }
4707
4708 fn as_channel(&self) -> &fidl::Channel {
4709 self.client.as_channel()
4710 }
4711}
4712
4713#[cfg(target_os = "fuchsia")]
4714impl DeviceRouteExtraConnectorSynchronousProxy {
4715 pub fn new(channel: fidl::Channel) -> Self {
4716 let protocol_name =
4717 <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4718 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4719 }
4720
4721 pub fn into_channel(self) -> fidl::Channel {
4722 self.client.into_channel()
4723 }
4724
4725 pub fn wait_for_event(
4728 &self,
4729 deadline: zx::MonotonicInstant,
4730 ) -> Result<DeviceRouteExtraConnectorEvent, fidl::Error> {
4731 DeviceRouteExtraConnectorEvent::decode(self.client.wait_for_event(deadline)?)
4732 }
4733
4734 pub fn r#connect(
4751 &self,
4752 mut name: &str,
4753 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4754 ) -> Result<(), fidl::Error> {
4755 self.client.send::<DeviceRouteExtraConnectorConnectRequest>(
4756 (name, server_end),
4757 0x12f72df7b1348fe2,
4758 fidl::encoding::DynamicFlags::empty(),
4759 )
4760 }
4761}
4762
4763#[cfg(target_os = "fuchsia")]
4764impl From<DeviceRouteExtraConnectorSynchronousProxy> for zx::Handle {
4765 fn from(value: DeviceRouteExtraConnectorSynchronousProxy) -> Self {
4766 value.into_channel().into()
4767 }
4768}
4769
4770#[cfg(target_os = "fuchsia")]
4771impl From<fidl::Channel> for DeviceRouteExtraConnectorSynchronousProxy {
4772 fn from(value: fidl::Channel) -> Self {
4773 Self::new(value)
4774 }
4775}
4776
4777#[cfg(target_os = "fuchsia")]
4778impl fidl::endpoints::FromClient for DeviceRouteExtraConnectorSynchronousProxy {
4779 type Protocol = DeviceRouteExtraConnectorMarker;
4780
4781 fn from_client(value: fidl::endpoints::ClientEnd<DeviceRouteExtraConnectorMarker>) -> Self {
4782 Self::new(value.into_channel())
4783 }
4784}
4785
4786#[derive(Debug, Clone)]
4787pub struct DeviceRouteExtraConnectorProxy {
4788 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4789}
4790
4791impl fidl::endpoints::Proxy for DeviceRouteExtraConnectorProxy {
4792 type Protocol = DeviceRouteExtraConnectorMarker;
4793
4794 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4795 Self::new(inner)
4796 }
4797
4798 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4799 self.client.into_channel().map_err(|client| Self { client })
4800 }
4801
4802 fn as_channel(&self) -> &::fidl::AsyncChannel {
4803 self.client.as_channel()
4804 }
4805}
4806
4807impl DeviceRouteExtraConnectorProxy {
4808 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4810 let protocol_name =
4811 <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4812 Self { client: fidl::client::Client::new(channel, protocol_name) }
4813 }
4814
4815 pub fn take_event_stream(&self) -> DeviceRouteExtraConnectorEventStream {
4821 DeviceRouteExtraConnectorEventStream { event_receiver: self.client.take_event_receiver() }
4822 }
4823
4824 pub fn r#connect(
4841 &self,
4842 mut name: &str,
4843 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4844 ) -> Result<(), fidl::Error> {
4845 DeviceRouteExtraConnectorProxyInterface::r#connect(self, name, server_end)
4846 }
4847}
4848
4849impl DeviceRouteExtraConnectorProxyInterface for DeviceRouteExtraConnectorProxy {
4850 fn r#connect(
4851 &self,
4852 mut name: &str,
4853 mut server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
4854 ) -> Result<(), fidl::Error> {
4855 self.client.send::<DeviceRouteExtraConnectorConnectRequest>(
4856 (name, server_end),
4857 0x12f72df7b1348fe2,
4858 fidl::encoding::DynamicFlags::empty(),
4859 )
4860 }
4861}
4862
4863pub struct DeviceRouteExtraConnectorEventStream {
4864 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4865}
4866
4867impl std::marker::Unpin for DeviceRouteExtraConnectorEventStream {}
4868
4869impl futures::stream::FusedStream for DeviceRouteExtraConnectorEventStream {
4870 fn is_terminated(&self) -> bool {
4871 self.event_receiver.is_terminated()
4872 }
4873}
4874
4875impl futures::Stream for DeviceRouteExtraConnectorEventStream {
4876 type Item = Result<DeviceRouteExtraConnectorEvent, fidl::Error>;
4877
4878 fn poll_next(
4879 mut self: std::pin::Pin<&mut Self>,
4880 cx: &mut std::task::Context<'_>,
4881 ) -> std::task::Poll<Option<Self::Item>> {
4882 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4883 &mut self.event_receiver,
4884 cx
4885 )?) {
4886 Some(buf) => std::task::Poll::Ready(Some(DeviceRouteExtraConnectorEvent::decode(buf))),
4887 None => std::task::Poll::Ready(None),
4888 }
4889 }
4890}
4891
4892#[derive(Debug)]
4893pub enum DeviceRouteExtraConnectorEvent {}
4894
4895impl DeviceRouteExtraConnectorEvent {
4896 fn decode(
4898 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4899 ) -> Result<DeviceRouteExtraConnectorEvent, fidl::Error> {
4900 let (bytes, _handles) = buf.split_mut();
4901 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4902 debug_assert_eq!(tx_header.tx_id, 0);
4903 match tx_header.ordinal {
4904 _ => Err(fidl::Error::UnknownOrdinal {
4905 ordinal: tx_header.ordinal,
4906 protocol_name:
4907 <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4908 }),
4909 }
4910 }
4911}
4912
4913pub struct DeviceRouteExtraConnectorRequestStream {
4915 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4916 is_terminated: bool,
4917}
4918
4919impl std::marker::Unpin for DeviceRouteExtraConnectorRequestStream {}
4920
4921impl futures::stream::FusedStream for DeviceRouteExtraConnectorRequestStream {
4922 fn is_terminated(&self) -> bool {
4923 self.is_terminated
4924 }
4925}
4926
4927impl fidl::endpoints::RequestStream for DeviceRouteExtraConnectorRequestStream {
4928 type Protocol = DeviceRouteExtraConnectorMarker;
4929 type ControlHandle = DeviceRouteExtraConnectorControlHandle;
4930
4931 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4932 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4933 }
4934
4935 fn control_handle(&self) -> Self::ControlHandle {
4936 DeviceRouteExtraConnectorControlHandle { inner: self.inner.clone() }
4937 }
4938
4939 fn into_inner(
4940 self,
4941 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4942 {
4943 (self.inner, self.is_terminated)
4944 }
4945
4946 fn from_inner(
4947 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4948 is_terminated: bool,
4949 ) -> Self {
4950 Self { inner, is_terminated }
4951 }
4952}
4953
4954impl futures::Stream for DeviceRouteExtraConnectorRequestStream {
4955 type Item = Result<DeviceRouteExtraConnectorRequest, fidl::Error>;
4956
4957 fn poll_next(
4958 mut self: std::pin::Pin<&mut Self>,
4959 cx: &mut std::task::Context<'_>,
4960 ) -> std::task::Poll<Option<Self::Item>> {
4961 let this = &mut *self;
4962 if this.inner.check_shutdown(cx) {
4963 this.is_terminated = true;
4964 return std::task::Poll::Ready(None);
4965 }
4966 if this.is_terminated {
4967 panic!("polled DeviceRouteExtraConnectorRequestStream after completion");
4968 }
4969 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4970 |bytes, handles| {
4971 match this.inner.channel().read_etc(cx, bytes, handles) {
4972 std::task::Poll::Ready(Ok(())) => {}
4973 std::task::Poll::Pending => return std::task::Poll::Pending,
4974 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4975 this.is_terminated = true;
4976 return std::task::Poll::Ready(None);
4977 }
4978 std::task::Poll::Ready(Err(e)) => {
4979 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4980 e.into(),
4981 ))))
4982 }
4983 }
4984
4985 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4987
4988 std::task::Poll::Ready(Some(match header.ordinal {
4989 0x12f72df7b1348fe2 => {
4990 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4991 let mut req = fidl::new_empty!(DeviceRouteExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4992 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRouteExtraConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
4993 let control_handle = DeviceRouteExtraConnectorControlHandle {
4994 inner: this.inner.clone(),
4995 };
4996 Ok(DeviceRouteExtraConnectorRequest::Connect {name: req.name,
4997server_end: req.server_end,
4998
4999 control_handle,
5000 })
5001 }
5002 _ => Err(fidl::Error::UnknownOrdinal {
5003 ordinal: header.ordinal,
5004 protocol_name: <DeviceRouteExtraConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5005 }),
5006 }))
5007 },
5008 )
5009 }
5010}
5011
5012#[derive(Debug)]
5015pub enum DeviceRouteExtraConnectorRequest {
5016 Connect {
5033 name: String,
5034 server_end: fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
5035 control_handle: DeviceRouteExtraConnectorControlHandle,
5036 },
5037}
5038
5039impl DeviceRouteExtraConnectorRequest {
5040 #[allow(irrefutable_let_patterns)]
5041 pub fn into_connect(
5042 self,
5043 ) -> Option<(
5044 String,
5045 fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>,
5046 DeviceRouteExtraConnectorControlHandle,
5047 )> {
5048 if let DeviceRouteExtraConnectorRequest::Connect { name, server_end, control_handle } = self
5049 {
5050 Some((name, server_end, control_handle))
5051 } else {
5052 None
5053 }
5054 }
5055
5056 pub fn method_name(&self) -> &'static str {
5058 match *self {
5059 DeviceRouteExtraConnectorRequest::Connect { .. } => "connect",
5060 }
5061 }
5062}
5063
5064#[derive(Debug, Clone)]
5065pub struct DeviceRouteExtraConnectorControlHandle {
5066 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5067}
5068
5069impl fidl::endpoints::ControlHandle for DeviceRouteExtraConnectorControlHandle {
5070 fn shutdown(&self) {
5071 self.inner.shutdown()
5072 }
5073 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5074 self.inner.shutdown_with_epitaph(status)
5075 }
5076
5077 fn is_closed(&self) -> bool {
5078 self.inner.channel().is_closed()
5079 }
5080 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5081 self.inner.channel().on_closed()
5082 }
5083
5084 #[cfg(target_os = "fuchsia")]
5085 fn signal_peer(
5086 &self,
5087 clear_mask: zx::Signals,
5088 set_mask: zx::Signals,
5089 ) -> Result<(), zx_status::Status> {
5090 use fidl::Peered;
5091 self.inner.channel().signal_peer(clear_mask, set_mask)
5092 }
5093}
5094
5095impl DeviceRouteExtraConnectorControlHandle {}
5096
5097#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5098pub struct LegacyJoiningMarker;
5099
5100impl fidl::endpoints::ProtocolMarker for LegacyJoiningMarker {
5101 type Proxy = LegacyJoiningProxy;
5102 type RequestStream = LegacyJoiningRequestStream;
5103 #[cfg(target_os = "fuchsia")]
5104 type SynchronousProxy = LegacyJoiningSynchronousProxy;
5105
5106 const DEBUG_NAME: &'static str = "(anonymous) LegacyJoining";
5107}
5108
5109pub trait LegacyJoiningProxyInterface: Send + Sync {
5110 type MakeJoinableResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
5111 fn r#make_joinable(&self, duration: i64, port: u16) -> Self::MakeJoinableResponseFut;
5112}
5113#[derive(Debug)]
5114#[cfg(target_os = "fuchsia")]
5115pub struct LegacyJoiningSynchronousProxy {
5116 client: fidl::client::sync::Client,
5117}
5118
5119#[cfg(target_os = "fuchsia")]
5120impl fidl::endpoints::SynchronousProxy for LegacyJoiningSynchronousProxy {
5121 type Proxy = LegacyJoiningProxy;
5122 type Protocol = LegacyJoiningMarker;
5123
5124 fn from_channel(inner: fidl::Channel) -> Self {
5125 Self::new(inner)
5126 }
5127
5128 fn into_channel(self) -> fidl::Channel {
5129 self.client.into_channel()
5130 }
5131
5132 fn as_channel(&self) -> &fidl::Channel {
5133 self.client.as_channel()
5134 }
5135}
5136
5137#[cfg(target_os = "fuchsia")]
5138impl LegacyJoiningSynchronousProxy {
5139 pub fn new(channel: fidl::Channel) -> Self {
5140 let protocol_name = <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5141 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5142 }
5143
5144 pub fn into_channel(self) -> fidl::Channel {
5145 self.client.into_channel()
5146 }
5147
5148 pub fn wait_for_event(
5151 &self,
5152 deadline: zx::MonotonicInstant,
5153 ) -> Result<LegacyJoiningEvent, fidl::Error> {
5154 LegacyJoiningEvent::decode(self.client.wait_for_event(deadline)?)
5155 }
5156
5157 pub fn r#make_joinable(
5181 &self,
5182 mut duration: i64,
5183 mut port: u16,
5184 ___deadline: zx::MonotonicInstant,
5185 ) -> Result<(), fidl::Error> {
5186 let _response = self
5187 .client
5188 .send_query::<LegacyJoiningMakeJoinableRequest, fidl::encoding::EmptyPayload>(
5189 (duration, port),
5190 0x1739a6ae36d5c5aa,
5191 fidl::encoding::DynamicFlags::empty(),
5192 ___deadline,
5193 )?;
5194 Ok(_response)
5195 }
5196}
5197
5198#[cfg(target_os = "fuchsia")]
5199impl From<LegacyJoiningSynchronousProxy> for zx::Handle {
5200 fn from(value: LegacyJoiningSynchronousProxy) -> Self {
5201 value.into_channel().into()
5202 }
5203}
5204
5205#[cfg(target_os = "fuchsia")]
5206impl From<fidl::Channel> for LegacyJoiningSynchronousProxy {
5207 fn from(value: fidl::Channel) -> Self {
5208 Self::new(value)
5209 }
5210}
5211
5212#[cfg(target_os = "fuchsia")]
5213impl fidl::endpoints::FromClient for LegacyJoiningSynchronousProxy {
5214 type Protocol = LegacyJoiningMarker;
5215
5216 fn from_client(value: fidl::endpoints::ClientEnd<LegacyJoiningMarker>) -> Self {
5217 Self::new(value.into_channel())
5218 }
5219}
5220
5221#[derive(Debug, Clone)]
5222pub struct LegacyJoiningProxy {
5223 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5224}
5225
5226impl fidl::endpoints::Proxy for LegacyJoiningProxy {
5227 type Protocol = LegacyJoiningMarker;
5228
5229 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5230 Self::new(inner)
5231 }
5232
5233 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5234 self.client.into_channel().map_err(|client| Self { client })
5235 }
5236
5237 fn as_channel(&self) -> &::fidl::AsyncChannel {
5238 self.client.as_channel()
5239 }
5240}
5241
5242impl LegacyJoiningProxy {
5243 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5245 let protocol_name = <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5246 Self { client: fidl::client::Client::new(channel, protocol_name) }
5247 }
5248
5249 pub fn take_event_stream(&self) -> LegacyJoiningEventStream {
5255 LegacyJoiningEventStream { event_receiver: self.client.take_event_receiver() }
5256 }
5257
5258 pub fn r#make_joinable(
5282 &self,
5283 mut duration: i64,
5284 mut port: u16,
5285 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5286 LegacyJoiningProxyInterface::r#make_joinable(self, duration, port)
5287 }
5288}
5289
5290impl LegacyJoiningProxyInterface for LegacyJoiningProxy {
5291 type MakeJoinableResponseFut =
5292 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5293 fn r#make_joinable(&self, mut duration: i64, mut port: u16) -> Self::MakeJoinableResponseFut {
5294 fn _decode(
5295 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5296 ) -> Result<(), fidl::Error> {
5297 let _response = fidl::client::decode_transaction_body::<
5298 fidl::encoding::EmptyPayload,
5299 fidl::encoding::DefaultFuchsiaResourceDialect,
5300 0x1739a6ae36d5c5aa,
5301 >(_buf?)?;
5302 Ok(_response)
5303 }
5304 self.client.send_query_and_decode::<LegacyJoiningMakeJoinableRequest, ()>(
5305 (duration, port),
5306 0x1739a6ae36d5c5aa,
5307 fidl::encoding::DynamicFlags::empty(),
5308 _decode,
5309 )
5310 }
5311}
5312
5313pub struct LegacyJoiningEventStream {
5314 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5315}
5316
5317impl std::marker::Unpin for LegacyJoiningEventStream {}
5318
5319impl futures::stream::FusedStream for LegacyJoiningEventStream {
5320 fn is_terminated(&self) -> bool {
5321 self.event_receiver.is_terminated()
5322 }
5323}
5324
5325impl futures::Stream for LegacyJoiningEventStream {
5326 type Item = Result<LegacyJoiningEvent, fidl::Error>;
5327
5328 fn poll_next(
5329 mut self: std::pin::Pin<&mut Self>,
5330 cx: &mut std::task::Context<'_>,
5331 ) -> std::task::Poll<Option<Self::Item>> {
5332 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5333 &mut self.event_receiver,
5334 cx
5335 )?) {
5336 Some(buf) => std::task::Poll::Ready(Some(LegacyJoiningEvent::decode(buf))),
5337 None => std::task::Poll::Ready(None),
5338 }
5339 }
5340}
5341
5342#[derive(Debug)]
5343pub enum LegacyJoiningEvent {}
5344
5345impl LegacyJoiningEvent {
5346 fn decode(
5348 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5349 ) -> Result<LegacyJoiningEvent, fidl::Error> {
5350 let (bytes, _handles) = buf.split_mut();
5351 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5352 debug_assert_eq!(tx_header.tx_id, 0);
5353 match tx_header.ordinal {
5354 _ => Err(fidl::Error::UnknownOrdinal {
5355 ordinal: tx_header.ordinal,
5356 protocol_name: <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5357 }),
5358 }
5359 }
5360}
5361
5362pub struct LegacyJoiningRequestStream {
5364 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5365 is_terminated: bool,
5366}
5367
5368impl std::marker::Unpin for LegacyJoiningRequestStream {}
5369
5370impl futures::stream::FusedStream for LegacyJoiningRequestStream {
5371 fn is_terminated(&self) -> bool {
5372 self.is_terminated
5373 }
5374}
5375
5376impl fidl::endpoints::RequestStream for LegacyJoiningRequestStream {
5377 type Protocol = LegacyJoiningMarker;
5378 type ControlHandle = LegacyJoiningControlHandle;
5379
5380 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5381 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5382 }
5383
5384 fn control_handle(&self) -> Self::ControlHandle {
5385 LegacyJoiningControlHandle { inner: self.inner.clone() }
5386 }
5387
5388 fn into_inner(
5389 self,
5390 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5391 {
5392 (self.inner, self.is_terminated)
5393 }
5394
5395 fn from_inner(
5396 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5397 is_terminated: bool,
5398 ) -> Self {
5399 Self { inner, is_terminated }
5400 }
5401}
5402
5403impl futures::Stream for LegacyJoiningRequestStream {
5404 type Item = Result<LegacyJoiningRequest, fidl::Error>;
5405
5406 fn poll_next(
5407 mut self: std::pin::Pin<&mut Self>,
5408 cx: &mut std::task::Context<'_>,
5409 ) -> std::task::Poll<Option<Self::Item>> {
5410 let this = &mut *self;
5411 if this.inner.check_shutdown(cx) {
5412 this.is_terminated = true;
5413 return std::task::Poll::Ready(None);
5414 }
5415 if this.is_terminated {
5416 panic!("polled LegacyJoiningRequestStream after completion");
5417 }
5418 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5419 |bytes, handles| {
5420 match this.inner.channel().read_etc(cx, bytes, handles) {
5421 std::task::Poll::Ready(Ok(())) => {}
5422 std::task::Poll::Pending => return std::task::Poll::Pending,
5423 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5424 this.is_terminated = true;
5425 return std::task::Poll::Ready(None);
5426 }
5427 std::task::Poll::Ready(Err(e)) => {
5428 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5429 e.into(),
5430 ))))
5431 }
5432 }
5433
5434 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5436
5437 std::task::Poll::Ready(Some(match header.ordinal {
5438 0x1739a6ae36d5c5aa => {
5439 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5440 let mut req = fidl::new_empty!(
5441 LegacyJoiningMakeJoinableRequest,
5442 fidl::encoding::DefaultFuchsiaResourceDialect
5443 );
5444 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LegacyJoiningMakeJoinableRequest>(&header, _body_bytes, handles, &mut req)?;
5445 let control_handle =
5446 LegacyJoiningControlHandle { inner: this.inner.clone() };
5447 Ok(LegacyJoiningRequest::MakeJoinable {
5448 duration: req.duration,
5449 port: req.port,
5450
5451 responder: LegacyJoiningMakeJoinableResponder {
5452 control_handle: std::mem::ManuallyDrop::new(control_handle),
5453 tx_id: header.tx_id,
5454 },
5455 })
5456 }
5457 _ => Err(fidl::Error::UnknownOrdinal {
5458 ordinal: header.ordinal,
5459 protocol_name:
5460 <LegacyJoiningMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5461 }),
5462 }))
5463 },
5464 )
5465 }
5466}
5467
5468#[derive(Debug)]
5473pub enum LegacyJoiningRequest {
5474 MakeJoinable { duration: i64, port: u16, responder: LegacyJoiningMakeJoinableResponder },
5498}
5499
5500impl LegacyJoiningRequest {
5501 #[allow(irrefutable_let_patterns)]
5502 pub fn into_make_joinable(self) -> Option<(i64, u16, LegacyJoiningMakeJoinableResponder)> {
5503 if let LegacyJoiningRequest::MakeJoinable { duration, port, responder } = self {
5504 Some((duration, port, responder))
5505 } else {
5506 None
5507 }
5508 }
5509
5510 pub fn method_name(&self) -> &'static str {
5512 match *self {
5513 LegacyJoiningRequest::MakeJoinable { .. } => "make_joinable",
5514 }
5515 }
5516}
5517
5518#[derive(Debug, Clone)]
5519pub struct LegacyJoiningControlHandle {
5520 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5521}
5522
5523impl fidl::endpoints::ControlHandle for LegacyJoiningControlHandle {
5524 fn shutdown(&self) {
5525 self.inner.shutdown()
5526 }
5527 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5528 self.inner.shutdown_with_epitaph(status)
5529 }
5530
5531 fn is_closed(&self) -> bool {
5532 self.inner.channel().is_closed()
5533 }
5534 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5535 self.inner.channel().on_closed()
5536 }
5537
5538 #[cfg(target_os = "fuchsia")]
5539 fn signal_peer(
5540 &self,
5541 clear_mask: zx::Signals,
5542 set_mask: zx::Signals,
5543 ) -> Result<(), zx_status::Status> {
5544 use fidl::Peered;
5545 self.inner.channel().signal_peer(clear_mask, set_mask)
5546 }
5547}
5548
5549impl LegacyJoiningControlHandle {}
5550
5551#[must_use = "FIDL methods require a response to be sent"]
5552#[derive(Debug)]
5553pub struct LegacyJoiningMakeJoinableResponder {
5554 control_handle: std::mem::ManuallyDrop<LegacyJoiningControlHandle>,
5555 tx_id: u32,
5556}
5557
5558impl std::ops::Drop for LegacyJoiningMakeJoinableResponder {
5562 fn drop(&mut self) {
5563 self.control_handle.shutdown();
5564 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5566 }
5567}
5568
5569impl fidl::endpoints::Responder for LegacyJoiningMakeJoinableResponder {
5570 type ControlHandle = LegacyJoiningControlHandle;
5571
5572 fn control_handle(&self) -> &LegacyJoiningControlHandle {
5573 &self.control_handle
5574 }
5575
5576 fn drop_without_shutdown(mut self) {
5577 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5579 std::mem::forget(self);
5581 }
5582}
5583
5584impl LegacyJoiningMakeJoinableResponder {
5585 pub fn send(self) -> Result<(), fidl::Error> {
5589 let _result = self.send_raw();
5590 if _result.is_err() {
5591 self.control_handle.shutdown();
5592 }
5593 self.drop_without_shutdown();
5594 _result
5595 }
5596
5597 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5599 let _result = self.send_raw();
5600 self.drop_without_shutdown();
5601 _result
5602 }
5603
5604 fn send_raw(&self) -> Result<(), fidl::Error> {
5605 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5606 (),
5607 self.tx_id,
5608 0x1739a6ae36d5c5aa,
5609 fidl::encoding::DynamicFlags::empty(),
5610 )
5611 }
5612}
5613
5614#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5615pub struct LegacyJoiningConnectorMarker;
5616
5617impl fidl::endpoints::ProtocolMarker for LegacyJoiningConnectorMarker {
5618 type Proxy = LegacyJoiningConnectorProxy;
5619 type RequestStream = LegacyJoiningConnectorRequestStream;
5620 #[cfg(target_os = "fuchsia")]
5621 type SynchronousProxy = LegacyJoiningConnectorSynchronousProxy;
5622
5623 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.LegacyJoiningConnector";
5624}
5625impl fidl::endpoints::DiscoverableProtocolMarker for LegacyJoiningConnectorMarker {}
5626
5627pub trait LegacyJoiningConnectorProxyInterface: Send + Sync {
5628 fn r#connect(
5629 &self,
5630 name: &str,
5631 server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5632 ) -> Result<(), fidl::Error>;
5633}
5634#[derive(Debug)]
5635#[cfg(target_os = "fuchsia")]
5636pub struct LegacyJoiningConnectorSynchronousProxy {
5637 client: fidl::client::sync::Client,
5638}
5639
5640#[cfg(target_os = "fuchsia")]
5641impl fidl::endpoints::SynchronousProxy for LegacyJoiningConnectorSynchronousProxy {
5642 type Proxy = LegacyJoiningConnectorProxy;
5643 type Protocol = LegacyJoiningConnectorMarker;
5644
5645 fn from_channel(inner: fidl::Channel) -> Self {
5646 Self::new(inner)
5647 }
5648
5649 fn into_channel(self) -> fidl::Channel {
5650 self.client.into_channel()
5651 }
5652
5653 fn as_channel(&self) -> &fidl::Channel {
5654 self.client.as_channel()
5655 }
5656}
5657
5658#[cfg(target_os = "fuchsia")]
5659impl LegacyJoiningConnectorSynchronousProxy {
5660 pub fn new(channel: fidl::Channel) -> Self {
5661 let protocol_name =
5662 <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5663 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5664 }
5665
5666 pub fn into_channel(self) -> fidl::Channel {
5667 self.client.into_channel()
5668 }
5669
5670 pub fn wait_for_event(
5673 &self,
5674 deadline: zx::MonotonicInstant,
5675 ) -> Result<LegacyJoiningConnectorEvent, fidl::Error> {
5676 LegacyJoiningConnectorEvent::decode(self.client.wait_for_event(deadline)?)
5677 }
5678
5679 pub fn r#connect(
5696 &self,
5697 mut name: &str,
5698 mut server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5699 ) -> Result<(), fidl::Error> {
5700 self.client.send::<LegacyJoiningConnectorConnectRequest>(
5701 (name, server_end),
5702 0x3c8dfeb943bb8d06,
5703 fidl::encoding::DynamicFlags::empty(),
5704 )
5705 }
5706}
5707
5708#[cfg(target_os = "fuchsia")]
5709impl From<LegacyJoiningConnectorSynchronousProxy> for zx::Handle {
5710 fn from(value: LegacyJoiningConnectorSynchronousProxy) -> Self {
5711 value.into_channel().into()
5712 }
5713}
5714
5715#[cfg(target_os = "fuchsia")]
5716impl From<fidl::Channel> for LegacyJoiningConnectorSynchronousProxy {
5717 fn from(value: fidl::Channel) -> Self {
5718 Self::new(value)
5719 }
5720}
5721
5722#[cfg(target_os = "fuchsia")]
5723impl fidl::endpoints::FromClient for LegacyJoiningConnectorSynchronousProxy {
5724 type Protocol = LegacyJoiningConnectorMarker;
5725
5726 fn from_client(value: fidl::endpoints::ClientEnd<LegacyJoiningConnectorMarker>) -> Self {
5727 Self::new(value.into_channel())
5728 }
5729}
5730
5731#[derive(Debug, Clone)]
5732pub struct LegacyJoiningConnectorProxy {
5733 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5734}
5735
5736impl fidl::endpoints::Proxy for LegacyJoiningConnectorProxy {
5737 type Protocol = LegacyJoiningConnectorMarker;
5738
5739 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5740 Self::new(inner)
5741 }
5742
5743 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5744 self.client.into_channel().map_err(|client| Self { client })
5745 }
5746
5747 fn as_channel(&self) -> &::fidl::AsyncChannel {
5748 self.client.as_channel()
5749 }
5750}
5751
5752impl LegacyJoiningConnectorProxy {
5753 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5755 let protocol_name =
5756 <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5757 Self { client: fidl::client::Client::new(channel, protocol_name) }
5758 }
5759
5760 pub fn take_event_stream(&self) -> LegacyJoiningConnectorEventStream {
5766 LegacyJoiningConnectorEventStream { event_receiver: self.client.take_event_receiver() }
5767 }
5768
5769 pub fn r#connect(
5786 &self,
5787 mut name: &str,
5788 mut server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5789 ) -> Result<(), fidl::Error> {
5790 LegacyJoiningConnectorProxyInterface::r#connect(self, name, server_end)
5791 }
5792}
5793
5794impl LegacyJoiningConnectorProxyInterface for LegacyJoiningConnectorProxy {
5795 fn r#connect(
5796 &self,
5797 mut name: &str,
5798 mut server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5799 ) -> Result<(), fidl::Error> {
5800 self.client.send::<LegacyJoiningConnectorConnectRequest>(
5801 (name, server_end),
5802 0x3c8dfeb943bb8d06,
5803 fidl::encoding::DynamicFlags::empty(),
5804 )
5805 }
5806}
5807
5808pub struct LegacyJoiningConnectorEventStream {
5809 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5810}
5811
5812impl std::marker::Unpin for LegacyJoiningConnectorEventStream {}
5813
5814impl futures::stream::FusedStream for LegacyJoiningConnectorEventStream {
5815 fn is_terminated(&self) -> bool {
5816 self.event_receiver.is_terminated()
5817 }
5818}
5819
5820impl futures::Stream for LegacyJoiningConnectorEventStream {
5821 type Item = Result<LegacyJoiningConnectorEvent, fidl::Error>;
5822
5823 fn poll_next(
5824 mut self: std::pin::Pin<&mut Self>,
5825 cx: &mut std::task::Context<'_>,
5826 ) -> std::task::Poll<Option<Self::Item>> {
5827 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5828 &mut self.event_receiver,
5829 cx
5830 )?) {
5831 Some(buf) => std::task::Poll::Ready(Some(LegacyJoiningConnectorEvent::decode(buf))),
5832 None => std::task::Poll::Ready(None),
5833 }
5834 }
5835}
5836
5837#[derive(Debug)]
5838pub enum LegacyJoiningConnectorEvent {}
5839
5840impl LegacyJoiningConnectorEvent {
5841 fn decode(
5843 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5844 ) -> Result<LegacyJoiningConnectorEvent, fidl::Error> {
5845 let (bytes, _handles) = buf.split_mut();
5846 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5847 debug_assert_eq!(tx_header.tx_id, 0);
5848 match tx_header.ordinal {
5849 _ => Err(fidl::Error::UnknownOrdinal {
5850 ordinal: tx_header.ordinal,
5851 protocol_name:
5852 <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5853 }),
5854 }
5855 }
5856}
5857
5858pub struct LegacyJoiningConnectorRequestStream {
5860 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5861 is_terminated: bool,
5862}
5863
5864impl std::marker::Unpin for LegacyJoiningConnectorRequestStream {}
5865
5866impl futures::stream::FusedStream for LegacyJoiningConnectorRequestStream {
5867 fn is_terminated(&self) -> bool {
5868 self.is_terminated
5869 }
5870}
5871
5872impl fidl::endpoints::RequestStream for LegacyJoiningConnectorRequestStream {
5873 type Protocol = LegacyJoiningConnectorMarker;
5874 type ControlHandle = LegacyJoiningConnectorControlHandle;
5875
5876 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5877 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5878 }
5879
5880 fn control_handle(&self) -> Self::ControlHandle {
5881 LegacyJoiningConnectorControlHandle { inner: self.inner.clone() }
5882 }
5883
5884 fn into_inner(
5885 self,
5886 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5887 {
5888 (self.inner, self.is_terminated)
5889 }
5890
5891 fn from_inner(
5892 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5893 is_terminated: bool,
5894 ) -> Self {
5895 Self { inner, is_terminated }
5896 }
5897}
5898
5899impl futures::Stream for LegacyJoiningConnectorRequestStream {
5900 type Item = Result<LegacyJoiningConnectorRequest, fidl::Error>;
5901
5902 fn poll_next(
5903 mut self: std::pin::Pin<&mut Self>,
5904 cx: &mut std::task::Context<'_>,
5905 ) -> std::task::Poll<Option<Self::Item>> {
5906 let this = &mut *self;
5907 if this.inner.check_shutdown(cx) {
5908 this.is_terminated = true;
5909 return std::task::Poll::Ready(None);
5910 }
5911 if this.is_terminated {
5912 panic!("polled LegacyJoiningConnectorRequestStream after completion");
5913 }
5914 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5915 |bytes, handles| {
5916 match this.inner.channel().read_etc(cx, bytes, handles) {
5917 std::task::Poll::Ready(Ok(())) => {}
5918 std::task::Poll::Pending => return std::task::Poll::Pending,
5919 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5920 this.is_terminated = true;
5921 return std::task::Poll::Ready(None);
5922 }
5923 std::task::Poll::Ready(Err(e)) => {
5924 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5925 e.into(),
5926 ))))
5927 }
5928 }
5929
5930 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5932
5933 std::task::Poll::Ready(Some(match header.ordinal {
5934 0x3c8dfeb943bb8d06 => {
5935 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5936 let mut req = fidl::new_empty!(LegacyJoiningConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5937 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LegacyJoiningConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
5938 let control_handle = LegacyJoiningConnectorControlHandle {
5939 inner: this.inner.clone(),
5940 };
5941 Ok(LegacyJoiningConnectorRequest::Connect {name: req.name,
5942server_end: req.server_end,
5943
5944 control_handle,
5945 })
5946 }
5947 _ => Err(fidl::Error::UnknownOrdinal {
5948 ordinal: header.ordinal,
5949 protocol_name: <LegacyJoiningConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5950 }),
5951 }))
5952 },
5953 )
5954 }
5955}
5956
5957#[derive(Debug)]
5960pub enum LegacyJoiningConnectorRequest {
5961 Connect {
5978 name: String,
5979 server_end: fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5980 control_handle: LegacyJoiningConnectorControlHandle,
5981 },
5982}
5983
5984impl LegacyJoiningConnectorRequest {
5985 #[allow(irrefutable_let_patterns)]
5986 pub fn into_connect(
5987 self,
5988 ) -> Option<(
5989 String,
5990 fidl::endpoints::ServerEnd<LegacyJoiningMarker>,
5991 LegacyJoiningConnectorControlHandle,
5992 )> {
5993 if let LegacyJoiningConnectorRequest::Connect { name, server_end, control_handle } = self {
5994 Some((name, server_end, control_handle))
5995 } else {
5996 None
5997 }
5998 }
5999
6000 pub fn method_name(&self) -> &'static str {
6002 match *self {
6003 LegacyJoiningConnectorRequest::Connect { .. } => "connect",
6004 }
6005 }
6006}
6007
6008#[derive(Debug, Clone)]
6009pub struct LegacyJoiningConnectorControlHandle {
6010 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6011}
6012
6013impl fidl::endpoints::ControlHandle for LegacyJoiningConnectorControlHandle {
6014 fn shutdown(&self) {
6015 self.inner.shutdown()
6016 }
6017 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6018 self.inner.shutdown_with_epitaph(status)
6019 }
6020
6021 fn is_closed(&self) -> bool {
6022 self.inner.channel().is_closed()
6023 }
6024 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6025 self.inner.channel().on_closed()
6026 }
6027
6028 #[cfg(target_os = "fuchsia")]
6029 fn signal_peer(
6030 &self,
6031 clear_mask: zx::Signals,
6032 set_mask: zx::Signals,
6033 ) -> Result<(), zx_status::Status> {
6034 use fidl::Peered;
6035 self.inner.channel().signal_peer(clear_mask, set_mask)
6036 }
6037}
6038
6039impl LegacyJoiningConnectorControlHandle {}
6040
6041#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6042pub struct ProvisioningMonitorMarker;
6043
6044impl fidl::endpoints::ProtocolMarker for ProvisioningMonitorMarker {
6045 type Proxy = ProvisioningMonitorProxy;
6046 type RequestStream = ProvisioningMonitorRequestStream;
6047 #[cfg(target_os = "fuchsia")]
6048 type SynchronousProxy = ProvisioningMonitorSynchronousProxy;
6049
6050 const DEBUG_NAME: &'static str = "(anonymous) ProvisioningMonitor";
6051}
6052pub type ProvisioningMonitorWatchProgressResult = Result<ProvisioningProgress, ProvisionError>;
6053
6054pub trait ProvisioningMonitorProxyInterface: Send + Sync {
6055 type WatchProgressResponseFut: std::future::Future<Output = Result<ProvisioningMonitorWatchProgressResult, fidl::Error>>
6056 + Send;
6057 fn r#watch_progress(&self) -> Self::WatchProgressResponseFut;
6058}
6059#[derive(Debug)]
6060#[cfg(target_os = "fuchsia")]
6061pub struct ProvisioningMonitorSynchronousProxy {
6062 client: fidl::client::sync::Client,
6063}
6064
6065#[cfg(target_os = "fuchsia")]
6066impl fidl::endpoints::SynchronousProxy for ProvisioningMonitorSynchronousProxy {
6067 type Proxy = ProvisioningMonitorProxy;
6068 type Protocol = ProvisioningMonitorMarker;
6069
6070 fn from_channel(inner: fidl::Channel) -> Self {
6071 Self::new(inner)
6072 }
6073
6074 fn into_channel(self) -> fidl::Channel {
6075 self.client.into_channel()
6076 }
6077
6078 fn as_channel(&self) -> &fidl::Channel {
6079 self.client.as_channel()
6080 }
6081}
6082
6083#[cfg(target_os = "fuchsia")]
6084impl ProvisioningMonitorSynchronousProxy {
6085 pub fn new(channel: fidl::Channel) -> Self {
6086 let protocol_name =
6087 <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6088 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6089 }
6090
6091 pub fn into_channel(self) -> fidl::Channel {
6092 self.client.into_channel()
6093 }
6094
6095 pub fn wait_for_event(
6098 &self,
6099 deadline: zx::MonotonicInstant,
6100 ) -> Result<ProvisioningMonitorEvent, fidl::Error> {
6101 ProvisioningMonitorEvent::decode(self.client.wait_for_event(deadline)?)
6102 }
6103
6104 pub fn r#watch_progress(
6117 &self,
6118 ___deadline: zx::MonotonicInstant,
6119 ) -> Result<ProvisioningMonitorWatchProgressResult, fidl::Error> {
6120 let _response =
6121 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
6122 ProvisioningMonitorWatchProgressResponse,
6123 ProvisionError,
6124 >>(
6125 (),
6126 0xc35336fc43ac0c,
6127 fidl::encoding::DynamicFlags::empty(),
6128 ___deadline,
6129 )?;
6130 Ok(_response.map(|x| x.progress))
6131 }
6132}
6133
6134#[cfg(target_os = "fuchsia")]
6135impl From<ProvisioningMonitorSynchronousProxy> for zx::Handle {
6136 fn from(value: ProvisioningMonitorSynchronousProxy) -> Self {
6137 value.into_channel().into()
6138 }
6139}
6140
6141#[cfg(target_os = "fuchsia")]
6142impl From<fidl::Channel> for ProvisioningMonitorSynchronousProxy {
6143 fn from(value: fidl::Channel) -> Self {
6144 Self::new(value)
6145 }
6146}
6147
6148#[cfg(target_os = "fuchsia")]
6149impl fidl::endpoints::FromClient for ProvisioningMonitorSynchronousProxy {
6150 type Protocol = ProvisioningMonitorMarker;
6151
6152 fn from_client(value: fidl::endpoints::ClientEnd<ProvisioningMonitorMarker>) -> Self {
6153 Self::new(value.into_channel())
6154 }
6155}
6156
6157#[derive(Debug, Clone)]
6158pub struct ProvisioningMonitorProxy {
6159 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6160}
6161
6162impl fidl::endpoints::Proxy for ProvisioningMonitorProxy {
6163 type Protocol = ProvisioningMonitorMarker;
6164
6165 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6166 Self::new(inner)
6167 }
6168
6169 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6170 self.client.into_channel().map_err(|client| Self { client })
6171 }
6172
6173 fn as_channel(&self) -> &::fidl::AsyncChannel {
6174 self.client.as_channel()
6175 }
6176}
6177
6178impl ProvisioningMonitorProxy {
6179 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6181 let protocol_name =
6182 <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6183 Self { client: fidl::client::Client::new(channel, protocol_name) }
6184 }
6185
6186 pub fn take_event_stream(&self) -> ProvisioningMonitorEventStream {
6192 ProvisioningMonitorEventStream { event_receiver: self.client.take_event_receiver() }
6193 }
6194
6195 pub fn r#watch_progress(
6208 &self,
6209 ) -> fidl::client::QueryResponseFut<
6210 ProvisioningMonitorWatchProgressResult,
6211 fidl::encoding::DefaultFuchsiaResourceDialect,
6212 > {
6213 ProvisioningMonitorProxyInterface::r#watch_progress(self)
6214 }
6215}
6216
6217impl ProvisioningMonitorProxyInterface for ProvisioningMonitorProxy {
6218 type WatchProgressResponseFut = fidl::client::QueryResponseFut<
6219 ProvisioningMonitorWatchProgressResult,
6220 fidl::encoding::DefaultFuchsiaResourceDialect,
6221 >;
6222 fn r#watch_progress(&self) -> Self::WatchProgressResponseFut {
6223 fn _decode(
6224 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6225 ) -> Result<ProvisioningMonitorWatchProgressResult, fidl::Error> {
6226 let _response = fidl::client::decode_transaction_body::<
6227 fidl::encoding::ResultType<
6228 ProvisioningMonitorWatchProgressResponse,
6229 ProvisionError,
6230 >,
6231 fidl::encoding::DefaultFuchsiaResourceDialect,
6232 0xc35336fc43ac0c,
6233 >(_buf?)?;
6234 Ok(_response.map(|x| x.progress))
6235 }
6236 self.client.send_query_and_decode::<
6237 fidl::encoding::EmptyPayload,
6238 ProvisioningMonitorWatchProgressResult,
6239 >(
6240 (),
6241 0xc35336fc43ac0c,
6242 fidl::encoding::DynamicFlags::empty(),
6243 _decode,
6244 )
6245 }
6246}
6247
6248pub struct ProvisioningMonitorEventStream {
6249 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6250}
6251
6252impl std::marker::Unpin for ProvisioningMonitorEventStream {}
6253
6254impl futures::stream::FusedStream for ProvisioningMonitorEventStream {
6255 fn is_terminated(&self) -> bool {
6256 self.event_receiver.is_terminated()
6257 }
6258}
6259
6260impl futures::Stream for ProvisioningMonitorEventStream {
6261 type Item = Result<ProvisioningMonitorEvent, fidl::Error>;
6262
6263 fn poll_next(
6264 mut self: std::pin::Pin<&mut Self>,
6265 cx: &mut std::task::Context<'_>,
6266 ) -> std::task::Poll<Option<Self::Item>> {
6267 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6268 &mut self.event_receiver,
6269 cx
6270 )?) {
6271 Some(buf) => std::task::Poll::Ready(Some(ProvisioningMonitorEvent::decode(buf))),
6272 None => std::task::Poll::Ready(None),
6273 }
6274 }
6275}
6276
6277#[derive(Debug)]
6278pub enum ProvisioningMonitorEvent {}
6279
6280impl ProvisioningMonitorEvent {
6281 fn decode(
6283 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6284 ) -> Result<ProvisioningMonitorEvent, fidl::Error> {
6285 let (bytes, _handles) = buf.split_mut();
6286 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6287 debug_assert_eq!(tx_header.tx_id, 0);
6288 match tx_header.ordinal {
6289 _ => Err(fidl::Error::UnknownOrdinal {
6290 ordinal: tx_header.ordinal,
6291 protocol_name:
6292 <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6293 }),
6294 }
6295 }
6296}
6297
6298pub struct ProvisioningMonitorRequestStream {
6300 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6301 is_terminated: bool,
6302}
6303
6304impl std::marker::Unpin for ProvisioningMonitorRequestStream {}
6305
6306impl futures::stream::FusedStream for ProvisioningMonitorRequestStream {
6307 fn is_terminated(&self) -> bool {
6308 self.is_terminated
6309 }
6310}
6311
6312impl fidl::endpoints::RequestStream for ProvisioningMonitorRequestStream {
6313 type Protocol = ProvisioningMonitorMarker;
6314 type ControlHandle = ProvisioningMonitorControlHandle;
6315
6316 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6317 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6318 }
6319
6320 fn control_handle(&self) -> Self::ControlHandle {
6321 ProvisioningMonitorControlHandle { inner: self.inner.clone() }
6322 }
6323
6324 fn into_inner(
6325 self,
6326 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6327 {
6328 (self.inner, self.is_terminated)
6329 }
6330
6331 fn from_inner(
6332 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6333 is_terminated: bool,
6334 ) -> Self {
6335 Self { inner, is_terminated }
6336 }
6337}
6338
6339impl futures::Stream for ProvisioningMonitorRequestStream {
6340 type Item = Result<ProvisioningMonitorRequest, fidl::Error>;
6341
6342 fn poll_next(
6343 mut self: std::pin::Pin<&mut Self>,
6344 cx: &mut std::task::Context<'_>,
6345 ) -> std::task::Poll<Option<Self::Item>> {
6346 let this = &mut *self;
6347 if this.inner.check_shutdown(cx) {
6348 this.is_terminated = true;
6349 return std::task::Poll::Ready(None);
6350 }
6351 if this.is_terminated {
6352 panic!("polled ProvisioningMonitorRequestStream after completion");
6353 }
6354 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6355 |bytes, handles| {
6356 match this.inner.channel().read_etc(cx, bytes, handles) {
6357 std::task::Poll::Ready(Ok(())) => {}
6358 std::task::Poll::Pending => return std::task::Poll::Pending,
6359 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6360 this.is_terminated = true;
6361 return std::task::Poll::Ready(None);
6362 }
6363 std::task::Poll::Ready(Err(e)) => {
6364 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6365 e.into(),
6366 ))))
6367 }
6368 }
6369
6370 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6372
6373 std::task::Poll::Ready(Some(match header.ordinal {
6374 0xc35336fc43ac0c => {
6375 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6376 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6377 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6378 let control_handle = ProvisioningMonitorControlHandle {
6379 inner: this.inner.clone(),
6380 };
6381 Ok(ProvisioningMonitorRequest::WatchProgress {
6382 responder: ProvisioningMonitorWatchProgressResponder {
6383 control_handle: std::mem::ManuallyDrop::new(control_handle),
6384 tx_id: header.tx_id,
6385 },
6386 })
6387 }
6388 _ => Err(fidl::Error::UnknownOrdinal {
6389 ordinal: header.ordinal,
6390 protocol_name: <ProvisioningMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6391 }),
6392 }))
6393 },
6394 )
6395 }
6396}
6397
6398#[derive(Debug)]
6403pub enum ProvisioningMonitorRequest {
6404 WatchProgress { responder: ProvisioningMonitorWatchProgressResponder },
6417}
6418
6419impl ProvisioningMonitorRequest {
6420 #[allow(irrefutable_let_patterns)]
6421 pub fn into_watch_progress(self) -> Option<(ProvisioningMonitorWatchProgressResponder)> {
6422 if let ProvisioningMonitorRequest::WatchProgress { responder } = self {
6423 Some((responder))
6424 } else {
6425 None
6426 }
6427 }
6428
6429 pub fn method_name(&self) -> &'static str {
6431 match *self {
6432 ProvisioningMonitorRequest::WatchProgress { .. } => "watch_progress",
6433 }
6434 }
6435}
6436
6437#[derive(Debug, Clone)]
6438pub struct ProvisioningMonitorControlHandle {
6439 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6440}
6441
6442impl fidl::endpoints::ControlHandle for ProvisioningMonitorControlHandle {
6443 fn shutdown(&self) {
6444 self.inner.shutdown()
6445 }
6446 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6447 self.inner.shutdown_with_epitaph(status)
6448 }
6449
6450 fn is_closed(&self) -> bool {
6451 self.inner.channel().is_closed()
6452 }
6453 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6454 self.inner.channel().on_closed()
6455 }
6456
6457 #[cfg(target_os = "fuchsia")]
6458 fn signal_peer(
6459 &self,
6460 clear_mask: zx::Signals,
6461 set_mask: zx::Signals,
6462 ) -> Result<(), zx_status::Status> {
6463 use fidl::Peered;
6464 self.inner.channel().signal_peer(clear_mask, set_mask)
6465 }
6466}
6467
6468impl ProvisioningMonitorControlHandle {}
6469
6470#[must_use = "FIDL methods require a response to be sent"]
6471#[derive(Debug)]
6472pub struct ProvisioningMonitorWatchProgressResponder {
6473 control_handle: std::mem::ManuallyDrop<ProvisioningMonitorControlHandle>,
6474 tx_id: u32,
6475}
6476
6477impl std::ops::Drop for ProvisioningMonitorWatchProgressResponder {
6481 fn drop(&mut self) {
6482 self.control_handle.shutdown();
6483 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6485 }
6486}
6487
6488impl fidl::endpoints::Responder for ProvisioningMonitorWatchProgressResponder {
6489 type ControlHandle = ProvisioningMonitorControlHandle;
6490
6491 fn control_handle(&self) -> &ProvisioningMonitorControlHandle {
6492 &self.control_handle
6493 }
6494
6495 fn drop_without_shutdown(mut self) {
6496 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6498 std::mem::forget(self);
6500 }
6501}
6502
6503impl ProvisioningMonitorWatchProgressResponder {
6504 pub fn send(
6508 self,
6509 mut result: Result<&ProvisioningProgress, ProvisionError>,
6510 ) -> Result<(), fidl::Error> {
6511 let _result = self.send_raw(result);
6512 if _result.is_err() {
6513 self.control_handle.shutdown();
6514 }
6515 self.drop_without_shutdown();
6516 _result
6517 }
6518
6519 pub fn send_no_shutdown_on_err(
6521 self,
6522 mut result: Result<&ProvisioningProgress, ProvisionError>,
6523 ) -> Result<(), fidl::Error> {
6524 let _result = self.send_raw(result);
6525 self.drop_without_shutdown();
6526 _result
6527 }
6528
6529 fn send_raw(
6530 &self,
6531 mut result: Result<&ProvisioningProgress, ProvisionError>,
6532 ) -> Result<(), fidl::Error> {
6533 self.control_handle.inner.send::<fidl::encoding::ResultType<
6534 ProvisioningMonitorWatchProgressResponse,
6535 ProvisionError,
6536 >>(
6537 result.map(|progress| (progress,)),
6538 self.tx_id,
6539 0xc35336fc43ac0c,
6540 fidl::encoding::DynamicFlags::empty(),
6541 )
6542 }
6543}
6544
6545#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6546pub struct TelemetryProviderMarker;
6547
6548impl fidl::endpoints::ProtocolMarker for TelemetryProviderMarker {
6549 type Proxy = TelemetryProviderProxy;
6550 type RequestStream = TelemetryProviderRequestStream;
6551 #[cfg(target_os = "fuchsia")]
6552 type SynchronousProxy = TelemetryProviderSynchronousProxy;
6553
6554 const DEBUG_NAME: &'static str = "(anonymous) TelemetryProvider";
6555}
6556
6557pub trait TelemetryProviderProxyInterface: Send + Sync {
6558 type GetTelemetryResponseFut: std::future::Future<Output = Result<Telemetry, fidl::Error>>
6559 + Send;
6560 fn r#get_telemetry(&self) -> Self::GetTelemetryResponseFut;
6561}
6562#[derive(Debug)]
6563#[cfg(target_os = "fuchsia")]
6564pub struct TelemetryProviderSynchronousProxy {
6565 client: fidl::client::sync::Client,
6566}
6567
6568#[cfg(target_os = "fuchsia")]
6569impl fidl::endpoints::SynchronousProxy for TelemetryProviderSynchronousProxy {
6570 type Proxy = TelemetryProviderProxy;
6571 type Protocol = TelemetryProviderMarker;
6572
6573 fn from_channel(inner: fidl::Channel) -> Self {
6574 Self::new(inner)
6575 }
6576
6577 fn into_channel(self) -> fidl::Channel {
6578 self.client.into_channel()
6579 }
6580
6581 fn as_channel(&self) -> &fidl::Channel {
6582 self.client.as_channel()
6583 }
6584}
6585
6586#[cfg(target_os = "fuchsia")]
6587impl TelemetryProviderSynchronousProxy {
6588 pub fn new(channel: fidl::Channel) -> Self {
6589 let protocol_name =
6590 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6591 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6592 }
6593
6594 pub fn into_channel(self) -> fidl::Channel {
6595 self.client.into_channel()
6596 }
6597
6598 pub fn wait_for_event(
6601 &self,
6602 deadline: zx::MonotonicInstant,
6603 ) -> Result<TelemetryProviderEvent, fidl::Error> {
6604 TelemetryProviderEvent::decode(self.client.wait_for_event(deadline)?)
6605 }
6606
6607 pub fn r#get_telemetry(
6609 &self,
6610 ___deadline: zx::MonotonicInstant,
6611 ) -> Result<Telemetry, fidl::Error> {
6612 let _response = self
6613 .client
6614 .send_query::<fidl::encoding::EmptyPayload, TelemetryProviderGetTelemetryResponse>(
6615 (),
6616 0xc34f2fff7dacc41,
6617 fidl::encoding::DynamicFlags::empty(),
6618 ___deadline,
6619 )?;
6620 Ok(_response.telemetry)
6621 }
6622}
6623
6624#[cfg(target_os = "fuchsia")]
6625impl From<TelemetryProviderSynchronousProxy> for zx::Handle {
6626 fn from(value: TelemetryProviderSynchronousProxy) -> Self {
6627 value.into_channel().into()
6628 }
6629}
6630
6631#[cfg(target_os = "fuchsia")]
6632impl From<fidl::Channel> for TelemetryProviderSynchronousProxy {
6633 fn from(value: fidl::Channel) -> Self {
6634 Self::new(value)
6635 }
6636}
6637
6638#[cfg(target_os = "fuchsia")]
6639impl fidl::endpoints::FromClient for TelemetryProviderSynchronousProxy {
6640 type Protocol = TelemetryProviderMarker;
6641
6642 fn from_client(value: fidl::endpoints::ClientEnd<TelemetryProviderMarker>) -> Self {
6643 Self::new(value.into_channel())
6644 }
6645}
6646
6647#[derive(Debug, Clone)]
6648pub struct TelemetryProviderProxy {
6649 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6650}
6651
6652impl fidl::endpoints::Proxy for TelemetryProviderProxy {
6653 type Protocol = TelemetryProviderMarker;
6654
6655 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6656 Self::new(inner)
6657 }
6658
6659 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6660 self.client.into_channel().map_err(|client| Self { client })
6661 }
6662
6663 fn as_channel(&self) -> &::fidl::AsyncChannel {
6664 self.client.as_channel()
6665 }
6666}
6667
6668impl TelemetryProviderProxy {
6669 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6671 let protocol_name =
6672 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6673 Self { client: fidl::client::Client::new(channel, protocol_name) }
6674 }
6675
6676 pub fn take_event_stream(&self) -> TelemetryProviderEventStream {
6682 TelemetryProviderEventStream { event_receiver: self.client.take_event_receiver() }
6683 }
6684
6685 pub fn r#get_telemetry(
6687 &self,
6688 ) -> fidl::client::QueryResponseFut<Telemetry, fidl::encoding::DefaultFuchsiaResourceDialect>
6689 {
6690 TelemetryProviderProxyInterface::r#get_telemetry(self)
6691 }
6692}
6693
6694impl TelemetryProviderProxyInterface for TelemetryProviderProxy {
6695 type GetTelemetryResponseFut =
6696 fidl::client::QueryResponseFut<Telemetry, fidl::encoding::DefaultFuchsiaResourceDialect>;
6697 fn r#get_telemetry(&self) -> Self::GetTelemetryResponseFut {
6698 fn _decode(
6699 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6700 ) -> Result<Telemetry, fidl::Error> {
6701 let _response = fidl::client::decode_transaction_body::<
6702 TelemetryProviderGetTelemetryResponse,
6703 fidl::encoding::DefaultFuchsiaResourceDialect,
6704 0xc34f2fff7dacc41,
6705 >(_buf?)?;
6706 Ok(_response.telemetry)
6707 }
6708 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Telemetry>(
6709 (),
6710 0xc34f2fff7dacc41,
6711 fidl::encoding::DynamicFlags::empty(),
6712 _decode,
6713 )
6714 }
6715}
6716
6717pub struct TelemetryProviderEventStream {
6718 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6719}
6720
6721impl std::marker::Unpin for TelemetryProviderEventStream {}
6722
6723impl futures::stream::FusedStream for TelemetryProviderEventStream {
6724 fn is_terminated(&self) -> bool {
6725 self.event_receiver.is_terminated()
6726 }
6727}
6728
6729impl futures::Stream for TelemetryProviderEventStream {
6730 type Item = Result<TelemetryProviderEvent, fidl::Error>;
6731
6732 fn poll_next(
6733 mut self: std::pin::Pin<&mut Self>,
6734 cx: &mut std::task::Context<'_>,
6735 ) -> std::task::Poll<Option<Self::Item>> {
6736 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6737 &mut self.event_receiver,
6738 cx
6739 )?) {
6740 Some(buf) => std::task::Poll::Ready(Some(TelemetryProviderEvent::decode(buf))),
6741 None => std::task::Poll::Ready(None),
6742 }
6743 }
6744}
6745
6746#[derive(Debug)]
6747pub enum TelemetryProviderEvent {}
6748
6749impl TelemetryProviderEvent {
6750 fn decode(
6752 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6753 ) -> Result<TelemetryProviderEvent, fidl::Error> {
6754 let (bytes, _handles) = buf.split_mut();
6755 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6756 debug_assert_eq!(tx_header.tx_id, 0);
6757 match tx_header.ordinal {
6758 _ => Err(fidl::Error::UnknownOrdinal {
6759 ordinal: tx_header.ordinal,
6760 protocol_name:
6761 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6762 }),
6763 }
6764 }
6765}
6766
6767pub struct TelemetryProviderRequestStream {
6769 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6770 is_terminated: bool,
6771}
6772
6773impl std::marker::Unpin for TelemetryProviderRequestStream {}
6774
6775impl futures::stream::FusedStream for TelemetryProviderRequestStream {
6776 fn is_terminated(&self) -> bool {
6777 self.is_terminated
6778 }
6779}
6780
6781impl fidl::endpoints::RequestStream for TelemetryProviderRequestStream {
6782 type Protocol = TelemetryProviderMarker;
6783 type ControlHandle = TelemetryProviderControlHandle;
6784
6785 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6786 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6787 }
6788
6789 fn control_handle(&self) -> Self::ControlHandle {
6790 TelemetryProviderControlHandle { inner: self.inner.clone() }
6791 }
6792
6793 fn into_inner(
6794 self,
6795 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6796 {
6797 (self.inner, self.is_terminated)
6798 }
6799
6800 fn from_inner(
6801 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6802 is_terminated: bool,
6803 ) -> Self {
6804 Self { inner, is_terminated }
6805 }
6806}
6807
6808impl futures::Stream for TelemetryProviderRequestStream {
6809 type Item = Result<TelemetryProviderRequest, fidl::Error>;
6810
6811 fn poll_next(
6812 mut self: std::pin::Pin<&mut Self>,
6813 cx: &mut std::task::Context<'_>,
6814 ) -> std::task::Poll<Option<Self::Item>> {
6815 let this = &mut *self;
6816 if this.inner.check_shutdown(cx) {
6817 this.is_terminated = true;
6818 return std::task::Poll::Ready(None);
6819 }
6820 if this.is_terminated {
6821 panic!("polled TelemetryProviderRequestStream after completion");
6822 }
6823 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6824 |bytes, handles| {
6825 match this.inner.channel().read_etc(cx, bytes, handles) {
6826 std::task::Poll::Ready(Ok(())) => {}
6827 std::task::Poll::Pending => return std::task::Poll::Pending,
6828 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6829 this.is_terminated = true;
6830 return std::task::Poll::Ready(None);
6831 }
6832 std::task::Poll::Ready(Err(e)) => {
6833 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6834 e.into(),
6835 ))))
6836 }
6837 }
6838
6839 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6841
6842 std::task::Poll::Ready(Some(match header.ordinal {
6843 0xc34f2fff7dacc41 => {
6844 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6845 let mut req = fidl::new_empty!(
6846 fidl::encoding::EmptyPayload,
6847 fidl::encoding::DefaultFuchsiaResourceDialect
6848 );
6849 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6850 let control_handle =
6851 TelemetryProviderControlHandle { inner: this.inner.clone() };
6852 Ok(TelemetryProviderRequest::GetTelemetry {
6853 responder: TelemetryProviderGetTelemetryResponder {
6854 control_handle: std::mem::ManuallyDrop::new(control_handle),
6855 tx_id: header.tx_id,
6856 },
6857 })
6858 }
6859 _ => Err(fidl::Error::UnknownOrdinal {
6860 ordinal: header.ordinal,
6861 protocol_name:
6862 <TelemetryProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6863 }),
6864 }))
6865 },
6866 )
6867 }
6868}
6869
6870#[derive(Debug)]
6872pub enum TelemetryProviderRequest {
6873 GetTelemetry { responder: TelemetryProviderGetTelemetryResponder },
6875}
6876
6877impl TelemetryProviderRequest {
6878 #[allow(irrefutable_let_patterns)]
6879 pub fn into_get_telemetry(self) -> Option<(TelemetryProviderGetTelemetryResponder)> {
6880 if let TelemetryProviderRequest::GetTelemetry { responder } = self {
6881 Some((responder))
6882 } else {
6883 None
6884 }
6885 }
6886
6887 pub fn method_name(&self) -> &'static str {
6889 match *self {
6890 TelemetryProviderRequest::GetTelemetry { .. } => "get_telemetry",
6891 }
6892 }
6893}
6894
6895#[derive(Debug, Clone)]
6896pub struct TelemetryProviderControlHandle {
6897 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6898}
6899
6900impl fidl::endpoints::ControlHandle for TelemetryProviderControlHandle {
6901 fn shutdown(&self) {
6902 self.inner.shutdown()
6903 }
6904 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6905 self.inner.shutdown_with_epitaph(status)
6906 }
6907
6908 fn is_closed(&self) -> bool {
6909 self.inner.channel().is_closed()
6910 }
6911 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6912 self.inner.channel().on_closed()
6913 }
6914
6915 #[cfg(target_os = "fuchsia")]
6916 fn signal_peer(
6917 &self,
6918 clear_mask: zx::Signals,
6919 set_mask: zx::Signals,
6920 ) -> Result<(), zx_status::Status> {
6921 use fidl::Peered;
6922 self.inner.channel().signal_peer(clear_mask, set_mask)
6923 }
6924}
6925
6926impl TelemetryProviderControlHandle {}
6927
6928#[must_use = "FIDL methods require a response to be sent"]
6929#[derive(Debug)]
6930pub struct TelemetryProviderGetTelemetryResponder {
6931 control_handle: std::mem::ManuallyDrop<TelemetryProviderControlHandle>,
6932 tx_id: u32,
6933}
6934
6935impl std::ops::Drop for TelemetryProviderGetTelemetryResponder {
6939 fn drop(&mut self) {
6940 self.control_handle.shutdown();
6941 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6943 }
6944}
6945
6946impl fidl::endpoints::Responder for TelemetryProviderGetTelemetryResponder {
6947 type ControlHandle = TelemetryProviderControlHandle;
6948
6949 fn control_handle(&self) -> &TelemetryProviderControlHandle {
6950 &self.control_handle
6951 }
6952
6953 fn drop_without_shutdown(mut self) {
6954 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6956 std::mem::forget(self);
6958 }
6959}
6960
6961impl TelemetryProviderGetTelemetryResponder {
6962 pub fn send(self, mut telemetry: &Telemetry) -> Result<(), fidl::Error> {
6966 let _result = self.send_raw(telemetry);
6967 if _result.is_err() {
6968 self.control_handle.shutdown();
6969 }
6970 self.drop_without_shutdown();
6971 _result
6972 }
6973
6974 pub fn send_no_shutdown_on_err(self, mut telemetry: &Telemetry) -> Result<(), fidl::Error> {
6976 let _result = self.send_raw(telemetry);
6977 self.drop_without_shutdown();
6978 _result
6979 }
6980
6981 fn send_raw(&self, mut telemetry: &Telemetry) -> Result<(), fidl::Error> {
6982 self.control_handle.inner.send::<TelemetryProviderGetTelemetryResponse>(
6983 (telemetry,),
6984 self.tx_id,
6985 0xc34f2fff7dacc41,
6986 fidl::encoding::DynamicFlags::empty(),
6987 )
6988 }
6989}
6990
6991#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6992pub struct TelemetryProviderConnectorMarker;
6993
6994impl fidl::endpoints::ProtocolMarker for TelemetryProviderConnectorMarker {
6995 type Proxy = TelemetryProviderConnectorProxy;
6996 type RequestStream = TelemetryProviderConnectorRequestStream;
6997 #[cfg(target_os = "fuchsia")]
6998 type SynchronousProxy = TelemetryProviderConnectorSynchronousProxy;
6999
7000 const DEBUG_NAME: &'static str = "fuchsia.lowpan.experimental.TelemetryProviderConnector";
7001}
7002impl fidl::endpoints::DiscoverableProtocolMarker for TelemetryProviderConnectorMarker {}
7003
7004pub trait TelemetryProviderConnectorProxyInterface: Send + Sync {
7005 fn r#connect(
7006 &self,
7007 name: &str,
7008 server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7009 ) -> Result<(), fidl::Error>;
7010}
7011#[derive(Debug)]
7012#[cfg(target_os = "fuchsia")]
7013pub struct TelemetryProviderConnectorSynchronousProxy {
7014 client: fidl::client::sync::Client,
7015}
7016
7017#[cfg(target_os = "fuchsia")]
7018impl fidl::endpoints::SynchronousProxy for TelemetryProviderConnectorSynchronousProxy {
7019 type Proxy = TelemetryProviderConnectorProxy;
7020 type Protocol = TelemetryProviderConnectorMarker;
7021
7022 fn from_channel(inner: fidl::Channel) -> Self {
7023 Self::new(inner)
7024 }
7025
7026 fn into_channel(self) -> fidl::Channel {
7027 self.client.into_channel()
7028 }
7029
7030 fn as_channel(&self) -> &fidl::Channel {
7031 self.client.as_channel()
7032 }
7033}
7034
7035#[cfg(target_os = "fuchsia")]
7036impl TelemetryProviderConnectorSynchronousProxy {
7037 pub fn new(channel: fidl::Channel) -> Self {
7038 let protocol_name =
7039 <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7040 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7041 }
7042
7043 pub fn into_channel(self) -> fidl::Channel {
7044 self.client.into_channel()
7045 }
7046
7047 pub fn wait_for_event(
7050 &self,
7051 deadline: zx::MonotonicInstant,
7052 ) -> Result<TelemetryProviderConnectorEvent, fidl::Error> {
7053 TelemetryProviderConnectorEvent::decode(self.client.wait_for_event(deadline)?)
7054 }
7055
7056 pub fn r#connect(
7068 &self,
7069 mut name: &str,
7070 mut server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7071 ) -> Result<(), fidl::Error> {
7072 self.client.send::<TelemetryProviderConnectorConnectRequest>(
7073 (name, server_end),
7074 0x24a5bf1be73e2fad,
7075 fidl::encoding::DynamicFlags::empty(),
7076 )
7077 }
7078}
7079
7080#[cfg(target_os = "fuchsia")]
7081impl From<TelemetryProviderConnectorSynchronousProxy> for zx::Handle {
7082 fn from(value: TelemetryProviderConnectorSynchronousProxy) -> Self {
7083 value.into_channel().into()
7084 }
7085}
7086
7087#[cfg(target_os = "fuchsia")]
7088impl From<fidl::Channel> for TelemetryProviderConnectorSynchronousProxy {
7089 fn from(value: fidl::Channel) -> Self {
7090 Self::new(value)
7091 }
7092}
7093
7094#[cfg(target_os = "fuchsia")]
7095impl fidl::endpoints::FromClient for TelemetryProviderConnectorSynchronousProxy {
7096 type Protocol = TelemetryProviderConnectorMarker;
7097
7098 fn from_client(value: fidl::endpoints::ClientEnd<TelemetryProviderConnectorMarker>) -> Self {
7099 Self::new(value.into_channel())
7100 }
7101}
7102
7103#[derive(Debug, Clone)]
7104pub struct TelemetryProviderConnectorProxy {
7105 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7106}
7107
7108impl fidl::endpoints::Proxy for TelemetryProviderConnectorProxy {
7109 type Protocol = TelemetryProviderConnectorMarker;
7110
7111 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7112 Self::new(inner)
7113 }
7114
7115 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7116 self.client.into_channel().map_err(|client| Self { client })
7117 }
7118
7119 fn as_channel(&self) -> &::fidl::AsyncChannel {
7120 self.client.as_channel()
7121 }
7122}
7123
7124impl TelemetryProviderConnectorProxy {
7125 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7127 let protocol_name =
7128 <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7129 Self { client: fidl::client::Client::new(channel, protocol_name) }
7130 }
7131
7132 pub fn take_event_stream(&self) -> TelemetryProviderConnectorEventStream {
7138 TelemetryProviderConnectorEventStream { event_receiver: self.client.take_event_receiver() }
7139 }
7140
7141 pub fn r#connect(
7153 &self,
7154 mut name: &str,
7155 mut server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7156 ) -> Result<(), fidl::Error> {
7157 TelemetryProviderConnectorProxyInterface::r#connect(self, name, server_end)
7158 }
7159}
7160
7161impl TelemetryProviderConnectorProxyInterface for TelemetryProviderConnectorProxy {
7162 fn r#connect(
7163 &self,
7164 mut name: &str,
7165 mut server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7166 ) -> Result<(), fidl::Error> {
7167 self.client.send::<TelemetryProviderConnectorConnectRequest>(
7168 (name, server_end),
7169 0x24a5bf1be73e2fad,
7170 fidl::encoding::DynamicFlags::empty(),
7171 )
7172 }
7173}
7174
7175pub struct TelemetryProviderConnectorEventStream {
7176 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7177}
7178
7179impl std::marker::Unpin for TelemetryProviderConnectorEventStream {}
7180
7181impl futures::stream::FusedStream for TelemetryProviderConnectorEventStream {
7182 fn is_terminated(&self) -> bool {
7183 self.event_receiver.is_terminated()
7184 }
7185}
7186
7187impl futures::Stream for TelemetryProviderConnectorEventStream {
7188 type Item = Result<TelemetryProviderConnectorEvent, fidl::Error>;
7189
7190 fn poll_next(
7191 mut self: std::pin::Pin<&mut Self>,
7192 cx: &mut std::task::Context<'_>,
7193 ) -> std::task::Poll<Option<Self::Item>> {
7194 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7195 &mut self.event_receiver,
7196 cx
7197 )?) {
7198 Some(buf) => std::task::Poll::Ready(Some(TelemetryProviderConnectorEvent::decode(buf))),
7199 None => std::task::Poll::Ready(None),
7200 }
7201 }
7202}
7203
7204#[derive(Debug)]
7205pub enum TelemetryProviderConnectorEvent {}
7206
7207impl TelemetryProviderConnectorEvent {
7208 fn decode(
7210 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7211 ) -> Result<TelemetryProviderConnectorEvent, fidl::Error> {
7212 let (bytes, _handles) = buf.split_mut();
7213 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7214 debug_assert_eq!(tx_header.tx_id, 0);
7215 match tx_header.ordinal {
7216 _ => Err(fidl::Error::UnknownOrdinal {
7217 ordinal: tx_header.ordinal,
7218 protocol_name: <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7219 })
7220 }
7221 }
7222}
7223
7224pub struct TelemetryProviderConnectorRequestStream {
7226 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7227 is_terminated: bool,
7228}
7229
7230impl std::marker::Unpin for TelemetryProviderConnectorRequestStream {}
7231
7232impl futures::stream::FusedStream for TelemetryProviderConnectorRequestStream {
7233 fn is_terminated(&self) -> bool {
7234 self.is_terminated
7235 }
7236}
7237
7238impl fidl::endpoints::RequestStream for TelemetryProviderConnectorRequestStream {
7239 type Protocol = TelemetryProviderConnectorMarker;
7240 type ControlHandle = TelemetryProviderConnectorControlHandle;
7241
7242 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7243 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7244 }
7245
7246 fn control_handle(&self) -> Self::ControlHandle {
7247 TelemetryProviderConnectorControlHandle { inner: self.inner.clone() }
7248 }
7249
7250 fn into_inner(
7251 self,
7252 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7253 {
7254 (self.inner, self.is_terminated)
7255 }
7256
7257 fn from_inner(
7258 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7259 is_terminated: bool,
7260 ) -> Self {
7261 Self { inner, is_terminated }
7262 }
7263}
7264
7265impl futures::Stream for TelemetryProviderConnectorRequestStream {
7266 type Item = Result<TelemetryProviderConnectorRequest, fidl::Error>;
7267
7268 fn poll_next(
7269 mut self: std::pin::Pin<&mut Self>,
7270 cx: &mut std::task::Context<'_>,
7271 ) -> std::task::Poll<Option<Self::Item>> {
7272 let this = &mut *self;
7273 if this.inner.check_shutdown(cx) {
7274 this.is_terminated = true;
7275 return std::task::Poll::Ready(None);
7276 }
7277 if this.is_terminated {
7278 panic!("polled TelemetryProviderConnectorRequestStream after completion");
7279 }
7280 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7281 |bytes, handles| {
7282 match this.inner.channel().read_etc(cx, bytes, handles) {
7283 std::task::Poll::Ready(Ok(())) => {}
7284 std::task::Poll::Pending => return std::task::Poll::Pending,
7285 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7286 this.is_terminated = true;
7287 return std::task::Poll::Ready(None);
7288 }
7289 std::task::Poll::Ready(Err(e)) => {
7290 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7291 e.into(),
7292 ))))
7293 }
7294 }
7295
7296 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7298
7299 std::task::Poll::Ready(Some(match header.ordinal {
7300 0x24a5bf1be73e2fad => {
7301 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7302 let mut req = fidl::new_empty!(TelemetryProviderConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7303 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TelemetryProviderConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
7304 let control_handle = TelemetryProviderConnectorControlHandle {
7305 inner: this.inner.clone(),
7306 };
7307 Ok(TelemetryProviderConnectorRequest::Connect {name: req.name,
7308server_end: req.server_end,
7309
7310 control_handle,
7311 })
7312 }
7313 _ => Err(fidl::Error::UnknownOrdinal {
7314 ordinal: header.ordinal,
7315 protocol_name: <TelemetryProviderConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7316 }),
7317 }))
7318 },
7319 )
7320 }
7321}
7322
7323#[derive(Debug)]
7325pub enum TelemetryProviderConnectorRequest {
7326 Connect {
7338 name: String,
7339 server_end: fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7340 control_handle: TelemetryProviderConnectorControlHandle,
7341 },
7342}
7343
7344impl TelemetryProviderConnectorRequest {
7345 #[allow(irrefutable_let_patterns)]
7346 pub fn into_connect(
7347 self,
7348 ) -> Option<(
7349 String,
7350 fidl::endpoints::ServerEnd<TelemetryProviderMarker>,
7351 TelemetryProviderConnectorControlHandle,
7352 )> {
7353 if let TelemetryProviderConnectorRequest::Connect { name, server_end, control_handle } =
7354 self
7355 {
7356 Some((name, server_end, control_handle))
7357 } else {
7358 None
7359 }
7360 }
7361
7362 pub fn method_name(&self) -> &'static str {
7364 match *self {
7365 TelemetryProviderConnectorRequest::Connect { .. } => "connect",
7366 }
7367 }
7368}
7369
7370#[derive(Debug, Clone)]
7371pub struct TelemetryProviderConnectorControlHandle {
7372 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7373}
7374
7375impl fidl::endpoints::ControlHandle for TelemetryProviderConnectorControlHandle {
7376 fn shutdown(&self) {
7377 self.inner.shutdown()
7378 }
7379 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7380 self.inner.shutdown_with_epitaph(status)
7381 }
7382
7383 fn is_closed(&self) -> bool {
7384 self.inner.channel().is_closed()
7385 }
7386 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7387 self.inner.channel().on_closed()
7388 }
7389
7390 #[cfg(target_os = "fuchsia")]
7391 fn signal_peer(
7392 &self,
7393 clear_mask: zx::Signals,
7394 set_mask: zx::Signals,
7395 ) -> Result<(), zx_status::Status> {
7396 use fidl::Peered;
7397 self.inner.channel().signal_peer(clear_mask, set_mask)
7398 }
7399}
7400
7401impl TelemetryProviderConnectorControlHandle {}
7402
7403mod internal {
7404 use super::*;
7405
7406 impl fidl::encoding::ResourceTypeMarker for DeviceConnectorConnectRequest {
7407 type Borrowed<'a> = &'a mut Self;
7408 fn take_or_borrow<'a>(
7409 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7410 ) -> Self::Borrowed<'a> {
7411 value
7412 }
7413 }
7414
7415 unsafe impl fidl::encoding::TypeMarker for DeviceConnectorConnectRequest {
7416 type Owned = Self;
7417
7418 #[inline(always)]
7419 fn inline_align(_context: fidl::encoding::Context) -> usize {
7420 8
7421 }
7422
7423 #[inline(always)]
7424 fn inline_size(_context: fidl::encoding::Context) -> usize {
7425 24
7426 }
7427 }
7428
7429 unsafe impl
7430 fidl::encoding::Encode<
7431 DeviceConnectorConnectRequest,
7432 fidl::encoding::DefaultFuchsiaResourceDialect,
7433 > for &mut DeviceConnectorConnectRequest
7434 {
7435 #[inline]
7436 unsafe fn encode(
7437 self,
7438 encoder: &mut fidl::encoding::Encoder<
7439 '_,
7440 fidl::encoding::DefaultFuchsiaResourceDialect,
7441 >,
7442 offset: usize,
7443 _depth: fidl::encoding::Depth,
7444 ) -> fidl::Result<()> {
7445 encoder.debug_check_bounds::<DeviceConnectorConnectRequest>(offset);
7446 fidl::encoding::Encode::<DeviceConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7448 (
7449 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
7450 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
7451 ),
7452 encoder, offset, _depth
7453 )
7454 }
7455 }
7456 unsafe impl<
7457 T0: fidl::encoding::Encode<
7458 fidl::encoding::BoundedString<32>,
7459 fidl::encoding::DefaultFuchsiaResourceDialect,
7460 >,
7461 T1: fidl::encoding::Encode<
7462 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
7463 fidl::encoding::DefaultFuchsiaResourceDialect,
7464 >,
7465 >
7466 fidl::encoding::Encode<
7467 DeviceConnectorConnectRequest,
7468 fidl::encoding::DefaultFuchsiaResourceDialect,
7469 > for (T0, T1)
7470 {
7471 #[inline]
7472 unsafe fn encode(
7473 self,
7474 encoder: &mut fidl::encoding::Encoder<
7475 '_,
7476 fidl::encoding::DefaultFuchsiaResourceDialect,
7477 >,
7478 offset: usize,
7479 depth: fidl::encoding::Depth,
7480 ) -> fidl::Result<()> {
7481 encoder.debug_check_bounds::<DeviceConnectorConnectRequest>(offset);
7482 unsafe {
7485 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7486 (ptr as *mut u64).write_unaligned(0);
7487 }
7488 self.0.encode(encoder, offset + 0, depth)?;
7490 self.1.encode(encoder, offset + 16, depth)?;
7491 Ok(())
7492 }
7493 }
7494
7495 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7496 for DeviceConnectorConnectRequest
7497 {
7498 #[inline(always)]
7499 fn new_empty() -> Self {
7500 Self {
7501 name: fidl::new_empty!(
7502 fidl::encoding::BoundedString<32>,
7503 fidl::encoding::DefaultFuchsiaResourceDialect
7504 ),
7505 server_end: fidl::new_empty!(
7506 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
7507 fidl::encoding::DefaultFuchsiaResourceDialect
7508 ),
7509 }
7510 }
7511
7512 #[inline]
7513 unsafe fn decode(
7514 &mut self,
7515 decoder: &mut fidl::encoding::Decoder<
7516 '_,
7517 fidl::encoding::DefaultFuchsiaResourceDialect,
7518 >,
7519 offset: usize,
7520 _depth: fidl::encoding::Depth,
7521 ) -> fidl::Result<()> {
7522 decoder.debug_check_bounds::<Self>(offset);
7523 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7525 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7526 let mask = 0xffffffff00000000u64;
7527 let maskedval = padval & mask;
7528 if maskedval != 0 {
7529 return Err(fidl::Error::NonZeroPadding {
7530 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7531 });
7532 }
7533 fidl::decode!(
7534 fidl::encoding::BoundedString<32>,
7535 fidl::encoding::DefaultFuchsiaResourceDialect,
7536 &mut self.name,
7537 decoder,
7538 offset + 0,
7539 _depth
7540 )?;
7541 fidl::decode!(
7542 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
7543 fidl::encoding::DefaultFuchsiaResourceDialect,
7544 &mut self.server_end,
7545 decoder,
7546 offset + 16,
7547 _depth
7548 )?;
7549 Ok(())
7550 }
7551 }
7552
7553 impl fidl::encoding::ResourceTypeMarker for DeviceExtraConnectorConnectRequest {
7554 type Borrowed<'a> = &'a mut Self;
7555 fn take_or_borrow<'a>(
7556 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7557 ) -> Self::Borrowed<'a> {
7558 value
7559 }
7560 }
7561
7562 unsafe impl fidl::encoding::TypeMarker for DeviceExtraConnectorConnectRequest {
7563 type Owned = Self;
7564
7565 #[inline(always)]
7566 fn inline_align(_context: fidl::encoding::Context) -> usize {
7567 8
7568 }
7569
7570 #[inline(always)]
7571 fn inline_size(_context: fidl::encoding::Context) -> usize {
7572 24
7573 }
7574 }
7575
7576 unsafe impl
7577 fidl::encoding::Encode<
7578 DeviceExtraConnectorConnectRequest,
7579 fidl::encoding::DefaultFuchsiaResourceDialect,
7580 > for &mut DeviceExtraConnectorConnectRequest
7581 {
7582 #[inline]
7583 unsafe fn encode(
7584 self,
7585 encoder: &mut fidl::encoding::Encoder<
7586 '_,
7587 fidl::encoding::DefaultFuchsiaResourceDialect,
7588 >,
7589 offset: usize,
7590 _depth: fidl::encoding::Depth,
7591 ) -> fidl::Result<()> {
7592 encoder.debug_check_bounds::<DeviceExtraConnectorConnectRequest>(offset);
7593 fidl::encoding::Encode::<DeviceExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7595 (
7596 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
7597 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
7598 ),
7599 encoder, offset, _depth
7600 )
7601 }
7602 }
7603 unsafe impl<
7604 T0: fidl::encoding::Encode<
7605 fidl::encoding::BoundedString<32>,
7606 fidl::encoding::DefaultFuchsiaResourceDialect,
7607 >,
7608 T1: fidl::encoding::Encode<
7609 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>>,
7610 fidl::encoding::DefaultFuchsiaResourceDialect,
7611 >,
7612 >
7613 fidl::encoding::Encode<
7614 DeviceExtraConnectorConnectRequest,
7615 fidl::encoding::DefaultFuchsiaResourceDialect,
7616 > for (T0, T1)
7617 {
7618 #[inline]
7619 unsafe fn encode(
7620 self,
7621 encoder: &mut fidl::encoding::Encoder<
7622 '_,
7623 fidl::encoding::DefaultFuchsiaResourceDialect,
7624 >,
7625 offset: usize,
7626 depth: fidl::encoding::Depth,
7627 ) -> fidl::Result<()> {
7628 encoder.debug_check_bounds::<DeviceExtraConnectorConnectRequest>(offset);
7629 unsafe {
7632 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7633 (ptr as *mut u64).write_unaligned(0);
7634 }
7635 self.0.encode(encoder, offset + 0, depth)?;
7637 self.1.encode(encoder, offset + 16, depth)?;
7638 Ok(())
7639 }
7640 }
7641
7642 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7643 for DeviceExtraConnectorConnectRequest
7644 {
7645 #[inline(always)]
7646 fn new_empty() -> Self {
7647 Self {
7648 name: fidl::new_empty!(
7649 fidl::encoding::BoundedString<32>,
7650 fidl::encoding::DefaultFuchsiaResourceDialect
7651 ),
7652 server_end: fidl::new_empty!(
7653 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>>,
7654 fidl::encoding::DefaultFuchsiaResourceDialect
7655 ),
7656 }
7657 }
7658
7659 #[inline]
7660 unsafe fn decode(
7661 &mut self,
7662 decoder: &mut fidl::encoding::Decoder<
7663 '_,
7664 fidl::encoding::DefaultFuchsiaResourceDialect,
7665 >,
7666 offset: usize,
7667 _depth: fidl::encoding::Depth,
7668 ) -> fidl::Result<()> {
7669 decoder.debug_check_bounds::<Self>(offset);
7670 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7672 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7673 let mask = 0xffffffff00000000u64;
7674 let maskedval = padval & mask;
7675 if maskedval != 0 {
7676 return Err(fidl::Error::NonZeroPadding {
7677 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7678 });
7679 }
7680 fidl::decode!(
7681 fidl::encoding::BoundedString<32>,
7682 fidl::encoding::DefaultFuchsiaResourceDialect,
7683 &mut self.name,
7684 decoder,
7685 offset + 0,
7686 _depth
7687 )?;
7688 fidl::decode!(
7689 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceExtraMarker>>,
7690 fidl::encoding::DefaultFuchsiaResourceDialect,
7691 &mut self.server_end,
7692 decoder,
7693 offset + 16,
7694 _depth
7695 )?;
7696 Ok(())
7697 }
7698 }
7699
7700 impl fidl::encoding::ResourceTypeMarker for DeviceExtraFormNetworkRequest {
7701 type Borrowed<'a> = &'a mut Self;
7702 fn take_or_borrow<'a>(
7703 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7704 ) -> Self::Borrowed<'a> {
7705 value
7706 }
7707 }
7708
7709 unsafe impl fidl::encoding::TypeMarker for DeviceExtraFormNetworkRequest {
7710 type Owned = Self;
7711
7712 #[inline(always)]
7713 fn inline_align(_context: fidl::encoding::Context) -> usize {
7714 8
7715 }
7716
7717 #[inline(always)]
7718 fn inline_size(_context: fidl::encoding::Context) -> usize {
7719 40
7720 }
7721 }
7722
7723 unsafe impl
7724 fidl::encoding::Encode<
7725 DeviceExtraFormNetworkRequest,
7726 fidl::encoding::DefaultFuchsiaResourceDialect,
7727 > for &mut DeviceExtraFormNetworkRequest
7728 {
7729 #[inline]
7730 unsafe fn encode(
7731 self,
7732 encoder: &mut fidl::encoding::Encoder<
7733 '_,
7734 fidl::encoding::DefaultFuchsiaResourceDialect,
7735 >,
7736 offset: usize,
7737 _depth: fidl::encoding::Depth,
7738 ) -> fidl::Result<()> {
7739 encoder.debug_check_bounds::<DeviceExtraFormNetworkRequest>(offset);
7740 fidl::encoding::Encode::<DeviceExtraFormNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7742 (
7743 <fidl_fuchsia_lowpan_device::ProvisioningParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
7744 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.progress),
7745 ),
7746 encoder, offset, _depth
7747 )
7748 }
7749 }
7750 unsafe impl<
7751 T0: fidl::encoding::Encode<
7752 fidl_fuchsia_lowpan_device::ProvisioningParams,
7753 fidl::encoding::DefaultFuchsiaResourceDialect,
7754 >,
7755 T1: fidl::encoding::Encode<
7756 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7757 fidl::encoding::DefaultFuchsiaResourceDialect,
7758 >,
7759 >
7760 fidl::encoding::Encode<
7761 DeviceExtraFormNetworkRequest,
7762 fidl::encoding::DefaultFuchsiaResourceDialect,
7763 > for (T0, T1)
7764 {
7765 #[inline]
7766 unsafe fn encode(
7767 self,
7768 encoder: &mut fidl::encoding::Encoder<
7769 '_,
7770 fidl::encoding::DefaultFuchsiaResourceDialect,
7771 >,
7772 offset: usize,
7773 depth: fidl::encoding::Depth,
7774 ) -> fidl::Result<()> {
7775 encoder.debug_check_bounds::<DeviceExtraFormNetworkRequest>(offset);
7776 unsafe {
7779 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7780 (ptr as *mut u64).write_unaligned(0);
7781 }
7782 self.0.encode(encoder, offset + 0, depth)?;
7784 self.1.encode(encoder, offset + 32, depth)?;
7785 Ok(())
7786 }
7787 }
7788
7789 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7790 for DeviceExtraFormNetworkRequest
7791 {
7792 #[inline(always)]
7793 fn new_empty() -> Self {
7794 Self {
7795 params: fidl::new_empty!(
7796 fidl_fuchsia_lowpan_device::ProvisioningParams,
7797 fidl::encoding::DefaultFuchsiaResourceDialect
7798 ),
7799 progress: fidl::new_empty!(
7800 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7801 fidl::encoding::DefaultFuchsiaResourceDialect
7802 ),
7803 }
7804 }
7805
7806 #[inline]
7807 unsafe fn decode(
7808 &mut self,
7809 decoder: &mut fidl::encoding::Decoder<
7810 '_,
7811 fidl::encoding::DefaultFuchsiaResourceDialect,
7812 >,
7813 offset: usize,
7814 _depth: fidl::encoding::Depth,
7815 ) -> fidl::Result<()> {
7816 decoder.debug_check_bounds::<Self>(offset);
7817 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7819 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7820 let mask = 0xffffffff00000000u64;
7821 let maskedval = padval & mask;
7822 if maskedval != 0 {
7823 return Err(fidl::Error::NonZeroPadding {
7824 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7825 });
7826 }
7827 fidl::decode!(
7828 fidl_fuchsia_lowpan_device::ProvisioningParams,
7829 fidl::encoding::DefaultFuchsiaResourceDialect,
7830 &mut self.params,
7831 decoder,
7832 offset + 0,
7833 _depth
7834 )?;
7835 fidl::decode!(
7836 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7837 fidl::encoding::DefaultFuchsiaResourceDialect,
7838 &mut self.progress,
7839 decoder,
7840 offset + 32,
7841 _depth
7842 )?;
7843 Ok(())
7844 }
7845 }
7846
7847 impl fidl::encoding::ResourceTypeMarker for DeviceExtraJoinNetworkRequest {
7848 type Borrowed<'a> = &'a mut Self;
7849 fn take_or_borrow<'a>(
7850 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7851 ) -> Self::Borrowed<'a> {
7852 value
7853 }
7854 }
7855
7856 unsafe impl fidl::encoding::TypeMarker for DeviceExtraJoinNetworkRequest {
7857 type Owned = Self;
7858
7859 #[inline(always)]
7860 fn inline_align(_context: fidl::encoding::Context) -> usize {
7861 8
7862 }
7863
7864 #[inline(always)]
7865 fn inline_size(_context: fidl::encoding::Context) -> usize {
7866 24
7867 }
7868 }
7869
7870 unsafe impl
7871 fidl::encoding::Encode<
7872 DeviceExtraJoinNetworkRequest,
7873 fidl::encoding::DefaultFuchsiaResourceDialect,
7874 > for &mut DeviceExtraJoinNetworkRequest
7875 {
7876 #[inline]
7877 unsafe fn encode(
7878 self,
7879 encoder: &mut fidl::encoding::Encoder<
7880 '_,
7881 fidl::encoding::DefaultFuchsiaResourceDialect,
7882 >,
7883 offset: usize,
7884 _depth: fidl::encoding::Depth,
7885 ) -> fidl::Result<()> {
7886 encoder.debug_check_bounds::<DeviceExtraJoinNetworkRequest>(offset);
7887 fidl::encoding::Encode::<DeviceExtraJoinNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7889 (
7890 <JoinParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
7891 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.progress),
7892 ),
7893 encoder, offset, _depth
7894 )
7895 }
7896 }
7897 unsafe impl<
7898 T0: fidl::encoding::Encode<JoinParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
7899 T1: fidl::encoding::Encode<
7900 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7901 fidl::encoding::DefaultFuchsiaResourceDialect,
7902 >,
7903 >
7904 fidl::encoding::Encode<
7905 DeviceExtraJoinNetworkRequest,
7906 fidl::encoding::DefaultFuchsiaResourceDialect,
7907 > for (T0, T1)
7908 {
7909 #[inline]
7910 unsafe fn encode(
7911 self,
7912 encoder: &mut fidl::encoding::Encoder<
7913 '_,
7914 fidl::encoding::DefaultFuchsiaResourceDialect,
7915 >,
7916 offset: usize,
7917 depth: fidl::encoding::Depth,
7918 ) -> fidl::Result<()> {
7919 encoder.debug_check_bounds::<DeviceExtraJoinNetworkRequest>(offset);
7920 unsafe {
7923 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7924 (ptr as *mut u64).write_unaligned(0);
7925 }
7926 self.0.encode(encoder, offset + 0, depth)?;
7928 self.1.encode(encoder, offset + 16, depth)?;
7929 Ok(())
7930 }
7931 }
7932
7933 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7934 for DeviceExtraJoinNetworkRequest
7935 {
7936 #[inline(always)]
7937 fn new_empty() -> Self {
7938 Self {
7939 params: fidl::new_empty!(JoinParams, fidl::encoding::DefaultFuchsiaResourceDialect),
7940 progress: fidl::new_empty!(
7941 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7942 fidl::encoding::DefaultFuchsiaResourceDialect
7943 ),
7944 }
7945 }
7946
7947 #[inline]
7948 unsafe fn decode(
7949 &mut self,
7950 decoder: &mut fidl::encoding::Decoder<
7951 '_,
7952 fidl::encoding::DefaultFuchsiaResourceDialect,
7953 >,
7954 offset: usize,
7955 _depth: fidl::encoding::Depth,
7956 ) -> fidl::Result<()> {
7957 decoder.debug_check_bounds::<Self>(offset);
7958 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7960 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7961 let mask = 0xffffffff00000000u64;
7962 let maskedval = padval & mask;
7963 if maskedval != 0 {
7964 return Err(fidl::Error::NonZeroPadding {
7965 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7966 });
7967 }
7968 fidl::decode!(
7969 JoinParams,
7970 fidl::encoding::DefaultFuchsiaResourceDialect,
7971 &mut self.params,
7972 decoder,
7973 offset + 0,
7974 _depth
7975 )?;
7976 fidl::decode!(
7977 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProvisioningMonitorMarker>>,
7978 fidl::encoding::DefaultFuchsiaResourceDialect,
7979 &mut self.progress,
7980 decoder,
7981 offset + 16,
7982 _depth
7983 )?;
7984 Ok(())
7985 }
7986 }
7987
7988 impl fidl::encoding::ResourceTypeMarker for DeviceExtraStartNetworkScanRequest {
7989 type Borrowed<'a> = &'a mut Self;
7990 fn take_or_borrow<'a>(
7991 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7992 ) -> Self::Borrowed<'a> {
7993 value
7994 }
7995 }
7996
7997 unsafe impl fidl::encoding::TypeMarker for DeviceExtraStartNetworkScanRequest {
7998 type Owned = Self;
7999
8000 #[inline(always)]
8001 fn inline_align(_context: fidl::encoding::Context) -> usize {
8002 8
8003 }
8004
8005 #[inline(always)]
8006 fn inline_size(_context: fidl::encoding::Context) -> usize {
8007 24
8008 }
8009 }
8010
8011 unsafe impl
8012 fidl::encoding::Encode<
8013 DeviceExtraStartNetworkScanRequest,
8014 fidl::encoding::DefaultFuchsiaResourceDialect,
8015 > for &mut DeviceExtraStartNetworkScanRequest
8016 {
8017 #[inline]
8018 unsafe fn encode(
8019 self,
8020 encoder: &mut fidl::encoding::Encoder<
8021 '_,
8022 fidl::encoding::DefaultFuchsiaResourceDialect,
8023 >,
8024 offset: usize,
8025 _depth: fidl::encoding::Depth,
8026 ) -> fidl::Result<()> {
8027 encoder.debug_check_bounds::<DeviceExtraStartNetworkScanRequest>(offset);
8028 fidl::encoding::Encode::<DeviceExtraStartNetworkScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8030 (
8031 <NetworkScanParameters as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
8032 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
8033 ),
8034 encoder, offset, _depth
8035 )
8036 }
8037 }
8038 unsafe impl<
8039 T0: fidl::encoding::Encode<
8040 NetworkScanParameters,
8041 fidl::encoding::DefaultFuchsiaResourceDialect,
8042 >,
8043 T1: fidl::encoding::Encode<
8044 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>>,
8045 fidl::encoding::DefaultFuchsiaResourceDialect,
8046 >,
8047 >
8048 fidl::encoding::Encode<
8049 DeviceExtraStartNetworkScanRequest,
8050 fidl::encoding::DefaultFuchsiaResourceDialect,
8051 > for (T0, T1)
8052 {
8053 #[inline]
8054 unsafe fn encode(
8055 self,
8056 encoder: &mut fidl::encoding::Encoder<
8057 '_,
8058 fidl::encoding::DefaultFuchsiaResourceDialect,
8059 >,
8060 offset: usize,
8061 depth: fidl::encoding::Depth,
8062 ) -> fidl::Result<()> {
8063 encoder.debug_check_bounds::<DeviceExtraStartNetworkScanRequest>(offset);
8064 unsafe {
8067 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8068 (ptr as *mut u64).write_unaligned(0);
8069 }
8070 self.0.encode(encoder, offset + 0, depth)?;
8072 self.1.encode(encoder, offset + 16, depth)?;
8073 Ok(())
8074 }
8075 }
8076
8077 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8078 for DeviceExtraStartNetworkScanRequest
8079 {
8080 #[inline(always)]
8081 fn new_empty() -> Self {
8082 Self {
8083 params: fidl::new_empty!(
8084 NetworkScanParameters,
8085 fidl::encoding::DefaultFuchsiaResourceDialect
8086 ),
8087 stream: fidl::new_empty!(
8088 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>>,
8089 fidl::encoding::DefaultFuchsiaResourceDialect
8090 ),
8091 }
8092 }
8093
8094 #[inline]
8095 unsafe fn decode(
8096 &mut self,
8097 decoder: &mut fidl::encoding::Decoder<
8098 '_,
8099 fidl::encoding::DefaultFuchsiaResourceDialect,
8100 >,
8101 offset: usize,
8102 _depth: fidl::encoding::Depth,
8103 ) -> fidl::Result<()> {
8104 decoder.debug_check_bounds::<Self>(offset);
8105 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8107 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8108 let mask = 0xffffffff00000000u64;
8109 let maskedval = padval & mask;
8110 if maskedval != 0 {
8111 return Err(fidl::Error::NonZeroPadding {
8112 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8113 });
8114 }
8115 fidl::decode!(
8116 NetworkScanParameters,
8117 fidl::encoding::DefaultFuchsiaResourceDialect,
8118 &mut self.params,
8119 decoder,
8120 offset + 0,
8121 _depth
8122 )?;
8123 fidl::decode!(
8124 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BeaconInfoStreamMarker>>,
8125 fidl::encoding::DefaultFuchsiaResourceDialect,
8126 &mut self.stream,
8127 decoder,
8128 offset + 16,
8129 _depth
8130 )?;
8131 Ok(())
8132 }
8133 }
8134
8135 impl fidl::encoding::ResourceTypeMarker for DeviceRouteConnectorConnectRequest {
8136 type Borrowed<'a> = &'a mut Self;
8137 fn take_or_borrow<'a>(
8138 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8139 ) -> Self::Borrowed<'a> {
8140 value
8141 }
8142 }
8143
8144 unsafe impl fidl::encoding::TypeMarker for DeviceRouteConnectorConnectRequest {
8145 type Owned = Self;
8146
8147 #[inline(always)]
8148 fn inline_align(_context: fidl::encoding::Context) -> usize {
8149 8
8150 }
8151
8152 #[inline(always)]
8153 fn inline_size(_context: fidl::encoding::Context) -> usize {
8154 24
8155 }
8156 }
8157
8158 unsafe impl
8159 fidl::encoding::Encode<
8160 DeviceRouteConnectorConnectRequest,
8161 fidl::encoding::DefaultFuchsiaResourceDialect,
8162 > for &mut DeviceRouteConnectorConnectRequest
8163 {
8164 #[inline]
8165 unsafe fn encode(
8166 self,
8167 encoder: &mut fidl::encoding::Encoder<
8168 '_,
8169 fidl::encoding::DefaultFuchsiaResourceDialect,
8170 >,
8171 offset: usize,
8172 _depth: fidl::encoding::Depth,
8173 ) -> fidl::Result<()> {
8174 encoder.debug_check_bounds::<DeviceRouteConnectorConnectRequest>(offset);
8175 fidl::encoding::Encode::<DeviceRouteConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8177 (
8178 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8179 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8180 ),
8181 encoder, offset, _depth
8182 )
8183 }
8184 }
8185 unsafe impl<
8186 T0: fidl::encoding::Encode<
8187 fidl::encoding::BoundedString<32>,
8188 fidl::encoding::DefaultFuchsiaResourceDialect,
8189 >,
8190 T1: fidl::encoding::Encode<
8191 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>>,
8192 fidl::encoding::DefaultFuchsiaResourceDialect,
8193 >,
8194 >
8195 fidl::encoding::Encode<
8196 DeviceRouteConnectorConnectRequest,
8197 fidl::encoding::DefaultFuchsiaResourceDialect,
8198 > for (T0, T1)
8199 {
8200 #[inline]
8201 unsafe fn encode(
8202 self,
8203 encoder: &mut fidl::encoding::Encoder<
8204 '_,
8205 fidl::encoding::DefaultFuchsiaResourceDialect,
8206 >,
8207 offset: usize,
8208 depth: fidl::encoding::Depth,
8209 ) -> fidl::Result<()> {
8210 encoder.debug_check_bounds::<DeviceRouteConnectorConnectRequest>(offset);
8211 unsafe {
8214 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8215 (ptr as *mut u64).write_unaligned(0);
8216 }
8217 self.0.encode(encoder, offset + 0, depth)?;
8219 self.1.encode(encoder, offset + 16, depth)?;
8220 Ok(())
8221 }
8222 }
8223
8224 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8225 for DeviceRouteConnectorConnectRequest
8226 {
8227 #[inline(always)]
8228 fn new_empty() -> Self {
8229 Self {
8230 name: fidl::new_empty!(
8231 fidl::encoding::BoundedString<32>,
8232 fidl::encoding::DefaultFuchsiaResourceDialect
8233 ),
8234 server_end: fidl::new_empty!(
8235 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>>,
8236 fidl::encoding::DefaultFuchsiaResourceDialect
8237 ),
8238 }
8239 }
8240
8241 #[inline]
8242 unsafe fn decode(
8243 &mut self,
8244 decoder: &mut fidl::encoding::Decoder<
8245 '_,
8246 fidl::encoding::DefaultFuchsiaResourceDialect,
8247 >,
8248 offset: usize,
8249 _depth: fidl::encoding::Depth,
8250 ) -> fidl::Result<()> {
8251 decoder.debug_check_bounds::<Self>(offset);
8252 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8254 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8255 let mask = 0xffffffff00000000u64;
8256 let maskedval = padval & mask;
8257 if maskedval != 0 {
8258 return Err(fidl::Error::NonZeroPadding {
8259 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8260 });
8261 }
8262 fidl::decode!(
8263 fidl::encoding::BoundedString<32>,
8264 fidl::encoding::DefaultFuchsiaResourceDialect,
8265 &mut self.name,
8266 decoder,
8267 offset + 0,
8268 _depth
8269 )?;
8270 fidl::decode!(
8271 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteMarker>>,
8272 fidl::encoding::DefaultFuchsiaResourceDialect,
8273 &mut self.server_end,
8274 decoder,
8275 offset + 16,
8276 _depth
8277 )?;
8278 Ok(())
8279 }
8280 }
8281
8282 impl fidl::encoding::ResourceTypeMarker for DeviceRouteExtraConnectorConnectRequest {
8283 type Borrowed<'a> = &'a mut Self;
8284 fn take_or_borrow<'a>(
8285 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8286 ) -> Self::Borrowed<'a> {
8287 value
8288 }
8289 }
8290
8291 unsafe impl fidl::encoding::TypeMarker for DeviceRouteExtraConnectorConnectRequest {
8292 type Owned = Self;
8293
8294 #[inline(always)]
8295 fn inline_align(_context: fidl::encoding::Context) -> usize {
8296 8
8297 }
8298
8299 #[inline(always)]
8300 fn inline_size(_context: fidl::encoding::Context) -> usize {
8301 24
8302 }
8303 }
8304
8305 unsafe impl
8306 fidl::encoding::Encode<
8307 DeviceRouteExtraConnectorConnectRequest,
8308 fidl::encoding::DefaultFuchsiaResourceDialect,
8309 > for &mut DeviceRouteExtraConnectorConnectRequest
8310 {
8311 #[inline]
8312 unsafe fn encode(
8313 self,
8314 encoder: &mut fidl::encoding::Encoder<
8315 '_,
8316 fidl::encoding::DefaultFuchsiaResourceDialect,
8317 >,
8318 offset: usize,
8319 _depth: fidl::encoding::Depth,
8320 ) -> fidl::Result<()> {
8321 encoder.debug_check_bounds::<DeviceRouteExtraConnectorConnectRequest>(offset);
8322 fidl::encoding::Encode::<DeviceRouteExtraConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8324 (
8325 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8326 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8327 ),
8328 encoder, offset, _depth
8329 )
8330 }
8331 }
8332 unsafe impl<
8333 T0: fidl::encoding::Encode<
8334 fidl::encoding::BoundedString<32>,
8335 fidl::encoding::DefaultFuchsiaResourceDialect,
8336 >,
8337 T1: fidl::encoding::Encode<
8338 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>>,
8339 fidl::encoding::DefaultFuchsiaResourceDialect,
8340 >,
8341 >
8342 fidl::encoding::Encode<
8343 DeviceRouteExtraConnectorConnectRequest,
8344 fidl::encoding::DefaultFuchsiaResourceDialect,
8345 > for (T0, T1)
8346 {
8347 #[inline]
8348 unsafe fn encode(
8349 self,
8350 encoder: &mut fidl::encoding::Encoder<
8351 '_,
8352 fidl::encoding::DefaultFuchsiaResourceDialect,
8353 >,
8354 offset: usize,
8355 depth: fidl::encoding::Depth,
8356 ) -> fidl::Result<()> {
8357 encoder.debug_check_bounds::<DeviceRouteExtraConnectorConnectRequest>(offset);
8358 unsafe {
8361 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8362 (ptr as *mut u64).write_unaligned(0);
8363 }
8364 self.0.encode(encoder, offset + 0, depth)?;
8366 self.1.encode(encoder, offset + 16, depth)?;
8367 Ok(())
8368 }
8369 }
8370
8371 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8372 for DeviceRouteExtraConnectorConnectRequest
8373 {
8374 #[inline(always)]
8375 fn new_empty() -> Self {
8376 Self {
8377 name: fidl::new_empty!(
8378 fidl::encoding::BoundedString<32>,
8379 fidl::encoding::DefaultFuchsiaResourceDialect
8380 ),
8381 server_end: fidl::new_empty!(
8382 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>>,
8383 fidl::encoding::DefaultFuchsiaResourceDialect
8384 ),
8385 }
8386 }
8387
8388 #[inline]
8389 unsafe fn decode(
8390 &mut self,
8391 decoder: &mut fidl::encoding::Decoder<
8392 '_,
8393 fidl::encoding::DefaultFuchsiaResourceDialect,
8394 >,
8395 offset: usize,
8396 _depth: fidl::encoding::Depth,
8397 ) -> fidl::Result<()> {
8398 decoder.debug_check_bounds::<Self>(offset);
8399 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8401 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8402 let mask = 0xffffffff00000000u64;
8403 let maskedval = padval & mask;
8404 if maskedval != 0 {
8405 return Err(fidl::Error::NonZeroPadding {
8406 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8407 });
8408 }
8409 fidl::decode!(
8410 fidl::encoding::BoundedString<32>,
8411 fidl::encoding::DefaultFuchsiaResourceDialect,
8412 &mut self.name,
8413 decoder,
8414 offset + 0,
8415 _depth
8416 )?;
8417 fidl::decode!(
8418 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceRouteExtraMarker>>,
8419 fidl::encoding::DefaultFuchsiaResourceDialect,
8420 &mut self.server_end,
8421 decoder,
8422 offset + 16,
8423 _depth
8424 )?;
8425 Ok(())
8426 }
8427 }
8428
8429 impl fidl::encoding::ResourceTypeMarker for LegacyJoiningConnectorConnectRequest {
8430 type Borrowed<'a> = &'a mut Self;
8431 fn take_or_borrow<'a>(
8432 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8433 ) -> Self::Borrowed<'a> {
8434 value
8435 }
8436 }
8437
8438 unsafe impl fidl::encoding::TypeMarker for LegacyJoiningConnectorConnectRequest {
8439 type Owned = Self;
8440
8441 #[inline(always)]
8442 fn inline_align(_context: fidl::encoding::Context) -> usize {
8443 8
8444 }
8445
8446 #[inline(always)]
8447 fn inline_size(_context: fidl::encoding::Context) -> usize {
8448 24
8449 }
8450 }
8451
8452 unsafe impl
8453 fidl::encoding::Encode<
8454 LegacyJoiningConnectorConnectRequest,
8455 fidl::encoding::DefaultFuchsiaResourceDialect,
8456 > for &mut LegacyJoiningConnectorConnectRequest
8457 {
8458 #[inline]
8459 unsafe fn encode(
8460 self,
8461 encoder: &mut fidl::encoding::Encoder<
8462 '_,
8463 fidl::encoding::DefaultFuchsiaResourceDialect,
8464 >,
8465 offset: usize,
8466 _depth: fidl::encoding::Depth,
8467 ) -> fidl::Result<()> {
8468 encoder.debug_check_bounds::<LegacyJoiningConnectorConnectRequest>(offset);
8469 fidl::encoding::Encode::<LegacyJoiningConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8471 (
8472 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8473 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8474 ),
8475 encoder, offset, _depth
8476 )
8477 }
8478 }
8479 unsafe impl<
8480 T0: fidl::encoding::Encode<
8481 fidl::encoding::BoundedString<32>,
8482 fidl::encoding::DefaultFuchsiaResourceDialect,
8483 >,
8484 T1: fidl::encoding::Encode<
8485 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>>,
8486 fidl::encoding::DefaultFuchsiaResourceDialect,
8487 >,
8488 >
8489 fidl::encoding::Encode<
8490 LegacyJoiningConnectorConnectRequest,
8491 fidl::encoding::DefaultFuchsiaResourceDialect,
8492 > for (T0, T1)
8493 {
8494 #[inline]
8495 unsafe fn encode(
8496 self,
8497 encoder: &mut fidl::encoding::Encoder<
8498 '_,
8499 fidl::encoding::DefaultFuchsiaResourceDialect,
8500 >,
8501 offset: usize,
8502 depth: fidl::encoding::Depth,
8503 ) -> fidl::Result<()> {
8504 encoder.debug_check_bounds::<LegacyJoiningConnectorConnectRequest>(offset);
8505 unsafe {
8508 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8509 (ptr as *mut u64).write_unaligned(0);
8510 }
8511 self.0.encode(encoder, offset + 0, depth)?;
8513 self.1.encode(encoder, offset + 16, depth)?;
8514 Ok(())
8515 }
8516 }
8517
8518 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8519 for LegacyJoiningConnectorConnectRequest
8520 {
8521 #[inline(always)]
8522 fn new_empty() -> Self {
8523 Self {
8524 name: fidl::new_empty!(
8525 fidl::encoding::BoundedString<32>,
8526 fidl::encoding::DefaultFuchsiaResourceDialect
8527 ),
8528 server_end: fidl::new_empty!(
8529 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>>,
8530 fidl::encoding::DefaultFuchsiaResourceDialect
8531 ),
8532 }
8533 }
8534
8535 #[inline]
8536 unsafe fn decode(
8537 &mut self,
8538 decoder: &mut fidl::encoding::Decoder<
8539 '_,
8540 fidl::encoding::DefaultFuchsiaResourceDialect,
8541 >,
8542 offset: usize,
8543 _depth: fidl::encoding::Depth,
8544 ) -> fidl::Result<()> {
8545 decoder.debug_check_bounds::<Self>(offset);
8546 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8548 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8549 let mask = 0xffffffff00000000u64;
8550 let maskedval = padval & mask;
8551 if maskedval != 0 {
8552 return Err(fidl::Error::NonZeroPadding {
8553 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8554 });
8555 }
8556 fidl::decode!(
8557 fidl::encoding::BoundedString<32>,
8558 fidl::encoding::DefaultFuchsiaResourceDialect,
8559 &mut self.name,
8560 decoder,
8561 offset + 0,
8562 _depth
8563 )?;
8564 fidl::decode!(
8565 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LegacyJoiningMarker>>,
8566 fidl::encoding::DefaultFuchsiaResourceDialect,
8567 &mut self.server_end,
8568 decoder,
8569 offset + 16,
8570 _depth
8571 )?;
8572 Ok(())
8573 }
8574 }
8575
8576 impl fidl::encoding::ResourceTypeMarker for TelemetryProviderConnectorConnectRequest {
8577 type Borrowed<'a> = &'a mut Self;
8578 fn take_or_borrow<'a>(
8579 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8580 ) -> Self::Borrowed<'a> {
8581 value
8582 }
8583 }
8584
8585 unsafe impl fidl::encoding::TypeMarker for TelemetryProviderConnectorConnectRequest {
8586 type Owned = Self;
8587
8588 #[inline(always)]
8589 fn inline_align(_context: fidl::encoding::Context) -> usize {
8590 8
8591 }
8592
8593 #[inline(always)]
8594 fn inline_size(_context: fidl::encoding::Context) -> usize {
8595 24
8596 }
8597 }
8598
8599 unsafe impl
8600 fidl::encoding::Encode<
8601 TelemetryProviderConnectorConnectRequest,
8602 fidl::encoding::DefaultFuchsiaResourceDialect,
8603 > for &mut TelemetryProviderConnectorConnectRequest
8604 {
8605 #[inline]
8606 unsafe fn encode(
8607 self,
8608 encoder: &mut fidl::encoding::Encoder<
8609 '_,
8610 fidl::encoding::DefaultFuchsiaResourceDialect,
8611 >,
8612 offset: usize,
8613 _depth: fidl::encoding::Depth,
8614 ) -> fidl::Result<()> {
8615 encoder.debug_check_bounds::<TelemetryProviderConnectorConnectRequest>(offset);
8616 fidl::encoding::Encode::<TelemetryProviderConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8618 (
8619 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
8620 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8621 ),
8622 encoder, offset, _depth
8623 )
8624 }
8625 }
8626 unsafe impl<
8627 T0: fidl::encoding::Encode<
8628 fidl::encoding::BoundedString<32>,
8629 fidl::encoding::DefaultFuchsiaResourceDialect,
8630 >,
8631 T1: fidl::encoding::Encode<
8632 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>>,
8633 fidl::encoding::DefaultFuchsiaResourceDialect,
8634 >,
8635 >
8636 fidl::encoding::Encode<
8637 TelemetryProviderConnectorConnectRequest,
8638 fidl::encoding::DefaultFuchsiaResourceDialect,
8639 > for (T0, T1)
8640 {
8641 #[inline]
8642 unsafe fn encode(
8643 self,
8644 encoder: &mut fidl::encoding::Encoder<
8645 '_,
8646 fidl::encoding::DefaultFuchsiaResourceDialect,
8647 >,
8648 offset: usize,
8649 depth: fidl::encoding::Depth,
8650 ) -> fidl::Result<()> {
8651 encoder.debug_check_bounds::<TelemetryProviderConnectorConnectRequest>(offset);
8652 unsafe {
8655 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8656 (ptr as *mut u64).write_unaligned(0);
8657 }
8658 self.0.encode(encoder, offset + 0, depth)?;
8660 self.1.encode(encoder, offset + 16, depth)?;
8661 Ok(())
8662 }
8663 }
8664
8665 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8666 for TelemetryProviderConnectorConnectRequest
8667 {
8668 #[inline(always)]
8669 fn new_empty() -> Self {
8670 Self {
8671 name: fidl::new_empty!(
8672 fidl::encoding::BoundedString<32>,
8673 fidl::encoding::DefaultFuchsiaResourceDialect
8674 ),
8675 server_end: fidl::new_empty!(
8676 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>>,
8677 fidl::encoding::DefaultFuchsiaResourceDialect
8678 ),
8679 }
8680 }
8681
8682 #[inline]
8683 unsafe fn decode(
8684 &mut self,
8685 decoder: &mut fidl::encoding::Decoder<
8686 '_,
8687 fidl::encoding::DefaultFuchsiaResourceDialect,
8688 >,
8689 offset: usize,
8690 _depth: fidl::encoding::Depth,
8691 ) -> fidl::Result<()> {
8692 decoder.debug_check_bounds::<Self>(offset);
8693 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8695 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8696 let mask = 0xffffffff00000000u64;
8697 let maskedval = padval & mask;
8698 if maskedval != 0 {
8699 return Err(fidl::Error::NonZeroPadding {
8700 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8701 });
8702 }
8703 fidl::decode!(
8704 fidl::encoding::BoundedString<32>,
8705 fidl::encoding::DefaultFuchsiaResourceDialect,
8706 &mut self.name,
8707 decoder,
8708 offset + 0,
8709 _depth
8710 )?;
8711 fidl::decode!(
8712 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryProviderMarker>>,
8713 fidl::encoding::DefaultFuchsiaResourceDialect,
8714 &mut self.server_end,
8715 decoder,
8716 offset + 16,
8717 _depth
8718 )?;
8719 Ok(())
8720 }
8721 }
8722}