1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_lowpan_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 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 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 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 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 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 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 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 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 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 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 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#[cfg(target_os = "fuchsia")]
316impl From<DeviceTestSynchronousProxy> for zx::Handle {
317 fn from(value: DeviceTestSynchronousProxy) -> Self {
318 value.into_channel().into()
319 }
320}
321
322#[cfg(target_os = "fuchsia")]
323impl From<fidl::Channel> for DeviceTestSynchronousProxy {
324 fn from(value: fidl::Channel) -> Self {
325 Self::new(value)
326 }
327}
328
329#[derive(Debug, Clone)]
330pub struct DeviceTestProxy {
331 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
332}
333
334impl fidl::endpoints::Proxy for DeviceTestProxy {
335 type Protocol = DeviceTestMarker;
336
337 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
338 Self::new(inner)
339 }
340
341 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
342 self.client.into_channel().map_err(|client| Self { client })
343 }
344
345 fn as_channel(&self) -> &::fidl::AsyncChannel {
346 self.client.as_channel()
347 }
348}
349
350impl DeviceTestProxy {
351 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
353 let protocol_name = <DeviceTestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
354 Self { client: fidl::client::Client::new(channel, protocol_name) }
355 }
356
357 pub fn take_event_stream(&self) -> DeviceTestEventStream {
363 DeviceTestEventStream { event_receiver: self.client.take_event_receiver() }
364 }
365
366 pub fn r#reset(
376 &self,
377 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
378 DeviceTestProxyInterface::r#reset(self)
379 }
380
381 pub fn r#get_ncp_version(
384 &self,
385 ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
386 DeviceTestProxyInterface::r#get_ncp_version(self)
387 }
388
389 pub fn r#get_current_rssi(
391 &self,
392 ) -> fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect> {
393 DeviceTestProxyInterface::r#get_current_rssi(self)
394 }
395
396 pub fn r#get_factory_mac_address(
398 &self,
399 ) -> fidl::client::QueryResponseFut<
400 fidl_fuchsia_lowpan::MacAddress,
401 fidl::encoding::DefaultFuchsiaResourceDialect,
402 > {
403 DeviceTestProxyInterface::r#get_factory_mac_address(self)
404 }
405
406 pub fn r#get_current_mac_address(
409 &self,
410 ) -> fidl::client::QueryResponseFut<
411 fidl_fuchsia_lowpan::MacAddress,
412 fidl::encoding::DefaultFuchsiaResourceDialect,
413 > {
414 DeviceTestProxyInterface::r#get_current_mac_address(self)
415 }
416
417 pub fn r#get_current_channel(
419 &self,
420 ) -> fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect> {
421 DeviceTestProxyInterface::r#get_current_channel(self)
422 }
423
424 pub fn r#get_partition_id(
427 &self,
428 ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
429 DeviceTestProxyInterface::r#get_partition_id(self)
430 }
431
432 pub fn r#get_thread_rloc16(
433 &self,
434 ) -> fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect> {
435 DeviceTestProxyInterface::r#get_thread_rloc16(self)
436 }
437
438 pub fn r#get_thread_router_id(
439 &self,
440 ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
441 DeviceTestProxyInterface::r#get_thread_router_id(self)
442 }
443
444 pub fn r#replace_mac_address_filter_settings(
448 &self,
449 mut settings: &MacAddressFilterSettings,
450 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
451 DeviceTestProxyInterface::r#replace_mac_address_filter_settings(self, settings)
452 }
453
454 pub fn r#get_mac_address_filter_settings(
456 &self,
457 ) -> fidl::client::QueryResponseFut<
458 MacAddressFilterSettings,
459 fidl::encoding::DefaultFuchsiaResourceDialect,
460 > {
461 DeviceTestProxyInterface::r#get_mac_address_filter_settings(self)
462 }
463
464 pub fn r#get_neighbor_table(
466 &self,
467 ) -> fidl::client::QueryResponseFut<
468 Vec<NeighborInfo>,
469 fidl::encoding::DefaultFuchsiaResourceDialect,
470 > {
471 DeviceTestProxyInterface::r#get_neighbor_table(self)
472 }
473}
474
475impl DeviceTestProxyInterface for DeviceTestProxy {
476 type ResetResponseFut =
477 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
478 fn r#reset(&self) -> Self::ResetResponseFut {
479 fn _decode(
480 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
481 ) -> Result<(), fidl::Error> {
482 let _response = fidl::client::decode_transaction_body::<
483 fidl::encoding::EmptyPayload,
484 fidl::encoding::DefaultFuchsiaResourceDialect,
485 0x772795fd82e287e,
486 >(_buf?)?;
487 Ok(_response)
488 }
489 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
490 (),
491 0x772795fd82e287e,
492 fidl::encoding::DynamicFlags::empty(),
493 _decode,
494 )
495 }
496
497 type GetNcpVersionResponseFut =
498 fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
499 fn r#get_ncp_version(&self) -> Self::GetNcpVersionResponseFut {
500 fn _decode(
501 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
502 ) -> Result<String, fidl::Error> {
503 let _response = fidl::client::decode_transaction_body::<
504 DeviceTestGetNcpVersionResponse,
505 fidl::encoding::DefaultFuchsiaResourceDialect,
506 0x5006d66ecaa992f2,
507 >(_buf?)?;
508 Ok(_response.version)
509 }
510 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, String>(
511 (),
512 0x5006d66ecaa992f2,
513 fidl::encoding::DynamicFlags::empty(),
514 _decode,
515 )
516 }
517
518 type GetCurrentRssiResponseFut =
519 fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect>;
520 fn r#get_current_rssi(&self) -> Self::GetCurrentRssiResponseFut {
521 fn _decode(
522 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
523 ) -> Result<i8, fidl::Error> {
524 let _response = fidl::client::decode_transaction_body::<
525 DeviceTestGetCurrentRssiResponse,
526 fidl::encoding::DefaultFuchsiaResourceDialect,
527 0x6ac289cf16a976ab,
528 >(_buf?)?;
529 Ok(_response.rssi)
530 }
531 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i8>(
532 (),
533 0x6ac289cf16a976ab,
534 fidl::encoding::DynamicFlags::empty(),
535 _decode,
536 )
537 }
538
539 type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
540 fidl_fuchsia_lowpan::MacAddress,
541 fidl::encoding::DefaultFuchsiaResourceDialect,
542 >;
543 fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
544 fn _decode(
545 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
546 ) -> Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error> {
547 let _response = fidl::client::decode_transaction_body::<
548 DeviceTestGetFactoryMacAddressResponse,
549 fidl::encoding::DefaultFuchsiaResourceDialect,
550 0x2a32094f1da3372,
551 >(_buf?)?;
552 Ok(_response.address)
553 }
554 self.client
555 .send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_lowpan::MacAddress>(
556 (),
557 0x2a32094f1da3372,
558 fidl::encoding::DynamicFlags::empty(),
559 _decode,
560 )
561 }
562
563 type GetCurrentMacAddressResponseFut = fidl::client::QueryResponseFut<
564 fidl_fuchsia_lowpan::MacAddress,
565 fidl::encoding::DefaultFuchsiaResourceDialect,
566 >;
567 fn r#get_current_mac_address(&self) -> Self::GetCurrentMacAddressResponseFut {
568 fn _decode(
569 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
570 ) -> Result<fidl_fuchsia_lowpan::MacAddress, fidl::Error> {
571 let _response = fidl::client::decode_transaction_body::<
572 DeviceTestGetCurrentMacAddressResponse,
573 fidl::encoding::DefaultFuchsiaResourceDialect,
574 0x39fc2f974a484b62,
575 >(_buf?)?;
576 Ok(_response.address)
577 }
578 self.client
579 .send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_lowpan::MacAddress>(
580 (),
581 0x39fc2f974a484b62,
582 fidl::encoding::DynamicFlags::empty(),
583 _decode,
584 )
585 }
586
587 type GetCurrentChannelResponseFut =
588 fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect>;
589 fn r#get_current_channel(&self) -> Self::GetCurrentChannelResponseFut {
590 fn _decode(
591 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
592 ) -> Result<u16, fidl::Error> {
593 let _response = fidl::client::decode_transaction_body::<
594 DeviceTestGetCurrentChannelResponse,
595 fidl::encoding::DefaultFuchsiaResourceDialect,
596 0x2bd32ba980668d13,
597 >(_buf?)?;
598 Ok(_response.channel_index)
599 }
600 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u16>(
601 (),
602 0x2bd32ba980668d13,
603 fidl::encoding::DynamicFlags::empty(),
604 _decode,
605 )
606 }
607
608 type GetPartitionIdResponseFut =
609 fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
610 fn r#get_partition_id(&self) -> Self::GetPartitionIdResponseFut {
611 fn _decode(
612 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
613 ) -> Result<u32, fidl::Error> {
614 let _response = fidl::client::decode_transaction_body::<
615 DeviceTestGetPartitionIdResponse,
616 fidl::encoding::DefaultFuchsiaResourceDialect,
617 0x32be448a6dc88b33,
618 >(_buf?)?;
619 Ok(_response.pid)
620 }
621 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
622 (),
623 0x32be448a6dc88b33,
624 fidl::encoding::DynamicFlags::empty(),
625 _decode,
626 )
627 }
628
629 type GetThreadRloc16ResponseFut =
630 fidl::client::QueryResponseFut<u16, fidl::encoding::DefaultFuchsiaResourceDialect>;
631 fn r#get_thread_rloc16(&self) -> Self::GetThreadRloc16ResponseFut {
632 fn _decode(
633 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
634 ) -> Result<u16, fidl::Error> {
635 let _response = fidl::client::decode_transaction_body::<
636 DeviceTestGetThreadRloc16Response,
637 fidl::encoding::DefaultFuchsiaResourceDialect,
638 0x4e554e42c1953d31,
639 >(_buf?)?;
640 Ok(_response.rloc)
641 }
642 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u16>(
643 (),
644 0x4e554e42c1953d31,
645 fidl::encoding::DynamicFlags::empty(),
646 _decode,
647 )
648 }
649
650 type GetThreadRouterIdResponseFut =
651 fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
652 fn r#get_thread_router_id(&self) -> Self::GetThreadRouterIdResponseFut {
653 fn _decode(
654 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
655 ) -> Result<u8, fidl::Error> {
656 let _response = fidl::client::decode_transaction_body::<
657 DeviceTestGetThreadRouterIdResponse,
658 fidl::encoding::DefaultFuchsiaResourceDialect,
659 0x753df71fce9f3563,
660 >(_buf?)?;
661 Ok(_response.router_id)
662 }
663 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
664 (),
665 0x753df71fce9f3563,
666 fidl::encoding::DynamicFlags::empty(),
667 _decode,
668 )
669 }
670
671 type ReplaceMacAddressFilterSettingsResponseFut =
672 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
673 fn r#replace_mac_address_filter_settings(
674 &self,
675 mut settings: &MacAddressFilterSettings,
676 ) -> Self::ReplaceMacAddressFilterSettingsResponseFut {
677 fn _decode(
678 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
679 ) -> Result<(), fidl::Error> {
680 let _response = fidl::client::decode_transaction_body::<
681 fidl::encoding::EmptyPayload,
682 fidl::encoding::DefaultFuchsiaResourceDialect,
683 0x66eb4780f869de19,
684 >(_buf?)?;
685 Ok(_response)
686 }
687 self.client.send_query_and_decode::<DeviceTestReplaceMacAddressFilterSettingsRequest, ()>(
688 (settings,),
689 0x66eb4780f869de19,
690 fidl::encoding::DynamicFlags::empty(),
691 _decode,
692 )
693 }
694
695 type GetMacAddressFilterSettingsResponseFut = fidl::client::QueryResponseFut<
696 MacAddressFilterSettings,
697 fidl::encoding::DefaultFuchsiaResourceDialect,
698 >;
699 fn r#get_mac_address_filter_settings(&self) -> Self::GetMacAddressFilterSettingsResponseFut {
700 fn _decode(
701 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
702 ) -> Result<MacAddressFilterSettings, fidl::Error> {
703 let _response = fidl::client::decode_transaction_body::<
704 DeviceTestGetMacAddressFilterSettingsResponse,
705 fidl::encoding::DefaultFuchsiaResourceDialect,
706 0x2d727bf2dd3e231c,
707 >(_buf?)?;
708 Ok(_response.settings)
709 }
710 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, MacAddressFilterSettings>(
711 (),
712 0x2d727bf2dd3e231c,
713 fidl::encoding::DynamicFlags::empty(),
714 _decode,
715 )
716 }
717
718 type GetNeighborTableResponseFut = fidl::client::QueryResponseFut<
719 Vec<NeighborInfo>,
720 fidl::encoding::DefaultFuchsiaResourceDialect,
721 >;
722 fn r#get_neighbor_table(&self) -> Self::GetNeighborTableResponseFut {
723 fn _decode(
724 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
725 ) -> Result<Vec<NeighborInfo>, fidl::Error> {
726 let _response = fidl::client::decode_transaction_body::<
727 DeviceTestGetNeighborTableResponse,
728 fidl::encoding::DefaultFuchsiaResourceDialect,
729 0x6f2db4573c413cde,
730 >(_buf?)?;
731 Ok(_response.neighbor_table)
732 }
733 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<NeighborInfo>>(
734 (),
735 0x6f2db4573c413cde,
736 fidl::encoding::DynamicFlags::empty(),
737 _decode,
738 )
739 }
740}
741
742pub struct DeviceTestEventStream {
743 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
744}
745
746impl std::marker::Unpin for DeviceTestEventStream {}
747
748impl futures::stream::FusedStream for DeviceTestEventStream {
749 fn is_terminated(&self) -> bool {
750 self.event_receiver.is_terminated()
751 }
752}
753
754impl futures::Stream for DeviceTestEventStream {
755 type Item = Result<DeviceTestEvent, fidl::Error>;
756
757 fn poll_next(
758 mut self: std::pin::Pin<&mut Self>,
759 cx: &mut std::task::Context<'_>,
760 ) -> std::task::Poll<Option<Self::Item>> {
761 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
762 &mut self.event_receiver,
763 cx
764 )?) {
765 Some(buf) => std::task::Poll::Ready(Some(DeviceTestEvent::decode(buf))),
766 None => std::task::Poll::Ready(None),
767 }
768 }
769}
770
771#[derive(Debug)]
772pub enum DeviceTestEvent {}
773
774impl DeviceTestEvent {
775 fn decode(
777 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
778 ) -> Result<DeviceTestEvent, fidl::Error> {
779 let (bytes, _handles) = buf.split_mut();
780 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
781 debug_assert_eq!(tx_header.tx_id, 0);
782 match tx_header.ordinal {
783 _ => Err(fidl::Error::UnknownOrdinal {
784 ordinal: tx_header.ordinal,
785 protocol_name: <DeviceTestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
786 }),
787 }
788 }
789}
790
791pub struct DeviceTestRequestStream {
793 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
794 is_terminated: bool,
795}
796
797impl std::marker::Unpin for DeviceTestRequestStream {}
798
799impl futures::stream::FusedStream for DeviceTestRequestStream {
800 fn is_terminated(&self) -> bool {
801 self.is_terminated
802 }
803}
804
805impl fidl::endpoints::RequestStream for DeviceTestRequestStream {
806 type Protocol = DeviceTestMarker;
807 type ControlHandle = DeviceTestControlHandle;
808
809 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
810 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
811 }
812
813 fn control_handle(&self) -> Self::ControlHandle {
814 DeviceTestControlHandle { inner: self.inner.clone() }
815 }
816
817 fn into_inner(
818 self,
819 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
820 {
821 (self.inner, self.is_terminated)
822 }
823
824 fn from_inner(
825 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
826 is_terminated: bool,
827 ) -> Self {
828 Self { inner, is_terminated }
829 }
830}
831
832impl futures::Stream for DeviceTestRequestStream {
833 type Item = Result<DeviceTestRequest, fidl::Error>;
834
835 fn poll_next(
836 mut self: std::pin::Pin<&mut Self>,
837 cx: &mut std::task::Context<'_>,
838 ) -> std::task::Poll<Option<Self::Item>> {
839 let this = &mut *self;
840 if this.inner.check_shutdown(cx) {
841 this.is_terminated = true;
842 return std::task::Poll::Ready(None);
843 }
844 if this.is_terminated {
845 panic!("polled DeviceTestRequestStream after completion");
846 }
847 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
848 |bytes, handles| {
849 match this.inner.channel().read_etc(cx, bytes, handles) {
850 std::task::Poll::Ready(Ok(())) => {}
851 std::task::Poll::Pending => return std::task::Poll::Pending,
852 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
853 this.is_terminated = true;
854 return std::task::Poll::Ready(None);
855 }
856 std::task::Poll::Ready(Err(e)) => {
857 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
858 e.into(),
859 ))))
860 }
861 }
862
863 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
865
866 std::task::Poll::Ready(Some(match header.ordinal {
867 0x772795fd82e287e => {
868 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
869 let mut req = fidl::new_empty!(
870 fidl::encoding::EmptyPayload,
871 fidl::encoding::DefaultFuchsiaResourceDialect
872 );
873 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
874 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
875 Ok(DeviceTestRequest::Reset {
876 responder: DeviceTestResetResponder {
877 control_handle: std::mem::ManuallyDrop::new(control_handle),
878 tx_id: header.tx_id,
879 },
880 })
881 }
882 0x5006d66ecaa992f2 => {
883 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
884 let mut req = fidl::new_empty!(
885 fidl::encoding::EmptyPayload,
886 fidl::encoding::DefaultFuchsiaResourceDialect
887 );
888 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
889 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
890 Ok(DeviceTestRequest::GetNcpVersion {
891 responder: DeviceTestGetNcpVersionResponder {
892 control_handle: std::mem::ManuallyDrop::new(control_handle),
893 tx_id: header.tx_id,
894 },
895 })
896 }
897 0x6ac289cf16a976ab => {
898 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
899 let mut req = fidl::new_empty!(
900 fidl::encoding::EmptyPayload,
901 fidl::encoding::DefaultFuchsiaResourceDialect
902 );
903 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
904 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
905 Ok(DeviceTestRequest::GetCurrentRssi {
906 responder: DeviceTestGetCurrentRssiResponder {
907 control_handle: std::mem::ManuallyDrop::new(control_handle),
908 tx_id: header.tx_id,
909 },
910 })
911 }
912 0x2a32094f1da3372 => {
913 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
914 let mut req = fidl::new_empty!(
915 fidl::encoding::EmptyPayload,
916 fidl::encoding::DefaultFuchsiaResourceDialect
917 );
918 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
919 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
920 Ok(DeviceTestRequest::GetFactoryMacAddress {
921 responder: DeviceTestGetFactoryMacAddressResponder {
922 control_handle: std::mem::ManuallyDrop::new(control_handle),
923 tx_id: header.tx_id,
924 },
925 })
926 }
927 0x39fc2f974a484b62 => {
928 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
929 let mut req = fidl::new_empty!(
930 fidl::encoding::EmptyPayload,
931 fidl::encoding::DefaultFuchsiaResourceDialect
932 );
933 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
934 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
935 Ok(DeviceTestRequest::GetCurrentMacAddress {
936 responder: DeviceTestGetCurrentMacAddressResponder {
937 control_handle: std::mem::ManuallyDrop::new(control_handle),
938 tx_id: header.tx_id,
939 },
940 })
941 }
942 0x2bd32ba980668d13 => {
943 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
944 let mut req = fidl::new_empty!(
945 fidl::encoding::EmptyPayload,
946 fidl::encoding::DefaultFuchsiaResourceDialect
947 );
948 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
949 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
950 Ok(DeviceTestRequest::GetCurrentChannel {
951 responder: DeviceTestGetCurrentChannelResponder {
952 control_handle: std::mem::ManuallyDrop::new(control_handle),
953 tx_id: header.tx_id,
954 },
955 })
956 }
957 0x32be448a6dc88b33 => {
958 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
959 let mut req = fidl::new_empty!(
960 fidl::encoding::EmptyPayload,
961 fidl::encoding::DefaultFuchsiaResourceDialect
962 );
963 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
964 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
965 Ok(DeviceTestRequest::GetPartitionId {
966 responder: DeviceTestGetPartitionIdResponder {
967 control_handle: std::mem::ManuallyDrop::new(control_handle),
968 tx_id: header.tx_id,
969 },
970 })
971 }
972 0x4e554e42c1953d31 => {
973 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
974 let mut req = fidl::new_empty!(
975 fidl::encoding::EmptyPayload,
976 fidl::encoding::DefaultFuchsiaResourceDialect
977 );
978 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
979 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
980 Ok(DeviceTestRequest::GetThreadRloc16 {
981 responder: DeviceTestGetThreadRloc16Responder {
982 control_handle: std::mem::ManuallyDrop::new(control_handle),
983 tx_id: header.tx_id,
984 },
985 })
986 }
987 0x753df71fce9f3563 => {
988 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
989 let mut req = fidl::new_empty!(
990 fidl::encoding::EmptyPayload,
991 fidl::encoding::DefaultFuchsiaResourceDialect
992 );
993 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
994 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
995 Ok(DeviceTestRequest::GetThreadRouterId {
996 responder: DeviceTestGetThreadRouterIdResponder {
997 control_handle: std::mem::ManuallyDrop::new(control_handle),
998 tx_id: header.tx_id,
999 },
1000 })
1001 }
1002 0x66eb4780f869de19 => {
1003 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1004 let mut req = fidl::new_empty!(
1005 DeviceTestReplaceMacAddressFilterSettingsRequest,
1006 fidl::encoding::DefaultFuchsiaResourceDialect
1007 );
1008 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceTestReplaceMacAddressFilterSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
1009 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
1010 Ok(DeviceTestRequest::ReplaceMacAddressFilterSettings {
1011 settings: req.settings,
1012
1013 responder: DeviceTestReplaceMacAddressFilterSettingsResponder {
1014 control_handle: std::mem::ManuallyDrop::new(control_handle),
1015 tx_id: header.tx_id,
1016 },
1017 })
1018 }
1019 0x2d727bf2dd3e231c => {
1020 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1021 let mut req = fidl::new_empty!(
1022 fidl::encoding::EmptyPayload,
1023 fidl::encoding::DefaultFuchsiaResourceDialect
1024 );
1025 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1026 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
1027 Ok(DeviceTestRequest::GetMacAddressFilterSettings {
1028 responder: DeviceTestGetMacAddressFilterSettingsResponder {
1029 control_handle: std::mem::ManuallyDrop::new(control_handle),
1030 tx_id: header.tx_id,
1031 },
1032 })
1033 }
1034 0x6f2db4573c413cde => {
1035 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1036 let mut req = fidl::new_empty!(
1037 fidl::encoding::EmptyPayload,
1038 fidl::encoding::DefaultFuchsiaResourceDialect
1039 );
1040 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1041 let control_handle = DeviceTestControlHandle { inner: this.inner.clone() };
1042 Ok(DeviceTestRequest::GetNeighborTable {
1043 responder: DeviceTestGetNeighborTableResponder {
1044 control_handle: std::mem::ManuallyDrop::new(control_handle),
1045 tx_id: header.tx_id,
1046 },
1047 })
1048 }
1049 _ => Err(fidl::Error::UnknownOrdinal {
1050 ordinal: header.ordinal,
1051 protocol_name:
1052 <DeviceTestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1053 }),
1054 }))
1055 },
1056 )
1057 }
1058}
1059
1060#[derive(Debug)]
1061pub enum DeviceTestRequest {
1062 Reset {
1072 responder: DeviceTestResetResponder,
1073 },
1074 GetNcpVersion {
1077 responder: DeviceTestGetNcpVersionResponder,
1078 },
1079 GetCurrentRssi {
1081 responder: DeviceTestGetCurrentRssiResponder,
1082 },
1083 GetFactoryMacAddress {
1085 responder: DeviceTestGetFactoryMacAddressResponder,
1086 },
1087 GetCurrentMacAddress {
1090 responder: DeviceTestGetCurrentMacAddressResponder,
1091 },
1092 GetCurrentChannel {
1094 responder: DeviceTestGetCurrentChannelResponder,
1095 },
1096 GetPartitionId {
1099 responder: DeviceTestGetPartitionIdResponder,
1100 },
1101 GetThreadRloc16 {
1102 responder: DeviceTestGetThreadRloc16Responder,
1103 },
1104 GetThreadRouterId {
1105 responder: DeviceTestGetThreadRouterIdResponder,
1106 },
1107 ReplaceMacAddressFilterSettings {
1111 settings: MacAddressFilterSettings,
1112 responder: DeviceTestReplaceMacAddressFilterSettingsResponder,
1113 },
1114 GetMacAddressFilterSettings {
1116 responder: DeviceTestGetMacAddressFilterSettingsResponder,
1117 },
1118 GetNeighborTable {
1120 responder: DeviceTestGetNeighborTableResponder,
1121 },
1122}
1123
1124impl DeviceTestRequest {
1125 #[allow(irrefutable_let_patterns)]
1126 pub fn into_reset(self) -> Option<(DeviceTestResetResponder)> {
1127 if let DeviceTestRequest::Reset { responder } = self {
1128 Some((responder))
1129 } else {
1130 None
1131 }
1132 }
1133
1134 #[allow(irrefutable_let_patterns)]
1135 pub fn into_get_ncp_version(self) -> Option<(DeviceTestGetNcpVersionResponder)> {
1136 if let DeviceTestRequest::GetNcpVersion { responder } = self {
1137 Some((responder))
1138 } else {
1139 None
1140 }
1141 }
1142
1143 #[allow(irrefutable_let_patterns)]
1144 pub fn into_get_current_rssi(self) -> Option<(DeviceTestGetCurrentRssiResponder)> {
1145 if let DeviceTestRequest::GetCurrentRssi { responder } = self {
1146 Some((responder))
1147 } else {
1148 None
1149 }
1150 }
1151
1152 #[allow(irrefutable_let_patterns)]
1153 pub fn into_get_factory_mac_address(self) -> Option<(DeviceTestGetFactoryMacAddressResponder)> {
1154 if let DeviceTestRequest::GetFactoryMacAddress { responder } = self {
1155 Some((responder))
1156 } else {
1157 None
1158 }
1159 }
1160
1161 #[allow(irrefutable_let_patterns)]
1162 pub fn into_get_current_mac_address(self) -> Option<(DeviceTestGetCurrentMacAddressResponder)> {
1163 if let DeviceTestRequest::GetCurrentMacAddress { responder } = self {
1164 Some((responder))
1165 } else {
1166 None
1167 }
1168 }
1169
1170 #[allow(irrefutable_let_patterns)]
1171 pub fn into_get_current_channel(self) -> Option<(DeviceTestGetCurrentChannelResponder)> {
1172 if let DeviceTestRequest::GetCurrentChannel { responder } = self {
1173 Some((responder))
1174 } else {
1175 None
1176 }
1177 }
1178
1179 #[allow(irrefutable_let_patterns)]
1180 pub fn into_get_partition_id(self) -> Option<(DeviceTestGetPartitionIdResponder)> {
1181 if let DeviceTestRequest::GetPartitionId { responder } = self {
1182 Some((responder))
1183 } else {
1184 None
1185 }
1186 }
1187
1188 #[allow(irrefutable_let_patterns)]
1189 pub fn into_get_thread_rloc16(self) -> Option<(DeviceTestGetThreadRloc16Responder)> {
1190 if let DeviceTestRequest::GetThreadRloc16 { responder } = self {
1191 Some((responder))
1192 } else {
1193 None
1194 }
1195 }
1196
1197 #[allow(irrefutable_let_patterns)]
1198 pub fn into_get_thread_router_id(self) -> Option<(DeviceTestGetThreadRouterIdResponder)> {
1199 if let DeviceTestRequest::GetThreadRouterId { responder } = self {
1200 Some((responder))
1201 } else {
1202 None
1203 }
1204 }
1205
1206 #[allow(irrefutable_let_patterns)]
1207 pub fn into_replace_mac_address_filter_settings(
1208 self,
1209 ) -> Option<(MacAddressFilterSettings, DeviceTestReplaceMacAddressFilterSettingsResponder)>
1210 {
1211 if let DeviceTestRequest::ReplaceMacAddressFilterSettings { settings, responder } = self {
1212 Some((settings, responder))
1213 } else {
1214 None
1215 }
1216 }
1217
1218 #[allow(irrefutable_let_patterns)]
1219 pub fn into_get_mac_address_filter_settings(
1220 self,
1221 ) -> Option<(DeviceTestGetMacAddressFilterSettingsResponder)> {
1222 if let DeviceTestRequest::GetMacAddressFilterSettings { responder } = self {
1223 Some((responder))
1224 } else {
1225 None
1226 }
1227 }
1228
1229 #[allow(irrefutable_let_patterns)]
1230 pub fn into_get_neighbor_table(self) -> Option<(DeviceTestGetNeighborTableResponder)> {
1231 if let DeviceTestRequest::GetNeighborTable { responder } = self {
1232 Some((responder))
1233 } else {
1234 None
1235 }
1236 }
1237
1238 pub fn method_name(&self) -> &'static str {
1240 match *self {
1241 DeviceTestRequest::Reset { .. } => "reset",
1242 DeviceTestRequest::GetNcpVersion { .. } => "get_ncp_version",
1243 DeviceTestRequest::GetCurrentRssi { .. } => "get_current_rssi",
1244 DeviceTestRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
1245 DeviceTestRequest::GetCurrentMacAddress { .. } => "get_current_mac_address",
1246 DeviceTestRequest::GetCurrentChannel { .. } => "get_current_channel",
1247 DeviceTestRequest::GetPartitionId { .. } => "get_partition_id",
1248 DeviceTestRequest::GetThreadRloc16 { .. } => "get_thread_rloc16",
1249 DeviceTestRequest::GetThreadRouterId { .. } => "get_thread_router_id",
1250 DeviceTestRequest::ReplaceMacAddressFilterSettings { .. } => {
1251 "replace_mac_address_filter_settings"
1252 }
1253 DeviceTestRequest::GetMacAddressFilterSettings { .. } => {
1254 "get_mac_address_filter_settings"
1255 }
1256 DeviceTestRequest::GetNeighborTable { .. } => "get_neighbor_table",
1257 }
1258 }
1259}
1260
1261#[derive(Debug, Clone)]
1262pub struct DeviceTestControlHandle {
1263 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1264}
1265
1266impl fidl::endpoints::ControlHandle for DeviceTestControlHandle {
1267 fn shutdown(&self) {
1268 self.inner.shutdown()
1269 }
1270 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1271 self.inner.shutdown_with_epitaph(status)
1272 }
1273
1274 fn is_closed(&self) -> bool {
1275 self.inner.channel().is_closed()
1276 }
1277 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1278 self.inner.channel().on_closed()
1279 }
1280
1281 #[cfg(target_os = "fuchsia")]
1282 fn signal_peer(
1283 &self,
1284 clear_mask: zx::Signals,
1285 set_mask: zx::Signals,
1286 ) -> Result<(), zx_status::Status> {
1287 use fidl::Peered;
1288 self.inner.channel().signal_peer(clear_mask, set_mask)
1289 }
1290}
1291
1292impl DeviceTestControlHandle {}
1293
1294#[must_use = "FIDL methods require a response to be sent"]
1295#[derive(Debug)]
1296pub struct DeviceTestResetResponder {
1297 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1298 tx_id: u32,
1299}
1300
1301impl std::ops::Drop for DeviceTestResetResponder {
1305 fn drop(&mut self) {
1306 self.control_handle.shutdown();
1307 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1309 }
1310}
1311
1312impl fidl::endpoints::Responder for DeviceTestResetResponder {
1313 type ControlHandle = DeviceTestControlHandle;
1314
1315 fn control_handle(&self) -> &DeviceTestControlHandle {
1316 &self.control_handle
1317 }
1318
1319 fn drop_without_shutdown(mut self) {
1320 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1322 std::mem::forget(self);
1324 }
1325}
1326
1327impl DeviceTestResetResponder {
1328 pub fn send(self) -> Result<(), fidl::Error> {
1332 let _result = self.send_raw();
1333 if _result.is_err() {
1334 self.control_handle.shutdown();
1335 }
1336 self.drop_without_shutdown();
1337 _result
1338 }
1339
1340 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1342 let _result = self.send_raw();
1343 self.drop_without_shutdown();
1344 _result
1345 }
1346
1347 fn send_raw(&self) -> Result<(), fidl::Error> {
1348 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1349 (),
1350 self.tx_id,
1351 0x772795fd82e287e,
1352 fidl::encoding::DynamicFlags::empty(),
1353 )
1354 }
1355}
1356
1357#[must_use = "FIDL methods require a response to be sent"]
1358#[derive(Debug)]
1359pub struct DeviceTestGetNcpVersionResponder {
1360 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1361 tx_id: u32,
1362}
1363
1364impl std::ops::Drop for DeviceTestGetNcpVersionResponder {
1368 fn drop(&mut self) {
1369 self.control_handle.shutdown();
1370 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1372 }
1373}
1374
1375impl fidl::endpoints::Responder for DeviceTestGetNcpVersionResponder {
1376 type ControlHandle = DeviceTestControlHandle;
1377
1378 fn control_handle(&self) -> &DeviceTestControlHandle {
1379 &self.control_handle
1380 }
1381
1382 fn drop_without_shutdown(mut self) {
1383 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1385 std::mem::forget(self);
1387 }
1388}
1389
1390impl DeviceTestGetNcpVersionResponder {
1391 pub fn send(self, mut version: &str) -> Result<(), fidl::Error> {
1395 let _result = self.send_raw(version);
1396 if _result.is_err() {
1397 self.control_handle.shutdown();
1398 }
1399 self.drop_without_shutdown();
1400 _result
1401 }
1402
1403 pub fn send_no_shutdown_on_err(self, mut version: &str) -> Result<(), fidl::Error> {
1405 let _result = self.send_raw(version);
1406 self.drop_without_shutdown();
1407 _result
1408 }
1409
1410 fn send_raw(&self, mut version: &str) -> Result<(), fidl::Error> {
1411 self.control_handle.inner.send::<DeviceTestGetNcpVersionResponse>(
1412 (version,),
1413 self.tx_id,
1414 0x5006d66ecaa992f2,
1415 fidl::encoding::DynamicFlags::empty(),
1416 )
1417 }
1418}
1419
1420#[must_use = "FIDL methods require a response to be sent"]
1421#[derive(Debug)]
1422pub struct DeviceTestGetCurrentRssiResponder {
1423 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1424 tx_id: u32,
1425}
1426
1427impl std::ops::Drop for DeviceTestGetCurrentRssiResponder {
1431 fn drop(&mut self) {
1432 self.control_handle.shutdown();
1433 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1435 }
1436}
1437
1438impl fidl::endpoints::Responder for DeviceTestGetCurrentRssiResponder {
1439 type ControlHandle = DeviceTestControlHandle;
1440
1441 fn control_handle(&self) -> &DeviceTestControlHandle {
1442 &self.control_handle
1443 }
1444
1445 fn drop_without_shutdown(mut self) {
1446 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1448 std::mem::forget(self);
1450 }
1451}
1452
1453impl DeviceTestGetCurrentRssiResponder {
1454 pub fn send(self, mut rssi: i8) -> Result<(), fidl::Error> {
1458 let _result = self.send_raw(rssi);
1459 if _result.is_err() {
1460 self.control_handle.shutdown();
1461 }
1462 self.drop_without_shutdown();
1463 _result
1464 }
1465
1466 pub fn send_no_shutdown_on_err(self, mut rssi: i8) -> Result<(), fidl::Error> {
1468 let _result = self.send_raw(rssi);
1469 self.drop_without_shutdown();
1470 _result
1471 }
1472
1473 fn send_raw(&self, mut rssi: i8) -> Result<(), fidl::Error> {
1474 self.control_handle.inner.send::<DeviceTestGetCurrentRssiResponse>(
1475 (rssi,),
1476 self.tx_id,
1477 0x6ac289cf16a976ab,
1478 fidl::encoding::DynamicFlags::empty(),
1479 )
1480 }
1481}
1482
1483#[must_use = "FIDL methods require a response to be sent"]
1484#[derive(Debug)]
1485pub struct DeviceTestGetFactoryMacAddressResponder {
1486 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1487 tx_id: u32,
1488}
1489
1490impl std::ops::Drop for DeviceTestGetFactoryMacAddressResponder {
1494 fn drop(&mut self) {
1495 self.control_handle.shutdown();
1496 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1498 }
1499}
1500
1501impl fidl::endpoints::Responder for DeviceTestGetFactoryMacAddressResponder {
1502 type ControlHandle = DeviceTestControlHandle;
1503
1504 fn control_handle(&self) -> &DeviceTestControlHandle {
1505 &self.control_handle
1506 }
1507
1508 fn drop_without_shutdown(mut self) {
1509 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1511 std::mem::forget(self);
1513 }
1514}
1515
1516impl DeviceTestGetFactoryMacAddressResponder {
1517 pub fn send(self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1521 let _result = self.send_raw(address);
1522 if _result.is_err() {
1523 self.control_handle.shutdown();
1524 }
1525 self.drop_without_shutdown();
1526 _result
1527 }
1528
1529 pub fn send_no_shutdown_on_err(
1531 self,
1532 mut address: &fidl_fuchsia_lowpan::MacAddress,
1533 ) -> Result<(), fidl::Error> {
1534 let _result = self.send_raw(address);
1535 self.drop_without_shutdown();
1536 _result
1537 }
1538
1539 fn send_raw(&self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1540 self.control_handle.inner.send::<DeviceTestGetFactoryMacAddressResponse>(
1541 (address,),
1542 self.tx_id,
1543 0x2a32094f1da3372,
1544 fidl::encoding::DynamicFlags::empty(),
1545 )
1546 }
1547}
1548
1549#[must_use = "FIDL methods require a response to be sent"]
1550#[derive(Debug)]
1551pub struct DeviceTestGetCurrentMacAddressResponder {
1552 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1553 tx_id: u32,
1554}
1555
1556impl std::ops::Drop for DeviceTestGetCurrentMacAddressResponder {
1560 fn drop(&mut self) {
1561 self.control_handle.shutdown();
1562 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1564 }
1565}
1566
1567impl fidl::endpoints::Responder for DeviceTestGetCurrentMacAddressResponder {
1568 type ControlHandle = DeviceTestControlHandle;
1569
1570 fn control_handle(&self) -> &DeviceTestControlHandle {
1571 &self.control_handle
1572 }
1573
1574 fn drop_without_shutdown(mut self) {
1575 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1577 std::mem::forget(self);
1579 }
1580}
1581
1582impl DeviceTestGetCurrentMacAddressResponder {
1583 pub fn send(self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1587 let _result = self.send_raw(address);
1588 if _result.is_err() {
1589 self.control_handle.shutdown();
1590 }
1591 self.drop_without_shutdown();
1592 _result
1593 }
1594
1595 pub fn send_no_shutdown_on_err(
1597 self,
1598 mut address: &fidl_fuchsia_lowpan::MacAddress,
1599 ) -> Result<(), fidl::Error> {
1600 let _result = self.send_raw(address);
1601 self.drop_without_shutdown();
1602 _result
1603 }
1604
1605 fn send_raw(&self, mut address: &fidl_fuchsia_lowpan::MacAddress) -> Result<(), fidl::Error> {
1606 self.control_handle.inner.send::<DeviceTestGetCurrentMacAddressResponse>(
1607 (address,),
1608 self.tx_id,
1609 0x39fc2f974a484b62,
1610 fidl::encoding::DynamicFlags::empty(),
1611 )
1612 }
1613}
1614
1615#[must_use = "FIDL methods require a response to be sent"]
1616#[derive(Debug)]
1617pub struct DeviceTestGetCurrentChannelResponder {
1618 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1619 tx_id: u32,
1620}
1621
1622impl std::ops::Drop for DeviceTestGetCurrentChannelResponder {
1626 fn drop(&mut self) {
1627 self.control_handle.shutdown();
1628 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1630 }
1631}
1632
1633impl fidl::endpoints::Responder for DeviceTestGetCurrentChannelResponder {
1634 type ControlHandle = DeviceTestControlHandle;
1635
1636 fn control_handle(&self) -> &DeviceTestControlHandle {
1637 &self.control_handle
1638 }
1639
1640 fn drop_without_shutdown(mut self) {
1641 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1643 std::mem::forget(self);
1645 }
1646}
1647
1648impl DeviceTestGetCurrentChannelResponder {
1649 pub fn send(self, mut channel_index: u16) -> Result<(), fidl::Error> {
1653 let _result = self.send_raw(channel_index);
1654 if _result.is_err() {
1655 self.control_handle.shutdown();
1656 }
1657 self.drop_without_shutdown();
1658 _result
1659 }
1660
1661 pub fn send_no_shutdown_on_err(self, mut channel_index: u16) -> Result<(), fidl::Error> {
1663 let _result = self.send_raw(channel_index);
1664 self.drop_without_shutdown();
1665 _result
1666 }
1667
1668 fn send_raw(&self, mut channel_index: u16) -> Result<(), fidl::Error> {
1669 self.control_handle.inner.send::<DeviceTestGetCurrentChannelResponse>(
1670 (channel_index,),
1671 self.tx_id,
1672 0x2bd32ba980668d13,
1673 fidl::encoding::DynamicFlags::empty(),
1674 )
1675 }
1676}
1677
1678#[must_use = "FIDL methods require a response to be sent"]
1679#[derive(Debug)]
1680pub struct DeviceTestGetPartitionIdResponder {
1681 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1682 tx_id: u32,
1683}
1684
1685impl std::ops::Drop for DeviceTestGetPartitionIdResponder {
1689 fn drop(&mut self) {
1690 self.control_handle.shutdown();
1691 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1693 }
1694}
1695
1696impl fidl::endpoints::Responder for DeviceTestGetPartitionIdResponder {
1697 type ControlHandle = DeviceTestControlHandle;
1698
1699 fn control_handle(&self) -> &DeviceTestControlHandle {
1700 &self.control_handle
1701 }
1702
1703 fn drop_without_shutdown(mut self) {
1704 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1706 std::mem::forget(self);
1708 }
1709}
1710
1711impl DeviceTestGetPartitionIdResponder {
1712 pub fn send(self, mut pid: u32) -> Result<(), fidl::Error> {
1716 let _result = self.send_raw(pid);
1717 if _result.is_err() {
1718 self.control_handle.shutdown();
1719 }
1720 self.drop_without_shutdown();
1721 _result
1722 }
1723
1724 pub fn send_no_shutdown_on_err(self, mut pid: u32) -> Result<(), fidl::Error> {
1726 let _result = self.send_raw(pid);
1727 self.drop_without_shutdown();
1728 _result
1729 }
1730
1731 fn send_raw(&self, mut pid: u32) -> Result<(), fidl::Error> {
1732 self.control_handle.inner.send::<DeviceTestGetPartitionIdResponse>(
1733 (pid,),
1734 self.tx_id,
1735 0x32be448a6dc88b33,
1736 fidl::encoding::DynamicFlags::empty(),
1737 )
1738 }
1739}
1740
1741#[must_use = "FIDL methods require a response to be sent"]
1742#[derive(Debug)]
1743pub struct DeviceTestGetThreadRloc16Responder {
1744 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1745 tx_id: u32,
1746}
1747
1748impl std::ops::Drop for DeviceTestGetThreadRloc16Responder {
1752 fn drop(&mut self) {
1753 self.control_handle.shutdown();
1754 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1756 }
1757}
1758
1759impl fidl::endpoints::Responder for DeviceTestGetThreadRloc16Responder {
1760 type ControlHandle = DeviceTestControlHandle;
1761
1762 fn control_handle(&self) -> &DeviceTestControlHandle {
1763 &self.control_handle
1764 }
1765
1766 fn drop_without_shutdown(mut self) {
1767 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1769 std::mem::forget(self);
1771 }
1772}
1773
1774impl DeviceTestGetThreadRloc16Responder {
1775 pub fn send(self, mut rloc: u16) -> Result<(), fidl::Error> {
1779 let _result = self.send_raw(rloc);
1780 if _result.is_err() {
1781 self.control_handle.shutdown();
1782 }
1783 self.drop_without_shutdown();
1784 _result
1785 }
1786
1787 pub fn send_no_shutdown_on_err(self, mut rloc: u16) -> Result<(), fidl::Error> {
1789 let _result = self.send_raw(rloc);
1790 self.drop_without_shutdown();
1791 _result
1792 }
1793
1794 fn send_raw(&self, mut rloc: u16) -> Result<(), fidl::Error> {
1795 self.control_handle.inner.send::<DeviceTestGetThreadRloc16Response>(
1796 (rloc,),
1797 self.tx_id,
1798 0x4e554e42c1953d31,
1799 fidl::encoding::DynamicFlags::empty(),
1800 )
1801 }
1802}
1803
1804#[must_use = "FIDL methods require a response to be sent"]
1805#[derive(Debug)]
1806pub struct DeviceTestGetThreadRouterIdResponder {
1807 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1808 tx_id: u32,
1809}
1810
1811impl std::ops::Drop for DeviceTestGetThreadRouterIdResponder {
1815 fn drop(&mut self) {
1816 self.control_handle.shutdown();
1817 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1819 }
1820}
1821
1822impl fidl::endpoints::Responder for DeviceTestGetThreadRouterIdResponder {
1823 type ControlHandle = DeviceTestControlHandle;
1824
1825 fn control_handle(&self) -> &DeviceTestControlHandle {
1826 &self.control_handle
1827 }
1828
1829 fn drop_without_shutdown(mut self) {
1830 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1832 std::mem::forget(self);
1834 }
1835}
1836
1837impl DeviceTestGetThreadRouterIdResponder {
1838 pub fn send(self, mut router_id: u8) -> Result<(), fidl::Error> {
1842 let _result = self.send_raw(router_id);
1843 if _result.is_err() {
1844 self.control_handle.shutdown();
1845 }
1846 self.drop_without_shutdown();
1847 _result
1848 }
1849
1850 pub fn send_no_shutdown_on_err(self, mut router_id: u8) -> Result<(), fidl::Error> {
1852 let _result = self.send_raw(router_id);
1853 self.drop_without_shutdown();
1854 _result
1855 }
1856
1857 fn send_raw(&self, mut router_id: u8) -> Result<(), fidl::Error> {
1858 self.control_handle.inner.send::<DeviceTestGetThreadRouterIdResponse>(
1859 (router_id,),
1860 self.tx_id,
1861 0x753df71fce9f3563,
1862 fidl::encoding::DynamicFlags::empty(),
1863 )
1864 }
1865}
1866
1867#[must_use = "FIDL methods require a response to be sent"]
1868#[derive(Debug)]
1869pub struct DeviceTestReplaceMacAddressFilterSettingsResponder {
1870 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1871 tx_id: u32,
1872}
1873
1874impl std::ops::Drop for DeviceTestReplaceMacAddressFilterSettingsResponder {
1878 fn drop(&mut self) {
1879 self.control_handle.shutdown();
1880 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1882 }
1883}
1884
1885impl fidl::endpoints::Responder for DeviceTestReplaceMacAddressFilterSettingsResponder {
1886 type ControlHandle = DeviceTestControlHandle;
1887
1888 fn control_handle(&self) -> &DeviceTestControlHandle {
1889 &self.control_handle
1890 }
1891
1892 fn drop_without_shutdown(mut self) {
1893 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1895 std::mem::forget(self);
1897 }
1898}
1899
1900impl DeviceTestReplaceMacAddressFilterSettingsResponder {
1901 pub fn send(self) -> Result<(), fidl::Error> {
1905 let _result = self.send_raw();
1906 if _result.is_err() {
1907 self.control_handle.shutdown();
1908 }
1909 self.drop_without_shutdown();
1910 _result
1911 }
1912
1913 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1915 let _result = self.send_raw();
1916 self.drop_without_shutdown();
1917 _result
1918 }
1919
1920 fn send_raw(&self) -> Result<(), fidl::Error> {
1921 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1922 (),
1923 self.tx_id,
1924 0x66eb4780f869de19,
1925 fidl::encoding::DynamicFlags::empty(),
1926 )
1927 }
1928}
1929
1930#[must_use = "FIDL methods require a response to be sent"]
1931#[derive(Debug)]
1932pub struct DeviceTestGetMacAddressFilterSettingsResponder {
1933 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
1934 tx_id: u32,
1935}
1936
1937impl std::ops::Drop for DeviceTestGetMacAddressFilterSettingsResponder {
1941 fn drop(&mut self) {
1942 self.control_handle.shutdown();
1943 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1945 }
1946}
1947
1948impl fidl::endpoints::Responder for DeviceTestGetMacAddressFilterSettingsResponder {
1949 type ControlHandle = DeviceTestControlHandle;
1950
1951 fn control_handle(&self) -> &DeviceTestControlHandle {
1952 &self.control_handle
1953 }
1954
1955 fn drop_without_shutdown(mut self) {
1956 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1958 std::mem::forget(self);
1960 }
1961}
1962
1963impl DeviceTestGetMacAddressFilterSettingsResponder {
1964 pub fn send(self, mut settings: &MacAddressFilterSettings) -> Result<(), fidl::Error> {
1968 let _result = self.send_raw(settings);
1969 if _result.is_err() {
1970 self.control_handle.shutdown();
1971 }
1972 self.drop_without_shutdown();
1973 _result
1974 }
1975
1976 pub fn send_no_shutdown_on_err(
1978 self,
1979 mut settings: &MacAddressFilterSettings,
1980 ) -> Result<(), fidl::Error> {
1981 let _result = self.send_raw(settings);
1982 self.drop_without_shutdown();
1983 _result
1984 }
1985
1986 fn send_raw(&self, mut settings: &MacAddressFilterSettings) -> Result<(), fidl::Error> {
1987 self.control_handle.inner.send::<DeviceTestGetMacAddressFilterSettingsResponse>(
1988 (settings,),
1989 self.tx_id,
1990 0x2d727bf2dd3e231c,
1991 fidl::encoding::DynamicFlags::empty(),
1992 )
1993 }
1994}
1995
1996#[must_use = "FIDL methods require a response to be sent"]
1997#[derive(Debug)]
1998pub struct DeviceTestGetNeighborTableResponder {
1999 control_handle: std::mem::ManuallyDrop<DeviceTestControlHandle>,
2000 tx_id: u32,
2001}
2002
2003impl std::ops::Drop for DeviceTestGetNeighborTableResponder {
2007 fn drop(&mut self) {
2008 self.control_handle.shutdown();
2009 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2011 }
2012}
2013
2014impl fidl::endpoints::Responder for DeviceTestGetNeighborTableResponder {
2015 type ControlHandle = DeviceTestControlHandle;
2016
2017 fn control_handle(&self) -> &DeviceTestControlHandle {
2018 &self.control_handle
2019 }
2020
2021 fn drop_without_shutdown(mut self) {
2022 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2024 std::mem::forget(self);
2026 }
2027}
2028
2029impl DeviceTestGetNeighborTableResponder {
2030 pub fn send(self, mut neighbor_table: &[NeighborInfo]) -> Result<(), fidl::Error> {
2034 let _result = self.send_raw(neighbor_table);
2035 if _result.is_err() {
2036 self.control_handle.shutdown();
2037 }
2038 self.drop_without_shutdown();
2039 _result
2040 }
2041
2042 pub fn send_no_shutdown_on_err(
2044 self,
2045 mut neighbor_table: &[NeighborInfo],
2046 ) -> Result<(), fidl::Error> {
2047 let _result = self.send_raw(neighbor_table);
2048 self.drop_without_shutdown();
2049 _result
2050 }
2051
2052 fn send_raw(&self, mut neighbor_table: &[NeighborInfo]) -> Result<(), fidl::Error> {
2053 self.control_handle.inner.send::<DeviceTestGetNeighborTableResponse>(
2054 (neighbor_table,),
2055 self.tx_id,
2056 0x6f2db4573c413cde,
2057 fidl::encoding::DynamicFlags::empty(),
2058 )
2059 }
2060}
2061
2062#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2063pub struct DeviceTestConnectorMarker;
2064
2065impl fidl::endpoints::ProtocolMarker for DeviceTestConnectorMarker {
2066 type Proxy = DeviceTestConnectorProxy;
2067 type RequestStream = DeviceTestConnectorRequestStream;
2068 #[cfg(target_os = "fuchsia")]
2069 type SynchronousProxy = DeviceTestConnectorSynchronousProxy;
2070
2071 const DEBUG_NAME: &'static str = "fuchsia.lowpan.test.DeviceTestConnector";
2072}
2073impl fidl::endpoints::DiscoverableProtocolMarker for DeviceTestConnectorMarker {}
2074
2075pub trait DeviceTestConnectorProxyInterface: Send + Sync {
2076 fn r#connect(
2077 &self,
2078 name: &str,
2079 server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2080 ) -> Result<(), fidl::Error>;
2081}
2082#[derive(Debug)]
2083#[cfg(target_os = "fuchsia")]
2084pub struct DeviceTestConnectorSynchronousProxy {
2085 client: fidl::client::sync::Client,
2086}
2087
2088#[cfg(target_os = "fuchsia")]
2089impl fidl::endpoints::SynchronousProxy for DeviceTestConnectorSynchronousProxy {
2090 type Proxy = DeviceTestConnectorProxy;
2091 type Protocol = DeviceTestConnectorMarker;
2092
2093 fn from_channel(inner: fidl::Channel) -> Self {
2094 Self::new(inner)
2095 }
2096
2097 fn into_channel(self) -> fidl::Channel {
2098 self.client.into_channel()
2099 }
2100
2101 fn as_channel(&self) -> &fidl::Channel {
2102 self.client.as_channel()
2103 }
2104}
2105
2106#[cfg(target_os = "fuchsia")]
2107impl DeviceTestConnectorSynchronousProxy {
2108 pub fn new(channel: fidl::Channel) -> Self {
2109 let protocol_name =
2110 <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2111 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2112 }
2113
2114 pub fn into_channel(self) -> fidl::Channel {
2115 self.client.into_channel()
2116 }
2117
2118 pub fn wait_for_event(
2121 &self,
2122 deadline: zx::MonotonicInstant,
2123 ) -> Result<DeviceTestConnectorEvent, fidl::Error> {
2124 DeviceTestConnectorEvent::decode(self.client.wait_for_event(deadline)?)
2125 }
2126
2127 pub fn r#connect(
2144 &self,
2145 mut name: &str,
2146 mut server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2147 ) -> Result<(), fidl::Error> {
2148 self.client.send::<DeviceTestConnectorConnectRequest>(
2149 (name, server_end),
2150 0x366c1167cee8caa3,
2151 fidl::encoding::DynamicFlags::empty(),
2152 )
2153 }
2154}
2155
2156#[cfg(target_os = "fuchsia")]
2157impl From<DeviceTestConnectorSynchronousProxy> for zx::Handle {
2158 fn from(value: DeviceTestConnectorSynchronousProxy) -> Self {
2159 value.into_channel().into()
2160 }
2161}
2162
2163#[cfg(target_os = "fuchsia")]
2164impl From<fidl::Channel> for DeviceTestConnectorSynchronousProxy {
2165 fn from(value: fidl::Channel) -> Self {
2166 Self::new(value)
2167 }
2168}
2169
2170#[derive(Debug, Clone)]
2171pub struct DeviceTestConnectorProxy {
2172 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2173}
2174
2175impl fidl::endpoints::Proxy for DeviceTestConnectorProxy {
2176 type Protocol = DeviceTestConnectorMarker;
2177
2178 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2179 Self::new(inner)
2180 }
2181
2182 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2183 self.client.into_channel().map_err(|client| Self { client })
2184 }
2185
2186 fn as_channel(&self) -> &::fidl::AsyncChannel {
2187 self.client.as_channel()
2188 }
2189}
2190
2191impl DeviceTestConnectorProxy {
2192 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2194 let protocol_name =
2195 <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2196 Self { client: fidl::client::Client::new(channel, protocol_name) }
2197 }
2198
2199 pub fn take_event_stream(&self) -> DeviceTestConnectorEventStream {
2205 DeviceTestConnectorEventStream { event_receiver: self.client.take_event_receiver() }
2206 }
2207
2208 pub fn r#connect(
2225 &self,
2226 mut name: &str,
2227 mut server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2228 ) -> Result<(), fidl::Error> {
2229 DeviceTestConnectorProxyInterface::r#connect(self, name, server_end)
2230 }
2231}
2232
2233impl DeviceTestConnectorProxyInterface for DeviceTestConnectorProxy {
2234 fn r#connect(
2235 &self,
2236 mut name: &str,
2237 mut server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2238 ) -> Result<(), fidl::Error> {
2239 self.client.send::<DeviceTestConnectorConnectRequest>(
2240 (name, server_end),
2241 0x366c1167cee8caa3,
2242 fidl::encoding::DynamicFlags::empty(),
2243 )
2244 }
2245}
2246
2247pub struct DeviceTestConnectorEventStream {
2248 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2249}
2250
2251impl std::marker::Unpin for DeviceTestConnectorEventStream {}
2252
2253impl futures::stream::FusedStream for DeviceTestConnectorEventStream {
2254 fn is_terminated(&self) -> bool {
2255 self.event_receiver.is_terminated()
2256 }
2257}
2258
2259impl futures::Stream for DeviceTestConnectorEventStream {
2260 type Item = Result<DeviceTestConnectorEvent, fidl::Error>;
2261
2262 fn poll_next(
2263 mut self: std::pin::Pin<&mut Self>,
2264 cx: &mut std::task::Context<'_>,
2265 ) -> std::task::Poll<Option<Self::Item>> {
2266 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2267 &mut self.event_receiver,
2268 cx
2269 )?) {
2270 Some(buf) => std::task::Poll::Ready(Some(DeviceTestConnectorEvent::decode(buf))),
2271 None => std::task::Poll::Ready(None),
2272 }
2273 }
2274}
2275
2276#[derive(Debug)]
2277pub enum DeviceTestConnectorEvent {}
2278
2279impl DeviceTestConnectorEvent {
2280 fn decode(
2282 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2283 ) -> Result<DeviceTestConnectorEvent, fidl::Error> {
2284 let (bytes, _handles) = buf.split_mut();
2285 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2286 debug_assert_eq!(tx_header.tx_id, 0);
2287 match tx_header.ordinal {
2288 _ => Err(fidl::Error::UnknownOrdinal {
2289 ordinal: tx_header.ordinal,
2290 protocol_name:
2291 <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2292 }),
2293 }
2294 }
2295}
2296
2297pub struct DeviceTestConnectorRequestStream {
2299 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2300 is_terminated: bool,
2301}
2302
2303impl std::marker::Unpin for DeviceTestConnectorRequestStream {}
2304
2305impl futures::stream::FusedStream for DeviceTestConnectorRequestStream {
2306 fn is_terminated(&self) -> bool {
2307 self.is_terminated
2308 }
2309}
2310
2311impl fidl::endpoints::RequestStream for DeviceTestConnectorRequestStream {
2312 type Protocol = DeviceTestConnectorMarker;
2313 type ControlHandle = DeviceTestConnectorControlHandle;
2314
2315 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2316 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2317 }
2318
2319 fn control_handle(&self) -> Self::ControlHandle {
2320 DeviceTestConnectorControlHandle { inner: self.inner.clone() }
2321 }
2322
2323 fn into_inner(
2324 self,
2325 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2326 {
2327 (self.inner, self.is_terminated)
2328 }
2329
2330 fn from_inner(
2331 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2332 is_terminated: bool,
2333 ) -> Self {
2334 Self { inner, is_terminated }
2335 }
2336}
2337
2338impl futures::Stream for DeviceTestConnectorRequestStream {
2339 type Item = Result<DeviceTestConnectorRequest, fidl::Error>;
2340
2341 fn poll_next(
2342 mut self: std::pin::Pin<&mut Self>,
2343 cx: &mut std::task::Context<'_>,
2344 ) -> std::task::Poll<Option<Self::Item>> {
2345 let this = &mut *self;
2346 if this.inner.check_shutdown(cx) {
2347 this.is_terminated = true;
2348 return std::task::Poll::Ready(None);
2349 }
2350 if this.is_terminated {
2351 panic!("polled DeviceTestConnectorRequestStream after completion");
2352 }
2353 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2354 |bytes, handles| {
2355 match this.inner.channel().read_etc(cx, bytes, handles) {
2356 std::task::Poll::Ready(Ok(())) => {}
2357 std::task::Poll::Pending => return std::task::Poll::Pending,
2358 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2359 this.is_terminated = true;
2360 return std::task::Poll::Ready(None);
2361 }
2362 std::task::Poll::Ready(Err(e)) => {
2363 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2364 e.into(),
2365 ))))
2366 }
2367 }
2368
2369 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2371
2372 std::task::Poll::Ready(Some(match header.ordinal {
2373 0x366c1167cee8caa3 => {
2374 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2375 let mut req = fidl::new_empty!(DeviceTestConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2376 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceTestConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
2377 let control_handle = DeviceTestConnectorControlHandle {
2378 inner: this.inner.clone(),
2379 };
2380 Ok(DeviceTestConnectorRequest::Connect {name: req.name,
2381server_end: req.server_end,
2382
2383 control_handle,
2384 })
2385 }
2386 _ => Err(fidl::Error::UnknownOrdinal {
2387 ordinal: header.ordinal,
2388 protocol_name: <DeviceTestConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2389 }),
2390 }))
2391 },
2392 )
2393 }
2394}
2395
2396#[derive(Debug)]
2399pub enum DeviceTestConnectorRequest {
2400 Connect {
2417 name: String,
2418 server_end: fidl::endpoints::ServerEnd<DeviceTestMarker>,
2419 control_handle: DeviceTestConnectorControlHandle,
2420 },
2421}
2422
2423impl DeviceTestConnectorRequest {
2424 #[allow(irrefutable_let_patterns)]
2425 pub fn into_connect(
2426 self,
2427 ) -> Option<(
2428 String,
2429 fidl::endpoints::ServerEnd<DeviceTestMarker>,
2430 DeviceTestConnectorControlHandle,
2431 )> {
2432 if let DeviceTestConnectorRequest::Connect { name, server_end, control_handle } = self {
2433 Some((name, server_end, control_handle))
2434 } else {
2435 None
2436 }
2437 }
2438
2439 pub fn method_name(&self) -> &'static str {
2441 match *self {
2442 DeviceTestConnectorRequest::Connect { .. } => "connect",
2443 }
2444 }
2445}
2446
2447#[derive(Debug, Clone)]
2448pub struct DeviceTestConnectorControlHandle {
2449 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2450}
2451
2452impl fidl::endpoints::ControlHandle for DeviceTestConnectorControlHandle {
2453 fn shutdown(&self) {
2454 self.inner.shutdown()
2455 }
2456 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2457 self.inner.shutdown_with_epitaph(status)
2458 }
2459
2460 fn is_closed(&self) -> bool {
2461 self.inner.channel().is_closed()
2462 }
2463 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2464 self.inner.channel().on_closed()
2465 }
2466
2467 #[cfg(target_os = "fuchsia")]
2468 fn signal_peer(
2469 &self,
2470 clear_mask: zx::Signals,
2471 set_mask: zx::Signals,
2472 ) -> Result<(), zx_status::Status> {
2473 use fidl::Peered;
2474 self.inner.channel().signal_peer(clear_mask, set_mask)
2475 }
2476}
2477
2478impl DeviceTestConnectorControlHandle {}
2479
2480mod internal {
2481 use super::*;
2482
2483 impl fidl::encoding::ResourceTypeMarker for DeviceTestConnectorConnectRequest {
2484 type Borrowed<'a> = &'a mut Self;
2485 fn take_or_borrow<'a>(
2486 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2487 ) -> Self::Borrowed<'a> {
2488 value
2489 }
2490 }
2491
2492 unsafe impl fidl::encoding::TypeMarker for DeviceTestConnectorConnectRequest {
2493 type Owned = Self;
2494
2495 #[inline(always)]
2496 fn inline_align(_context: fidl::encoding::Context) -> usize {
2497 8
2498 }
2499
2500 #[inline(always)]
2501 fn inline_size(_context: fidl::encoding::Context) -> usize {
2502 24
2503 }
2504 }
2505
2506 unsafe impl
2507 fidl::encoding::Encode<
2508 DeviceTestConnectorConnectRequest,
2509 fidl::encoding::DefaultFuchsiaResourceDialect,
2510 > for &mut DeviceTestConnectorConnectRequest
2511 {
2512 #[inline]
2513 unsafe fn encode(
2514 self,
2515 encoder: &mut fidl::encoding::Encoder<
2516 '_,
2517 fidl::encoding::DefaultFuchsiaResourceDialect,
2518 >,
2519 offset: usize,
2520 _depth: fidl::encoding::Depth,
2521 ) -> fidl::Result<()> {
2522 encoder.debug_check_bounds::<DeviceTestConnectorConnectRequest>(offset);
2523 fidl::encoding::Encode::<DeviceTestConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2525 (
2526 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
2527 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
2528 ),
2529 encoder, offset, _depth
2530 )
2531 }
2532 }
2533 unsafe impl<
2534 T0: fidl::encoding::Encode<
2535 fidl::encoding::BoundedString<32>,
2536 fidl::encoding::DefaultFuchsiaResourceDialect,
2537 >,
2538 T1: fidl::encoding::Encode<
2539 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>>,
2540 fidl::encoding::DefaultFuchsiaResourceDialect,
2541 >,
2542 >
2543 fidl::encoding::Encode<
2544 DeviceTestConnectorConnectRequest,
2545 fidl::encoding::DefaultFuchsiaResourceDialect,
2546 > for (T0, T1)
2547 {
2548 #[inline]
2549 unsafe fn encode(
2550 self,
2551 encoder: &mut fidl::encoding::Encoder<
2552 '_,
2553 fidl::encoding::DefaultFuchsiaResourceDialect,
2554 >,
2555 offset: usize,
2556 depth: fidl::encoding::Depth,
2557 ) -> fidl::Result<()> {
2558 encoder.debug_check_bounds::<DeviceTestConnectorConnectRequest>(offset);
2559 unsafe {
2562 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2563 (ptr as *mut u64).write_unaligned(0);
2564 }
2565 self.0.encode(encoder, offset + 0, depth)?;
2567 self.1.encode(encoder, offset + 16, depth)?;
2568 Ok(())
2569 }
2570 }
2571
2572 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2573 for DeviceTestConnectorConnectRequest
2574 {
2575 #[inline(always)]
2576 fn new_empty() -> Self {
2577 Self {
2578 name: fidl::new_empty!(
2579 fidl::encoding::BoundedString<32>,
2580 fidl::encoding::DefaultFuchsiaResourceDialect
2581 ),
2582 server_end: fidl::new_empty!(
2583 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>>,
2584 fidl::encoding::DefaultFuchsiaResourceDialect
2585 ),
2586 }
2587 }
2588
2589 #[inline]
2590 unsafe fn decode(
2591 &mut self,
2592 decoder: &mut fidl::encoding::Decoder<
2593 '_,
2594 fidl::encoding::DefaultFuchsiaResourceDialect,
2595 >,
2596 offset: usize,
2597 _depth: fidl::encoding::Depth,
2598 ) -> fidl::Result<()> {
2599 decoder.debug_check_bounds::<Self>(offset);
2600 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2602 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2603 let mask = 0xffffffff00000000u64;
2604 let maskedval = padval & mask;
2605 if maskedval != 0 {
2606 return Err(fidl::Error::NonZeroPadding {
2607 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2608 });
2609 }
2610 fidl::decode!(
2611 fidl::encoding::BoundedString<32>,
2612 fidl::encoding::DefaultFuchsiaResourceDialect,
2613 &mut self.name,
2614 decoder,
2615 offset + 0,
2616 _depth
2617 )?;
2618 fidl::decode!(
2619 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceTestMarker>>,
2620 fidl::encoding::DefaultFuchsiaResourceDialect,
2621 &mut self.server_end,
2622 decoder,
2623 offset + 16,
2624 _depth
2625 )?;
2626 Ok(())
2627 }
2628 }
2629}