fidl_fuchsia_lowpan_test/
fidl_fuchsia_lowpan_test.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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_test_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DeviceTestConnectorConnectRequest {
16    pub name: String,
17    pub server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21    for DeviceTestConnectorConnectRequest
22{
23}
24
25#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
26pub struct DeviceTestMarker;
27
28impl fidl::endpoints::ProtocolMarker for DeviceTestMarker {
29    type Proxy = DeviceTestProxy;
30    type RequestStream = DeviceTestRequestStream;
31    #[cfg(target_os = "fuchsia")]
32    type SynchronousProxy = DeviceTestSynchronousProxy;
33
34    const DEBUG_NAME: &'static str = "(anonymous) DeviceTest";
35}
36
37pub trait DeviceTestProxyInterface: Send + Sync {
38    type ResetResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
39    fn r#reset(&self) -> Self::ResetResponseFut;
40    type GetNcpVersionResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
41    fn r#get_ncp_version(&self) -> Self::GetNcpVersionResponseFut;
42    type GetCurrentRssiResponseFut: std::future::Future<Output = Result<i8, fidl::Error>> + Send;
43    fn r#get_current_rssi(&self) -> Self::GetCurrentRssiResponseFut;
44    type GetFactoryMacAddressResponseFut: std::future::Future<Output = Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error>>
45        + Send;
46    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut;
47    type GetCurrentMacAddressResponseFut: std::future::Future<Output = Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error>>
48        + Send;
49    fn r#get_current_mac_address(&self) -> Self::GetCurrentMacAddressResponseFut;
50    type GetCurrentChannelResponseFut: std::future::Future<Output = Result<u16, fidl::Error>> + Send;
51    fn r#get_current_channel(&self) -> Self::GetCurrentChannelResponseFut;
52    type GetPartitionIdResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
53    fn r#get_partition_id(&self) -> Self::GetPartitionIdResponseFut;
54    type GetThreadRloc16ResponseFut: std::future::Future<Output = Result<u16, fidl::Error>> + Send;
55    fn r#get_thread_rloc16(&self) -> Self::GetThreadRloc16ResponseFut;
56    type GetThreadRouterIdResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
57    fn r#get_thread_router_id(&self) -> Self::GetThreadRouterIdResponseFut;
58    type ReplaceMacAddressFilterSettingsResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
59        + Send;
60    fn r#replace_mac_address_filter_settings(
61        &self,
62        settings: &MacAddressFilterSettings,
63    ) -> Self::ReplaceMacAddressFilterSettingsResponseFut;
64    type GetMacAddressFilterSettingsResponseFut: std::future::Future<Output = Result<MacAddressFilterSettings, fidl::Error>>
65        + Send;
66    fn r#get_mac_address_filter_settings(&self) -> Self::GetMacAddressFilterSettingsResponseFut;
67    type GetNeighborTableResponseFut: std::future::Future<Output = Result<Vec<NeighborInfo>, fidl::Error>>
68        + Send;
69    fn r#get_neighbor_table(&self) -> Self::GetNeighborTableResponseFut;
70}
71#[derive(Debug)]
72#[cfg(target_os = "fuchsia")]
73pub struct DeviceTestSynchronousProxy {
74    client: fidl::client::sync::Client,
75}
76
77#[cfg(target_os = "fuchsia")]
78impl fidl::endpoints::SynchronousProxy for DeviceTestSynchronousProxy {
79    type Proxy = DeviceTestProxy;
80    type Protocol = DeviceTestMarker;
81
82    fn from_channel(inner: fidl::Channel) -> Self {
83        Self::new(inner)
84    }
85
86    fn into_channel(self) -> fidl::Channel {
87        self.client.into_channel()
88    }
89
90    fn as_channel(&self) -> &fidl::Channel {
91        self.client.as_channel()
92    }
93}
94
95#[cfg(target_os = "fuchsia")]
96impl DeviceTestSynchronousProxy {
97    pub fn new(channel: fidl::Channel) -> Self {
98        let protocol_name = <DeviceTestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
99        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
100    }
101
102    pub fn into_channel(self) -> fidl::Channel {
103        self.client.into_channel()
104    }
105
106    /// Waits until an event arrives and returns it. It is safe for other
107    /// threads to make concurrent requests while waiting for an event.
108    pub fn wait_for_event(
109        &self,
110        deadline: zx::MonotonicInstant,
111    ) -> Result<DeviceTestEvent, fidl::Error> {
112        DeviceTestEvent::decode(self.client.wait_for_event(deadline)?)
113    }
114
115    /// Resets this network interface, returning
116    /// all volatile state to default values. Any
117    /// information stored in non-volatile memory
118    /// is preserved. If the interface was attached
119    /// to a network, this method will cause the
120    /// interface to detach. In that case, once the
121    /// interface has finished initialization the
122    /// interface will attempt to reattach to the
123    /// previous network.
124    pub fn r#reset(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
125        let _response =
126            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
127                (),
128                0x772795fd82e287e,
129                fidl::encoding::DynamicFlags::empty(),
130                ___deadline,
131            )?;
132        Ok(_response)
133    }
134
135    /// Returns the version string describing the firmware/stack
136    /// version that is in use.
137    pub fn r#get_ncp_version(
138        &self,
139        ___deadline: zx::MonotonicInstant,
140    ) -> Result<String, fidl::Error> {
141        let _response = self
142            .client
143            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetNcpVersionResponse>(
144                (),
145                0x5006d66ecaa992f2,
146                fidl::encoding::DynamicFlags::empty(),
147                ___deadline,
148            )?;
149        Ok(_response.version)
150    }
151
152    /// Returns the current RSSI measured by the radio.
153    pub fn r#get_current_rssi(&self, ___deadline: zx::MonotonicInstant) -> Result<i8, fidl::Error> {
154        let _response = self
155            .client
156            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetCurrentRssiResponse>(
157                (),
158                0x6ac289cf16a976ab,
159                fidl::encoding::DynamicFlags::empty(),
160                ___deadline,
161            )?;
162        Ok(_response.rssi)
163    }
164
165    /// Returns the factory-assigned static MAC address.
166    pub fn r#get_factory_mac_address(
167        &self,
168        ___deadline: zx::MonotonicInstant,
169    ) -> Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error> {
170        let _response = self
171            .client
172            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetFactoryMacAddressResponse>(
173                (),
174                0x2a32094f1da3372,
175                fidl::encoding::DynamicFlags::empty(),
176                ___deadline,
177            )?;
178        Ok(_response.address)
179    }
180
181    /// Returns the currently used MAC address, which can
182    /// differ from the static factory-assigned MAC address.
183    pub fn r#get_current_mac_address(
184        &self,
185        ___deadline: zx::MonotonicInstant,
186    ) -> Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error> {
187        let _response = self
188            .client
189            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetCurrentMacAddressResponse>(
190                (),
191                0x39fc2f974a484b62,
192                fidl::encoding::DynamicFlags::empty(),
193                ___deadline,
194            )?;
195        Ok(_response.address)
196    }
197
198    /// Returns the current channel index for the radio.
199    pub fn r#get_current_channel(
200        &self,
201        ___deadline: zx::MonotonicInstant,
202    ) -> Result<u16, fidl::Error> {
203        let _response = self
204            .client
205            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetCurrentChannelResponse>(
206                (),
207                0x2bd32ba980668d13,
208                fidl::encoding::DynamicFlags::empty(),
209                ___deadline,
210            )?;
211        Ok(_response.channel_index)
212    }
213
214    /// Returns the partition ID of the currently associated
215    /// network partition.
216    pub fn r#get_partition_id(
217        &self,
218        ___deadline: zx::MonotonicInstant,
219    ) -> Result<u32, fidl::Error> {
220        let _response = self
221            .client
222            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetPartitionIdResponse>(
223                (),
224                0x32be448a6dc88b33,
225                fidl::encoding::DynamicFlags::empty(),
226                ___deadline,
227            )?;
228        Ok(_response.pid)
229    }
230
231    pub fn r#get_thread_rloc16(
232        &self,
233        ___deadline: zx::MonotonicInstant,
234    ) -> Result<u16, fidl::Error> {
235        let _response = self
236            .client
237            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetThreadRloc16Response>(
238                (),
239                0x4e554e42c1953d31,
240                fidl::encoding::DynamicFlags::empty(),
241                ___deadline,
242            )?;
243        Ok(_response.rloc)
244    }
245
246    pub fn r#get_thread_router_id(
247        &self,
248        ___deadline: zx::MonotonicInstant,
249    ) -> Result<u8, fidl::Error> {
250        let _response = self
251            .client
252            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetThreadRouterIdResponse>(
253                (),
254                0x753df71fce9f3563,
255                fidl::encoding::DynamicFlags::empty(),
256                ___deadline,
257            )?;
258        Ok(_response.router_id)
259    }
260
261    /// Updates the address filter settings.
262    ///
263    /// Responds once the filter settings have taken effect.
264    pub fn r#replace_mac_address_filter_settings(
265        &self,
266        mut settings: &MacAddressFilterSettings,
267        ___deadline: zx::MonotonicInstant,
268    ) -> Result<(), fidl::Error> {
269        let _response = self.client.send_query::<
270            DeviceTestReplaceMacAddressFilterSettingsRequest,
271            fidl::encoding::EmptyPayload,
272        >(
273            (settings,),
274            0x66eb4780f869de19,
275            fidl::encoding::DynamicFlags::empty(),
276            ___deadline,
277        )?;
278        Ok(_response)
279    }
280
281    /// Returns the current address filter settings.
282    pub fn r#get_mac_address_filter_settings(
283        &self,
284        ___deadline: zx::MonotonicInstant,
285    ) -> Result<MacAddressFilterSettings, fidl::Error> {
286        let _response = self.client.send_query::<
287            fidl::encoding::EmptyPayload,
288            DeviceTestGetMacAddressFilterSettingsResponse,
289        >(
290            (),
291            0x2d727bf2dd3e231c,
292            fidl::encoding::DynamicFlags::empty(),
293            ___deadline,
294        )?;
295        Ok(_response.settings)
296    }
297
298    /// Returns a snapshot of the current neighbor table.
299    pub fn r#get_neighbor_table(
300        &self,
301        ___deadline: zx::MonotonicInstant,
302    ) -> Result<Vec<NeighborInfo>, fidl::Error> {
303        let _response = self
304            .client
305            .send_query::<fidl::encoding::EmptyPayload, DeviceTestGetNeighborTableResponse>(
306                (),
307                0x6f2db4573c413cde,
308                fidl::encoding::DynamicFlags::empty(),
309                ___deadline,
310            )?;
311        Ok(_response.neighbor_table)
312    }
313}
314
315#[derive(Debug, Clone)]
316pub struct DeviceTestProxy {
317    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
318}
319
320impl fidl::endpoints::Proxy for DeviceTestProxy {
321    type Protocol = DeviceTestMarker;
322
323    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
324        Self::new(inner)
325    }
326
327    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
328        self.client.into_channel().map_err(|client| Self { client })
329    }
330
331    fn as_channel(&self) -> &::fidl::AsyncChannel {
332        self.client.as_channel()
333    }
334}
335
336impl DeviceTestProxy {
337    /// Create a new Proxy for fuchsia.lowpan.test/DeviceTest.
338    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
339        let protocol_name = <DeviceTestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
340        Self { client: fidl::client::Client::new(channel, protocol_name) }
341    }
342
343    /// Get a Stream of events from the remote end of the protocol.
344    ///
345    /// # Panics
346    ///
347    /// Panics if the event stream was already taken.
348    pub fn take_event_stream(&self) -> DeviceTestEventStream {
349        DeviceTestEventStream { event_receiver: self.client.take_event_receiver() }
350    }
351
352    /// Resets this network interface, returning
353    /// all volatile state to default values. Any
354    /// information stored in non-volatile memory
355    /// is preserved. If the interface was attached
356    /// to a network, this method will cause the
357    /// interface to detach. In that case, once the
358    /// interface has finished initialization the
359    /// interface will attempt to reattach to the
360    /// previous network.
361    pub fn r#reset(
362        &self,
363    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
364        DeviceTestProxyInterface::r#reset(self)
365    }
366
367    /// Returns the version string describing the firmware/stack
368    /// version that is in use.
369    pub fn r#get_ncp_version(
370        &self,
371    ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
372        DeviceTestProxyInterface::r#get_ncp_version(self)
373    }
374
375    /// Returns the current RSSI measured by the radio.
376    pub fn r#get_current_rssi(
377        &self,
378    ) -> fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect> {
379        DeviceTestProxyInterface::r#get_current_rssi(self)
380    }
381
382    /// Returns the factory-assigned static MAC address.
383    pub fn r#get_factory_mac_address(
384        &self,
385    ) -> fidl::client::QueryResponseFut<
386        fidl_fuchsia_lowpan::MacAddress,
387        fidl::encoding::DefaultFuchsiaResourceDialect,
388    > {
389        DeviceTestProxyInterface::r#get_factory_mac_address(self)
390    }
391
392    /// Returns the currently used MAC address, which can
393    /// differ from the static factory-assigned MAC address.
394    pub fn r#get_current_mac_address(
395        &self,
396    ) -> fidl::client::QueryResponseFut<
397        fidl_fuchsia_lowpan::MacAddress,
398        fidl::encoding::DefaultFuchsiaResourceDialect,
399    > {
400        DeviceTestProxyInterface::r#get_current_mac_address(self)
401    }
402
403    /// Returns the current channel index for the radio.
404    pub fn r#get_current_channel(
405        &self,
406    ) -> fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect> {
407        DeviceTestProxyInterface::r#get_current_channel(self)
408    }
409
410    /// Returns the partition ID of the currently associated
411    /// network partition.
412    pub fn r#get_partition_id(
413        &self,
414    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
415        DeviceTestProxyInterface::r#get_partition_id(self)
416    }
417
418    pub fn r#get_thread_rloc16(
419        &self,
420    ) -> fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect> {
421        DeviceTestProxyInterface::r#get_thread_rloc16(self)
422    }
423
424    pub fn r#get_thread_router_id(
425        &self,
426    ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
427        DeviceTestProxyInterface::r#get_thread_router_id(self)
428    }
429
430    /// Updates the address filter settings.
431    ///
432    /// Responds once the filter settings have taken effect.
433    pub fn r#replace_mac_address_filter_settings(
434        &self,
435        mut settings: &MacAddressFilterSettings,
436    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
437        DeviceTestProxyInterface::r#replace_mac_address_filter_settings(self, settings)
438    }
439
440    /// Returns the current address filter settings.
441    pub fn r#get_mac_address_filter_settings(
442        &self,
443    ) -> fidl::client::QueryResponseFut<
444        MacAddressFilterSettings,
445        fidl::encoding::DefaultFuchsiaResourceDialect,
446    > {
447        DeviceTestProxyInterface::r#get_mac_address_filter_settings(self)
448    }
449
450    /// Returns a snapshot of the current neighbor table.
451    pub fn r#get_neighbor_table(
452        &self,
453    ) -> fidl::client::QueryResponseFut<
454        Vec<NeighborInfo>,
455        fidl::encoding::DefaultFuchsiaResourceDialect,
456    > {
457        DeviceTestProxyInterface::r#get_neighbor_table(self)
458    }
459}
460
461impl DeviceTestProxyInterface for DeviceTestProxy {
462    type ResetResponseFut =
463        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
464    fn r#reset(&self) -> Self::ResetResponseFut {
465        fn _decode(
466            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
467        ) -> Result<(), fidl::Error> {
468            let _response = fidl::client::decode_transaction_body::<
469                fidl::encoding::EmptyPayload,
470                fidl::encoding::DefaultFuchsiaResourceDialect,
471                0x772795fd82e287e,
472            >(_buf?)?;
473            Ok(_response)
474        }
475        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
476            (),
477            0x772795fd82e287e,
478            fidl::encoding::DynamicFlags::empty(),
479            _decode,
480        )
481    }
482
483    type GetNcpVersionResponseFut =
484        fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
485    fn r#get_ncp_version(&self) -> Self::GetNcpVersionResponseFut {
486        fn _decode(
487            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
488        ) -> Result<String, fidl::Error> {
489            let _response = fidl::client::decode_transaction_body::<
490                DeviceTestGetNcpVersionResponse,
491                fidl::encoding::DefaultFuchsiaResourceDialect,
492                0x5006d66ecaa992f2,
493            >(_buf?)?;
494            Ok(_response.version)
495        }
496        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, String>(
497            (),
498            0x5006d66ecaa992f2,
499            fidl::encoding::DynamicFlags::empty(),
500            _decode,
501        )
502    }
503
504    type GetCurrentRssiResponseFut =
505        fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect>;
506    fn r#get_current_rssi(&self) -> Self::GetCurrentRssiResponseFut {
507        fn _decode(
508            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
509        ) -> Result<i8, fidl::Error> {
510            let _response = fidl::client::decode_transaction_body::<
511                DeviceTestGetCurrentRssiResponse,
512                fidl::encoding::DefaultFuchsiaResourceDialect,
513                0x6ac289cf16a976ab,
514            >(_buf?)?;
515            Ok(_response.rssi)
516        }
517        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i8>(
518            (),
519            0x6ac289cf16a976ab,
520            fidl::encoding::DynamicFlags::empty(),
521            _decode,
522        )
523    }
524
525    type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
526        fidl_fuchsia_lowpan::MacAddress,
527        fidl::encoding::DefaultFuchsiaResourceDialect,
528    >;
529    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
530        fn _decode(
531            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
532        ) -> Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error> {
533            let _response = fidl::client::decode_transaction_body::<
534                DeviceTestGetFactoryMacAddressResponse,
535                fidl::encoding::DefaultFuchsiaResourceDialect,
536                0x2a32094f1da3372,
537            >(_buf?)?;
538            Ok(_response.address)
539        }
540        self.client
541            .send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_lowpan::MacAddress>(
542                (),
543                0x2a32094f1da3372,
544                fidl::encoding::DynamicFlags::empty(),
545                _decode,
546            )
547    }
548
549    type GetCurrentMacAddressResponseFut = fidl::client::QueryResponseFut<
550        fidl_fuchsia_lowpan::MacAddress,
551        fidl::encoding::DefaultFuchsiaResourceDialect,
552    >;
553    fn r#get_current_mac_address(&self) -> Self::GetCurrentMacAddressResponseFut {
554        fn _decode(
555            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
556        ) -> Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error> {
557            let _response = fidl::client::decode_transaction_body::<
558                DeviceTestGetCurrentMacAddressResponse,
559                fidl::encoding::DefaultFuchsiaResourceDialect,
560                0x39fc2f974a484b62,
561            >(_buf?)?;
562            Ok(_response.address)
563        }
564        self.client
565            .send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_lowpan::MacAddress>(
566                (),
567                0x39fc2f974a484b62,
568                fidl::encoding::DynamicFlags::empty(),
569                _decode,
570            )
571    }
572
573    type GetCurrentChannelResponseFut =
574        fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect>;
575    fn r#get_current_channel(&self) -> Self::GetCurrentChannelResponseFut {
576        fn _decode(
577            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
578        ) -> Result<u16, fidl::Error> {
579            let _response = fidl::client::decode_transaction_body::<
580                DeviceTestGetCurrentChannelResponse,
581                fidl::encoding::DefaultFuchsiaResourceDialect,
582                0x2bd32ba980668d13,
583            >(_buf?)?;
584            Ok(_response.channel_index)
585        }
586        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u16>(
587            (),
588            0x2bd32ba980668d13,
589            fidl::encoding::DynamicFlags::empty(),
590            _decode,
591        )
592    }
593
594    type GetPartitionIdResponseFut =
595        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
596    fn r#get_partition_id(&self) -> Self::GetPartitionIdResponseFut {
597        fn _decode(
598            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
599        ) -> Result<u32, fidl::Error> {
600            let _response = fidl::client::decode_transaction_body::<
601                DeviceTestGetPartitionIdResponse,
602                fidl::encoding::DefaultFuchsiaResourceDialect,
603                0x32be448a6dc88b33,
604            >(_buf?)?;
605            Ok(_response.pid)
606        }
607        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
608            (),
609            0x32be448a6dc88b33,
610            fidl::encoding::DynamicFlags::empty(),
611            _decode,
612        )
613    }
614
615    type GetThreadRloc16ResponseFut =
616        fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect>;
617    fn r#get_thread_rloc16(&self) -> Self::GetThreadRloc16ResponseFut {
618        fn _decode(
619            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
620        ) -> Result<u16, fidl::Error> {
621            let _response = fidl::client::decode_transaction_body::<
622                DeviceTestGetThreadRloc16Response,
623                fidl::encoding::DefaultFuchsiaResourceDialect,
624                0x4e554e42c1953d31,
625            >(_buf?)?;
626            Ok(_response.rloc)
627        }
628        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u16>(
629            (),
630            0x4e554e42c1953d31,
631            fidl::encoding::DynamicFlags::empty(),
632            _decode,
633        )
634    }
635
636    type GetThreadRouterIdResponseFut =
637        fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
638    fn r#get_thread_router_id(&self) -> Self::GetThreadRouterIdResponseFut {
639        fn _decode(
640            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
641        ) -> Result<u8, fidl::Error> {
642            let _response = fidl::client::decode_transaction_body::<
643                DeviceTestGetThreadRouterIdResponse,
644                fidl::encoding::DefaultFuchsiaResourceDialect,
645                0x753df71fce9f3563,
646            >(_buf?)?;
647            Ok(_response.router_id)
648        }
649        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
650            (),
651            0x753df71fce9f3563,
652            fidl::encoding::DynamicFlags::empty(),
653            _decode,
654        )
655    }
656
657    type ReplaceMacAddressFilterSettingsResponseFut =
658        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
659    fn r#replace_mac_address_filter_settings(
660        &self,
661        mut settings: &MacAddressFilterSettings,
662    ) -> Self::ReplaceMacAddressFilterSettingsResponseFut {
663        fn _decode(
664            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
665        ) -> Result<(), fidl::Error> {
666            let _response = fidl::client::decode_transaction_body::<
667                fidl::encoding::EmptyPayload,
668                fidl::encoding::DefaultFuchsiaResourceDialect,
669                0x66eb4780f869de19,
670            >(_buf?)?;
671            Ok(_response)
672        }
673        self.client.send_query_and_decode::<DeviceTestReplaceMacAddressFilterSettingsRequest, ()>(
674            (settings,),
675            0x66eb4780f869de19,
676            fidl::encoding::DynamicFlags::empty(),
677            _decode,
678        )
679    }
680
681    type GetMacAddressFilterSettingsResponseFut = fidl::client::QueryResponseFut<
682        MacAddressFilterSettings,
683        fidl::encoding::DefaultFuchsiaResourceDialect,
684    >;
685    fn r#get_mac_address_filter_settings(&self) -> Self::GetMacAddressFilterSettingsResponseFut {
686        fn _decode(
687            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
688        ) -> Result<MacAddressFilterSettings, fidl::Error> {
689            let _response = fidl::client::decode_transaction_body::<
690                DeviceTestGetMacAddressFilterSettingsResponse,
691                fidl::encoding::DefaultFuchsiaResourceDialect,
692                0x2d727bf2dd3e231c,
693            >(_buf?)?;
694            Ok(_response.settings)
695        }
696        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, MacAddressFilterSettings>(
697            (),
698            0x2d727bf2dd3e231c,
699            fidl::encoding::DynamicFlags::empty(),
700            _decode,
701        )
702    }
703
704    type GetNeighborTableResponseFut = fidl::client::QueryResponseFut<
705        Vec<NeighborInfo>,
706        fidl::encoding::DefaultFuchsiaResourceDialect,
707    >;
708    fn r#get_neighbor_table(&self) -> Self::GetNeighborTableResponseFut {
709        fn _decode(
710            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
711        ) -> Result<Vec<NeighborInfo>, fidl::Error> {
712            let _response = fidl::client::decode_transaction_body::<
713                DeviceTestGetNeighborTableResponse,
714                fidl::encoding::DefaultFuchsiaResourceDialect,
715                0x6f2db4573c413cde,
716            >(_buf?)?;
717            Ok(_response.neighbor_table)
718        }
719        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<NeighborInfo>>(
720            (),
721            0x6f2db4573c413cde,
722            fidl::encoding::DynamicFlags::empty(),
723            _decode,
724        )
725    }
726}
727
728pub struct DeviceTestEventStream {
729    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
730}
731
732impl std::marker::Unpin for DeviceTestEventStream {}
733
734impl futures::stream::FusedStream for DeviceTestEventStream {
735    fn is_terminated(&self) -> bool {
736        self.event_receiver.is_terminated()
737    }
738}
739
740impl futures::Stream for DeviceTestEventStream {
741    type Item = Result<DeviceTestEvent, fidl::Error>;
742
743    fn poll_next(
744        mut self: std::pin::Pin<&mut Self>,
745        cx: &mut std::task::Context<'_>,
746    ) -> std::task::Poll<Option<Self::Item>> {
747        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
748            &mut self.event_receiver,
749            cx
750        )?) {
751            Some(buf) => std::task::Poll::Ready(Some(DeviceTestEvent::decode(buf))),
752            None => std::task::Poll::Ready(None),
753        }
754    }
755}
756
757#[derive(Debug)]
758pub enum DeviceTestEvent {}
759
760impl DeviceTestEvent {
761    /// Decodes a message buffer as a [`DeviceTestEvent`].
762    fn decode(
763        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
764    ) -> Result<DeviceTestEvent, fidl::Error> {
765        let (bytes, _handles) = buf.split_mut();
766        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
767        debug_assert_eq!(tx_header.tx_id, 0);
768        match tx_header.ordinal {
769            _ => Err(fidl::Error::UnknownOrdinal {
770                ordinal: tx_header.ordinal,
771                protocol_name: <DeviceTestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
772            }),
773        }
774    }
775}
776
777/// A Stream of incoming requests for fuchsia.lowpan.test/DeviceTest.
778pub struct DeviceTestRequestStream {
779    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
780    is_terminated: bool,
781}
782
783impl std::marker::Unpin for DeviceTestRequestStream {}
784
785impl futures::stream::FusedStream for DeviceTestRequestStream {
786    fn is_terminated(&self) -> bool {
787        self.is_terminated
788    }
789}
790
791impl fidl::endpoints::RequestStream for DeviceTestRequestStream {
792    type Protocol = DeviceTestMarker;
793    type ControlHandle = DeviceTestControlHandle;
794
795    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
796        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
797    }
798
799    fn control_handle(&self) -> Self::ControlHandle {
800        DeviceTestControlHandle { inner: self.inner.clone() }
801    }
802
803    fn into_inner(
804        self,
805    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
806    {
807        (self.inner, self.is_terminated)
808    }
809
810    fn from_inner(
811        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
812        is_terminated: bool,
813    ) -> Self {
814        Self { inner, is_terminated }
815    }
816}
817
818impl futures::Stream for DeviceTestRequestStream {
819    type Item = Result<DeviceTestRequest, fidl::Error>;
820
821    fn poll_next(
822        mut self: std::pin::Pin<&mut Self>,
823        cx: &mut std::task::Context<'_>,
824    ) -> std::task::Poll<Option<Self::Item>> {
825        let this = &mut *self;
826        if this.inner.check_shutdown(cx) {
827            this.is_terminated = true;
828            return std::task::Poll::Ready(None);
829        }
830        if this.is_terminated {
831            panic!("polled DeviceTestRequestStream after completion");
832        }
833        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
834            |bytes, handles| {
835                match this.inner.channel().read_etc(cx, bytes, handles) {
836                    std::task::Poll::Ready(Ok(())) => {}
837                    std::task::Poll::Pending => return std::task::Poll::Pending,
838                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
839                        this.is_terminated = true;
840                        return std::task::Poll::Ready(None);
841                    }
842                    std::task::Poll::Ready(Err(e)) => {
843                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
844                            e.into(),
845                        ))))
846                    }
847                }
848
849                // A message has been received from the channel
850                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
851
852                std::task::Poll::Ready(Some(match header.ordinal {
853                    0x772795fd82e287e => {
854                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
855                        let mut req = fidl::new_empty!(
856                            fidl::encoding::EmptyPayload,
857                            fidl::encoding::DefaultFuchsiaResourceDialect
858                        );
859                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
860                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
861                        Ok(DeviceTestRequest::Reset {
862                            responder: DeviceTestResetResponder {
863                                control_handle: std::mem::ManuallyDrop::new(control_handle),
864                                tx_id: header.tx_id,
865                            },
866                        })
867                    }
868                    0x5006d66ecaa992f2 => {
869                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
870                        let mut req = fidl::new_empty!(
871                            fidl::encoding::EmptyPayload,
872                            fidl::encoding::DefaultFuchsiaResourceDialect
873                        );
874                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
875                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
876                        Ok(DeviceTestRequest::GetNcpVersion {
877                            responder: DeviceTestGetNcpVersionResponder {
878                                control_handle: std::mem::ManuallyDrop::new(control_handle),
879                                tx_id: header.tx_id,
880                            },
881                        })
882                    }
883                    0x6ac289cf16a976ab => {
884                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
885                        let mut req = fidl::new_empty!(
886                            fidl::encoding::EmptyPayload,
887                            fidl::encoding::DefaultFuchsiaResourceDialect
888                        );
889                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
890                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
891                        Ok(DeviceTestRequest::GetCurrentRssi {
892                            responder: DeviceTestGetCurrentRssiResponder {
893                                control_handle: std::mem::ManuallyDrop::new(control_handle),
894                                tx_id: header.tx_id,
895                            },
896                        })
897                    }
898                    0x2a32094f1da3372 => {
899                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
900                        let mut req = fidl::new_empty!(
901                            fidl::encoding::EmptyPayload,
902                            fidl::encoding::DefaultFuchsiaResourceDialect
903                        );
904                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
905                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
906                        Ok(DeviceTestRequest::GetFactoryMacAddress {
907                            responder: DeviceTestGetFactoryMacAddressResponder {
908                                control_handle: std::mem::ManuallyDrop::new(control_handle),
909                                tx_id: header.tx_id,
910                            },
911                        })
912                    }
913                    0x39fc2f974a484b62 => {
914                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
915                        let mut req = fidl::new_empty!(
916                            fidl::encoding::EmptyPayload,
917                            fidl::encoding::DefaultFuchsiaResourceDialect
918                        );
919                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
920                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
921                        Ok(DeviceTestRequest::GetCurrentMacAddress {
922                            responder: DeviceTestGetCurrentMacAddressResponder {
923                                control_handle: std::mem::ManuallyDrop::new(control_handle),
924                                tx_id: header.tx_id,
925                            },
926                        })
927                    }
928                    0x2bd32ba980668d13 => {
929                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
930                        let mut req = fidl::new_empty!(
931                            fidl::encoding::EmptyPayload,
932                            fidl::encoding::DefaultFuchsiaResourceDialect
933                        );
934                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
935                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
936                        Ok(DeviceTestRequest::GetCurrentChannel {
937                            responder: DeviceTestGetCurrentChannelResponder {
938                                control_handle: std::mem::ManuallyDrop::new(control_handle),
939                                tx_id: header.tx_id,
940                            },
941                        })
942                    }
943                    0x32be448a6dc88b33 => {
944                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
945                        let mut req = fidl::new_empty!(
946                            fidl::encoding::EmptyPayload,
947                            fidl::encoding::DefaultFuchsiaResourceDialect
948                        );
949                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
950                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
951                        Ok(DeviceTestRequest::GetPartitionId {
952                            responder: DeviceTestGetPartitionIdResponder {
953                                control_handle: std::mem::ManuallyDrop::new(control_handle),
954                                tx_id: header.tx_id,
955                            },
956                        })
957                    }
958                    0x4e554e42c1953d31 => {
959                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
960                        let mut req = fidl::new_empty!(
961                            fidl::encoding::EmptyPayload,
962                            fidl::encoding::DefaultFuchsiaResourceDialect
963                        );
964                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
965                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
966                        Ok(DeviceTestRequest::GetThreadRloc16 {
967                            responder: DeviceTestGetThreadRloc16Responder {
968                                control_handle: std::mem::ManuallyDrop::new(control_handle),
969                                tx_id: header.tx_id,
970                            },
971                        })
972                    }
973                    0x753df71fce9f3563 => {
974                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
975                        let mut req = fidl::new_empty!(
976                            fidl::encoding::EmptyPayload,
977                            fidl::encoding::DefaultFuchsiaResourceDialect
978                        );
979                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
980                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
981                        Ok(DeviceTestRequest::GetThreadRouterId {
982                            responder: DeviceTestGetThreadRouterIdResponder {
983                                control_handle: std::mem::ManuallyDrop::new(control_handle),
984                                tx_id: header.tx_id,
985                            },
986                        })
987                    }
988                    0x66eb4780f869de19 => {
989                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
990                        let mut req = fidl::new_empty!(
991                            DeviceTestReplaceMacAddressFilterSettingsRequest,
992                            fidl::encoding::DefaultFuchsiaResourceDialect
993                        );
994                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceTestReplaceMacAddressFilterSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
995                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
996                        Ok(DeviceTestRequest::ReplaceMacAddressFilterSettings {
997                            settings: req.settings,
998
999                            responder: DeviceTestReplaceMacAddressFilterSettingsResponder {
1000                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1001                                tx_id: header.tx_id,
1002                            },
1003                        })
1004                    }
1005                    0x2d727bf2dd3e231c => {
1006                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1007                        let mut req = fidl::new_empty!(
1008                            fidl::encoding::EmptyPayload,
1009                            fidl::encoding::DefaultFuchsiaResourceDialect
1010                        );
1011                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1012                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
1013                        Ok(DeviceTestRequest::GetMacAddressFilterSettings {
1014                            responder: DeviceTestGetMacAddressFilterSettingsResponder {
1015                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1016                                tx_id: header.tx_id,
1017                            },
1018                        })
1019                    }
1020                    0x6f2db4573c413cde => {
1021                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1022                        let mut req = fidl::new_empty!(
1023                            fidl::encoding::EmptyPayload,
1024                            fidl::encoding::DefaultFuchsiaResourceDialect
1025                        );
1026                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1027                        let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
1028                        Ok(DeviceTestRequest::GetNeighborTable {
1029                            responder: DeviceTestGetNeighborTableResponder {
1030                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1031                                tx_id: header.tx_id,
1032                            },
1033                        })
1034                    }
1035                    _ => Err(fidl::Error::UnknownOrdinal {
1036                        ordinal: header.ordinal,
1037                        protocol_name:
1038                            <DeviceTestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1039                    }),
1040                }))
1041            },
1042        )
1043    }
1044}
1045
1046#[derive(Debug)]
1047pub enum DeviceTestRequest {
1048    /// Resets this network interface, returning
1049    /// all volatile state to default values. Any
1050    /// information stored in non-volatile memory
1051    /// is preserved. If the interface was attached
1052    /// to a network, this method will cause the
1053    /// interface to detach. In that case, once the
1054    /// interface has finished initialization the
1055    /// interface will attempt to reattach to the
1056    /// previous network.
1057    Reset {
1058        responder: DeviceTestResetResponder,
1059    },
1060    /// Returns the version string describing the firmware/stack
1061    /// version that is in use.
1062    GetNcpVersion {
1063        responder: DeviceTestGetNcpVersionResponder,
1064    },
1065    /// Returns the current RSSI measured by the radio.
1066    GetCurrentRssi {
1067        responder: DeviceTestGetCurrentRssiResponder,
1068    },
1069    /// Returns the factory-assigned static MAC address.
1070    GetFactoryMacAddress {
1071        responder: DeviceTestGetFactoryMacAddressResponder,
1072    },
1073    /// Returns the currently used MAC address, which can
1074    /// differ from the static factory-assigned MAC address.
1075    GetCurrentMacAddress {
1076        responder: DeviceTestGetCurrentMacAddressResponder,
1077    },
1078    /// Returns the current channel index for the radio.
1079    GetCurrentChannel {
1080        responder: DeviceTestGetCurrentChannelResponder,
1081    },
1082    /// Returns the partition ID of the currently associated
1083    /// network partition.
1084    GetPartitionId {
1085        responder: DeviceTestGetPartitionIdResponder,
1086    },
1087    GetThreadRloc16 {
1088        responder: DeviceTestGetThreadRloc16Responder,
1089    },
1090    GetThreadRouterId {
1091        responder: DeviceTestGetThreadRouterIdResponder,
1092    },
1093    /// Updates the address filter settings.
1094    ///
1095    /// Responds once the filter settings have taken effect.
1096    ReplaceMacAddressFilterSettings {
1097        settings: MacAddressFilterSettings,
1098        responder: DeviceTestReplaceMacAddressFilterSettingsResponder,
1099    },
1100    /// Returns the current address filter settings.
1101    GetMacAddressFilterSettings {
1102        responder: DeviceTestGetMacAddressFilterSettingsResponder,
1103    },
1104    /// Returns a snapshot of the current neighbor table.
1105    GetNeighborTable {
1106        responder: DeviceTestGetNeighborTableResponder,
1107    },
1108}
1109
1110impl DeviceTestRequest {
1111    #[allow(irrefutable_let_patterns)]
1112    pub fn into_reset(self) -> Option<(DeviceTestResetResponder)> {
1113        if let DeviceTestRequest::Reset { responder } = self {
1114            Some((responder))
1115        } else {
1116            None
1117        }
1118    }
1119
1120    #[allow(irrefutable_let_patterns)]
1121    pub fn into_get_ncp_version(self) -> Option<(DeviceTestGetNcpVersionResponder)> {
1122        if let DeviceTestRequest::GetNcpVersion { responder } = self {
1123            Some((responder))
1124        } else {
1125            None
1126        }
1127    }
1128
1129    #[allow(irrefutable_let_patterns)]
1130    pub fn into_get_current_rssi(self) -> Option<(DeviceTestGetCurrentRssiResponder)> {
1131        if let DeviceTestRequest::GetCurrentRssi { responder } = self {
1132            Some((responder))
1133        } else {
1134            None
1135        }
1136    }
1137
1138    #[allow(irrefutable_let_patterns)]
1139    pub fn into_get_factory_mac_address(self) -> Option<(DeviceTestGetFactoryMacAddressResponder)> {
1140        if let DeviceTestRequest::GetFactoryMacAddress { responder } = self {
1141            Some((responder))
1142        } else {
1143            None
1144        }
1145    }
1146
1147    #[allow(irrefutable_let_patterns)]
1148    pub fn into_get_current_mac_address(self) -> Option<(DeviceTestGetCurrentMacAddressResponder)> {
1149        if let DeviceTestRequest::GetCurrentMacAddress { responder } = self {
1150            Some((responder))
1151        } else {
1152            None
1153        }
1154    }
1155
1156    #[allow(irrefutable_let_patterns)]
1157    pub fn into_get_current_channel(self) -> Option<(DeviceTestGetCurrentChannelResponder)> {
1158        if let DeviceTestRequest::GetCurrentChannel { responder } = self {
1159            Some((responder))
1160        } else {
1161            None
1162        }
1163    }
1164
1165    #[allow(irrefutable_let_patterns)]
1166    pub fn into_get_partition_id(self) -> Option<(DeviceTestGetPartitionIdResponder)> {
1167        if let DeviceTestRequest::GetPartitionId { responder } = self {
1168            Some((responder))
1169        } else {
1170            None
1171        }
1172    }
1173
1174    #[allow(irrefutable_let_patterns)]
1175    pub fn into_get_thread_rloc16(self) -> Option<(DeviceTestGetThreadRloc16Responder)> {
1176        if let DeviceTestRequest::GetThreadRloc16 { responder } = self {
1177            Some((responder))
1178        } else {
1179            None
1180        }
1181    }
1182
1183    #[allow(irrefutable_let_patterns)]
1184    pub fn into_get_thread_router_id(self) -> Option<(DeviceTestGetThreadRouterIdResponder)> {
1185        if let DeviceTestRequest::GetThreadRouterId { responder } = self {
1186            Some((responder))
1187        } else {
1188            None
1189        }
1190    }
1191
1192    #[allow(irrefutable_let_patterns)]
1193    pub fn into_replace_mac_address_filter_settings(
1194        self,
1195    ) -> Option<(MacAddressFilterSettings, DeviceTestReplaceMacAddressFilterSettingsResponder)>
1196    {
1197        if let DeviceTestRequest::ReplaceMacAddressFilterSettings { settings, responder } = self {
1198            Some((settings, responder))
1199        } else {
1200            None
1201        }
1202    }
1203
1204    #[allow(irrefutable_let_patterns)]
1205    pub fn into_get_mac_address_filter_settings(
1206        self,
1207    ) -> Option<(DeviceTestGetMacAddressFilterSettingsResponder)> {
1208        if let DeviceTestRequest::GetMacAddressFilterSettings { responder } = self {
1209            Some((responder))
1210        } else {
1211            None
1212        }
1213    }
1214
1215    #[allow(irrefutable_let_patterns)]
1216    pub fn into_get_neighbor_table(self) -> Option<(DeviceTestGetNeighborTableResponder)> {
1217        if let DeviceTestRequest::GetNeighborTable { responder } = self {
1218            Some((responder))
1219        } else {
1220            None
1221        }
1222    }
1223
1224    /// Name of the method defined in FIDL
1225    pub fn method_name(&self) -> &'static str {
1226        match *self {
1227            DeviceTestRequest::Reset { .. } => "reset",
1228            DeviceTestRequest::GetNcpVersion { .. } => "get_ncp_version",
1229            DeviceTestRequest::GetCurrentRssi { .. } => "get_current_rssi",
1230            DeviceTestRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
1231            DeviceTestRequest::GetCurrentMacAddress { .. } => "get_current_mac_address",
1232            DeviceTestRequest::GetCurrentChannel { .. } => "get_current_channel",
1233            DeviceTestRequest::GetPartitionId { .. } => "get_partition_id",
1234            DeviceTestRequest::GetThreadRloc16 { .. } => "get_thread_rloc16",
1235            DeviceTestRequest::GetThreadRouterId { .. } => "get_thread_router_id",
1236            DeviceTestRequest::ReplaceMacAddressFilterSettings { .. } => {
1237                "replace_mac_address_filter_settings"
1238            }
1239            DeviceTestRequest::GetMacAddressFilterSettings { .. } => {
1240                "get_mac_address_filter_settings"
1241            }
1242            DeviceTestRequest::GetNeighborTable { .. } => "get_neighbor_table",
1243        }
1244    }
1245}
1246
1247#[derive(Debug, Clone)]
1248pub struct DeviceTestControlHandle {
1249    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1250}
1251
1252impl fidl::endpoints::ControlHandle for DeviceTestControlHandle {
1253    fn shutdown(&self) {
1254        self.inner.shutdown()
1255    }
1256    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1257        self.inner.shutdown_with_epitaph(status)
1258    }
1259
1260    fn is_closed(&self) -> bool {
1261        self.inner.channel().is_closed()
1262    }
1263    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1264        self.inner.channel().on_closed()
1265    }
1266
1267    #[cfg(target_os = "fuchsia")]
1268    fn signal_peer(
1269        &self,
1270        clear_mask: zx::Signals,
1271        set_mask: zx::Signals,
1272    ) -> Result<(), zx_status::Status> {
1273        use fidl::Peered;
1274        self.inner.channel().signal_peer(clear_mask, set_mask)
1275    }
1276}
1277
1278impl DeviceTestControlHandle {}
1279
1280#[must_use = "FIDL methods require a response to be sent"]
1281#[derive(Debug)]
1282pub struct DeviceTestResetResponder {
1283    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1284    tx_id: u32,
1285}
1286
1287/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1288/// if the responder is dropped without sending a response, so that the client
1289/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1290impl std::ops::Drop for DeviceTestResetResponder {
1291    fn drop(&mut self) {
1292        self.control_handle.shutdown();
1293        // Safety: drops once, never accessed again
1294        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1295    }
1296}
1297
1298impl fidl::endpoints::Responder for DeviceTestResetResponder {
1299    type ControlHandle = DeviceTestControlHandle;
1300
1301    fn control_handle(&self) -> &DeviceTestControlHandle {
1302        &self.control_handle
1303    }
1304
1305    fn drop_without_shutdown(mut self) {
1306        // Safety: drops once, never accessed again due to mem::forget
1307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1308        // Prevent Drop from running (which would shut down the channel)
1309        std::mem::forget(self);
1310    }
1311}
1312
1313impl DeviceTestResetResponder {
1314    /// Sends a response to the FIDL transaction.
1315    ///
1316    /// Sets the channel to shutdown if an error occurs.
1317    pub fn send(self) -> Result<(), fidl::Error> {
1318        let _result = self.send_raw();
1319        if _result.is_err() {
1320            self.control_handle.shutdown();
1321        }
1322        self.drop_without_shutdown();
1323        _result
1324    }
1325
1326    /// Similar to "send" but does not shutdown the channel if an error occurs.
1327    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1328        let _result = self.send_raw();
1329        self.drop_without_shutdown();
1330        _result
1331    }
1332
1333    fn send_raw(&self) -> Result<(), fidl::Error> {
1334        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1335            (),
1336            self.tx_id,
1337            0x772795fd82e287e,
1338            fidl::encoding::DynamicFlags::empty(),
1339        )
1340    }
1341}
1342
1343#[must_use = "FIDL methods require a response to be sent"]
1344#[derive(Debug)]
1345pub struct DeviceTestGetNcpVersionResponder {
1346    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1347    tx_id: u32,
1348}
1349
1350/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1351/// if the responder is dropped without sending a response, so that the client
1352/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1353impl std::ops::Drop for DeviceTestGetNcpVersionResponder {
1354    fn drop(&mut self) {
1355        self.control_handle.shutdown();
1356        // Safety: drops once, never accessed again
1357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1358    }
1359}
1360
1361impl fidl::endpoints::Responder for DeviceTestGetNcpVersionResponder {
1362    type ControlHandle = DeviceTestControlHandle;
1363
1364    fn control_handle(&self) -> &DeviceTestControlHandle {
1365        &self.control_handle
1366    }
1367
1368    fn drop_without_shutdown(mut self) {
1369        // Safety: drops once, never accessed again due to mem::forget
1370        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1371        // Prevent Drop from running (which would shut down the channel)
1372        std::mem::forget(self);
1373    }
1374}
1375
1376impl DeviceTestGetNcpVersionResponder {
1377    /// Sends a response to the FIDL transaction.
1378    ///
1379    /// Sets the channel to shutdown if an error occurs.
1380    pub fn send(self, mut version: &str) -> Result<(), fidl::Error> {
1381        let _result = self.send_raw(version);
1382        if _result.is_err() {
1383            self.control_handle.shutdown();
1384        }
1385        self.drop_without_shutdown();
1386        _result
1387    }
1388
1389    /// Similar to "send" but does not shutdown the channel if an error occurs.
1390    pub fn send_no_shutdown_on_err(self, mut version: &str) -> Result<(), fidl::Error> {
1391        let _result = self.send_raw(version);
1392        self.drop_without_shutdown();
1393        _result
1394    }
1395
1396    fn send_raw(&self, mut version: &str) -> Result<(), fidl::Error> {
1397        self.control_handle.inner.send::<DeviceTestGetNcpVersionResponse>(
1398            (version,),
1399            self.tx_id,
1400            0x5006d66ecaa992f2,
1401            fidl::encoding::DynamicFlags::empty(),
1402        )
1403    }
1404}
1405
1406#[must_use = "FIDL methods require a response to be sent"]
1407#[derive(Debug)]
1408pub struct DeviceTestGetCurrentRssiResponder {
1409    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1410    tx_id: u32,
1411}
1412
1413/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1414/// if the responder is dropped without sending a response, so that the client
1415/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1416impl std::ops::Drop for DeviceTestGetCurrentRssiResponder {
1417    fn drop(&mut self) {
1418        self.control_handle.shutdown();
1419        // Safety: drops once, never accessed again
1420        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1421    }
1422}
1423
1424impl fidl::endpoints::Responder for DeviceTestGetCurrentRssiResponder {
1425    type ControlHandle = DeviceTestControlHandle;
1426
1427    fn control_handle(&self) -> &DeviceTestControlHandle {
1428        &self.control_handle
1429    }
1430
1431    fn drop_without_shutdown(mut self) {
1432        // Safety: drops once, never accessed again due to mem::forget
1433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1434        // Prevent Drop from running (which would shut down the channel)
1435        std::mem::forget(self);
1436    }
1437}
1438
1439impl DeviceTestGetCurrentRssiResponder {
1440    /// Sends a response to the FIDL transaction.
1441    ///
1442    /// Sets the channel to shutdown if an error occurs.
1443    pub fn send(self, mut rssi: i8) -> Result<(), fidl::Error> {
1444        let _result = self.send_raw(rssi);
1445        if _result.is_err() {
1446            self.control_handle.shutdown();
1447        }
1448        self.drop_without_shutdown();
1449        _result
1450    }
1451
1452    /// Similar to "send" but does not shutdown the channel if an error occurs.
1453    pub fn send_no_shutdown_on_err(self, mut rssi: i8) -> Result<(), fidl::Error> {
1454        let _result = self.send_raw(rssi);
1455        self.drop_without_shutdown();
1456        _result
1457    }
1458
1459    fn send_raw(&self, mut rssi: i8) -> Result<(), fidl::Error> {
1460        self.control_handle.inner.send::<DeviceTestGetCurrentRssiResponse>(
1461            (rssi,),
1462            self.tx_id,
1463            0x6ac289cf16a976ab,
1464            fidl::encoding::DynamicFlags::empty(),
1465        )
1466    }
1467}
1468
1469#[must_use = "FIDL methods require a response to be sent"]
1470#[derive(Debug)]
1471pub struct DeviceTestGetFactoryMacAddressResponder {
1472    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1473    tx_id: u32,
1474}
1475
1476/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1477/// if the responder is dropped without sending a response, so that the client
1478/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1479impl std::ops::Drop for DeviceTestGetFactoryMacAddressResponder {
1480    fn drop(&mut self) {
1481        self.control_handle.shutdown();
1482        // Safety: drops once, never accessed again
1483        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1484    }
1485}
1486
1487impl fidl::endpoints::Responder for DeviceTestGetFactoryMacAddressResponder {
1488    type ControlHandle = DeviceTestControlHandle;
1489
1490    fn control_handle(&self) -> &DeviceTestControlHandle {
1491        &self.control_handle
1492    }
1493
1494    fn drop_without_shutdown(mut self) {
1495        // Safety: drops once, never accessed again due to mem::forget
1496        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1497        // Prevent Drop from running (which would shut down the channel)
1498        std::mem::forget(self);
1499    }
1500}
1501
1502impl DeviceTestGetFactoryMacAddressResponder {
1503    /// Sends a response to the FIDL transaction.
1504    ///
1505    /// Sets the channel to shutdown if an error occurs.
1506    pub fn send(self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1507        let _result = self.send_raw(address);
1508        if _result.is_err() {
1509            self.control_handle.shutdown();
1510        }
1511        self.drop_without_shutdown();
1512        _result
1513    }
1514
1515    /// Similar to "send" but does not shutdown the channel if an error occurs.
1516    pub fn send_no_shutdown_on_err(
1517        self,
1518        mut address: &fidl_fuchsia_lowpan::MacAddress,
1519    ) -> Result<(), fidl::Error> {
1520        let _result = self.send_raw(address);
1521        self.drop_without_shutdown();
1522        _result
1523    }
1524
1525    fn send_raw(&self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1526        self.control_handle.inner.send::<DeviceTestGetFactoryMacAddressResponse>(
1527            (address,),
1528            self.tx_id,
1529            0x2a32094f1da3372,
1530            fidl::encoding::DynamicFlags::empty(),
1531        )
1532    }
1533}
1534
1535#[must_use = "FIDL methods require a response to be sent"]
1536#[derive(Debug)]
1537pub struct DeviceTestGetCurrentMacAddressResponder {
1538    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1539    tx_id: u32,
1540}
1541
1542/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1543/// if the responder is dropped without sending a response, so that the client
1544/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1545impl std::ops::Drop for DeviceTestGetCurrentMacAddressResponder {
1546    fn drop(&mut self) {
1547        self.control_handle.shutdown();
1548        // Safety: drops once, never accessed again
1549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1550    }
1551}
1552
1553impl fidl::endpoints::Responder for DeviceTestGetCurrentMacAddressResponder {
1554    type ControlHandle = DeviceTestControlHandle;
1555
1556    fn control_handle(&self) -> &DeviceTestControlHandle {
1557        &self.control_handle
1558    }
1559
1560    fn drop_without_shutdown(mut self) {
1561        // Safety: drops once, never accessed again due to mem::forget
1562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1563        // Prevent Drop from running (which would shut down the channel)
1564        std::mem::forget(self);
1565    }
1566}
1567
1568impl DeviceTestGetCurrentMacAddressResponder {
1569    /// Sends a response to the FIDL transaction.
1570    ///
1571    /// Sets the channel to shutdown if an error occurs.
1572    pub fn send(self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1573        let _result = self.send_raw(address);
1574        if _result.is_err() {
1575            self.control_handle.shutdown();
1576        }
1577        self.drop_without_shutdown();
1578        _result
1579    }
1580
1581    /// Similar to "send" but does not shutdown the channel if an error occurs.
1582    pub fn send_no_shutdown_on_err(
1583        self,
1584        mut address: &fidl_fuchsia_lowpan::MacAddress,
1585    ) -> Result<(), fidl::Error> {
1586        let _result = self.send_raw(address);
1587        self.drop_without_shutdown();
1588        _result
1589    }
1590
1591    fn send_raw(&self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1592        self.control_handle.inner.send::<DeviceTestGetCurrentMacAddressResponse>(
1593            (address,),
1594            self.tx_id,
1595            0x39fc2f974a484b62,
1596            fidl::encoding::DynamicFlags::empty(),
1597        )
1598    }
1599}
1600
1601#[must_use = "FIDL methods require a response to be sent"]
1602#[derive(Debug)]
1603pub struct DeviceTestGetCurrentChannelResponder {
1604    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1605    tx_id: u32,
1606}
1607
1608/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1609/// if the responder is dropped without sending a response, so that the client
1610/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1611impl std::ops::Drop for DeviceTestGetCurrentChannelResponder {
1612    fn drop(&mut self) {
1613        self.control_handle.shutdown();
1614        // Safety: drops once, never accessed again
1615        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1616    }
1617}
1618
1619impl fidl::endpoints::Responder for DeviceTestGetCurrentChannelResponder {
1620    type ControlHandle = DeviceTestControlHandle;
1621
1622    fn control_handle(&self) -> &DeviceTestControlHandle {
1623        &self.control_handle
1624    }
1625
1626    fn drop_without_shutdown(mut self) {
1627        // Safety: drops once, never accessed again due to mem::forget
1628        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1629        // Prevent Drop from running (which would shut down the channel)
1630        std::mem::forget(self);
1631    }
1632}
1633
1634impl DeviceTestGetCurrentChannelResponder {
1635    /// Sends a response to the FIDL transaction.
1636    ///
1637    /// Sets the channel to shutdown if an error occurs.
1638    pub fn send(self, mut channel_index: u16) -> Result<(), fidl::Error> {
1639        let _result = self.send_raw(channel_index);
1640        if _result.is_err() {
1641            self.control_handle.shutdown();
1642        }
1643        self.drop_without_shutdown();
1644        _result
1645    }
1646
1647    /// Similar to "send" but does not shutdown the channel if an error occurs.
1648    pub fn send_no_shutdown_on_err(self, mut channel_index: u16) -> Result<(), fidl::Error> {
1649        let _result = self.send_raw(channel_index);
1650        self.drop_without_shutdown();
1651        _result
1652    }
1653
1654    fn send_raw(&self, mut channel_index: u16) -> Result<(), fidl::Error> {
1655        self.control_handle.inner.send::<DeviceTestGetCurrentChannelResponse>(
1656            (channel_index,),
1657            self.tx_id,
1658            0x2bd32ba980668d13,
1659            fidl::encoding::DynamicFlags::empty(),
1660        )
1661    }
1662}
1663
1664#[must_use = "FIDL methods require a response to be sent"]
1665#[derive(Debug)]
1666pub struct DeviceTestGetPartitionIdResponder {
1667    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1668    tx_id: u32,
1669}
1670
1671/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1672/// if the responder is dropped without sending a response, so that the client
1673/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1674impl std::ops::Drop for DeviceTestGetPartitionIdResponder {
1675    fn drop(&mut self) {
1676        self.control_handle.shutdown();
1677        // Safety: drops once, never accessed again
1678        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1679    }
1680}
1681
1682impl fidl::endpoints::Responder for DeviceTestGetPartitionIdResponder {
1683    type ControlHandle = DeviceTestControlHandle;
1684
1685    fn control_handle(&self) -> &DeviceTestControlHandle {
1686        &self.control_handle
1687    }
1688
1689    fn drop_without_shutdown(mut self) {
1690        // Safety: drops once, never accessed again due to mem::forget
1691        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1692        // Prevent Drop from running (which would shut down the channel)
1693        std::mem::forget(self);
1694    }
1695}
1696
1697impl DeviceTestGetPartitionIdResponder {
1698    /// Sends a response to the FIDL transaction.
1699    ///
1700    /// Sets the channel to shutdown if an error occurs.
1701    pub fn send(self, mut pid: u32) -> Result<(), fidl::Error> {
1702        let _result = self.send_raw(pid);
1703        if _result.is_err() {
1704            self.control_handle.shutdown();
1705        }
1706        self.drop_without_shutdown();
1707        _result
1708    }
1709
1710    /// Similar to "send" but does not shutdown the channel if an error occurs.
1711    pub fn send_no_shutdown_on_err(self, mut pid: u32) -> Result<(), fidl::Error> {
1712        let _result = self.send_raw(pid);
1713        self.drop_without_shutdown();
1714        _result
1715    }
1716
1717    fn send_raw(&self, mut pid: u32) -> Result<(), fidl::Error> {
1718        self.control_handle.inner.send::<DeviceTestGetPartitionIdResponse>(
1719            (pid,),
1720            self.tx_id,
1721            0x32be448a6dc88b33,
1722            fidl::encoding::DynamicFlags::empty(),
1723        )
1724    }
1725}
1726
1727#[must_use = "FIDL methods require a response to be sent"]
1728#[derive(Debug)]
1729pub struct DeviceTestGetThreadRloc16Responder {
1730    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1731    tx_id: u32,
1732}
1733
1734/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1735/// if the responder is dropped without sending a response, so that the client
1736/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1737impl std::ops::Drop for DeviceTestGetThreadRloc16Responder {
1738    fn drop(&mut self) {
1739        self.control_handle.shutdown();
1740        // Safety: drops once, never accessed again
1741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1742    }
1743}
1744
1745impl fidl::endpoints::Responder for DeviceTestGetThreadRloc16Responder {
1746    type ControlHandle = DeviceTestControlHandle;
1747
1748    fn control_handle(&self) -> &DeviceTestControlHandle {
1749        &self.control_handle
1750    }
1751
1752    fn drop_without_shutdown(mut self) {
1753        // Safety: drops once, never accessed again due to mem::forget
1754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1755        // Prevent Drop from running (which would shut down the channel)
1756        std::mem::forget(self);
1757    }
1758}
1759
1760impl DeviceTestGetThreadRloc16Responder {
1761    /// Sends a response to the FIDL transaction.
1762    ///
1763    /// Sets the channel to shutdown if an error occurs.
1764    pub fn send(self, mut rloc: u16) -> Result<(), fidl::Error> {
1765        let _result = self.send_raw(rloc);
1766        if _result.is_err() {
1767            self.control_handle.shutdown();
1768        }
1769        self.drop_without_shutdown();
1770        _result
1771    }
1772
1773    /// Similar to "send" but does not shutdown the channel if an error occurs.
1774    pub fn send_no_shutdown_on_err(self, mut rloc: u16) -> Result<(), fidl::Error> {
1775        let _result = self.send_raw(rloc);
1776        self.drop_without_shutdown();
1777        _result
1778    }
1779
1780    fn send_raw(&self, mut rloc: u16) -> Result<(), fidl::Error> {
1781        self.control_handle.inner.send::<DeviceTestGetThreadRloc16Response>(
1782            (rloc,),
1783            self.tx_id,
1784            0x4e554e42c1953d31,
1785            fidl::encoding::DynamicFlags::empty(),
1786        )
1787    }
1788}
1789
1790#[must_use = "FIDL methods require a response to be sent"]
1791#[derive(Debug)]
1792pub struct DeviceTestGetThreadRouterIdResponder {
1793    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1794    tx_id: u32,
1795}
1796
1797/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1798/// if the responder is dropped without sending a response, so that the client
1799/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1800impl std::ops::Drop for DeviceTestGetThreadRouterIdResponder {
1801    fn drop(&mut self) {
1802        self.control_handle.shutdown();
1803        // Safety: drops once, never accessed again
1804        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1805    }
1806}
1807
1808impl fidl::endpoints::Responder for DeviceTestGetThreadRouterIdResponder {
1809    type ControlHandle = DeviceTestControlHandle;
1810
1811    fn control_handle(&self) -> &DeviceTestControlHandle {
1812        &self.control_handle
1813    }
1814
1815    fn drop_without_shutdown(mut self) {
1816        // Safety: drops once, never accessed again due to mem::forget
1817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1818        // Prevent Drop from running (which would shut down the channel)
1819        std::mem::forget(self);
1820    }
1821}
1822
1823impl DeviceTestGetThreadRouterIdResponder {
1824    /// Sends a response to the FIDL transaction.
1825    ///
1826    /// Sets the channel to shutdown if an error occurs.
1827    pub fn send(self, mut router_id: u8) -> Result<(), fidl::Error> {
1828        let _result = self.send_raw(router_id);
1829        if _result.is_err() {
1830            self.control_handle.shutdown();
1831        }
1832        self.drop_without_shutdown();
1833        _result
1834    }
1835
1836    /// Similar to "send" but does not shutdown the channel if an error occurs.
1837    pub fn send_no_shutdown_on_err(self, mut router_id: u8) -> Result<(), fidl::Error> {
1838        let _result = self.send_raw(router_id);
1839        self.drop_without_shutdown();
1840        _result
1841    }
1842
1843    fn send_raw(&self, mut router_id: u8) -> Result<(), fidl::Error> {
1844        self.control_handle.inner.send::<DeviceTestGetThreadRouterIdResponse>(
1845            (router_id,),
1846            self.tx_id,
1847            0x753df71fce9f3563,
1848            fidl::encoding::DynamicFlags::empty(),
1849        )
1850    }
1851}
1852
1853#[must_use = "FIDL methods require a response to be sent"]
1854#[derive(Debug)]
1855pub struct DeviceTestReplaceMacAddressFilterSettingsResponder {
1856    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1857    tx_id: u32,
1858}
1859
1860/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1861/// if the responder is dropped without sending a response, so that the client
1862/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1863impl std::ops::Drop for DeviceTestReplaceMacAddressFilterSettingsResponder {
1864    fn drop(&mut self) {
1865        self.control_handle.shutdown();
1866        // Safety: drops once, never accessed again
1867        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1868    }
1869}
1870
1871impl fidl::endpoints::Responder for DeviceTestReplaceMacAddressFilterSettingsResponder {
1872    type ControlHandle = DeviceTestControlHandle;
1873
1874    fn control_handle(&self) -> &DeviceTestControlHandle {
1875        &self.control_handle
1876    }
1877
1878    fn drop_without_shutdown(mut self) {
1879        // Safety: drops once, never accessed again due to mem::forget
1880        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1881        // Prevent Drop from running (which would shut down the channel)
1882        std::mem::forget(self);
1883    }
1884}
1885
1886impl DeviceTestReplaceMacAddressFilterSettingsResponder {
1887    /// Sends a response to the FIDL transaction.
1888    ///
1889    /// Sets the channel to shutdown if an error occurs.
1890    pub fn send(self) -> Result<(), fidl::Error> {
1891        let _result = self.send_raw();
1892        if _result.is_err() {
1893            self.control_handle.shutdown();
1894        }
1895        self.drop_without_shutdown();
1896        _result
1897    }
1898
1899    /// Similar to "send" but does not shutdown the channel if an error occurs.
1900    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1901        let _result = self.send_raw();
1902        self.drop_without_shutdown();
1903        _result
1904    }
1905
1906    fn send_raw(&self) -> Result<(), fidl::Error> {
1907        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1908            (),
1909            self.tx_id,
1910            0x66eb4780f869de19,
1911            fidl::encoding::DynamicFlags::empty(),
1912        )
1913    }
1914}
1915
1916#[must_use = "FIDL methods require a response to be sent"]
1917#[derive(Debug)]
1918pub struct DeviceTestGetMacAddressFilterSettingsResponder {
1919    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1920    tx_id: u32,
1921}
1922
1923/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1924/// if the responder is dropped without sending a response, so that the client
1925/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1926impl std::ops::Drop for DeviceTestGetMacAddressFilterSettingsResponder {
1927    fn drop(&mut self) {
1928        self.control_handle.shutdown();
1929        // Safety: drops once, never accessed again
1930        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1931    }
1932}
1933
1934impl fidl::endpoints::Responder for DeviceTestGetMacAddressFilterSettingsResponder {
1935    type ControlHandle = DeviceTestControlHandle;
1936
1937    fn control_handle(&self) -> &DeviceTestControlHandle {
1938        &self.control_handle
1939    }
1940
1941    fn drop_without_shutdown(mut self) {
1942        // Safety: drops once, never accessed again due to mem::forget
1943        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1944        // Prevent Drop from running (which would shut down the channel)
1945        std::mem::forget(self);
1946    }
1947}
1948
1949impl DeviceTestGetMacAddressFilterSettingsResponder {
1950    /// Sends a response to the FIDL transaction.
1951    ///
1952    /// Sets the channel to shutdown if an error occurs.
1953    pub fn send(self, mut settings: &MacAddressFilterSettings) -> Result<(), fidl::Error> {
1954        let _result = self.send_raw(settings);
1955        if _result.is_err() {
1956            self.control_handle.shutdown();
1957        }
1958        self.drop_without_shutdown();
1959        _result
1960    }
1961
1962    /// Similar to "send" but does not shutdown the channel if an error occurs.
1963    pub fn send_no_shutdown_on_err(
1964        self,
1965        mut settings: &MacAddressFilterSettings,
1966    ) -> Result<(), fidl::Error> {
1967        let _result = self.send_raw(settings);
1968        self.drop_without_shutdown();
1969        _result
1970    }
1971
1972    fn send_raw(&self, mut settings: &MacAddressFilterSettings) -> Result<(), fidl::Error> {
1973        self.control_handle.inner.send::<DeviceTestGetMacAddressFilterSettingsResponse>(
1974            (settings,),
1975            self.tx_id,
1976            0x2d727bf2dd3e231c,
1977            fidl::encoding::DynamicFlags::empty(),
1978        )
1979    }
1980}
1981
1982#[must_use = "FIDL methods require a response to be sent"]
1983#[derive(Debug)]
1984pub struct DeviceTestGetNeighborTableResponder {
1985    control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1986    tx_id: u32,
1987}
1988
1989/// Set the the channel to be shutdown (see [`DeviceTestControlHandle::shutdown`])
1990/// if the responder is dropped without sending a response, so that the client
1991/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1992impl std::ops::Drop for DeviceTestGetNeighborTableResponder {
1993    fn drop(&mut self) {
1994        self.control_handle.shutdown();
1995        // Safety: drops once, never accessed again
1996        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1997    }
1998}
1999
2000impl fidl::endpoints::Responder for DeviceTestGetNeighborTableResponder {
2001    type ControlHandle = DeviceTestControlHandle;
2002
2003    fn control_handle(&self) -> &DeviceTestControlHandle {
2004        &self.control_handle
2005    }
2006
2007    fn drop_without_shutdown(mut self) {
2008        // Safety: drops once, never accessed again due to mem::forget
2009        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2010        // Prevent Drop from running (which would shut down the channel)
2011        std::mem::forget(self);
2012    }
2013}
2014
2015impl DeviceTestGetNeighborTableResponder {
2016    /// Sends a response to the FIDL transaction.
2017    ///
2018    /// Sets the channel to shutdown if an error occurs.
2019    pub fn send(self, mut neighbor_table: &[NeighborInfo]) -> Result<(), fidl::Error> {
2020        let _result = self.send_raw(neighbor_table);
2021        if _result.is_err() {
2022            self.control_handle.shutdown();
2023        }
2024        self.drop_without_shutdown();
2025        _result
2026    }
2027
2028    /// Similar to "send" but does not shutdown the channel if an error occurs.
2029    pub fn send_no_shutdown_on_err(
2030        self,
2031        mut neighbor_table: &[NeighborInfo],
2032    ) -> Result<(), fidl::Error> {
2033        let _result = self.send_raw(neighbor_table);
2034        self.drop_without_shutdown();
2035        _result
2036    }
2037
2038    fn send_raw(&self, mut neighbor_table: &[NeighborInfo]) -> Result<(), fidl::Error> {
2039        self.control_handle.inner.send::<DeviceTestGetNeighborTableResponse>(
2040            (neighbor_table,),
2041            self.tx_id,
2042            0x6f2db4573c413cde,
2043            fidl::encoding::DynamicFlags::empty(),
2044        )
2045    }
2046}
2047
2048#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2049pub struct DeviceTestConnectorMarker;
2050
2051impl fidl::endpoints::ProtocolMarker for DeviceTestConnectorMarker {
2052    type Proxy = DeviceTestConnectorProxy;
2053    type RequestStream = DeviceTestConnectorRequestStream;
2054    #[cfg(target_os = "fuchsia")]
2055    type SynchronousProxy = DeviceTestConnectorSynchronousProxy;
2056
2057    const DEBUG_NAME: &'static str = "fuchsia.lowpan.test.DeviceTestConnector";
2058}
2059impl fidl::endpoints::DiscoverableProtocolMarker for DeviceTestConnectorMarker {}
2060
2061pub trait DeviceTestConnectorProxyInterface: Send + Sync {
2062    fn r#connect(
2063        &self,
2064        name: &str,
2065        server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2066    ) -> Result<(), fidl::Error>;
2067}
2068#[derive(Debug)]
2069#[cfg(target_os = "fuchsia")]
2070pub struct DeviceTestConnectorSynchronousProxy {
2071    client: fidl::client::sync::Client,
2072}
2073
2074#[cfg(target_os = "fuchsia")]
2075impl fidl::endpoints::SynchronousProxy for DeviceTestConnectorSynchronousProxy {
2076    type Proxy = DeviceTestConnectorProxy;
2077    type Protocol = DeviceTestConnectorMarker;
2078
2079    fn from_channel(inner: fidl::Channel) -> Self {
2080        Self::new(inner)
2081    }
2082
2083    fn into_channel(self) -> fidl::Channel {
2084        self.client.into_channel()
2085    }
2086
2087    fn as_channel(&self) -> &fidl::Channel {
2088        self.client.as_channel()
2089    }
2090}
2091
2092#[cfg(target_os = "fuchsia")]
2093impl DeviceTestConnectorSynchronousProxy {
2094    pub fn new(channel: fidl::Channel) -> Self {
2095        let protocol_name =
2096            <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2097        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2098    }
2099
2100    pub fn into_channel(self) -> fidl::Channel {
2101        self.client.into_channel()
2102    }
2103
2104    /// Waits until an event arrives and returns it. It is safe for other
2105    /// threads to make concurrent requests while waiting for an event.
2106    pub fn wait_for_event(
2107        &self,
2108        deadline: zx::MonotonicInstant,
2109    ) -> Result<DeviceTestConnectorEvent, fidl::Error> {
2110        DeviceTestConnectorEvent::decode(self.client.wait_for_event(deadline)?)
2111    }
2112
2113    /// Connects to the [`DeviceTest`] protocol on the
2114    /// named LoWPAN interface.
2115    ///
2116    /// The name of the interface can be learned by calling
2117    /// [`fuchsia.lowpan/Lookup.GetDevices`].
2118    ///
2119    /// If there is an error in processing this request
2120    /// the given channel is closed and an epitaph code used
2121    /// to describe the reason for the failure:
2122    ///
2123    /// * `ZX_ERR_INVALID_ARGUMENT`: The given interface name
2124    ///   was not formatted correctly or otherwise invalid.
2125    /// * `ZX_ERR_NOT_FOUND`: No interface was found with the
2126    ///   given name.
2127    /// * `ZX_ERR_NOT_SUPPORTED`: The interface exists but
2128    ///   does not support this protocol.
2129    pub fn r#connect(
2130        &self,
2131        mut name: &str,
2132        mut server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2133    ) -> Result<(), fidl::Error> {
2134        self.client.send::<DeviceTestConnectorConnectRequest>(
2135            (name, server_end),
2136            0x366c1167cee8caa3,
2137            fidl::encoding::DynamicFlags::empty(),
2138        )
2139    }
2140}
2141
2142#[derive(Debug, Clone)]
2143pub struct DeviceTestConnectorProxy {
2144    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2145}
2146
2147impl fidl::endpoints::Proxy for DeviceTestConnectorProxy {
2148    type Protocol = DeviceTestConnectorMarker;
2149
2150    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2151        Self::new(inner)
2152    }
2153
2154    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2155        self.client.into_channel().map_err(|client| Self { client })
2156    }
2157
2158    fn as_channel(&self) -> &::fidl::AsyncChannel {
2159        self.client.as_channel()
2160    }
2161}
2162
2163impl DeviceTestConnectorProxy {
2164    /// Create a new Proxy for fuchsia.lowpan.test/DeviceTestConnector.
2165    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2166        let protocol_name =
2167            <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2168        Self { client: fidl::client::Client::new(channel, protocol_name) }
2169    }
2170
2171    /// Get a Stream of events from the remote end of the protocol.
2172    ///
2173    /// # Panics
2174    ///
2175    /// Panics if the event stream was already taken.
2176    pub fn take_event_stream(&self) -> DeviceTestConnectorEventStream {
2177        DeviceTestConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2178    }
2179
2180    /// Connects to the [`DeviceTest`] protocol on the
2181    /// named LoWPAN interface.
2182    ///
2183    /// The name of the interface can be learned by calling
2184    /// [`fuchsia.lowpan/Lookup.GetDevices`].
2185    ///
2186    /// If there is an error in processing this request
2187    /// the given channel is closed and an epitaph code used
2188    /// to describe the reason for the failure:
2189    ///
2190    /// * `ZX_ERR_INVALID_ARGUMENT`: The given interface name
2191    ///   was not formatted correctly or otherwise invalid.
2192    /// * `ZX_ERR_NOT_FOUND`: No interface was found with the
2193    ///   given name.
2194    /// * `ZX_ERR_NOT_SUPPORTED`: The interface exists but
2195    ///   does not support this protocol.
2196    pub fn r#connect(
2197        &self,
2198        mut name: &str,
2199        mut server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2200    ) -> Result<(), fidl::Error> {
2201        DeviceTestConnectorProxyInterface::r#connect(self, name, server_end)
2202    }
2203}
2204
2205impl DeviceTestConnectorProxyInterface for DeviceTestConnectorProxy {
2206    fn r#connect(
2207        &self,
2208        mut name: &str,
2209        mut server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2210    ) -> Result<(), fidl::Error> {
2211        self.client.send::<DeviceTestConnectorConnectRequest>(
2212            (name, server_end),
2213            0x366c1167cee8caa3,
2214            fidl::encoding::DynamicFlags::empty(),
2215        )
2216    }
2217}
2218
2219pub struct DeviceTestConnectorEventStream {
2220    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2221}
2222
2223impl std::marker::Unpin for DeviceTestConnectorEventStream {}
2224
2225impl futures::stream::FusedStream for DeviceTestConnectorEventStream {
2226    fn is_terminated(&self) -> bool {
2227        self.event_receiver.is_terminated()
2228    }
2229}
2230
2231impl futures::Stream for DeviceTestConnectorEventStream {
2232    type Item = Result<DeviceTestConnectorEvent, fidl::Error>;
2233
2234    fn poll_next(
2235        mut self: std::pin::Pin<&mut Self>,
2236        cx: &mut std::task::Context<'_>,
2237    ) -> std::task::Poll<Option<Self::Item>> {
2238        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2239            &mut self.event_receiver,
2240            cx
2241        )?) {
2242            Some(buf) => std::task::Poll::Ready(Some(DeviceTestConnectorEvent::decode(buf))),
2243            None => std::task::Poll::Ready(None),
2244        }
2245    }
2246}
2247
2248#[derive(Debug)]
2249pub enum DeviceTestConnectorEvent {}
2250
2251impl DeviceTestConnectorEvent {
2252    /// Decodes a message buffer as a [`DeviceTestConnectorEvent`].
2253    fn decode(
2254        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2255    ) -> Result<DeviceTestConnectorEvent, fidl::Error> {
2256        let (bytes, _handles) = buf.split_mut();
2257        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2258        debug_assert_eq!(tx_header.tx_id, 0);
2259        match tx_header.ordinal {
2260            _ => Err(fidl::Error::UnknownOrdinal {
2261                ordinal: tx_header.ordinal,
2262                protocol_name:
2263                    <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2264            }),
2265        }
2266    }
2267}
2268
2269/// A Stream of incoming requests for fuchsia.lowpan.test/DeviceTestConnector.
2270pub struct DeviceTestConnectorRequestStream {
2271    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2272    is_terminated: bool,
2273}
2274
2275impl std::marker::Unpin for DeviceTestConnectorRequestStream {}
2276
2277impl futures::stream::FusedStream for DeviceTestConnectorRequestStream {
2278    fn is_terminated(&self) -> bool {
2279        self.is_terminated
2280    }
2281}
2282
2283impl fidl::endpoints::RequestStream for DeviceTestConnectorRequestStream {
2284    type Protocol = DeviceTestConnectorMarker;
2285    type ControlHandle = DeviceTestConnectorControlHandle;
2286
2287    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2288        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2289    }
2290
2291    fn control_handle(&self) -> Self::ControlHandle {
2292        DeviceTestConnectorControlHandle { inner: self.inner.clone() }
2293    }
2294
2295    fn into_inner(
2296        self,
2297    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2298    {
2299        (self.inner, self.is_terminated)
2300    }
2301
2302    fn from_inner(
2303        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2304        is_terminated: bool,
2305    ) -> Self {
2306        Self { inner, is_terminated }
2307    }
2308}
2309
2310impl futures::Stream for DeviceTestConnectorRequestStream {
2311    type Item = Result<DeviceTestConnectorRequest, fidl::Error>;
2312
2313    fn poll_next(
2314        mut self: std::pin::Pin<&mut Self>,
2315        cx: &mut std::task::Context<'_>,
2316    ) -> std::task::Poll<Option<Self::Item>> {
2317        let this = &mut *self;
2318        if this.inner.check_shutdown(cx) {
2319            this.is_terminated = true;
2320            return std::task::Poll::Ready(None);
2321        }
2322        if this.is_terminated {
2323            panic!("polled DeviceTestConnectorRequestStream after completion");
2324        }
2325        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2326            |bytes, handles| {
2327                match this.inner.channel().read_etc(cx, bytes, handles) {
2328                    std::task::Poll::Ready(Ok(())) => {}
2329                    std::task::Poll::Pending => return std::task::Poll::Pending,
2330                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2331                        this.is_terminated = true;
2332                        return std::task::Poll::Ready(None);
2333                    }
2334                    std::task::Poll::Ready(Err(e)) => {
2335                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2336                            e.into(),
2337                        ))))
2338                    }
2339                }
2340
2341                // A message has been received from the channel
2342                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2343
2344                std::task::Poll::Ready(Some(match header.ordinal {
2345                0x366c1167cee8caa3 => {
2346                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2347                    let mut req = fidl::new_empty!(DeviceTestConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2348                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceTestConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2349                    let control_handle = DeviceTestConnectorControlHandle {
2350                        inner: this.inner.clone(),
2351                    };
2352                    Ok(DeviceTestConnectorRequest::Connect {name: req.name,
2353server_end: req.server_end,
2354
2355                        control_handle,
2356                    })
2357                }
2358                _ => Err(fidl::Error::UnknownOrdinal {
2359                    ordinal: header.ordinal,
2360                    protocol_name: <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2361                }),
2362            }))
2363            },
2364        )
2365    }
2366}
2367
2368/// Protocol for connecting to [`DeviceTest`] on a LoWPAN
2369/// interface.
2370#[derive(Debug)]
2371pub enum DeviceTestConnectorRequest {
2372    /// Connects to the [`DeviceTest`] protocol on the
2373    /// named LoWPAN interface.
2374    ///
2375    /// The name of the interface can be learned by calling
2376    /// [`fuchsia.lowpan/Lookup.GetDevices`].
2377    ///
2378    /// If there is an error in processing this request
2379    /// the given channel is closed and an epitaph code used
2380    /// to describe the reason for the failure:
2381    ///
2382    /// * `ZX_ERR_INVALID_ARGUMENT`: The given interface name
2383    ///   was not formatted correctly or otherwise invalid.
2384    /// * `ZX_ERR_NOT_FOUND`: No interface was found with the
2385    ///   given name.
2386    /// * `ZX_ERR_NOT_SUPPORTED`: The interface exists but
2387    ///   does not support this protocol.
2388    Connect {
2389        name: String,
2390        server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2391        control_handle: DeviceTestConnectorControlHandle,
2392    },
2393}
2394
2395impl DeviceTestConnectorRequest {
2396    #[allow(irrefutable_let_patterns)]
2397    pub fn into_connect(
2398        self,
2399    ) -> Option<(
2400        String,
2401        fidl::endpoints::ServerEnd<DeviceTestMarker>,
2402        DeviceTestConnectorControlHandle,
2403    )> {
2404        if let DeviceTestConnectorRequest::Connect { name, server_end, control_handle } = self {
2405            Some((name, server_end, control_handle))
2406        } else {
2407            None
2408        }
2409    }
2410
2411    /// Name of the method defined in FIDL
2412    pub fn method_name(&self) -> &'static str {
2413        match *self {
2414            DeviceTestConnectorRequest::Connect { .. } => "connect",
2415        }
2416    }
2417}
2418
2419#[derive(Debug, Clone)]
2420pub struct DeviceTestConnectorControlHandle {
2421    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2422}
2423
2424impl fidl::endpoints::ControlHandle for DeviceTestConnectorControlHandle {
2425    fn shutdown(&self) {
2426        self.inner.shutdown()
2427    }
2428    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2429        self.inner.shutdown_with_epitaph(status)
2430    }
2431
2432    fn is_closed(&self) -> bool {
2433        self.inner.channel().is_closed()
2434    }
2435    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2436        self.inner.channel().on_closed()
2437    }
2438
2439    #[cfg(target_os = "fuchsia")]
2440    fn signal_peer(
2441        &self,
2442        clear_mask: zx::Signals,
2443        set_mask: zx::Signals,
2444    ) -> Result<(), zx_status::Status> {
2445        use fidl::Peered;
2446        self.inner.channel().signal_peer(clear_mask, set_mask)
2447    }
2448}
2449
2450impl DeviceTestConnectorControlHandle {}
2451
2452mod internal {
2453    use super::*;
2454
2455    impl fidl::encoding::ResourceTypeMarker for DeviceTestConnectorConnectRequest {
2456        type Borrowed<'a> = &'a mut Self;
2457        fn take_or_borrow<'a>(
2458            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2459        ) -> Self::Borrowed<'a> {
2460            value
2461        }
2462    }
2463
2464    unsafe impl fidl::encoding::TypeMarker for DeviceTestConnectorConnectRequest {
2465        type Owned = Self;
2466
2467        #[inline(always)]
2468        fn inline_align(_context: fidl::encoding::Context) -> usize {
2469            8
2470        }
2471
2472        #[inline(always)]
2473        fn inline_size(_context: fidl::encoding::Context) -> usize {
2474            24
2475        }
2476    }
2477
2478    unsafe impl
2479        fidl::encoding::Encode<
2480            DeviceTestConnectorConnectRequest,
2481            fidl::encoding::DefaultFuchsiaResourceDialect,
2482        > for &mut DeviceTestConnectorConnectRequest
2483    {
2484        #[inline]
2485        unsafe fn encode(
2486            self,
2487            encoder: &mut fidl::encoding::Encoder<
2488                '_,
2489                fidl::encoding::DefaultFuchsiaResourceDialect,
2490            >,
2491            offset: usize,
2492            _depth: fidl::encoding::Depth,
2493        ) -> fidl::Result<()> {
2494            encoder.debug_check_bounds::<DeviceTestConnectorConnectRequest>(offset);
2495            // Delegate to tuple encoding.
2496            fidl::encoding::Encode::<DeviceTestConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2497                (
2498                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
2499                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
2500                ),
2501                encoder, offset, _depth
2502            )
2503        }
2504    }
2505    unsafe impl<
2506            T0: fidl::encoding::Encode<
2507                fidl::encoding::BoundedString<32>,
2508                fidl::encoding::DefaultFuchsiaResourceDialect,
2509            >,
2510            T1: fidl::encoding::Encode<
2511                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>>,
2512                fidl::encoding::DefaultFuchsiaResourceDialect,
2513            >,
2514        >
2515        fidl::encoding::Encode<
2516            DeviceTestConnectorConnectRequest,
2517            fidl::encoding::DefaultFuchsiaResourceDialect,
2518        > for (T0, T1)
2519    {
2520        #[inline]
2521        unsafe fn encode(
2522            self,
2523            encoder: &mut fidl::encoding::Encoder<
2524                '_,
2525                fidl::encoding::DefaultFuchsiaResourceDialect,
2526            >,
2527            offset: usize,
2528            depth: fidl::encoding::Depth,
2529        ) -> fidl::Result<()> {
2530            encoder.debug_check_bounds::<DeviceTestConnectorConnectRequest>(offset);
2531            // Zero out padding regions. There's no need to apply masks
2532            // because the unmasked parts will be overwritten by fields.
2533            unsafe {
2534                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2535                (ptr as *mut u64).write_unaligned(0);
2536            }
2537            // Write the fields.
2538            self.0.encode(encoder, offset + 0, depth)?;
2539            self.1.encode(encoder, offset + 16, depth)?;
2540            Ok(())
2541        }
2542    }
2543
2544    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2545        for DeviceTestConnectorConnectRequest
2546    {
2547        #[inline(always)]
2548        fn new_empty() -> Self {
2549            Self {
2550                name: fidl::new_empty!(
2551                    fidl::encoding::BoundedString<32>,
2552                    fidl::encoding::DefaultFuchsiaResourceDialect
2553                ),
2554                server_end: fidl::new_empty!(
2555                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>>,
2556                    fidl::encoding::DefaultFuchsiaResourceDialect
2557                ),
2558            }
2559        }
2560
2561        #[inline]
2562        unsafe fn decode(
2563            &mut self,
2564            decoder: &mut fidl::encoding::Decoder<
2565                '_,
2566                fidl::encoding::DefaultFuchsiaResourceDialect,
2567            >,
2568            offset: usize,
2569            _depth: fidl::encoding::Depth,
2570        ) -> fidl::Result<()> {
2571            decoder.debug_check_bounds::<Self>(offset);
2572            // Verify that padding bytes are zero.
2573            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2574            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2575            let mask = 0xffffffff00000000u64;
2576            let maskedval = padval & mask;
2577            if maskedval != 0 {
2578                return Err(fidl::Error::NonZeroPadding {
2579                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2580                });
2581            }
2582            fidl::decode!(
2583                fidl::encoding::BoundedString<32>,
2584                fidl::encoding::DefaultFuchsiaResourceDialect,
2585                &mut self.name,
2586                decoder,
2587                offset + 0,
2588                _depth
2589            )?;
2590            fidl::decode!(
2591                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>>,
2592                fidl::encoding::DefaultFuchsiaResourceDialect,
2593                &mut self.server_end,
2594                decoder,
2595                offset + 16,
2596                _depth
2597            )?;
2598            Ok(())
2599        }
2600    }
2601}