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_wlan_wlanix__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct Nl80211MessageV2Request {
16 pub message: Nl80211Message,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageV2Request {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct Nl80211MessageV2Response {
23 pub response: fidl::Vmo,
24}
25
26impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageV2Response {}
27
28#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29#[repr(C)]
30pub struct WifiStaIfaceSetMacAddressRequest {
31 pub mac_addr: [u8; 6],
32}
33
34impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
35 for WifiStaIfaceSetMacAddressRequest
36{
37}
38
39#[derive(Debug, Default, PartialEq)]
40pub struct Nl80211GetMulticastRequest {
41 pub group: Option<String>,
42 pub multicast: Option<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
43 #[doc(hidden)]
44 pub __source_breaking: fidl::marker::SourceBreaking,
45}
46
47impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
48 for Nl80211GetMulticastRequest
49{
50}
51
52#[derive(Debug, Default, PartialEq)]
53pub struct Nl80211MessageRequest {
54 pub message: Option<Nl80211Message>,
55 #[doc(hidden)]
56 pub __source_breaking: fidl::marker::SourceBreaking,
57}
58
59impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageRequest {}
60
61#[derive(Debug, Default, PartialEq)]
62pub struct Nl80211MulticastMessageRequest {
63 pub message: Option<Nl80211Message>,
64 #[doc(hidden)]
65 pub __source_breaking: fidl::marker::SourceBreaking,
66}
67
68impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
69 for Nl80211MulticastMessageRequest
70{
71}
72
73#[derive(Debug, Default, PartialEq)]
74pub struct Nl80211MessageResponse {
75 pub responses: Option<Vec<Nl80211Message>>,
76 #[doc(hidden)]
77 pub __source_breaking: fidl::marker::SourceBreaking,
78}
79
80impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageResponse {}
81
82#[derive(Debug, Default, PartialEq)]
83pub struct SupplicantAddStaInterfaceRequest {
84 pub iface: Option<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
85 pub iface_name: Option<String>,
86 #[doc(hidden)]
87 pub __source_breaking: fidl::marker::SourceBreaking,
88}
89
90impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
91 for SupplicantAddStaInterfaceRequest
92{
93}
94
95#[derive(Debug, Default, PartialEq)]
96pub struct SupplicantRemoveInterfaceRequest {
97 pub iface_name: Option<String>,
98 #[doc(hidden)]
99 pub __source_breaking: fidl::marker::SourceBreaking,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
103 for SupplicantRemoveInterfaceRequest
104{
105}
106
107#[derive(Debug, Default, PartialEq)]
108pub struct SupplicantStaIfaceAddNetworkRequest {
109 pub network: Option<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
110 #[doc(hidden)]
111 pub __source_breaking: fidl::marker::SourceBreaking,
112}
113
114impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
115 for SupplicantStaIfaceAddNetworkRequest
116{
117}
118
119#[derive(Debug, Default, PartialEq)]
120pub struct SupplicantStaIfaceRegisterCallbackRequest {
121 pub callback: Option<fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>>,
122 #[doc(hidden)]
123 pub __source_breaking: fidl::marker::SourceBreaking,
124}
125
126impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
127 for SupplicantStaIfaceRegisterCallbackRequest
128{
129}
130
131#[derive(Debug, Default, PartialEq)]
132pub struct SupplicantStaIfaceSetPowerSaveRequest {
133 pub enable: Option<bool>,
134 #[doc(hidden)]
135 pub __source_breaking: fidl::marker::SourceBreaking,
136}
137
138impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
139 for SupplicantStaIfaceSetPowerSaveRequest
140{
141}
142
143#[derive(Debug, Default, PartialEq)]
144pub struct SupplicantStaIfaceSetStaCountryCodeRequest {
145 pub code: Option<[u8; 2]>,
146 #[doc(hidden)]
147 pub __source_breaking: fidl::marker::SourceBreaking,
148}
149
150impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
151 for SupplicantStaIfaceSetStaCountryCodeRequest
152{
153}
154
155#[derive(Debug, Default, PartialEq)]
156pub struct SupplicantStaIfaceSetSuspendModeEnabledRequest {
157 pub enable: Option<bool>,
158 #[doc(hidden)]
159 pub __source_breaking: fidl::marker::SourceBreaking,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
163 for SupplicantStaIfaceSetSuspendModeEnabledRequest
164{
165}
166
167#[derive(Debug, Default, PartialEq)]
168pub struct WifiChipCreateStaIfaceRequest {
169 pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
170 #[doc(hidden)]
171 pub __source_breaking: fidl::marker::SourceBreaking,
172}
173
174impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
175 for WifiChipCreateStaIfaceRequest
176{
177}
178
179#[derive(Debug, Default, PartialEq)]
180pub struct WifiChipGetStaIfaceRequest {
181 pub iface_name: Option<String>,
182 pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
183 #[doc(hidden)]
184 pub __source_breaking: fidl::marker::SourceBreaking,
185}
186
187impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
188 for WifiChipGetStaIfaceRequest
189{
190}
191
192#[derive(Debug, Default, PartialEq)]
193pub struct WifiChipRemoveStaIfaceRequest {
194 pub iface_name: Option<String>,
195 #[doc(hidden)]
196 pub __source_breaking: fidl::marker::SourceBreaking,
197}
198
199impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
200 for WifiChipRemoveStaIfaceRequest
201{
202}
203
204#[derive(Debug, Default, PartialEq)]
205pub struct WifiChipSetCountryCodeRequest {
206 pub code: Option<[u8; 2]>,
207 #[doc(hidden)]
208 pub __source_breaking: fidl::marker::SourceBreaking,
209}
210
211impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
212 for WifiChipSetCountryCodeRequest
213{
214}
215
216#[derive(Debug, Default, PartialEq)]
217pub struct WifiEventCallbackOnSubsystemRestartRequest {
218 pub status: Option<i32>,
219 #[doc(hidden)]
220 pub __source_breaking: fidl::marker::SourceBreaking,
221}
222
223impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
224 for WifiEventCallbackOnSubsystemRestartRequest
225{
226}
227
228#[derive(Debug, Default, PartialEq)]
229pub struct WifiGetChipRequest {
230 pub chip_id: Option<u32>,
231 pub chip: Option<fidl::endpoints::ServerEnd<WifiChipMarker>>,
232 #[doc(hidden)]
233 pub __source_breaking: fidl::marker::SourceBreaking,
234}
235
236impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WifiGetChipRequest {}
237
238#[derive(Debug, Default, PartialEq)]
239pub struct WifiLegacyHalSelectTxPowerScenarioRequest {
240 pub scenario: Option<WifiLegacyHalTxPowerScenario>,
241 #[doc(hidden)]
242 pub __source_breaking: fidl::marker::SourceBreaking,
243}
244
245impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
246 for WifiLegacyHalSelectTxPowerScenarioRequest
247{
248}
249
250#[derive(Debug, Default, PartialEq)]
251pub struct WifiRegisterEventCallbackRequest {
252 pub callback: Option<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
253 #[doc(hidden)]
254 pub __source_breaking: fidl::marker::SourceBreaking,
255}
256
257impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
258 for WifiRegisterEventCallbackRequest
259{
260}
261
262#[derive(Debug, Default, PartialEq)]
263pub struct WifiStaIfaceSetScanOnlyModeRequest {
264 pub enable: Option<bool>,
265 #[doc(hidden)]
266 pub __source_breaking: fidl::marker::SourceBreaking,
267}
268
269impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
270 for WifiStaIfaceSetScanOnlyModeRequest
271{
272}
273
274#[derive(Debug, Default, PartialEq)]
275pub struct WlanixGetNl80211Request {
276 pub nl80211: Option<fidl::endpoints::ServerEnd<Nl80211Marker>>,
277 #[doc(hidden)]
278 pub __source_breaking: fidl::marker::SourceBreaking,
279}
280
281impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetNl80211Request {}
282
283#[derive(Debug, Default, PartialEq)]
284pub struct WlanixGetSupplicantRequest {
285 pub supplicant: Option<fidl::endpoints::ServerEnd<SupplicantMarker>>,
286 #[doc(hidden)]
287 pub __source_breaking: fidl::marker::SourceBreaking,
288}
289
290impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
291 for WlanixGetSupplicantRequest
292{
293}
294
295#[derive(Debug, Default, PartialEq)]
296pub struct WlanixGetWifiLegacyHalRequest {
297 pub legacy_hal: Option<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
298 #[doc(hidden)]
299 pub __source_breaking: fidl::marker::SourceBreaking,
300}
301
302impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
303 for WlanixGetWifiLegacyHalRequest
304{
305}
306
307#[derive(Debug, Default, PartialEq)]
308pub struct WlanixGetWifiRequest {
309 pub wifi: Option<fidl::endpoints::ServerEnd<WifiMarker>>,
310 #[doc(hidden)]
311 pub __source_breaking: fidl::marker::SourceBreaking,
312}
313
314impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetWifiRequest {}
315
316#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
317pub struct Nl80211Marker;
318
319impl fidl::endpoints::ProtocolMarker for Nl80211Marker {
320 type Proxy = Nl80211Proxy;
321 type RequestStream = Nl80211RequestStream;
322 #[cfg(target_os = "fuchsia")]
323 type SynchronousProxy = Nl80211SynchronousProxy;
324
325 const DEBUG_NAME: &'static str = "(anonymous) Nl80211";
326}
327pub type Nl80211MessageResult = Result<Nl80211MessageResponse, i32>;
328pub type Nl80211MessageV2Result = Result<fidl::Vmo, i32>;
329
330pub trait Nl80211ProxyInterface: Send + Sync {
331 fn r#get_multicast(&self, payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error>;
332 type MessageResponseFut: std::future::Future<Output = Result<Nl80211MessageResult, fidl::Error>>
333 + Send;
334 fn r#message(&self, payload: Nl80211MessageRequest) -> Self::MessageResponseFut;
335 type MessageV2ResponseFut: std::future::Future<Output = Result<Nl80211MessageV2Result, fidl::Error>>
336 + Send;
337 fn r#message_v2(&self, message: &Nl80211Message) -> Self::MessageV2ResponseFut;
338}
339#[derive(Debug)]
340#[cfg(target_os = "fuchsia")]
341pub struct Nl80211SynchronousProxy {
342 client: fidl::client::sync::Client,
343}
344
345#[cfg(target_os = "fuchsia")]
346impl fidl::endpoints::SynchronousProxy for Nl80211SynchronousProxy {
347 type Proxy = Nl80211Proxy;
348 type Protocol = Nl80211Marker;
349
350 fn from_channel(inner: fidl::Channel) -> Self {
351 Self::new(inner)
352 }
353
354 fn into_channel(self) -> fidl::Channel {
355 self.client.into_channel()
356 }
357
358 fn as_channel(&self) -> &fidl::Channel {
359 self.client.as_channel()
360 }
361}
362
363#[cfg(target_os = "fuchsia")]
364impl Nl80211SynchronousProxy {
365 pub fn new(channel: fidl::Channel) -> Self {
366 Self { client: fidl::client::sync::Client::new(channel) }
367 }
368
369 pub fn into_channel(self) -> fidl::Channel {
370 self.client.into_channel()
371 }
372
373 pub fn wait_for_event(
376 &self,
377 deadline: zx::MonotonicInstant,
378 ) -> Result<Nl80211Event, fidl::Error> {
379 Nl80211Event::decode(self.client.wait_for_event::<Nl80211Marker>(deadline)?)
380 }
381
382 pub fn r#get_multicast(
383 &self,
384 mut payload: Nl80211GetMulticastRequest,
385 ) -> Result<(), fidl::Error> {
386 self.client.send::<Nl80211GetMulticastRequest>(
387 &mut payload,
388 0x58b73dd089681dc2,
389 fidl::encoding::DynamicFlags::FLEXIBLE,
390 )
391 }
392
393 pub fn r#message(
394 &self,
395 mut payload: Nl80211MessageRequest,
396 ___deadline: zx::MonotonicInstant,
397 ) -> Result<Nl80211MessageResult, fidl::Error> {
398 let _response = self.client.send_query::<
399 Nl80211MessageRequest,
400 fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
401 Nl80211Marker,
402 >(
403 &mut payload,
404 0x6336259e15bb3795,
405 fidl::encoding::DynamicFlags::FLEXIBLE,
406 ___deadline,
407 )?
408 .into_result::<Nl80211Marker>("message")?;
409 Ok(_response.map(|x| x))
410 }
411
412 pub fn r#message_v2(
413 &self,
414 mut message: &Nl80211Message,
415 ___deadline: zx::MonotonicInstant,
416 ) -> Result<Nl80211MessageV2Result, fidl::Error> {
417 let _response = self.client.send_query::<
418 Nl80211MessageV2Request,
419 fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
420 Nl80211Marker,
421 >(
422 (message,),
423 0x4626796aba1e2987,
424 fidl::encoding::DynamicFlags::FLEXIBLE,
425 ___deadline,
426 )?
427 .into_result::<Nl80211Marker>("message_v2")?;
428 Ok(_response.map(|x| x.response))
429 }
430}
431
432#[cfg(target_os = "fuchsia")]
433impl From<Nl80211SynchronousProxy> for zx::NullableHandle {
434 fn from(value: Nl80211SynchronousProxy) -> Self {
435 value.into_channel().into()
436 }
437}
438
439#[cfg(target_os = "fuchsia")]
440impl From<fidl::Channel> for Nl80211SynchronousProxy {
441 fn from(value: fidl::Channel) -> Self {
442 Self::new(value)
443 }
444}
445
446#[cfg(target_os = "fuchsia")]
447impl fidl::endpoints::FromClient for Nl80211SynchronousProxy {
448 type Protocol = Nl80211Marker;
449
450 fn from_client(value: fidl::endpoints::ClientEnd<Nl80211Marker>) -> Self {
451 Self::new(value.into_channel())
452 }
453}
454
455#[derive(Debug, Clone)]
456pub struct Nl80211Proxy {
457 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
458}
459
460impl fidl::endpoints::Proxy for Nl80211Proxy {
461 type Protocol = Nl80211Marker;
462
463 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
464 Self::new(inner)
465 }
466
467 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
468 self.client.into_channel().map_err(|client| Self { client })
469 }
470
471 fn as_channel(&self) -> &::fidl::AsyncChannel {
472 self.client.as_channel()
473 }
474}
475
476impl Nl80211Proxy {
477 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
479 let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
480 Self { client: fidl::client::Client::new(channel, protocol_name) }
481 }
482
483 pub fn take_event_stream(&self) -> Nl80211EventStream {
489 Nl80211EventStream { event_receiver: self.client.take_event_receiver() }
490 }
491
492 pub fn r#get_multicast(
493 &self,
494 mut payload: Nl80211GetMulticastRequest,
495 ) -> Result<(), fidl::Error> {
496 Nl80211ProxyInterface::r#get_multicast(self, payload)
497 }
498
499 pub fn r#message(
500 &self,
501 mut payload: Nl80211MessageRequest,
502 ) -> fidl::client::QueryResponseFut<
503 Nl80211MessageResult,
504 fidl::encoding::DefaultFuchsiaResourceDialect,
505 > {
506 Nl80211ProxyInterface::r#message(self, payload)
507 }
508
509 pub fn r#message_v2(
510 &self,
511 mut message: &Nl80211Message,
512 ) -> fidl::client::QueryResponseFut<
513 Nl80211MessageV2Result,
514 fidl::encoding::DefaultFuchsiaResourceDialect,
515 > {
516 Nl80211ProxyInterface::r#message_v2(self, message)
517 }
518}
519
520impl Nl80211ProxyInterface for Nl80211Proxy {
521 fn r#get_multicast(&self, mut payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error> {
522 self.client.send::<Nl80211GetMulticastRequest>(
523 &mut payload,
524 0x58b73dd089681dc2,
525 fidl::encoding::DynamicFlags::FLEXIBLE,
526 )
527 }
528
529 type MessageResponseFut = fidl::client::QueryResponseFut<
530 Nl80211MessageResult,
531 fidl::encoding::DefaultFuchsiaResourceDialect,
532 >;
533 fn r#message(&self, mut payload: Nl80211MessageRequest) -> Self::MessageResponseFut {
534 fn _decode(
535 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
536 ) -> Result<Nl80211MessageResult, fidl::Error> {
537 let _response = fidl::client::decode_transaction_body::<
538 fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
539 fidl::encoding::DefaultFuchsiaResourceDialect,
540 0x6336259e15bb3795,
541 >(_buf?)?
542 .into_result::<Nl80211Marker>("message")?;
543 Ok(_response.map(|x| x))
544 }
545 self.client.send_query_and_decode::<Nl80211MessageRequest, Nl80211MessageResult>(
546 &mut payload,
547 0x6336259e15bb3795,
548 fidl::encoding::DynamicFlags::FLEXIBLE,
549 _decode,
550 )
551 }
552
553 type MessageV2ResponseFut = fidl::client::QueryResponseFut<
554 Nl80211MessageV2Result,
555 fidl::encoding::DefaultFuchsiaResourceDialect,
556 >;
557 fn r#message_v2(&self, mut message: &Nl80211Message) -> Self::MessageV2ResponseFut {
558 fn _decode(
559 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
560 ) -> Result<Nl80211MessageV2Result, fidl::Error> {
561 let _response = fidl::client::decode_transaction_body::<
562 fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
563 fidl::encoding::DefaultFuchsiaResourceDialect,
564 0x4626796aba1e2987,
565 >(_buf?)?
566 .into_result::<Nl80211Marker>("message_v2")?;
567 Ok(_response.map(|x| x.response))
568 }
569 self.client.send_query_and_decode::<Nl80211MessageV2Request, Nl80211MessageV2Result>(
570 (message,),
571 0x4626796aba1e2987,
572 fidl::encoding::DynamicFlags::FLEXIBLE,
573 _decode,
574 )
575 }
576}
577
578pub struct Nl80211EventStream {
579 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
580}
581
582impl std::marker::Unpin for Nl80211EventStream {}
583
584impl futures::stream::FusedStream for Nl80211EventStream {
585 fn is_terminated(&self) -> bool {
586 self.event_receiver.is_terminated()
587 }
588}
589
590impl futures::Stream for Nl80211EventStream {
591 type Item = Result<Nl80211Event, fidl::Error>;
592
593 fn poll_next(
594 mut self: std::pin::Pin<&mut Self>,
595 cx: &mut std::task::Context<'_>,
596 ) -> std::task::Poll<Option<Self::Item>> {
597 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
598 &mut self.event_receiver,
599 cx
600 )?) {
601 Some(buf) => std::task::Poll::Ready(Some(Nl80211Event::decode(buf))),
602 None => std::task::Poll::Ready(None),
603 }
604 }
605}
606
607#[derive(Debug)]
608pub enum Nl80211Event {
609 #[non_exhaustive]
610 _UnknownEvent {
611 ordinal: u64,
613 },
614}
615
616impl Nl80211Event {
617 fn decode(
619 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
620 ) -> Result<Nl80211Event, fidl::Error> {
621 let (bytes, _handles) = buf.split_mut();
622 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
623 debug_assert_eq!(tx_header.tx_id, 0);
624 match tx_header.ordinal {
625 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
626 Ok(Nl80211Event::_UnknownEvent { ordinal: tx_header.ordinal })
627 }
628 _ => Err(fidl::Error::UnknownOrdinal {
629 ordinal: tx_header.ordinal,
630 protocol_name: <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
631 }),
632 }
633 }
634}
635
636pub struct Nl80211RequestStream {
638 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
639 is_terminated: bool,
640}
641
642impl std::marker::Unpin for Nl80211RequestStream {}
643
644impl futures::stream::FusedStream for Nl80211RequestStream {
645 fn is_terminated(&self) -> bool {
646 self.is_terminated
647 }
648}
649
650impl fidl::endpoints::RequestStream for Nl80211RequestStream {
651 type Protocol = Nl80211Marker;
652 type ControlHandle = Nl80211ControlHandle;
653
654 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
655 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
656 }
657
658 fn control_handle(&self) -> Self::ControlHandle {
659 Nl80211ControlHandle { inner: self.inner.clone() }
660 }
661
662 fn into_inner(
663 self,
664 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
665 {
666 (self.inner, self.is_terminated)
667 }
668
669 fn from_inner(
670 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
671 is_terminated: bool,
672 ) -> Self {
673 Self { inner, is_terminated }
674 }
675}
676
677impl futures::Stream for Nl80211RequestStream {
678 type Item = Result<Nl80211Request, fidl::Error>;
679
680 fn poll_next(
681 mut self: std::pin::Pin<&mut Self>,
682 cx: &mut std::task::Context<'_>,
683 ) -> std::task::Poll<Option<Self::Item>> {
684 let this = &mut *self;
685 if this.inner.check_shutdown(cx) {
686 this.is_terminated = true;
687 return std::task::Poll::Ready(None);
688 }
689 if this.is_terminated {
690 panic!("polled Nl80211RequestStream after completion");
691 }
692 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
693 |bytes, handles| {
694 match this.inner.channel().read_etc(cx, bytes, handles) {
695 std::task::Poll::Ready(Ok(())) => {}
696 std::task::Poll::Pending => return std::task::Poll::Pending,
697 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
698 this.is_terminated = true;
699 return std::task::Poll::Ready(None);
700 }
701 std::task::Poll::Ready(Err(e)) => {
702 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
703 e.into(),
704 ))));
705 }
706 }
707
708 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
710
711 std::task::Poll::Ready(Some(match header.ordinal {
712 0x58b73dd089681dc2 => {
713 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
714 let mut req = fidl::new_empty!(
715 Nl80211GetMulticastRequest,
716 fidl::encoding::DefaultFuchsiaResourceDialect
717 );
718 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211GetMulticastRequest>(&header, _body_bytes, handles, &mut req)?;
719 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
720 Ok(Nl80211Request::GetMulticast { payload: req, control_handle })
721 }
722 0x6336259e15bb3795 => {
723 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
724 let mut req = fidl::new_empty!(
725 Nl80211MessageRequest,
726 fidl::encoding::DefaultFuchsiaResourceDialect
727 );
728 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageRequest>(&header, _body_bytes, handles, &mut req)?;
729 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
730 Ok(Nl80211Request::Message {
731 payload: req,
732 responder: Nl80211MessageResponder {
733 control_handle: std::mem::ManuallyDrop::new(control_handle),
734 tx_id: header.tx_id,
735 },
736 })
737 }
738 0x4626796aba1e2987 => {
739 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
740 let mut req = fidl::new_empty!(
741 Nl80211MessageV2Request,
742 fidl::encoding::DefaultFuchsiaResourceDialect
743 );
744 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageV2Request>(&header, _body_bytes, handles, &mut req)?;
745 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
746 Ok(Nl80211Request::MessageV2 {
747 message: req.message,
748
749 responder: Nl80211MessageV2Responder {
750 control_handle: std::mem::ManuallyDrop::new(control_handle),
751 tx_id: header.tx_id,
752 },
753 })
754 }
755 _ if header.tx_id == 0
756 && header
757 .dynamic_flags()
758 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
759 {
760 Ok(Nl80211Request::_UnknownMethod {
761 ordinal: header.ordinal,
762 control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
763 method_type: fidl::MethodType::OneWay,
764 })
765 }
766 _ if header
767 .dynamic_flags()
768 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
769 {
770 this.inner.send_framework_err(
771 fidl::encoding::FrameworkErr::UnknownMethod,
772 header.tx_id,
773 header.ordinal,
774 header.dynamic_flags(),
775 (bytes, handles),
776 )?;
777 Ok(Nl80211Request::_UnknownMethod {
778 ordinal: header.ordinal,
779 control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
780 method_type: fidl::MethodType::TwoWay,
781 })
782 }
783 _ => Err(fidl::Error::UnknownOrdinal {
784 ordinal: header.ordinal,
785 protocol_name:
786 <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
787 }),
788 }))
789 },
790 )
791 }
792}
793
794#[derive(Debug)]
795pub enum Nl80211Request {
796 GetMulticast {
797 payload: Nl80211GetMulticastRequest,
798 control_handle: Nl80211ControlHandle,
799 },
800 Message {
801 payload: Nl80211MessageRequest,
802 responder: Nl80211MessageResponder,
803 },
804 MessageV2 {
805 message: Nl80211Message,
806 responder: Nl80211MessageV2Responder,
807 },
808 #[non_exhaustive]
810 _UnknownMethod {
811 ordinal: u64,
813 control_handle: Nl80211ControlHandle,
814 method_type: fidl::MethodType,
815 },
816}
817
818impl Nl80211Request {
819 #[allow(irrefutable_let_patterns)]
820 pub fn into_get_multicast(self) -> Option<(Nl80211GetMulticastRequest, Nl80211ControlHandle)> {
821 if let Nl80211Request::GetMulticast { payload, control_handle } = self {
822 Some((payload, control_handle))
823 } else {
824 None
825 }
826 }
827
828 #[allow(irrefutable_let_patterns)]
829 pub fn into_message(self) -> Option<(Nl80211MessageRequest, Nl80211MessageResponder)> {
830 if let Nl80211Request::Message { payload, responder } = self {
831 Some((payload, responder))
832 } else {
833 None
834 }
835 }
836
837 #[allow(irrefutable_let_patterns)]
838 pub fn into_message_v2(self) -> Option<(Nl80211Message, Nl80211MessageV2Responder)> {
839 if let Nl80211Request::MessageV2 { message, responder } = self {
840 Some((message, responder))
841 } else {
842 None
843 }
844 }
845
846 pub fn method_name(&self) -> &'static str {
848 match *self {
849 Nl80211Request::GetMulticast { .. } => "get_multicast",
850 Nl80211Request::Message { .. } => "message",
851 Nl80211Request::MessageV2 { .. } => "message_v2",
852 Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
853 "unknown one-way method"
854 }
855 Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
856 "unknown two-way method"
857 }
858 }
859 }
860}
861
862#[derive(Debug, Clone)]
863pub struct Nl80211ControlHandle {
864 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
865}
866
867impl fidl::endpoints::ControlHandle for Nl80211ControlHandle {
868 fn shutdown(&self) {
869 self.inner.shutdown()
870 }
871
872 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
873 self.inner.shutdown_with_epitaph(status)
874 }
875
876 fn is_closed(&self) -> bool {
877 self.inner.channel().is_closed()
878 }
879 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
880 self.inner.channel().on_closed()
881 }
882
883 #[cfg(target_os = "fuchsia")]
884 fn signal_peer(
885 &self,
886 clear_mask: zx::Signals,
887 set_mask: zx::Signals,
888 ) -> Result<(), zx_status::Status> {
889 use fidl::Peered;
890 self.inner.channel().signal_peer(clear_mask, set_mask)
891 }
892}
893
894impl Nl80211ControlHandle {}
895
896#[must_use = "FIDL methods require a response to be sent"]
897#[derive(Debug)]
898pub struct Nl80211MessageResponder {
899 control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
900 tx_id: u32,
901}
902
903impl std::ops::Drop for Nl80211MessageResponder {
907 fn drop(&mut self) {
908 self.control_handle.shutdown();
909 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
911 }
912}
913
914impl fidl::endpoints::Responder for Nl80211MessageResponder {
915 type ControlHandle = Nl80211ControlHandle;
916
917 fn control_handle(&self) -> &Nl80211ControlHandle {
918 &self.control_handle
919 }
920
921 fn drop_without_shutdown(mut self) {
922 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
924 std::mem::forget(self);
926 }
927}
928
929impl Nl80211MessageResponder {
930 pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
934 let _result = self.send_raw(result);
935 if _result.is_err() {
936 self.control_handle.shutdown();
937 }
938 self.drop_without_shutdown();
939 _result
940 }
941
942 pub fn send_no_shutdown_on_err(
944 self,
945 mut result: Result<Nl80211MessageResponse, i32>,
946 ) -> Result<(), fidl::Error> {
947 let _result = self.send_raw(result);
948 self.drop_without_shutdown();
949 _result
950 }
951
952 fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
953 self.control_handle
954 .inner
955 .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
956 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
957 self.tx_id,
958 0x6336259e15bb3795,
959 fidl::encoding::DynamicFlags::FLEXIBLE,
960 )
961 }
962}
963
964#[must_use = "FIDL methods require a response to be sent"]
965#[derive(Debug)]
966pub struct Nl80211MessageV2Responder {
967 control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
968 tx_id: u32,
969}
970
971impl std::ops::Drop for Nl80211MessageV2Responder {
975 fn drop(&mut self) {
976 self.control_handle.shutdown();
977 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
979 }
980}
981
982impl fidl::endpoints::Responder for Nl80211MessageV2Responder {
983 type ControlHandle = Nl80211ControlHandle;
984
985 fn control_handle(&self) -> &Nl80211ControlHandle {
986 &self.control_handle
987 }
988
989 fn drop_without_shutdown(mut self) {
990 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
992 std::mem::forget(self);
994 }
995}
996
997impl Nl80211MessageV2Responder {
998 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1002 let _result = self.send_raw(result);
1003 if _result.is_err() {
1004 self.control_handle.shutdown();
1005 }
1006 self.drop_without_shutdown();
1007 _result
1008 }
1009
1010 pub fn send_no_shutdown_on_err(
1012 self,
1013 mut result: Result<fidl::Vmo, i32>,
1014 ) -> Result<(), fidl::Error> {
1015 let _result = self.send_raw(result);
1016 self.drop_without_shutdown();
1017 _result
1018 }
1019
1020 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1021 self.control_handle
1022 .inner
1023 .send::<fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>>(
1024 fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1025 self.tx_id,
1026 0x4626796aba1e2987,
1027 fidl::encoding::DynamicFlags::FLEXIBLE,
1028 )
1029 }
1030}
1031
1032#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1033pub struct Nl80211MulticastMarker;
1034
1035impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
1036 type Proxy = Nl80211MulticastProxy;
1037 type RequestStream = Nl80211MulticastRequestStream;
1038 #[cfg(target_os = "fuchsia")]
1039 type SynchronousProxy = Nl80211MulticastSynchronousProxy;
1040
1041 const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
1042}
1043
1044pub trait Nl80211MulticastProxyInterface: Send + Sync {
1045 fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
1046}
1047#[derive(Debug)]
1048#[cfg(target_os = "fuchsia")]
1049pub struct Nl80211MulticastSynchronousProxy {
1050 client: fidl::client::sync::Client,
1051}
1052
1053#[cfg(target_os = "fuchsia")]
1054impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
1055 type Proxy = Nl80211MulticastProxy;
1056 type Protocol = Nl80211MulticastMarker;
1057
1058 fn from_channel(inner: fidl::Channel) -> Self {
1059 Self::new(inner)
1060 }
1061
1062 fn into_channel(self) -> fidl::Channel {
1063 self.client.into_channel()
1064 }
1065
1066 fn as_channel(&self) -> &fidl::Channel {
1067 self.client.as_channel()
1068 }
1069}
1070
1071#[cfg(target_os = "fuchsia")]
1072impl Nl80211MulticastSynchronousProxy {
1073 pub fn new(channel: fidl::Channel) -> Self {
1074 Self { client: fidl::client::sync::Client::new(channel) }
1075 }
1076
1077 pub fn into_channel(self) -> fidl::Channel {
1078 self.client.into_channel()
1079 }
1080
1081 pub fn wait_for_event(
1084 &self,
1085 deadline: zx::MonotonicInstant,
1086 ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1087 Nl80211MulticastEvent::decode(
1088 self.client.wait_for_event::<Nl80211MulticastMarker>(deadline)?,
1089 )
1090 }
1091
1092 pub fn r#message(
1093 &self,
1094 mut payload: Nl80211MulticastMessageRequest,
1095 ) -> Result<(), fidl::Error> {
1096 self.client.send::<Nl80211MulticastMessageRequest>(
1097 &mut payload,
1098 0x4cc9241f302f16c0,
1099 fidl::encoding::DynamicFlags::FLEXIBLE,
1100 )
1101 }
1102}
1103
1104#[cfg(target_os = "fuchsia")]
1105impl From<Nl80211MulticastSynchronousProxy> for zx::NullableHandle {
1106 fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
1107 value.into_channel().into()
1108 }
1109}
1110
1111#[cfg(target_os = "fuchsia")]
1112impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
1113 fn from(value: fidl::Channel) -> Self {
1114 Self::new(value)
1115 }
1116}
1117
1118#[cfg(target_os = "fuchsia")]
1119impl fidl::endpoints::FromClient for Nl80211MulticastSynchronousProxy {
1120 type Protocol = Nl80211MulticastMarker;
1121
1122 fn from_client(value: fidl::endpoints::ClientEnd<Nl80211MulticastMarker>) -> Self {
1123 Self::new(value.into_channel())
1124 }
1125}
1126
1127#[derive(Debug, Clone)]
1128pub struct Nl80211MulticastProxy {
1129 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1130}
1131
1132impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
1133 type Protocol = Nl80211MulticastMarker;
1134
1135 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1136 Self::new(inner)
1137 }
1138
1139 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1140 self.client.into_channel().map_err(|client| Self { client })
1141 }
1142
1143 fn as_channel(&self) -> &::fidl::AsyncChannel {
1144 self.client.as_channel()
1145 }
1146}
1147
1148impl Nl80211MulticastProxy {
1149 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1151 let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1152 Self { client: fidl::client::Client::new(channel, protocol_name) }
1153 }
1154
1155 pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
1161 Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
1162 }
1163
1164 pub fn r#message(
1165 &self,
1166 mut payload: Nl80211MulticastMessageRequest,
1167 ) -> Result<(), fidl::Error> {
1168 Nl80211MulticastProxyInterface::r#message(self, payload)
1169 }
1170}
1171
1172impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
1173 fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
1174 self.client.send::<Nl80211MulticastMessageRequest>(
1175 &mut payload,
1176 0x4cc9241f302f16c0,
1177 fidl::encoding::DynamicFlags::FLEXIBLE,
1178 )
1179 }
1180}
1181
1182pub struct Nl80211MulticastEventStream {
1183 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1184}
1185
1186impl std::marker::Unpin for Nl80211MulticastEventStream {}
1187
1188impl futures::stream::FusedStream for Nl80211MulticastEventStream {
1189 fn is_terminated(&self) -> bool {
1190 self.event_receiver.is_terminated()
1191 }
1192}
1193
1194impl futures::Stream for Nl80211MulticastEventStream {
1195 type Item = Result<Nl80211MulticastEvent, fidl::Error>;
1196
1197 fn poll_next(
1198 mut self: std::pin::Pin<&mut Self>,
1199 cx: &mut std::task::Context<'_>,
1200 ) -> std::task::Poll<Option<Self::Item>> {
1201 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1202 &mut self.event_receiver,
1203 cx
1204 )?) {
1205 Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
1206 None => std::task::Poll::Ready(None),
1207 }
1208 }
1209}
1210
1211#[derive(Debug)]
1212pub enum Nl80211MulticastEvent {
1213 #[non_exhaustive]
1214 _UnknownEvent {
1215 ordinal: u64,
1217 },
1218}
1219
1220impl Nl80211MulticastEvent {
1221 fn decode(
1223 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1224 ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1225 let (bytes, _handles) = buf.split_mut();
1226 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1227 debug_assert_eq!(tx_header.tx_id, 0);
1228 match tx_header.ordinal {
1229 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1230 Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1231 }
1232 _ => Err(fidl::Error::UnknownOrdinal {
1233 ordinal: tx_header.ordinal,
1234 protocol_name:
1235 <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1236 }),
1237 }
1238 }
1239}
1240
1241pub struct Nl80211MulticastRequestStream {
1243 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1244 is_terminated: bool,
1245}
1246
1247impl std::marker::Unpin for Nl80211MulticastRequestStream {}
1248
1249impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
1250 fn is_terminated(&self) -> bool {
1251 self.is_terminated
1252 }
1253}
1254
1255impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
1256 type Protocol = Nl80211MulticastMarker;
1257 type ControlHandle = Nl80211MulticastControlHandle;
1258
1259 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1260 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1261 }
1262
1263 fn control_handle(&self) -> Self::ControlHandle {
1264 Nl80211MulticastControlHandle { inner: self.inner.clone() }
1265 }
1266
1267 fn into_inner(
1268 self,
1269 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1270 {
1271 (self.inner, self.is_terminated)
1272 }
1273
1274 fn from_inner(
1275 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1276 is_terminated: bool,
1277 ) -> Self {
1278 Self { inner, is_terminated }
1279 }
1280}
1281
1282impl futures::Stream for Nl80211MulticastRequestStream {
1283 type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1284
1285 fn poll_next(
1286 mut self: std::pin::Pin<&mut Self>,
1287 cx: &mut std::task::Context<'_>,
1288 ) -> std::task::Poll<Option<Self::Item>> {
1289 let this = &mut *self;
1290 if this.inner.check_shutdown(cx) {
1291 this.is_terminated = true;
1292 return std::task::Poll::Ready(None);
1293 }
1294 if this.is_terminated {
1295 panic!("polled Nl80211MulticastRequestStream after completion");
1296 }
1297 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1298 |bytes, handles| {
1299 match this.inner.channel().read_etc(cx, bytes, handles) {
1300 std::task::Poll::Ready(Ok(())) => {}
1301 std::task::Poll::Pending => return std::task::Poll::Pending,
1302 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1303 this.is_terminated = true;
1304 return std::task::Poll::Ready(None);
1305 }
1306 std::task::Poll::Ready(Err(e)) => {
1307 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1308 e.into(),
1309 ))));
1310 }
1311 }
1312
1313 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1315
1316 std::task::Poll::Ready(Some(match header.ordinal {
1317 0x4cc9241f302f16c0 => {
1318 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1319 let mut req = fidl::new_empty!(
1320 Nl80211MulticastMessageRequest,
1321 fidl::encoding::DefaultFuchsiaResourceDialect
1322 );
1323 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1324 let control_handle =
1325 Nl80211MulticastControlHandle { inner: this.inner.clone() };
1326 Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1327 }
1328 _ if header.tx_id == 0
1329 && header
1330 .dynamic_flags()
1331 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1332 {
1333 Ok(Nl80211MulticastRequest::_UnknownMethod {
1334 ordinal: header.ordinal,
1335 control_handle: Nl80211MulticastControlHandle {
1336 inner: this.inner.clone(),
1337 },
1338 method_type: fidl::MethodType::OneWay,
1339 })
1340 }
1341 _ if header
1342 .dynamic_flags()
1343 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1344 {
1345 this.inner.send_framework_err(
1346 fidl::encoding::FrameworkErr::UnknownMethod,
1347 header.tx_id,
1348 header.ordinal,
1349 header.dynamic_flags(),
1350 (bytes, handles),
1351 )?;
1352 Ok(Nl80211MulticastRequest::_UnknownMethod {
1353 ordinal: header.ordinal,
1354 control_handle: Nl80211MulticastControlHandle {
1355 inner: this.inner.clone(),
1356 },
1357 method_type: fidl::MethodType::TwoWay,
1358 })
1359 }
1360 _ => Err(fidl::Error::UnknownOrdinal {
1361 ordinal: header.ordinal,
1362 protocol_name:
1363 <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1364 }),
1365 }))
1366 },
1367 )
1368 }
1369}
1370
1371#[derive(Debug)]
1372pub enum Nl80211MulticastRequest {
1373 Message {
1374 payload: Nl80211MulticastMessageRequest,
1375 control_handle: Nl80211MulticastControlHandle,
1376 },
1377 #[non_exhaustive]
1379 _UnknownMethod {
1380 ordinal: u64,
1382 control_handle: Nl80211MulticastControlHandle,
1383 method_type: fidl::MethodType,
1384 },
1385}
1386
1387impl Nl80211MulticastRequest {
1388 #[allow(irrefutable_let_patterns)]
1389 pub fn into_message(
1390 self,
1391 ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1392 if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1393 Some((payload, control_handle))
1394 } else {
1395 None
1396 }
1397 }
1398
1399 pub fn method_name(&self) -> &'static str {
1401 match *self {
1402 Nl80211MulticastRequest::Message { .. } => "message",
1403 Nl80211MulticastRequest::_UnknownMethod {
1404 method_type: fidl::MethodType::OneWay,
1405 ..
1406 } => "unknown one-way method",
1407 Nl80211MulticastRequest::_UnknownMethod {
1408 method_type: fidl::MethodType::TwoWay,
1409 ..
1410 } => "unknown two-way method",
1411 }
1412 }
1413}
1414
1415#[derive(Debug, Clone)]
1416pub struct Nl80211MulticastControlHandle {
1417 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1418}
1419
1420impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1421 fn shutdown(&self) {
1422 self.inner.shutdown()
1423 }
1424
1425 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1426 self.inner.shutdown_with_epitaph(status)
1427 }
1428
1429 fn is_closed(&self) -> bool {
1430 self.inner.channel().is_closed()
1431 }
1432 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1433 self.inner.channel().on_closed()
1434 }
1435
1436 #[cfg(target_os = "fuchsia")]
1437 fn signal_peer(
1438 &self,
1439 clear_mask: zx::Signals,
1440 set_mask: zx::Signals,
1441 ) -> Result<(), zx_status::Status> {
1442 use fidl::Peered;
1443 self.inner.channel().signal_peer(clear_mask, set_mask)
1444 }
1445}
1446
1447impl Nl80211MulticastControlHandle {}
1448
1449#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1450pub struct SupplicantMarker;
1451
1452impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1453 type Proxy = SupplicantProxy;
1454 type RequestStream = SupplicantRequestStream;
1455 #[cfg(target_os = "fuchsia")]
1456 type SynchronousProxy = SupplicantSynchronousProxy;
1457
1458 const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1459}
1460
1461pub trait SupplicantProxyInterface: Send + Sync {
1462 fn r#add_sta_interface(
1463 &self,
1464 payload: SupplicantAddStaInterfaceRequest,
1465 ) -> Result<(), fidl::Error>;
1466 fn r#remove_interface(
1467 &self,
1468 payload: SupplicantRemoveInterfaceRequest,
1469 ) -> Result<(), fidl::Error>;
1470}
1471#[derive(Debug)]
1472#[cfg(target_os = "fuchsia")]
1473pub struct SupplicantSynchronousProxy {
1474 client: fidl::client::sync::Client,
1475}
1476
1477#[cfg(target_os = "fuchsia")]
1478impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1479 type Proxy = SupplicantProxy;
1480 type Protocol = SupplicantMarker;
1481
1482 fn from_channel(inner: fidl::Channel) -> Self {
1483 Self::new(inner)
1484 }
1485
1486 fn into_channel(self) -> fidl::Channel {
1487 self.client.into_channel()
1488 }
1489
1490 fn as_channel(&self) -> &fidl::Channel {
1491 self.client.as_channel()
1492 }
1493}
1494
1495#[cfg(target_os = "fuchsia")]
1496impl SupplicantSynchronousProxy {
1497 pub fn new(channel: fidl::Channel) -> Self {
1498 Self { client: fidl::client::sync::Client::new(channel) }
1499 }
1500
1501 pub fn into_channel(self) -> fidl::Channel {
1502 self.client.into_channel()
1503 }
1504
1505 pub fn wait_for_event(
1508 &self,
1509 deadline: zx::MonotonicInstant,
1510 ) -> Result<SupplicantEvent, fidl::Error> {
1511 SupplicantEvent::decode(self.client.wait_for_event::<SupplicantMarker>(deadline)?)
1512 }
1513
1514 pub fn r#add_sta_interface(
1515 &self,
1516 mut payload: SupplicantAddStaInterfaceRequest,
1517 ) -> Result<(), fidl::Error> {
1518 self.client.send::<SupplicantAddStaInterfaceRequest>(
1519 &mut payload,
1520 0x73194b2afe9b367e,
1521 fidl::encoding::DynamicFlags::FLEXIBLE,
1522 )
1523 }
1524
1525 pub fn r#remove_interface(
1526 &self,
1527 mut payload: SupplicantRemoveInterfaceRequest,
1528 ) -> Result<(), fidl::Error> {
1529 self.client.send::<SupplicantRemoveInterfaceRequest>(
1530 &mut payload,
1531 0x7f83e5b75b27d242,
1532 fidl::encoding::DynamicFlags::FLEXIBLE,
1533 )
1534 }
1535}
1536
1537#[cfg(target_os = "fuchsia")]
1538impl From<SupplicantSynchronousProxy> for zx::NullableHandle {
1539 fn from(value: SupplicantSynchronousProxy) -> Self {
1540 value.into_channel().into()
1541 }
1542}
1543
1544#[cfg(target_os = "fuchsia")]
1545impl From<fidl::Channel> for SupplicantSynchronousProxy {
1546 fn from(value: fidl::Channel) -> Self {
1547 Self::new(value)
1548 }
1549}
1550
1551#[cfg(target_os = "fuchsia")]
1552impl fidl::endpoints::FromClient for SupplicantSynchronousProxy {
1553 type Protocol = SupplicantMarker;
1554
1555 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantMarker>) -> Self {
1556 Self::new(value.into_channel())
1557 }
1558}
1559
1560#[derive(Debug, Clone)]
1561pub struct SupplicantProxy {
1562 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1563}
1564
1565impl fidl::endpoints::Proxy for SupplicantProxy {
1566 type Protocol = SupplicantMarker;
1567
1568 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1569 Self::new(inner)
1570 }
1571
1572 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1573 self.client.into_channel().map_err(|client| Self { client })
1574 }
1575
1576 fn as_channel(&self) -> &::fidl::AsyncChannel {
1577 self.client.as_channel()
1578 }
1579}
1580
1581impl SupplicantProxy {
1582 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1584 let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1585 Self { client: fidl::client::Client::new(channel, protocol_name) }
1586 }
1587
1588 pub fn take_event_stream(&self) -> SupplicantEventStream {
1594 SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1595 }
1596
1597 pub fn r#add_sta_interface(
1598 &self,
1599 mut payload: SupplicantAddStaInterfaceRequest,
1600 ) -> Result<(), fidl::Error> {
1601 SupplicantProxyInterface::r#add_sta_interface(self, payload)
1602 }
1603
1604 pub fn r#remove_interface(
1605 &self,
1606 mut payload: SupplicantRemoveInterfaceRequest,
1607 ) -> Result<(), fidl::Error> {
1608 SupplicantProxyInterface::r#remove_interface(self, payload)
1609 }
1610}
1611
1612impl SupplicantProxyInterface for SupplicantProxy {
1613 fn r#add_sta_interface(
1614 &self,
1615 mut payload: SupplicantAddStaInterfaceRequest,
1616 ) -> Result<(), fidl::Error> {
1617 self.client.send::<SupplicantAddStaInterfaceRequest>(
1618 &mut payload,
1619 0x73194b2afe9b367e,
1620 fidl::encoding::DynamicFlags::FLEXIBLE,
1621 )
1622 }
1623
1624 fn r#remove_interface(
1625 &self,
1626 mut payload: SupplicantRemoveInterfaceRequest,
1627 ) -> Result<(), fidl::Error> {
1628 self.client.send::<SupplicantRemoveInterfaceRequest>(
1629 &mut payload,
1630 0x7f83e5b75b27d242,
1631 fidl::encoding::DynamicFlags::FLEXIBLE,
1632 )
1633 }
1634}
1635
1636pub struct SupplicantEventStream {
1637 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1638}
1639
1640impl std::marker::Unpin for SupplicantEventStream {}
1641
1642impl futures::stream::FusedStream for SupplicantEventStream {
1643 fn is_terminated(&self) -> bool {
1644 self.event_receiver.is_terminated()
1645 }
1646}
1647
1648impl futures::Stream for SupplicantEventStream {
1649 type Item = Result<SupplicantEvent, fidl::Error>;
1650
1651 fn poll_next(
1652 mut self: std::pin::Pin<&mut Self>,
1653 cx: &mut std::task::Context<'_>,
1654 ) -> std::task::Poll<Option<Self::Item>> {
1655 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1656 &mut self.event_receiver,
1657 cx
1658 )?) {
1659 Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1660 None => std::task::Poll::Ready(None),
1661 }
1662 }
1663}
1664
1665#[derive(Debug)]
1666pub enum SupplicantEvent {
1667 #[non_exhaustive]
1668 _UnknownEvent {
1669 ordinal: u64,
1671 },
1672}
1673
1674impl SupplicantEvent {
1675 fn decode(
1677 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1678 ) -> Result<SupplicantEvent, fidl::Error> {
1679 let (bytes, _handles) = buf.split_mut();
1680 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1681 debug_assert_eq!(tx_header.tx_id, 0);
1682 match tx_header.ordinal {
1683 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1684 Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1685 }
1686 _ => Err(fidl::Error::UnknownOrdinal {
1687 ordinal: tx_header.ordinal,
1688 protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1689 }),
1690 }
1691 }
1692}
1693
1694pub struct SupplicantRequestStream {
1696 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1697 is_terminated: bool,
1698}
1699
1700impl std::marker::Unpin for SupplicantRequestStream {}
1701
1702impl futures::stream::FusedStream for SupplicantRequestStream {
1703 fn is_terminated(&self) -> bool {
1704 self.is_terminated
1705 }
1706}
1707
1708impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1709 type Protocol = SupplicantMarker;
1710 type ControlHandle = SupplicantControlHandle;
1711
1712 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1713 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1714 }
1715
1716 fn control_handle(&self) -> Self::ControlHandle {
1717 SupplicantControlHandle { inner: self.inner.clone() }
1718 }
1719
1720 fn into_inner(
1721 self,
1722 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1723 {
1724 (self.inner, self.is_terminated)
1725 }
1726
1727 fn from_inner(
1728 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1729 is_terminated: bool,
1730 ) -> Self {
1731 Self { inner, is_terminated }
1732 }
1733}
1734
1735impl futures::Stream for SupplicantRequestStream {
1736 type Item = Result<SupplicantRequest, fidl::Error>;
1737
1738 fn poll_next(
1739 mut self: std::pin::Pin<&mut Self>,
1740 cx: &mut std::task::Context<'_>,
1741 ) -> std::task::Poll<Option<Self::Item>> {
1742 let this = &mut *self;
1743 if this.inner.check_shutdown(cx) {
1744 this.is_terminated = true;
1745 return std::task::Poll::Ready(None);
1746 }
1747 if this.is_terminated {
1748 panic!("polled SupplicantRequestStream after completion");
1749 }
1750 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1751 |bytes, handles| {
1752 match this.inner.channel().read_etc(cx, bytes, handles) {
1753 std::task::Poll::Ready(Ok(())) => {}
1754 std::task::Poll::Pending => return std::task::Poll::Pending,
1755 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1756 this.is_terminated = true;
1757 return std::task::Poll::Ready(None);
1758 }
1759 std::task::Poll::Ready(Err(e)) => {
1760 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1761 e.into(),
1762 ))));
1763 }
1764 }
1765
1766 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1768
1769 std::task::Poll::Ready(Some(match header.ordinal {
1770 0x73194b2afe9b367e => {
1771 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1772 let mut req = fidl::new_empty!(
1773 SupplicantAddStaInterfaceRequest,
1774 fidl::encoding::DefaultFuchsiaResourceDialect
1775 );
1776 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1777 let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1778 Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1779 }
1780 0x7f83e5b75b27d242 => {
1781 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1782 let mut req = fidl::new_empty!(
1783 SupplicantRemoveInterfaceRequest,
1784 fidl::encoding::DefaultFuchsiaResourceDialect
1785 );
1786 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantRemoveInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1787 let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1788 Ok(SupplicantRequest::RemoveInterface { payload: req, control_handle })
1789 }
1790 _ if header.tx_id == 0
1791 && header
1792 .dynamic_flags()
1793 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1794 {
1795 Ok(SupplicantRequest::_UnknownMethod {
1796 ordinal: header.ordinal,
1797 control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1798 method_type: fidl::MethodType::OneWay,
1799 })
1800 }
1801 _ if header
1802 .dynamic_flags()
1803 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1804 {
1805 this.inner.send_framework_err(
1806 fidl::encoding::FrameworkErr::UnknownMethod,
1807 header.tx_id,
1808 header.ordinal,
1809 header.dynamic_flags(),
1810 (bytes, handles),
1811 )?;
1812 Ok(SupplicantRequest::_UnknownMethod {
1813 ordinal: header.ordinal,
1814 control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1815 method_type: fidl::MethodType::TwoWay,
1816 })
1817 }
1818 _ => Err(fidl::Error::UnknownOrdinal {
1819 ordinal: header.ordinal,
1820 protocol_name:
1821 <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1822 }),
1823 }))
1824 },
1825 )
1826 }
1827}
1828
1829#[derive(Debug)]
1830pub enum SupplicantRequest {
1831 AddStaInterface {
1832 payload: SupplicantAddStaInterfaceRequest,
1833 control_handle: SupplicantControlHandle,
1834 },
1835 RemoveInterface {
1836 payload: SupplicantRemoveInterfaceRequest,
1837 control_handle: SupplicantControlHandle,
1838 },
1839 #[non_exhaustive]
1841 _UnknownMethod {
1842 ordinal: u64,
1844 control_handle: SupplicantControlHandle,
1845 method_type: fidl::MethodType,
1846 },
1847}
1848
1849impl SupplicantRequest {
1850 #[allow(irrefutable_let_patterns)]
1851 pub fn into_add_sta_interface(
1852 self,
1853 ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1854 if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1855 Some((payload, control_handle))
1856 } else {
1857 None
1858 }
1859 }
1860
1861 #[allow(irrefutable_let_patterns)]
1862 pub fn into_remove_interface(
1863 self,
1864 ) -> Option<(SupplicantRemoveInterfaceRequest, SupplicantControlHandle)> {
1865 if let SupplicantRequest::RemoveInterface { payload, control_handle } = self {
1866 Some((payload, control_handle))
1867 } else {
1868 None
1869 }
1870 }
1871
1872 pub fn method_name(&self) -> &'static str {
1874 match *self {
1875 SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1876 SupplicantRequest::RemoveInterface { .. } => "remove_interface",
1877 SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1878 "unknown one-way method"
1879 }
1880 SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1881 "unknown two-way method"
1882 }
1883 }
1884 }
1885}
1886
1887#[derive(Debug, Clone)]
1888pub struct SupplicantControlHandle {
1889 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1890}
1891
1892impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1893 fn shutdown(&self) {
1894 self.inner.shutdown()
1895 }
1896
1897 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1898 self.inner.shutdown_with_epitaph(status)
1899 }
1900
1901 fn is_closed(&self) -> bool {
1902 self.inner.channel().is_closed()
1903 }
1904 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1905 self.inner.channel().on_closed()
1906 }
1907
1908 #[cfg(target_os = "fuchsia")]
1909 fn signal_peer(
1910 &self,
1911 clear_mask: zx::Signals,
1912 set_mask: zx::Signals,
1913 ) -> Result<(), zx_status::Status> {
1914 use fidl::Peered;
1915 self.inner.channel().signal_peer(clear_mask, set_mask)
1916 }
1917}
1918
1919impl SupplicantControlHandle {}
1920
1921#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1922pub struct SupplicantStaIfaceMarker;
1923
1924impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1925 type Proxy = SupplicantStaIfaceProxy;
1926 type RequestStream = SupplicantStaIfaceRequestStream;
1927 #[cfg(target_os = "fuchsia")]
1928 type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1929
1930 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1931}
1932pub type SupplicantStaIfaceGetMacAddressResult =
1933 Result<SupplicantStaIfaceGetMacAddressResponse, i32>;
1934pub type SupplicantStaIfaceGetFactoryMacAddressResult = Result<[u8; 6], i32>;
1935pub type SupplicantStaIfaceSetBtCoexistenceModeResult = Result<(), WlanixError>;
1936pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1937pub type SupplicantStaIfaceGetSignalPollResultsResult =
1938 Result<SupplicantStaIfaceGetSignalPollResultsResponse, i32>;
1939
1940pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1941 fn r#register_callback(
1942 &self,
1943 payload: SupplicantStaIfaceRegisterCallbackRequest,
1944 ) -> Result<(), fidl::Error>;
1945 fn r#add_network(
1946 &self,
1947 payload: SupplicantStaIfaceAddNetworkRequest,
1948 ) -> Result<(), fidl::Error>;
1949 type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1950 fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1951 type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1952 + Send;
1953 fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1954 type GetFactoryMacAddressResponseFut: std::future::Future<
1955 Output = Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error>,
1956 > + Send;
1957 fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut;
1958 type SetBtCoexistenceModeResponseFut: std::future::Future<
1959 Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1960 > + Send;
1961 fn r#set_bt_coexistence_mode(
1962 &self,
1963 payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1964 ) -> Self::SetBtCoexistenceModeResponseFut;
1965 type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1966 fn r#set_power_save(
1967 &self,
1968 payload: SupplicantStaIfaceSetPowerSaveRequest,
1969 ) -> Self::SetPowerSaveResponseFut;
1970 type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1971 + Send;
1972 fn r#set_suspend_mode_enabled(
1973 &self,
1974 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1975 ) -> Self::SetSuspendModeEnabledResponseFut;
1976 type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1977 + Send;
1978 fn r#set_sta_country_code(
1979 &self,
1980 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1981 ) -> Self::SetStaCountryCodeResponseFut;
1982 type GetSignalPollResultsResponseFut: std::future::Future<
1983 Output = Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error>,
1984 > + Send;
1985 fn r#get_signal_poll_results(&self) -> Self::GetSignalPollResultsResponseFut;
1986}
1987#[derive(Debug)]
1988#[cfg(target_os = "fuchsia")]
1989pub struct SupplicantStaIfaceSynchronousProxy {
1990 client: fidl::client::sync::Client,
1991}
1992
1993#[cfg(target_os = "fuchsia")]
1994impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1995 type Proxy = SupplicantStaIfaceProxy;
1996 type Protocol = SupplicantStaIfaceMarker;
1997
1998 fn from_channel(inner: fidl::Channel) -> Self {
1999 Self::new(inner)
2000 }
2001
2002 fn into_channel(self) -> fidl::Channel {
2003 self.client.into_channel()
2004 }
2005
2006 fn as_channel(&self) -> &fidl::Channel {
2007 self.client.as_channel()
2008 }
2009}
2010
2011#[cfg(target_os = "fuchsia")]
2012impl SupplicantStaIfaceSynchronousProxy {
2013 pub fn new(channel: fidl::Channel) -> Self {
2014 Self { client: fidl::client::sync::Client::new(channel) }
2015 }
2016
2017 pub fn into_channel(self) -> fidl::Channel {
2018 self.client.into_channel()
2019 }
2020
2021 pub fn wait_for_event(
2024 &self,
2025 deadline: zx::MonotonicInstant,
2026 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2027 SupplicantStaIfaceEvent::decode(
2028 self.client.wait_for_event::<SupplicantStaIfaceMarker>(deadline)?,
2029 )
2030 }
2031
2032 pub fn r#register_callback(
2033 &self,
2034 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2035 ) -> Result<(), fidl::Error> {
2036 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2037 &mut payload,
2038 0x1be680e863a8e71,
2039 fidl::encoding::DynamicFlags::FLEXIBLE,
2040 )
2041 }
2042
2043 pub fn r#add_network(
2044 &self,
2045 mut payload: SupplicantStaIfaceAddNetworkRequest,
2046 ) -> Result<(), fidl::Error> {
2047 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2048 &mut payload,
2049 0xa77cf60628766dc,
2050 fidl::encoding::DynamicFlags::FLEXIBLE,
2051 )
2052 }
2053
2054 pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2055 let _response = self.client.send_query::<
2056 fidl::encoding::EmptyPayload,
2057 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2058 SupplicantStaIfaceMarker,
2059 >(
2060 (),
2061 0x52a1d38e0b4871fa,
2062 fidl::encoding::DynamicFlags::FLEXIBLE,
2063 ___deadline,
2064 )?
2065 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2066 Ok(_response)
2067 }
2068
2069 pub fn r#get_mac_address(
2070 &self,
2071 ___deadline: zx::MonotonicInstant,
2072 ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2073 let _response = self.client.send_query::<
2074 fidl::encoding::EmptyPayload,
2075 fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2076 SupplicantStaIfaceMarker,
2077 >(
2078 (),
2079 0x60591d204a3f537f,
2080 fidl::encoding::DynamicFlags::FLEXIBLE,
2081 ___deadline,
2082 )?
2083 .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2084 Ok(_response.map(|x| x))
2085 }
2086
2087 pub fn r#get_factory_mac_address(
2088 &self,
2089 ___deadline: zx::MonotonicInstant,
2090 ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2091 let _response =
2092 self.client
2093 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2094 SupplicantStaIfaceGetFactoryMacAddressResponse,
2095 i32,
2096 >, SupplicantStaIfaceMarker>(
2097 (),
2098 0x58857179ad71e624,
2099 fidl::encoding::DynamicFlags::FLEXIBLE,
2100 ___deadline,
2101 )?
2102 .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2103 Ok(_response.map(|x| x.mac_addr))
2104 }
2105
2106 pub fn r#set_bt_coexistence_mode(
2107 &self,
2108 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2109 ___deadline: zx::MonotonicInstant,
2110 ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2111 let _response = self.client.send_query::<
2112 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2113 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2114 SupplicantStaIfaceMarker,
2115 >(
2116 payload,
2117 0x14567ff593a9b154,
2118 fidl::encoding::DynamicFlags::FLEXIBLE,
2119 ___deadline,
2120 )?
2121 .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2122 Ok(_response.map(|x| x))
2123 }
2124
2125 pub fn r#set_power_save(
2126 &self,
2127 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2128 ___deadline: zx::MonotonicInstant,
2129 ) -> Result<(), fidl::Error> {
2130 let _response = self.client.send_query::<
2131 SupplicantStaIfaceSetPowerSaveRequest,
2132 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2133 SupplicantStaIfaceMarker,
2134 >(
2135 &mut payload,
2136 0x5a04c29320085298,
2137 fidl::encoding::DynamicFlags::FLEXIBLE,
2138 ___deadline,
2139 )?
2140 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2141 Ok(_response)
2142 }
2143
2144 pub fn r#set_suspend_mode_enabled(
2145 &self,
2146 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2147 ___deadline: zx::MonotonicInstant,
2148 ) -> Result<(), fidl::Error> {
2149 let _response = self.client.send_query::<
2150 SupplicantStaIfaceSetSuspendModeEnabledRequest,
2151 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2152 SupplicantStaIfaceMarker,
2153 >(
2154 &mut payload,
2155 0xaf10de85bb7023a,
2156 fidl::encoding::DynamicFlags::FLEXIBLE,
2157 ___deadline,
2158 )?
2159 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2160 Ok(_response)
2161 }
2162
2163 pub fn r#set_sta_country_code(
2164 &self,
2165 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2166 ___deadline: zx::MonotonicInstant,
2167 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2168 let _response = self.client.send_query::<
2169 SupplicantStaIfaceSetStaCountryCodeRequest,
2170 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2171 SupplicantStaIfaceMarker,
2172 >(
2173 &mut payload,
2174 0x977e22f9b79b26e,
2175 fidl::encoding::DynamicFlags::FLEXIBLE,
2176 ___deadline,
2177 )?
2178 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2179 Ok(_response.map(|x| x))
2180 }
2181
2182 pub fn r#get_signal_poll_results(
2183 &self,
2184 ___deadline: zx::MonotonicInstant,
2185 ) -> Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error> {
2186 let _response =
2187 self.client
2188 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2189 SupplicantStaIfaceGetSignalPollResultsResponse,
2190 i32,
2191 >, SupplicantStaIfaceMarker>(
2192 (),
2193 0x783512ea6925df61,
2194 fidl::encoding::DynamicFlags::FLEXIBLE,
2195 ___deadline,
2196 )?
2197 .into_result::<SupplicantStaIfaceMarker>("get_signal_poll_results")?;
2198 Ok(_response.map(|x| x))
2199 }
2200}
2201
2202#[cfg(target_os = "fuchsia")]
2203impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2204 fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2205 value.into_channel().into()
2206 }
2207}
2208
2209#[cfg(target_os = "fuchsia")]
2210impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2211 fn from(value: fidl::Channel) -> Self {
2212 Self::new(value)
2213 }
2214}
2215
2216#[cfg(target_os = "fuchsia")]
2217impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2218 type Protocol = SupplicantStaIfaceMarker;
2219
2220 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2221 Self::new(value.into_channel())
2222 }
2223}
2224
2225#[derive(Debug, Clone)]
2226pub struct SupplicantStaIfaceProxy {
2227 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2228}
2229
2230impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2231 type Protocol = SupplicantStaIfaceMarker;
2232
2233 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2234 Self::new(inner)
2235 }
2236
2237 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2238 self.client.into_channel().map_err(|client| Self { client })
2239 }
2240
2241 fn as_channel(&self) -> &::fidl::AsyncChannel {
2242 self.client.as_channel()
2243 }
2244}
2245
2246impl SupplicantStaIfaceProxy {
2247 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2249 let protocol_name =
2250 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2251 Self { client: fidl::client::Client::new(channel, protocol_name) }
2252 }
2253
2254 pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2260 SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2261 }
2262
2263 pub fn r#register_callback(
2264 &self,
2265 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2266 ) -> Result<(), fidl::Error> {
2267 SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2268 }
2269
2270 pub fn r#add_network(
2271 &self,
2272 mut payload: SupplicantStaIfaceAddNetworkRequest,
2273 ) -> Result<(), fidl::Error> {
2274 SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2275 }
2276
2277 pub fn r#disconnect(
2278 &self,
2279 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2280 SupplicantStaIfaceProxyInterface::r#disconnect(self)
2281 }
2282
2283 pub fn r#get_mac_address(
2284 &self,
2285 ) -> fidl::client::QueryResponseFut<
2286 SupplicantStaIfaceGetMacAddressResult,
2287 fidl::encoding::DefaultFuchsiaResourceDialect,
2288 > {
2289 SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2290 }
2291
2292 pub fn r#get_factory_mac_address(
2293 &self,
2294 ) -> fidl::client::QueryResponseFut<
2295 SupplicantStaIfaceGetFactoryMacAddressResult,
2296 fidl::encoding::DefaultFuchsiaResourceDialect,
2297 > {
2298 SupplicantStaIfaceProxyInterface::r#get_factory_mac_address(self)
2299 }
2300
2301 pub fn r#set_bt_coexistence_mode(
2302 &self,
2303 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2304 ) -> fidl::client::QueryResponseFut<
2305 SupplicantStaIfaceSetBtCoexistenceModeResult,
2306 fidl::encoding::DefaultFuchsiaResourceDialect,
2307 > {
2308 SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2309 }
2310
2311 pub fn r#set_power_save(
2312 &self,
2313 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2314 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2315 SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2316 }
2317
2318 pub fn r#set_suspend_mode_enabled(
2319 &self,
2320 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2321 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2322 SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2323 }
2324
2325 pub fn r#set_sta_country_code(
2326 &self,
2327 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2328 ) -> fidl::client::QueryResponseFut<
2329 SupplicantStaIfaceSetStaCountryCodeResult,
2330 fidl::encoding::DefaultFuchsiaResourceDialect,
2331 > {
2332 SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2333 }
2334
2335 pub fn r#get_signal_poll_results(
2336 &self,
2337 ) -> fidl::client::QueryResponseFut<
2338 SupplicantStaIfaceGetSignalPollResultsResult,
2339 fidl::encoding::DefaultFuchsiaResourceDialect,
2340 > {
2341 SupplicantStaIfaceProxyInterface::r#get_signal_poll_results(self)
2342 }
2343}
2344
2345impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2346 fn r#register_callback(
2347 &self,
2348 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2349 ) -> Result<(), fidl::Error> {
2350 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2351 &mut payload,
2352 0x1be680e863a8e71,
2353 fidl::encoding::DynamicFlags::FLEXIBLE,
2354 )
2355 }
2356
2357 fn r#add_network(
2358 &self,
2359 mut payload: SupplicantStaIfaceAddNetworkRequest,
2360 ) -> Result<(), fidl::Error> {
2361 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2362 &mut payload,
2363 0xa77cf60628766dc,
2364 fidl::encoding::DynamicFlags::FLEXIBLE,
2365 )
2366 }
2367
2368 type DisconnectResponseFut =
2369 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2370 fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2371 fn _decode(
2372 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2373 ) -> Result<(), fidl::Error> {
2374 let _response = fidl::client::decode_transaction_body::<
2375 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2376 fidl::encoding::DefaultFuchsiaResourceDialect,
2377 0x52a1d38e0b4871fa,
2378 >(_buf?)?
2379 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2380 Ok(_response)
2381 }
2382 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2383 (),
2384 0x52a1d38e0b4871fa,
2385 fidl::encoding::DynamicFlags::FLEXIBLE,
2386 _decode,
2387 )
2388 }
2389
2390 type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2391 SupplicantStaIfaceGetMacAddressResult,
2392 fidl::encoding::DefaultFuchsiaResourceDialect,
2393 >;
2394 fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2395 fn _decode(
2396 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2397 ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2398 let _response = fidl::client::decode_transaction_body::<
2399 fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2400 fidl::encoding::DefaultFuchsiaResourceDialect,
2401 0x60591d204a3f537f,
2402 >(_buf?)?
2403 .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2404 Ok(_response.map(|x| x))
2405 }
2406 self.client.send_query_and_decode::<
2407 fidl::encoding::EmptyPayload,
2408 SupplicantStaIfaceGetMacAddressResult,
2409 >(
2410 (),
2411 0x60591d204a3f537f,
2412 fidl::encoding::DynamicFlags::FLEXIBLE,
2413 _decode,
2414 )
2415 }
2416
2417 type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
2418 SupplicantStaIfaceGetFactoryMacAddressResult,
2419 fidl::encoding::DefaultFuchsiaResourceDialect,
2420 >;
2421 fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
2422 fn _decode(
2423 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2424 ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2425 let _response = fidl::client::decode_transaction_body::<
2426 fidl::encoding::FlexibleResultType<
2427 SupplicantStaIfaceGetFactoryMacAddressResponse,
2428 i32,
2429 >,
2430 fidl::encoding::DefaultFuchsiaResourceDialect,
2431 0x58857179ad71e624,
2432 >(_buf?)?
2433 .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2434 Ok(_response.map(|x| x.mac_addr))
2435 }
2436 self.client.send_query_and_decode::<
2437 fidl::encoding::EmptyPayload,
2438 SupplicantStaIfaceGetFactoryMacAddressResult,
2439 >(
2440 (),
2441 0x58857179ad71e624,
2442 fidl::encoding::DynamicFlags::FLEXIBLE,
2443 _decode,
2444 )
2445 }
2446
2447 type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2448 SupplicantStaIfaceSetBtCoexistenceModeResult,
2449 fidl::encoding::DefaultFuchsiaResourceDialect,
2450 >;
2451 fn r#set_bt_coexistence_mode(
2452 &self,
2453 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2454 ) -> Self::SetBtCoexistenceModeResponseFut {
2455 fn _decode(
2456 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2457 ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2458 let _response = fidl::client::decode_transaction_body::<
2459 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2460 fidl::encoding::DefaultFuchsiaResourceDialect,
2461 0x14567ff593a9b154,
2462 >(_buf?)?
2463 .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2464 Ok(_response.map(|x| x))
2465 }
2466 self.client.send_query_and_decode::<
2467 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2468 SupplicantStaIfaceSetBtCoexistenceModeResult,
2469 >(
2470 payload,
2471 0x14567ff593a9b154,
2472 fidl::encoding::DynamicFlags::FLEXIBLE,
2473 _decode,
2474 )
2475 }
2476
2477 type SetPowerSaveResponseFut =
2478 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2479 fn r#set_power_save(
2480 &self,
2481 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2482 ) -> Self::SetPowerSaveResponseFut {
2483 fn _decode(
2484 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2485 ) -> Result<(), fidl::Error> {
2486 let _response = fidl::client::decode_transaction_body::<
2487 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2488 fidl::encoding::DefaultFuchsiaResourceDialect,
2489 0x5a04c29320085298,
2490 >(_buf?)?
2491 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2492 Ok(_response)
2493 }
2494 self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2495 &mut payload,
2496 0x5a04c29320085298,
2497 fidl::encoding::DynamicFlags::FLEXIBLE,
2498 _decode,
2499 )
2500 }
2501
2502 type SetSuspendModeEnabledResponseFut =
2503 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2504 fn r#set_suspend_mode_enabled(
2505 &self,
2506 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2507 ) -> Self::SetSuspendModeEnabledResponseFut {
2508 fn _decode(
2509 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2510 ) -> Result<(), fidl::Error> {
2511 let _response = fidl::client::decode_transaction_body::<
2512 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2513 fidl::encoding::DefaultFuchsiaResourceDialect,
2514 0xaf10de85bb7023a,
2515 >(_buf?)?
2516 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2517 Ok(_response)
2518 }
2519 self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2520 &mut payload,
2521 0xaf10de85bb7023a,
2522 fidl::encoding::DynamicFlags::FLEXIBLE,
2523 _decode,
2524 )
2525 }
2526
2527 type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2528 SupplicantStaIfaceSetStaCountryCodeResult,
2529 fidl::encoding::DefaultFuchsiaResourceDialect,
2530 >;
2531 fn r#set_sta_country_code(
2532 &self,
2533 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2534 ) -> Self::SetStaCountryCodeResponseFut {
2535 fn _decode(
2536 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2537 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2538 let _response = fidl::client::decode_transaction_body::<
2539 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2540 fidl::encoding::DefaultFuchsiaResourceDialect,
2541 0x977e22f9b79b26e,
2542 >(_buf?)?
2543 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2544 Ok(_response.map(|x| x))
2545 }
2546 self.client.send_query_and_decode::<
2547 SupplicantStaIfaceSetStaCountryCodeRequest,
2548 SupplicantStaIfaceSetStaCountryCodeResult,
2549 >(
2550 &mut payload,
2551 0x977e22f9b79b26e,
2552 fidl::encoding::DynamicFlags::FLEXIBLE,
2553 _decode,
2554 )
2555 }
2556
2557 type GetSignalPollResultsResponseFut = fidl::client::QueryResponseFut<
2558 SupplicantStaIfaceGetSignalPollResultsResult,
2559 fidl::encoding::DefaultFuchsiaResourceDialect,
2560 >;
2561 fn r#get_signal_poll_results(&self) -> Self::GetSignalPollResultsResponseFut {
2562 fn _decode(
2563 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2564 ) -> Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error> {
2565 let _response = fidl::client::decode_transaction_body::<
2566 fidl::encoding::FlexibleResultType<
2567 SupplicantStaIfaceGetSignalPollResultsResponse,
2568 i32,
2569 >,
2570 fidl::encoding::DefaultFuchsiaResourceDialect,
2571 0x783512ea6925df61,
2572 >(_buf?)?
2573 .into_result::<SupplicantStaIfaceMarker>("get_signal_poll_results")?;
2574 Ok(_response.map(|x| x))
2575 }
2576 self.client.send_query_and_decode::<
2577 fidl::encoding::EmptyPayload,
2578 SupplicantStaIfaceGetSignalPollResultsResult,
2579 >(
2580 (),
2581 0x783512ea6925df61,
2582 fidl::encoding::DynamicFlags::FLEXIBLE,
2583 _decode,
2584 )
2585 }
2586}
2587
2588pub struct SupplicantStaIfaceEventStream {
2589 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2590}
2591
2592impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2593
2594impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2595 fn is_terminated(&self) -> bool {
2596 self.event_receiver.is_terminated()
2597 }
2598}
2599
2600impl futures::Stream for SupplicantStaIfaceEventStream {
2601 type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2602
2603 fn poll_next(
2604 mut self: std::pin::Pin<&mut Self>,
2605 cx: &mut std::task::Context<'_>,
2606 ) -> std::task::Poll<Option<Self::Item>> {
2607 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2608 &mut self.event_receiver,
2609 cx
2610 )?) {
2611 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2612 None => std::task::Poll::Ready(None),
2613 }
2614 }
2615}
2616
2617#[derive(Debug)]
2618pub enum SupplicantStaIfaceEvent {
2619 #[non_exhaustive]
2620 _UnknownEvent {
2621 ordinal: u64,
2623 },
2624}
2625
2626impl SupplicantStaIfaceEvent {
2627 fn decode(
2629 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2630 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2631 let (bytes, _handles) = buf.split_mut();
2632 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2633 debug_assert_eq!(tx_header.tx_id, 0);
2634 match tx_header.ordinal {
2635 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2636 Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2637 }
2638 _ => Err(fidl::Error::UnknownOrdinal {
2639 ordinal: tx_header.ordinal,
2640 protocol_name:
2641 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2642 }),
2643 }
2644 }
2645}
2646
2647pub struct SupplicantStaIfaceRequestStream {
2649 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2650 is_terminated: bool,
2651}
2652
2653impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2654
2655impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2656 fn is_terminated(&self) -> bool {
2657 self.is_terminated
2658 }
2659}
2660
2661impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2662 type Protocol = SupplicantStaIfaceMarker;
2663 type ControlHandle = SupplicantStaIfaceControlHandle;
2664
2665 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2666 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2667 }
2668
2669 fn control_handle(&self) -> Self::ControlHandle {
2670 SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2671 }
2672
2673 fn into_inner(
2674 self,
2675 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2676 {
2677 (self.inner, self.is_terminated)
2678 }
2679
2680 fn from_inner(
2681 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2682 is_terminated: bool,
2683 ) -> Self {
2684 Self { inner, is_terminated }
2685 }
2686}
2687
2688impl futures::Stream for SupplicantStaIfaceRequestStream {
2689 type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2690
2691 fn poll_next(
2692 mut self: std::pin::Pin<&mut Self>,
2693 cx: &mut std::task::Context<'_>,
2694 ) -> std::task::Poll<Option<Self::Item>> {
2695 let this = &mut *self;
2696 if this.inner.check_shutdown(cx) {
2697 this.is_terminated = true;
2698 return std::task::Poll::Ready(None);
2699 }
2700 if this.is_terminated {
2701 panic!("polled SupplicantStaIfaceRequestStream after completion");
2702 }
2703 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2704 |bytes, handles| {
2705 match this.inner.channel().read_etc(cx, bytes, handles) {
2706 std::task::Poll::Ready(Ok(())) => {}
2707 std::task::Poll::Pending => return std::task::Poll::Pending,
2708 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2709 this.is_terminated = true;
2710 return std::task::Poll::Ready(None);
2711 }
2712 std::task::Poll::Ready(Err(e)) => {
2713 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2714 e.into(),
2715 ))));
2716 }
2717 }
2718
2719 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2721
2722 std::task::Poll::Ready(Some(match header.ordinal {
2723 0x1be680e863a8e71 => {
2724 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2725 let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2726 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2727 let control_handle = SupplicantStaIfaceControlHandle {
2728 inner: this.inner.clone(),
2729 };
2730 Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2731 control_handle,
2732 })
2733 }
2734 0xa77cf60628766dc => {
2735 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2736 let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2737 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2738 let control_handle = SupplicantStaIfaceControlHandle {
2739 inner: this.inner.clone(),
2740 };
2741 Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2742 control_handle,
2743 })
2744 }
2745 0x52a1d38e0b4871fa => {
2746 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2747 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2748 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2749 let control_handle = SupplicantStaIfaceControlHandle {
2750 inner: this.inner.clone(),
2751 };
2752 Ok(SupplicantStaIfaceRequest::Disconnect {
2753 responder: SupplicantStaIfaceDisconnectResponder {
2754 control_handle: std::mem::ManuallyDrop::new(control_handle),
2755 tx_id: header.tx_id,
2756 },
2757 })
2758 }
2759 0x60591d204a3f537f => {
2760 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2761 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2762 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2763 let control_handle = SupplicantStaIfaceControlHandle {
2764 inner: this.inner.clone(),
2765 };
2766 Ok(SupplicantStaIfaceRequest::GetMacAddress {
2767 responder: SupplicantStaIfaceGetMacAddressResponder {
2768 control_handle: std::mem::ManuallyDrop::new(control_handle),
2769 tx_id: header.tx_id,
2770 },
2771 })
2772 }
2773 0x58857179ad71e624 => {
2774 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2775 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2776 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2777 let control_handle = SupplicantStaIfaceControlHandle {
2778 inner: this.inner.clone(),
2779 };
2780 Ok(SupplicantStaIfaceRequest::GetFactoryMacAddress {
2781 responder: SupplicantStaIfaceGetFactoryMacAddressResponder {
2782 control_handle: std::mem::ManuallyDrop::new(control_handle),
2783 tx_id: header.tx_id,
2784 },
2785 })
2786 }
2787 0x14567ff593a9b154 => {
2788 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2789 let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2790 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2791 let control_handle = SupplicantStaIfaceControlHandle {
2792 inner: this.inner.clone(),
2793 };
2794 Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2795 responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2796 control_handle: std::mem::ManuallyDrop::new(control_handle),
2797 tx_id: header.tx_id,
2798 },
2799 })
2800 }
2801 0x5a04c29320085298 => {
2802 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2803 let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2804 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2805 let control_handle = SupplicantStaIfaceControlHandle {
2806 inner: this.inner.clone(),
2807 };
2808 Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2809 responder: SupplicantStaIfaceSetPowerSaveResponder {
2810 control_handle: std::mem::ManuallyDrop::new(control_handle),
2811 tx_id: header.tx_id,
2812 },
2813 })
2814 }
2815 0xaf10de85bb7023a => {
2816 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2817 let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2818 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2819 let control_handle = SupplicantStaIfaceControlHandle {
2820 inner: this.inner.clone(),
2821 };
2822 Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2823 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2824 control_handle: std::mem::ManuallyDrop::new(control_handle),
2825 tx_id: header.tx_id,
2826 },
2827 })
2828 }
2829 0x977e22f9b79b26e => {
2830 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2831 let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2832 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2833 let control_handle = SupplicantStaIfaceControlHandle {
2834 inner: this.inner.clone(),
2835 };
2836 Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2837 responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2838 control_handle: std::mem::ManuallyDrop::new(control_handle),
2839 tx_id: header.tx_id,
2840 },
2841 })
2842 }
2843 0x783512ea6925df61 => {
2844 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2845 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2846 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2847 let control_handle = SupplicantStaIfaceControlHandle {
2848 inner: this.inner.clone(),
2849 };
2850 Ok(SupplicantStaIfaceRequest::GetSignalPollResults {
2851 responder: SupplicantStaIfaceGetSignalPollResultsResponder {
2852 control_handle: std::mem::ManuallyDrop::new(control_handle),
2853 tx_id: header.tx_id,
2854 },
2855 })
2856 }
2857 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2858 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2859 ordinal: header.ordinal,
2860 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2861 method_type: fidl::MethodType::OneWay,
2862 })
2863 }
2864 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2865 this.inner.send_framework_err(
2866 fidl::encoding::FrameworkErr::UnknownMethod,
2867 header.tx_id,
2868 header.ordinal,
2869 header.dynamic_flags(),
2870 (bytes, handles),
2871 )?;
2872 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2873 ordinal: header.ordinal,
2874 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2875 method_type: fidl::MethodType::TwoWay,
2876 })
2877 }
2878 _ => Err(fidl::Error::UnknownOrdinal {
2879 ordinal: header.ordinal,
2880 protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2881 }),
2882 }))
2883 },
2884 )
2885 }
2886}
2887
2888#[derive(Debug)]
2889pub enum SupplicantStaIfaceRequest {
2890 RegisterCallback {
2891 payload: SupplicantStaIfaceRegisterCallbackRequest,
2892 control_handle: SupplicantStaIfaceControlHandle,
2893 },
2894 AddNetwork {
2895 payload: SupplicantStaIfaceAddNetworkRequest,
2896 control_handle: SupplicantStaIfaceControlHandle,
2897 },
2898 Disconnect {
2899 responder: SupplicantStaIfaceDisconnectResponder,
2900 },
2901 GetMacAddress {
2902 responder: SupplicantStaIfaceGetMacAddressResponder,
2903 },
2904 GetFactoryMacAddress {
2905 responder: SupplicantStaIfaceGetFactoryMacAddressResponder,
2906 },
2907 SetBtCoexistenceMode {
2908 payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2909 responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2910 },
2911 SetPowerSave {
2912 payload: SupplicantStaIfaceSetPowerSaveRequest,
2913 responder: SupplicantStaIfaceSetPowerSaveResponder,
2914 },
2915 SetSuspendModeEnabled {
2916 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2917 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2918 },
2919 SetStaCountryCode {
2920 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2921 responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2922 },
2923 GetSignalPollResults {
2924 responder: SupplicantStaIfaceGetSignalPollResultsResponder,
2925 },
2926 #[non_exhaustive]
2928 _UnknownMethod {
2929 ordinal: u64,
2931 control_handle: SupplicantStaIfaceControlHandle,
2932 method_type: fidl::MethodType,
2933 },
2934}
2935
2936impl SupplicantStaIfaceRequest {
2937 #[allow(irrefutable_let_patterns)]
2938 pub fn into_register_callback(
2939 self,
2940 ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2941 if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2942 Some((payload, control_handle))
2943 } else {
2944 None
2945 }
2946 }
2947
2948 #[allow(irrefutable_let_patterns)]
2949 pub fn into_add_network(
2950 self,
2951 ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2952 if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2953 Some((payload, control_handle))
2954 } else {
2955 None
2956 }
2957 }
2958
2959 #[allow(irrefutable_let_patterns)]
2960 pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2961 if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2962 Some((responder))
2963 } else {
2964 None
2965 }
2966 }
2967
2968 #[allow(irrefutable_let_patterns)]
2969 pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2970 if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2971 Some((responder))
2972 } else {
2973 None
2974 }
2975 }
2976
2977 #[allow(irrefutable_let_patterns)]
2978 pub fn into_get_factory_mac_address(
2979 self,
2980 ) -> Option<(SupplicantStaIfaceGetFactoryMacAddressResponder)> {
2981 if let SupplicantStaIfaceRequest::GetFactoryMacAddress { responder } = self {
2982 Some((responder))
2983 } else {
2984 None
2985 }
2986 }
2987
2988 #[allow(irrefutable_let_patterns)]
2989 pub fn into_set_bt_coexistence_mode(
2990 self,
2991 ) -> Option<(
2992 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2993 SupplicantStaIfaceSetBtCoexistenceModeResponder,
2994 )> {
2995 if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
2996 Some((payload, responder))
2997 } else {
2998 None
2999 }
3000 }
3001
3002 #[allow(irrefutable_let_patterns)]
3003 pub fn into_set_power_save(
3004 self,
3005 ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
3006 {
3007 if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
3008 Some((payload, responder))
3009 } else {
3010 None
3011 }
3012 }
3013
3014 #[allow(irrefutable_let_patterns)]
3015 pub fn into_set_suspend_mode_enabled(
3016 self,
3017 ) -> Option<(
3018 SupplicantStaIfaceSetSuspendModeEnabledRequest,
3019 SupplicantStaIfaceSetSuspendModeEnabledResponder,
3020 )> {
3021 if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
3022 Some((payload, responder))
3023 } else {
3024 None
3025 }
3026 }
3027
3028 #[allow(irrefutable_let_patterns)]
3029 pub fn into_set_sta_country_code(
3030 self,
3031 ) -> Option<(
3032 SupplicantStaIfaceSetStaCountryCodeRequest,
3033 SupplicantStaIfaceSetStaCountryCodeResponder,
3034 )> {
3035 if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
3036 Some((payload, responder))
3037 } else {
3038 None
3039 }
3040 }
3041
3042 #[allow(irrefutable_let_patterns)]
3043 pub fn into_get_signal_poll_results(
3044 self,
3045 ) -> Option<(SupplicantStaIfaceGetSignalPollResultsResponder)> {
3046 if let SupplicantStaIfaceRequest::GetSignalPollResults { responder } = self {
3047 Some((responder))
3048 } else {
3049 None
3050 }
3051 }
3052
3053 pub fn method_name(&self) -> &'static str {
3055 match *self {
3056 SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
3057 SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
3058 SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
3059 SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
3060 SupplicantStaIfaceRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
3061 SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
3062 SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
3063 SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
3064 SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
3065 SupplicantStaIfaceRequest::GetSignalPollResults { .. } => "get_signal_poll_results",
3066 SupplicantStaIfaceRequest::_UnknownMethod {
3067 method_type: fidl::MethodType::OneWay,
3068 ..
3069 } => "unknown one-way method",
3070 SupplicantStaIfaceRequest::_UnknownMethod {
3071 method_type: fidl::MethodType::TwoWay,
3072 ..
3073 } => "unknown two-way method",
3074 }
3075 }
3076}
3077
3078#[derive(Debug, Clone)]
3079pub struct SupplicantStaIfaceControlHandle {
3080 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3081}
3082
3083impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
3084 fn shutdown(&self) {
3085 self.inner.shutdown()
3086 }
3087
3088 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3089 self.inner.shutdown_with_epitaph(status)
3090 }
3091
3092 fn is_closed(&self) -> bool {
3093 self.inner.channel().is_closed()
3094 }
3095 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3096 self.inner.channel().on_closed()
3097 }
3098
3099 #[cfg(target_os = "fuchsia")]
3100 fn signal_peer(
3101 &self,
3102 clear_mask: zx::Signals,
3103 set_mask: zx::Signals,
3104 ) -> Result<(), zx_status::Status> {
3105 use fidl::Peered;
3106 self.inner.channel().signal_peer(clear_mask, set_mask)
3107 }
3108}
3109
3110impl SupplicantStaIfaceControlHandle {}
3111
3112#[must_use = "FIDL methods require a response to be sent"]
3113#[derive(Debug)]
3114pub struct SupplicantStaIfaceDisconnectResponder {
3115 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3116 tx_id: u32,
3117}
3118
3119impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
3123 fn drop(&mut self) {
3124 self.control_handle.shutdown();
3125 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3127 }
3128}
3129
3130impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
3131 type ControlHandle = SupplicantStaIfaceControlHandle;
3132
3133 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3134 &self.control_handle
3135 }
3136
3137 fn drop_without_shutdown(mut self) {
3138 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3140 std::mem::forget(self);
3142 }
3143}
3144
3145impl SupplicantStaIfaceDisconnectResponder {
3146 pub fn send(self) -> Result<(), fidl::Error> {
3150 let _result = self.send_raw();
3151 if _result.is_err() {
3152 self.control_handle.shutdown();
3153 }
3154 self.drop_without_shutdown();
3155 _result
3156 }
3157
3158 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3160 let _result = self.send_raw();
3161 self.drop_without_shutdown();
3162 _result
3163 }
3164
3165 fn send_raw(&self) -> Result<(), fidl::Error> {
3166 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3167 fidl::encoding::Flexible::new(()),
3168 self.tx_id,
3169 0x52a1d38e0b4871fa,
3170 fidl::encoding::DynamicFlags::FLEXIBLE,
3171 )
3172 }
3173}
3174
3175#[must_use = "FIDL methods require a response to be sent"]
3176#[derive(Debug)]
3177pub struct SupplicantStaIfaceGetMacAddressResponder {
3178 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3179 tx_id: u32,
3180}
3181
3182impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
3186 fn drop(&mut self) {
3187 self.control_handle.shutdown();
3188 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3190 }
3191}
3192
3193impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
3194 type ControlHandle = SupplicantStaIfaceControlHandle;
3195
3196 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3197 &self.control_handle
3198 }
3199
3200 fn drop_without_shutdown(mut self) {
3201 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3203 std::mem::forget(self);
3205 }
3206}
3207
3208impl SupplicantStaIfaceGetMacAddressResponder {
3209 pub fn send(
3213 self,
3214 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3215 ) -> Result<(), fidl::Error> {
3216 let _result = self.send_raw(result);
3217 if _result.is_err() {
3218 self.control_handle.shutdown();
3219 }
3220 self.drop_without_shutdown();
3221 _result
3222 }
3223
3224 pub fn send_no_shutdown_on_err(
3226 self,
3227 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3228 ) -> Result<(), fidl::Error> {
3229 let _result = self.send_raw(result);
3230 self.drop_without_shutdown();
3231 _result
3232 }
3233
3234 fn send_raw(
3235 &self,
3236 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3237 ) -> Result<(), fidl::Error> {
3238 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3239 SupplicantStaIfaceGetMacAddressResponse,
3240 i32,
3241 >>(
3242 fidl::encoding::FlexibleResult::new(result),
3243 self.tx_id,
3244 0x60591d204a3f537f,
3245 fidl::encoding::DynamicFlags::FLEXIBLE,
3246 )
3247 }
3248}
3249
3250#[must_use = "FIDL methods require a response to be sent"]
3251#[derive(Debug)]
3252pub struct SupplicantStaIfaceGetFactoryMacAddressResponder {
3253 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3254 tx_id: u32,
3255}
3256
3257impl std::ops::Drop for SupplicantStaIfaceGetFactoryMacAddressResponder {
3261 fn drop(&mut self) {
3262 self.control_handle.shutdown();
3263 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3265 }
3266}
3267
3268impl fidl::endpoints::Responder for SupplicantStaIfaceGetFactoryMacAddressResponder {
3269 type ControlHandle = SupplicantStaIfaceControlHandle;
3270
3271 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3272 &self.control_handle
3273 }
3274
3275 fn drop_without_shutdown(mut self) {
3276 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3278 std::mem::forget(self);
3280 }
3281}
3282
3283impl SupplicantStaIfaceGetFactoryMacAddressResponder {
3284 pub fn send(self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3288 let _result = self.send_raw(result);
3289 if _result.is_err() {
3290 self.control_handle.shutdown();
3291 }
3292 self.drop_without_shutdown();
3293 _result
3294 }
3295
3296 pub fn send_no_shutdown_on_err(
3298 self,
3299 mut result: Result<&[u8; 6], i32>,
3300 ) -> Result<(), fidl::Error> {
3301 let _result = self.send_raw(result);
3302 self.drop_without_shutdown();
3303 _result
3304 }
3305
3306 fn send_raw(&self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3307 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3308 SupplicantStaIfaceGetFactoryMacAddressResponse,
3309 i32,
3310 >>(
3311 fidl::encoding::FlexibleResult::new(result.map(|mac_addr| (mac_addr,))),
3312 self.tx_id,
3313 0x58857179ad71e624,
3314 fidl::encoding::DynamicFlags::FLEXIBLE,
3315 )
3316 }
3317}
3318
3319#[must_use = "FIDL methods require a response to be sent"]
3320#[derive(Debug)]
3321pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3322 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3323 tx_id: u32,
3324}
3325
3326impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3330 fn drop(&mut self) {
3331 self.control_handle.shutdown();
3332 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3334 }
3335}
3336
3337impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3338 type ControlHandle = SupplicantStaIfaceControlHandle;
3339
3340 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3341 &self.control_handle
3342 }
3343
3344 fn drop_without_shutdown(mut self) {
3345 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3347 std::mem::forget(self);
3349 }
3350}
3351
3352impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3353 pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3357 let _result = self.send_raw(result);
3358 if _result.is_err() {
3359 self.control_handle.shutdown();
3360 }
3361 self.drop_without_shutdown();
3362 _result
3363 }
3364
3365 pub fn send_no_shutdown_on_err(
3367 self,
3368 mut result: Result<(), WlanixError>,
3369 ) -> Result<(), fidl::Error> {
3370 let _result = self.send_raw(result);
3371 self.drop_without_shutdown();
3372 _result
3373 }
3374
3375 fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3376 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3377 fidl::encoding::EmptyStruct,
3378 WlanixError,
3379 >>(
3380 fidl::encoding::FlexibleResult::new(result),
3381 self.tx_id,
3382 0x14567ff593a9b154,
3383 fidl::encoding::DynamicFlags::FLEXIBLE,
3384 )
3385 }
3386}
3387
3388#[must_use = "FIDL methods require a response to be sent"]
3389#[derive(Debug)]
3390pub struct SupplicantStaIfaceSetPowerSaveResponder {
3391 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3392 tx_id: u32,
3393}
3394
3395impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3399 fn drop(&mut self) {
3400 self.control_handle.shutdown();
3401 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3403 }
3404}
3405
3406impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3407 type ControlHandle = SupplicantStaIfaceControlHandle;
3408
3409 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3410 &self.control_handle
3411 }
3412
3413 fn drop_without_shutdown(mut self) {
3414 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3416 std::mem::forget(self);
3418 }
3419}
3420
3421impl SupplicantStaIfaceSetPowerSaveResponder {
3422 pub fn send(self) -> Result<(), fidl::Error> {
3426 let _result = self.send_raw();
3427 if _result.is_err() {
3428 self.control_handle.shutdown();
3429 }
3430 self.drop_without_shutdown();
3431 _result
3432 }
3433
3434 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3436 let _result = self.send_raw();
3437 self.drop_without_shutdown();
3438 _result
3439 }
3440
3441 fn send_raw(&self) -> Result<(), fidl::Error> {
3442 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3443 fidl::encoding::Flexible::new(()),
3444 self.tx_id,
3445 0x5a04c29320085298,
3446 fidl::encoding::DynamicFlags::FLEXIBLE,
3447 )
3448 }
3449}
3450
3451#[must_use = "FIDL methods require a response to be sent"]
3452#[derive(Debug)]
3453pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3454 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3455 tx_id: u32,
3456}
3457
3458impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3462 fn drop(&mut self) {
3463 self.control_handle.shutdown();
3464 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3466 }
3467}
3468
3469impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3470 type ControlHandle = SupplicantStaIfaceControlHandle;
3471
3472 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3473 &self.control_handle
3474 }
3475
3476 fn drop_without_shutdown(mut self) {
3477 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3479 std::mem::forget(self);
3481 }
3482}
3483
3484impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3485 pub fn send(self) -> Result<(), fidl::Error> {
3489 let _result = self.send_raw();
3490 if _result.is_err() {
3491 self.control_handle.shutdown();
3492 }
3493 self.drop_without_shutdown();
3494 _result
3495 }
3496
3497 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3499 let _result = self.send_raw();
3500 self.drop_without_shutdown();
3501 _result
3502 }
3503
3504 fn send_raw(&self) -> Result<(), fidl::Error> {
3505 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3506 fidl::encoding::Flexible::new(()),
3507 self.tx_id,
3508 0xaf10de85bb7023a,
3509 fidl::encoding::DynamicFlags::FLEXIBLE,
3510 )
3511 }
3512}
3513
3514#[must_use = "FIDL methods require a response to be sent"]
3515#[derive(Debug)]
3516pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3517 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3518 tx_id: u32,
3519}
3520
3521impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3525 fn drop(&mut self) {
3526 self.control_handle.shutdown();
3527 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3529 }
3530}
3531
3532impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3533 type ControlHandle = SupplicantStaIfaceControlHandle;
3534
3535 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3536 &self.control_handle
3537 }
3538
3539 fn drop_without_shutdown(mut self) {
3540 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3542 std::mem::forget(self);
3544 }
3545}
3546
3547impl SupplicantStaIfaceSetStaCountryCodeResponder {
3548 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3552 let _result = self.send_raw(result);
3553 if _result.is_err() {
3554 self.control_handle.shutdown();
3555 }
3556 self.drop_without_shutdown();
3557 _result
3558 }
3559
3560 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3562 let _result = self.send_raw(result);
3563 self.drop_without_shutdown();
3564 _result
3565 }
3566
3567 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3568 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3569 fidl::encoding::EmptyStruct,
3570 i32,
3571 >>(
3572 fidl::encoding::FlexibleResult::new(result),
3573 self.tx_id,
3574 0x977e22f9b79b26e,
3575 fidl::encoding::DynamicFlags::FLEXIBLE,
3576 )
3577 }
3578}
3579
3580#[must_use = "FIDL methods require a response to be sent"]
3581#[derive(Debug)]
3582pub struct SupplicantStaIfaceGetSignalPollResultsResponder {
3583 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3584 tx_id: u32,
3585}
3586
3587impl std::ops::Drop for SupplicantStaIfaceGetSignalPollResultsResponder {
3591 fn drop(&mut self) {
3592 self.control_handle.shutdown();
3593 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3595 }
3596}
3597
3598impl fidl::endpoints::Responder for SupplicantStaIfaceGetSignalPollResultsResponder {
3599 type ControlHandle = SupplicantStaIfaceControlHandle;
3600
3601 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3602 &self.control_handle
3603 }
3604
3605 fn drop_without_shutdown(mut self) {
3606 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3608 std::mem::forget(self);
3610 }
3611}
3612
3613impl SupplicantStaIfaceGetSignalPollResultsResponder {
3614 pub fn send(
3618 self,
3619 mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3620 ) -> Result<(), fidl::Error> {
3621 let _result = self.send_raw(result);
3622 if _result.is_err() {
3623 self.control_handle.shutdown();
3624 }
3625 self.drop_without_shutdown();
3626 _result
3627 }
3628
3629 pub fn send_no_shutdown_on_err(
3631 self,
3632 mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3633 ) -> Result<(), fidl::Error> {
3634 let _result = self.send_raw(result);
3635 self.drop_without_shutdown();
3636 _result
3637 }
3638
3639 fn send_raw(
3640 &self,
3641 mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3642 ) -> Result<(), fidl::Error> {
3643 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3644 SupplicantStaIfaceGetSignalPollResultsResponse,
3645 i32,
3646 >>(
3647 fidl::encoding::FlexibleResult::new(result),
3648 self.tx_id,
3649 0x783512ea6925df61,
3650 fidl::encoding::DynamicFlags::FLEXIBLE,
3651 )
3652 }
3653}
3654
3655#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3656pub struct SupplicantStaIfaceCallbackMarker;
3657
3658impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3659 type Proxy = SupplicantStaIfaceCallbackProxy;
3660 type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3661 #[cfg(target_os = "fuchsia")]
3662 type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3663
3664 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3665}
3666
3667pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3668 fn r#on_state_changed(
3669 &self,
3670 payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3671 ) -> Result<(), fidl::Error>;
3672 fn r#on_disconnected(
3673 &self,
3674 payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3675 ) -> Result<(), fidl::Error>;
3676 fn r#on_association_rejected(
3677 &self,
3678 payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3679 ) -> Result<(), fidl::Error>;
3680}
3681#[derive(Debug)]
3682#[cfg(target_os = "fuchsia")]
3683pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3684 client: fidl::client::sync::Client,
3685}
3686
3687#[cfg(target_os = "fuchsia")]
3688impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3689 type Proxy = SupplicantStaIfaceCallbackProxy;
3690 type Protocol = SupplicantStaIfaceCallbackMarker;
3691
3692 fn from_channel(inner: fidl::Channel) -> Self {
3693 Self::new(inner)
3694 }
3695
3696 fn into_channel(self) -> fidl::Channel {
3697 self.client.into_channel()
3698 }
3699
3700 fn as_channel(&self) -> &fidl::Channel {
3701 self.client.as_channel()
3702 }
3703}
3704
3705#[cfg(target_os = "fuchsia")]
3706impl SupplicantStaIfaceCallbackSynchronousProxy {
3707 pub fn new(channel: fidl::Channel) -> Self {
3708 Self { client: fidl::client::sync::Client::new(channel) }
3709 }
3710
3711 pub fn into_channel(self) -> fidl::Channel {
3712 self.client.into_channel()
3713 }
3714
3715 pub fn wait_for_event(
3718 &self,
3719 deadline: zx::MonotonicInstant,
3720 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3721 SupplicantStaIfaceCallbackEvent::decode(
3722 self.client.wait_for_event::<SupplicantStaIfaceCallbackMarker>(deadline)?,
3723 )
3724 }
3725
3726 pub fn r#on_state_changed(
3727 &self,
3728 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3729 ) -> Result<(), fidl::Error> {
3730 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3731 payload,
3732 0x27e086d26c49eb6c,
3733 fidl::encoding::DynamicFlags::FLEXIBLE,
3734 )
3735 }
3736
3737 pub fn r#on_disconnected(
3738 &self,
3739 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3740 ) -> Result<(), fidl::Error> {
3741 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3742 payload,
3743 0x69546475f4dee0cc,
3744 fidl::encoding::DynamicFlags::FLEXIBLE,
3745 )
3746 }
3747
3748 pub fn r#on_association_rejected(
3749 &self,
3750 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3751 ) -> Result<(), fidl::Error> {
3752 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3753 payload,
3754 0x7ef3961518bed988,
3755 fidl::encoding::DynamicFlags::FLEXIBLE,
3756 )
3757 }
3758}
3759
3760#[cfg(target_os = "fuchsia")]
3761impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3762 fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3763 value.into_channel().into()
3764 }
3765}
3766
3767#[cfg(target_os = "fuchsia")]
3768impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3769 fn from(value: fidl::Channel) -> Self {
3770 Self::new(value)
3771 }
3772}
3773
3774#[cfg(target_os = "fuchsia")]
3775impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3776 type Protocol = SupplicantStaIfaceCallbackMarker;
3777
3778 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3779 Self::new(value.into_channel())
3780 }
3781}
3782
3783#[derive(Debug, Clone)]
3784pub struct SupplicantStaIfaceCallbackProxy {
3785 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3786}
3787
3788impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3789 type Protocol = SupplicantStaIfaceCallbackMarker;
3790
3791 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3792 Self::new(inner)
3793 }
3794
3795 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3796 self.client.into_channel().map_err(|client| Self { client })
3797 }
3798
3799 fn as_channel(&self) -> &::fidl::AsyncChannel {
3800 self.client.as_channel()
3801 }
3802}
3803
3804impl SupplicantStaIfaceCallbackProxy {
3805 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3807 let protocol_name =
3808 <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3809 Self { client: fidl::client::Client::new(channel, protocol_name) }
3810 }
3811
3812 pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3818 SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3819 }
3820
3821 pub fn r#on_state_changed(
3822 &self,
3823 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3824 ) -> Result<(), fidl::Error> {
3825 SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3826 }
3827
3828 pub fn r#on_disconnected(
3829 &self,
3830 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3831 ) -> Result<(), fidl::Error> {
3832 SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3833 }
3834
3835 pub fn r#on_association_rejected(
3836 &self,
3837 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3838 ) -> Result<(), fidl::Error> {
3839 SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3840 }
3841}
3842
3843impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3844 fn r#on_state_changed(
3845 &self,
3846 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3847 ) -> Result<(), fidl::Error> {
3848 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3849 payload,
3850 0x27e086d26c49eb6c,
3851 fidl::encoding::DynamicFlags::FLEXIBLE,
3852 )
3853 }
3854
3855 fn r#on_disconnected(
3856 &self,
3857 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3858 ) -> Result<(), fidl::Error> {
3859 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3860 payload,
3861 0x69546475f4dee0cc,
3862 fidl::encoding::DynamicFlags::FLEXIBLE,
3863 )
3864 }
3865
3866 fn r#on_association_rejected(
3867 &self,
3868 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3869 ) -> Result<(), fidl::Error> {
3870 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3871 payload,
3872 0x7ef3961518bed988,
3873 fidl::encoding::DynamicFlags::FLEXIBLE,
3874 )
3875 }
3876}
3877
3878pub struct SupplicantStaIfaceCallbackEventStream {
3879 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3880}
3881
3882impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3883
3884impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3885 fn is_terminated(&self) -> bool {
3886 self.event_receiver.is_terminated()
3887 }
3888}
3889
3890impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3891 type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3892
3893 fn poll_next(
3894 mut self: std::pin::Pin<&mut Self>,
3895 cx: &mut std::task::Context<'_>,
3896 ) -> std::task::Poll<Option<Self::Item>> {
3897 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3898 &mut self.event_receiver,
3899 cx
3900 )?) {
3901 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3902 None => std::task::Poll::Ready(None),
3903 }
3904 }
3905}
3906
3907#[derive(Debug)]
3908pub enum SupplicantStaIfaceCallbackEvent {
3909 #[non_exhaustive]
3910 _UnknownEvent {
3911 ordinal: u64,
3913 },
3914}
3915
3916impl SupplicantStaIfaceCallbackEvent {
3917 fn decode(
3919 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3920 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3921 let (bytes, _handles) = buf.split_mut();
3922 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3923 debug_assert_eq!(tx_header.tx_id, 0);
3924 match tx_header.ordinal {
3925 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3926 Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3927 ordinal: tx_header.ordinal,
3928 })
3929 }
3930 _ => Err(fidl::Error::UnknownOrdinal {
3931 ordinal: tx_header.ordinal,
3932 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3933 })
3934 }
3935 }
3936}
3937
3938pub struct SupplicantStaIfaceCallbackRequestStream {
3940 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3941 is_terminated: bool,
3942}
3943
3944impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3945
3946impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3947 fn is_terminated(&self) -> bool {
3948 self.is_terminated
3949 }
3950}
3951
3952impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3953 type Protocol = SupplicantStaIfaceCallbackMarker;
3954 type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3955
3956 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3957 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3958 }
3959
3960 fn control_handle(&self) -> Self::ControlHandle {
3961 SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3962 }
3963
3964 fn into_inner(
3965 self,
3966 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3967 {
3968 (self.inner, self.is_terminated)
3969 }
3970
3971 fn from_inner(
3972 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3973 is_terminated: bool,
3974 ) -> Self {
3975 Self { inner, is_terminated }
3976 }
3977}
3978
3979impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
3980 type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
3981
3982 fn poll_next(
3983 mut self: std::pin::Pin<&mut Self>,
3984 cx: &mut std::task::Context<'_>,
3985 ) -> std::task::Poll<Option<Self::Item>> {
3986 let this = &mut *self;
3987 if this.inner.check_shutdown(cx) {
3988 this.is_terminated = true;
3989 return std::task::Poll::Ready(None);
3990 }
3991 if this.is_terminated {
3992 panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
3993 }
3994 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3995 |bytes, handles| {
3996 match this.inner.channel().read_etc(cx, bytes, handles) {
3997 std::task::Poll::Ready(Ok(())) => {}
3998 std::task::Poll::Pending => return std::task::Poll::Pending,
3999 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4000 this.is_terminated = true;
4001 return std::task::Poll::Ready(None);
4002 }
4003 std::task::Poll::Ready(Err(e)) => {
4004 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4005 e.into(),
4006 ))));
4007 }
4008 }
4009
4010 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4012
4013 std::task::Poll::Ready(Some(match header.ordinal {
4014 0x27e086d26c49eb6c => {
4015 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4016 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4017 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
4018 let control_handle = SupplicantStaIfaceCallbackControlHandle {
4019 inner: this.inner.clone(),
4020 };
4021 Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
4022 control_handle,
4023 })
4024 }
4025 0x69546475f4dee0cc => {
4026 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4027 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4028 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
4029 let control_handle = SupplicantStaIfaceCallbackControlHandle {
4030 inner: this.inner.clone(),
4031 };
4032 Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
4033 control_handle,
4034 })
4035 }
4036 0x7ef3961518bed988 => {
4037 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4038 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4039 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
4040 let control_handle = SupplicantStaIfaceCallbackControlHandle {
4041 inner: this.inner.clone(),
4042 };
4043 Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
4044 control_handle,
4045 })
4046 }
4047 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4048 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4049 ordinal: header.ordinal,
4050 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
4051 method_type: fidl::MethodType::OneWay,
4052 })
4053 }
4054 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4055 this.inner.send_framework_err(
4056 fidl::encoding::FrameworkErr::UnknownMethod,
4057 header.tx_id,
4058 header.ordinal,
4059 header.dynamic_flags(),
4060 (bytes, handles),
4061 )?;
4062 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4063 ordinal: header.ordinal,
4064 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
4065 method_type: fidl::MethodType::TwoWay,
4066 })
4067 }
4068 _ => Err(fidl::Error::UnknownOrdinal {
4069 ordinal: header.ordinal,
4070 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4071 }),
4072 }))
4073 },
4074 )
4075 }
4076}
4077
4078#[derive(Debug)]
4079pub enum SupplicantStaIfaceCallbackRequest {
4080 OnStateChanged {
4081 payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
4082 control_handle: SupplicantStaIfaceCallbackControlHandle,
4083 },
4084 OnDisconnected {
4085 payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
4086 control_handle: SupplicantStaIfaceCallbackControlHandle,
4087 },
4088 OnAssociationRejected {
4089 payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
4090 control_handle: SupplicantStaIfaceCallbackControlHandle,
4091 },
4092 #[non_exhaustive]
4094 _UnknownMethod {
4095 ordinal: u64,
4097 control_handle: SupplicantStaIfaceCallbackControlHandle,
4098 method_type: fidl::MethodType,
4099 },
4100}
4101
4102impl SupplicantStaIfaceCallbackRequest {
4103 #[allow(irrefutable_let_patterns)]
4104 pub fn into_on_state_changed(
4105 self,
4106 ) -> Option<(
4107 SupplicantStaIfaceCallbackOnStateChangedRequest,
4108 SupplicantStaIfaceCallbackControlHandle,
4109 )> {
4110 if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
4111 {
4112 Some((payload, control_handle))
4113 } else {
4114 None
4115 }
4116 }
4117
4118 #[allow(irrefutable_let_patterns)]
4119 pub fn into_on_disconnected(
4120 self,
4121 ) -> Option<(
4122 SupplicantStaIfaceCallbackOnDisconnectedRequest,
4123 SupplicantStaIfaceCallbackControlHandle,
4124 )> {
4125 if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
4126 {
4127 Some((payload, control_handle))
4128 } else {
4129 None
4130 }
4131 }
4132
4133 #[allow(irrefutable_let_patterns)]
4134 pub fn into_on_association_rejected(
4135 self,
4136 ) -> Option<(
4137 SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
4138 SupplicantStaIfaceCallbackControlHandle,
4139 )> {
4140 if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
4141 payload,
4142 control_handle,
4143 } = self
4144 {
4145 Some((payload, control_handle))
4146 } else {
4147 None
4148 }
4149 }
4150
4151 pub fn method_name(&self) -> &'static str {
4153 match *self {
4154 SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
4155 SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
4156 SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
4157 "on_association_rejected"
4158 }
4159 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4160 method_type: fidl::MethodType::OneWay,
4161 ..
4162 } => "unknown one-way method",
4163 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4164 method_type: fidl::MethodType::TwoWay,
4165 ..
4166 } => "unknown two-way method",
4167 }
4168 }
4169}
4170
4171#[derive(Debug, Clone)]
4172pub struct SupplicantStaIfaceCallbackControlHandle {
4173 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4174}
4175
4176impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
4177 fn shutdown(&self) {
4178 self.inner.shutdown()
4179 }
4180
4181 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4182 self.inner.shutdown_with_epitaph(status)
4183 }
4184
4185 fn is_closed(&self) -> bool {
4186 self.inner.channel().is_closed()
4187 }
4188 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4189 self.inner.channel().on_closed()
4190 }
4191
4192 #[cfg(target_os = "fuchsia")]
4193 fn signal_peer(
4194 &self,
4195 clear_mask: zx::Signals,
4196 set_mask: zx::Signals,
4197 ) -> Result<(), zx_status::Status> {
4198 use fidl::Peered;
4199 self.inner.channel().signal_peer(clear_mask, set_mask)
4200 }
4201}
4202
4203impl SupplicantStaIfaceCallbackControlHandle {}
4204
4205#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4206pub struct SupplicantStaNetworkMarker;
4207
4208impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
4209 type Proxy = SupplicantStaNetworkProxy;
4210 type RequestStream = SupplicantStaNetworkRequestStream;
4211 #[cfg(target_os = "fuchsia")]
4212 type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
4213
4214 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
4215}
4216pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
4217
4218pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
4219 fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
4220 -> Result<(), fidl::Error>;
4221 fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
4222 fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
4223 fn r#set_key_mgmt(
4224 &self,
4225 payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4226 ) -> Result<(), fidl::Error>;
4227 fn r#set_psk_passphrase(
4228 &self,
4229 payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4230 ) -> Result<(), fidl::Error>;
4231 fn r#set_sae_password(
4232 &self,
4233 payload: &SupplicantStaNetworkSetSaePasswordRequest,
4234 ) -> Result<(), fidl::Error>;
4235 fn r#set_wep_key(
4236 &self,
4237 payload: &SupplicantStaNetworkSetWepKeyRequest,
4238 ) -> Result<(), fidl::Error>;
4239 fn r#set_wep_tx_key_idx(
4240 &self,
4241 payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4242 ) -> Result<(), fidl::Error>;
4243 type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
4244 + Send;
4245 fn r#select(&self) -> Self::SelectResponseFut;
4246}
4247#[derive(Debug)]
4248#[cfg(target_os = "fuchsia")]
4249pub struct SupplicantStaNetworkSynchronousProxy {
4250 client: fidl::client::sync::Client,
4251}
4252
4253#[cfg(target_os = "fuchsia")]
4254impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
4255 type Proxy = SupplicantStaNetworkProxy;
4256 type Protocol = SupplicantStaNetworkMarker;
4257
4258 fn from_channel(inner: fidl::Channel) -> Self {
4259 Self::new(inner)
4260 }
4261
4262 fn into_channel(self) -> fidl::Channel {
4263 self.client.into_channel()
4264 }
4265
4266 fn as_channel(&self) -> &fidl::Channel {
4267 self.client.as_channel()
4268 }
4269}
4270
4271#[cfg(target_os = "fuchsia")]
4272impl SupplicantStaNetworkSynchronousProxy {
4273 pub fn new(channel: fidl::Channel) -> Self {
4274 Self { client: fidl::client::sync::Client::new(channel) }
4275 }
4276
4277 pub fn into_channel(self) -> fidl::Channel {
4278 self.client.into_channel()
4279 }
4280
4281 pub fn wait_for_event(
4284 &self,
4285 deadline: zx::MonotonicInstant,
4286 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4287 SupplicantStaNetworkEvent::decode(
4288 self.client.wait_for_event::<SupplicantStaNetworkMarker>(deadline)?,
4289 )
4290 }
4291
4292 pub fn r#set_bssid(
4293 &self,
4294 mut payload: &SupplicantStaNetworkSetBssidRequest,
4295 ) -> Result<(), fidl::Error> {
4296 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4297 payload,
4298 0x10a91d044ee6374d,
4299 fidl::encoding::DynamicFlags::FLEXIBLE,
4300 )
4301 }
4302
4303 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4304 self.client.send::<fidl::encoding::EmptyPayload>(
4305 (),
4306 0xbc7ad82f541b267,
4307 fidl::encoding::DynamicFlags::FLEXIBLE,
4308 )
4309 }
4310
4311 pub fn r#set_ssid(
4312 &self,
4313 mut payload: &SupplicantStaNetworkSetSsidRequest,
4314 ) -> Result<(), fidl::Error> {
4315 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4316 payload,
4317 0x6b598a7a802e3083,
4318 fidl::encoding::DynamicFlags::FLEXIBLE,
4319 )
4320 }
4321
4322 pub fn r#set_key_mgmt(
4323 &self,
4324 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4325 ) -> Result<(), fidl::Error> {
4326 self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4327 payload,
4328 0xc67082685b75a5c,
4329 fidl::encoding::DynamicFlags::FLEXIBLE,
4330 )
4331 }
4332
4333 pub fn r#set_psk_passphrase(
4334 &self,
4335 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4336 ) -> Result<(), fidl::Error> {
4337 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4338 payload,
4339 0xf6d438225979307,
4340 fidl::encoding::DynamicFlags::FLEXIBLE,
4341 )
4342 }
4343
4344 pub fn r#set_sae_password(
4345 &self,
4346 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4347 ) -> Result<(), fidl::Error> {
4348 self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4349 payload,
4350 0x2982737e196747b8,
4351 fidl::encoding::DynamicFlags::FLEXIBLE,
4352 )
4353 }
4354
4355 pub fn r#set_wep_key(
4356 &self,
4357 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4358 ) -> Result<(), fidl::Error> {
4359 self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4360 payload,
4361 0x22a7e25ec81f2dee,
4362 fidl::encoding::DynamicFlags::FLEXIBLE,
4363 )
4364 }
4365
4366 pub fn r#set_wep_tx_key_idx(
4369 &self,
4370 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4371 ) -> Result<(), fidl::Error> {
4372 self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4373 payload,
4374 0x4f25576c21fcb8cb,
4375 fidl::encoding::DynamicFlags::FLEXIBLE,
4376 )
4377 }
4378
4379 pub fn r#select(
4380 &self,
4381 ___deadline: zx::MonotonicInstant,
4382 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4383 let _response = self.client.send_query::<
4384 fidl::encoding::EmptyPayload,
4385 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4386 SupplicantStaNetworkMarker,
4387 >(
4388 (),
4389 0x354bc361a0c77b45,
4390 fidl::encoding::DynamicFlags::FLEXIBLE,
4391 ___deadline,
4392 )?
4393 .into_result::<SupplicantStaNetworkMarker>("select")?;
4394 Ok(_response.map(|x| x))
4395 }
4396}
4397
4398#[cfg(target_os = "fuchsia")]
4399impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4400 fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4401 value.into_channel().into()
4402 }
4403}
4404
4405#[cfg(target_os = "fuchsia")]
4406impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4407 fn from(value: fidl::Channel) -> Self {
4408 Self::new(value)
4409 }
4410}
4411
4412#[cfg(target_os = "fuchsia")]
4413impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4414 type Protocol = SupplicantStaNetworkMarker;
4415
4416 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4417 Self::new(value.into_channel())
4418 }
4419}
4420
4421#[derive(Debug, Clone)]
4422pub struct SupplicantStaNetworkProxy {
4423 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4424}
4425
4426impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4427 type Protocol = SupplicantStaNetworkMarker;
4428
4429 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4430 Self::new(inner)
4431 }
4432
4433 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4434 self.client.into_channel().map_err(|client| Self { client })
4435 }
4436
4437 fn as_channel(&self) -> &::fidl::AsyncChannel {
4438 self.client.as_channel()
4439 }
4440}
4441
4442impl SupplicantStaNetworkProxy {
4443 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4445 let protocol_name =
4446 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4447 Self { client: fidl::client::Client::new(channel, protocol_name) }
4448 }
4449
4450 pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4456 SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4457 }
4458
4459 pub fn r#set_bssid(
4460 &self,
4461 mut payload: &SupplicantStaNetworkSetBssidRequest,
4462 ) -> Result<(), fidl::Error> {
4463 SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4464 }
4465
4466 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4467 SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4468 }
4469
4470 pub fn r#set_ssid(
4471 &self,
4472 mut payload: &SupplicantStaNetworkSetSsidRequest,
4473 ) -> Result<(), fidl::Error> {
4474 SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4475 }
4476
4477 pub fn r#set_key_mgmt(
4478 &self,
4479 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4480 ) -> Result<(), fidl::Error> {
4481 SupplicantStaNetworkProxyInterface::r#set_key_mgmt(self, payload)
4482 }
4483
4484 pub fn r#set_psk_passphrase(
4485 &self,
4486 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4487 ) -> Result<(), fidl::Error> {
4488 SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4489 }
4490
4491 pub fn r#set_sae_password(
4492 &self,
4493 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4494 ) -> Result<(), fidl::Error> {
4495 SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4496 }
4497
4498 pub fn r#set_wep_key(
4499 &self,
4500 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4501 ) -> Result<(), fidl::Error> {
4502 SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4503 }
4504
4505 pub fn r#set_wep_tx_key_idx(
4508 &self,
4509 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4510 ) -> Result<(), fidl::Error> {
4511 SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4512 }
4513
4514 pub fn r#select(
4515 &self,
4516 ) -> fidl::client::QueryResponseFut<
4517 SupplicantStaNetworkSelectResult,
4518 fidl::encoding::DefaultFuchsiaResourceDialect,
4519 > {
4520 SupplicantStaNetworkProxyInterface::r#select(self)
4521 }
4522}
4523
4524impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4525 fn r#set_bssid(
4526 &self,
4527 mut payload: &SupplicantStaNetworkSetBssidRequest,
4528 ) -> Result<(), fidl::Error> {
4529 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4530 payload,
4531 0x10a91d044ee6374d,
4532 fidl::encoding::DynamicFlags::FLEXIBLE,
4533 )
4534 }
4535
4536 fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4537 self.client.send::<fidl::encoding::EmptyPayload>(
4538 (),
4539 0xbc7ad82f541b267,
4540 fidl::encoding::DynamicFlags::FLEXIBLE,
4541 )
4542 }
4543
4544 fn r#set_ssid(
4545 &self,
4546 mut payload: &SupplicantStaNetworkSetSsidRequest,
4547 ) -> Result<(), fidl::Error> {
4548 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4549 payload,
4550 0x6b598a7a802e3083,
4551 fidl::encoding::DynamicFlags::FLEXIBLE,
4552 )
4553 }
4554
4555 fn r#set_key_mgmt(
4556 &self,
4557 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4558 ) -> Result<(), fidl::Error> {
4559 self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4560 payload,
4561 0xc67082685b75a5c,
4562 fidl::encoding::DynamicFlags::FLEXIBLE,
4563 )
4564 }
4565
4566 fn r#set_psk_passphrase(
4567 &self,
4568 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4569 ) -> Result<(), fidl::Error> {
4570 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4571 payload,
4572 0xf6d438225979307,
4573 fidl::encoding::DynamicFlags::FLEXIBLE,
4574 )
4575 }
4576
4577 fn r#set_sae_password(
4578 &self,
4579 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4580 ) -> Result<(), fidl::Error> {
4581 self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4582 payload,
4583 0x2982737e196747b8,
4584 fidl::encoding::DynamicFlags::FLEXIBLE,
4585 )
4586 }
4587
4588 fn r#set_wep_key(
4589 &self,
4590 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4591 ) -> Result<(), fidl::Error> {
4592 self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4593 payload,
4594 0x22a7e25ec81f2dee,
4595 fidl::encoding::DynamicFlags::FLEXIBLE,
4596 )
4597 }
4598
4599 fn r#set_wep_tx_key_idx(
4600 &self,
4601 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4602 ) -> Result<(), fidl::Error> {
4603 self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4604 payload,
4605 0x4f25576c21fcb8cb,
4606 fidl::encoding::DynamicFlags::FLEXIBLE,
4607 )
4608 }
4609
4610 type SelectResponseFut = fidl::client::QueryResponseFut<
4611 SupplicantStaNetworkSelectResult,
4612 fidl::encoding::DefaultFuchsiaResourceDialect,
4613 >;
4614 fn r#select(&self) -> Self::SelectResponseFut {
4615 fn _decode(
4616 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4617 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4618 let _response = fidl::client::decode_transaction_body::<
4619 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4620 fidl::encoding::DefaultFuchsiaResourceDialect,
4621 0x354bc361a0c77b45,
4622 >(_buf?)?
4623 .into_result::<SupplicantStaNetworkMarker>("select")?;
4624 Ok(_response.map(|x| x))
4625 }
4626 self.client.send_query_and_decode::<
4627 fidl::encoding::EmptyPayload,
4628 SupplicantStaNetworkSelectResult,
4629 >(
4630 (),
4631 0x354bc361a0c77b45,
4632 fidl::encoding::DynamicFlags::FLEXIBLE,
4633 _decode,
4634 )
4635 }
4636}
4637
4638pub struct SupplicantStaNetworkEventStream {
4639 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4640}
4641
4642impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4643
4644impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4645 fn is_terminated(&self) -> bool {
4646 self.event_receiver.is_terminated()
4647 }
4648}
4649
4650impl futures::Stream for SupplicantStaNetworkEventStream {
4651 type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4652
4653 fn poll_next(
4654 mut self: std::pin::Pin<&mut Self>,
4655 cx: &mut std::task::Context<'_>,
4656 ) -> std::task::Poll<Option<Self::Item>> {
4657 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4658 &mut self.event_receiver,
4659 cx
4660 )?) {
4661 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4662 None => std::task::Poll::Ready(None),
4663 }
4664 }
4665}
4666
4667#[derive(Debug)]
4668pub enum SupplicantStaNetworkEvent {
4669 #[non_exhaustive]
4670 _UnknownEvent {
4671 ordinal: u64,
4673 },
4674}
4675
4676impl SupplicantStaNetworkEvent {
4677 fn decode(
4679 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4680 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4681 let (bytes, _handles) = buf.split_mut();
4682 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4683 debug_assert_eq!(tx_header.tx_id, 0);
4684 match tx_header.ordinal {
4685 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4686 Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4687 }
4688 _ => Err(fidl::Error::UnknownOrdinal {
4689 ordinal: tx_header.ordinal,
4690 protocol_name:
4691 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4692 }),
4693 }
4694 }
4695}
4696
4697pub struct SupplicantStaNetworkRequestStream {
4699 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4700 is_terminated: bool,
4701}
4702
4703impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4704
4705impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4706 fn is_terminated(&self) -> bool {
4707 self.is_terminated
4708 }
4709}
4710
4711impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4712 type Protocol = SupplicantStaNetworkMarker;
4713 type ControlHandle = SupplicantStaNetworkControlHandle;
4714
4715 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4716 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4717 }
4718
4719 fn control_handle(&self) -> Self::ControlHandle {
4720 SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4721 }
4722
4723 fn into_inner(
4724 self,
4725 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4726 {
4727 (self.inner, self.is_terminated)
4728 }
4729
4730 fn from_inner(
4731 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4732 is_terminated: bool,
4733 ) -> Self {
4734 Self { inner, is_terminated }
4735 }
4736}
4737
4738impl futures::Stream for SupplicantStaNetworkRequestStream {
4739 type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4740
4741 fn poll_next(
4742 mut self: std::pin::Pin<&mut Self>,
4743 cx: &mut std::task::Context<'_>,
4744 ) -> std::task::Poll<Option<Self::Item>> {
4745 let this = &mut *self;
4746 if this.inner.check_shutdown(cx) {
4747 this.is_terminated = true;
4748 return std::task::Poll::Ready(None);
4749 }
4750 if this.is_terminated {
4751 panic!("polled SupplicantStaNetworkRequestStream after completion");
4752 }
4753 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4754 |bytes, handles| {
4755 match this.inner.channel().read_etc(cx, bytes, handles) {
4756 std::task::Poll::Ready(Ok(())) => {}
4757 std::task::Poll::Pending => return std::task::Poll::Pending,
4758 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4759 this.is_terminated = true;
4760 return std::task::Poll::Ready(None);
4761 }
4762 std::task::Poll::Ready(Err(e)) => {
4763 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4764 e.into(),
4765 ))));
4766 }
4767 }
4768
4769 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4771
4772 std::task::Poll::Ready(Some(match header.ordinal {
4773 0x10a91d044ee6374d => {
4774 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4775 let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4776 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4777 let control_handle = SupplicantStaNetworkControlHandle {
4778 inner: this.inner.clone(),
4779 };
4780 Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4781 control_handle,
4782 })
4783 }
4784 0xbc7ad82f541b267 => {
4785 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4786 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4787 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4788 let control_handle = SupplicantStaNetworkControlHandle {
4789 inner: this.inner.clone(),
4790 };
4791 Ok(SupplicantStaNetworkRequest::ClearBssid {
4792 control_handle,
4793 })
4794 }
4795 0x6b598a7a802e3083 => {
4796 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4797 let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4798 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4799 let control_handle = SupplicantStaNetworkControlHandle {
4800 inner: this.inner.clone(),
4801 };
4802 Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4803 control_handle,
4804 })
4805 }
4806 0xc67082685b75a5c => {
4807 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4808 let mut req = fidl::new_empty!(SupplicantStaNetworkSetKeyMgmtRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4809 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetKeyMgmtRequest>(&header, _body_bytes, handles, &mut req)?;
4810 let control_handle = SupplicantStaNetworkControlHandle {
4811 inner: this.inner.clone(),
4812 };
4813 Ok(SupplicantStaNetworkRequest::SetKeyMgmt {payload: req,
4814 control_handle,
4815 })
4816 }
4817 0xf6d438225979307 => {
4818 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4819 let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4820 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4821 let control_handle = SupplicantStaNetworkControlHandle {
4822 inner: this.inner.clone(),
4823 };
4824 Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4825 control_handle,
4826 })
4827 }
4828 0x2982737e196747b8 => {
4829 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4830 let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4831 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4832 let control_handle = SupplicantStaNetworkControlHandle {
4833 inner: this.inner.clone(),
4834 };
4835 Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4836 control_handle,
4837 })
4838 }
4839 0x22a7e25ec81f2dee => {
4840 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4841 let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4842 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4843 let control_handle = SupplicantStaNetworkControlHandle {
4844 inner: this.inner.clone(),
4845 };
4846 Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4847 control_handle,
4848 })
4849 }
4850 0x4f25576c21fcb8cb => {
4851 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4852 let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4853 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4854 let control_handle = SupplicantStaNetworkControlHandle {
4855 inner: this.inner.clone(),
4856 };
4857 Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4858 control_handle,
4859 })
4860 }
4861 0x354bc361a0c77b45 => {
4862 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4863 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4864 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4865 let control_handle = SupplicantStaNetworkControlHandle {
4866 inner: this.inner.clone(),
4867 };
4868 Ok(SupplicantStaNetworkRequest::Select {
4869 responder: SupplicantStaNetworkSelectResponder {
4870 control_handle: std::mem::ManuallyDrop::new(control_handle),
4871 tx_id: header.tx_id,
4872 },
4873 })
4874 }
4875 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4876 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4877 ordinal: header.ordinal,
4878 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4879 method_type: fidl::MethodType::OneWay,
4880 })
4881 }
4882 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4883 this.inner.send_framework_err(
4884 fidl::encoding::FrameworkErr::UnknownMethod,
4885 header.tx_id,
4886 header.ordinal,
4887 header.dynamic_flags(),
4888 (bytes, handles),
4889 )?;
4890 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4891 ordinal: header.ordinal,
4892 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4893 method_type: fidl::MethodType::TwoWay,
4894 })
4895 }
4896 _ => Err(fidl::Error::UnknownOrdinal {
4897 ordinal: header.ordinal,
4898 protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4899 }),
4900 }))
4901 },
4902 )
4903 }
4904}
4905
4906#[derive(Debug)]
4907pub enum SupplicantStaNetworkRequest {
4908 SetBssid {
4909 payload: SupplicantStaNetworkSetBssidRequest,
4910 control_handle: SupplicantStaNetworkControlHandle,
4911 },
4912 ClearBssid {
4913 control_handle: SupplicantStaNetworkControlHandle,
4914 },
4915 SetSsid {
4916 payload: SupplicantStaNetworkSetSsidRequest,
4917 control_handle: SupplicantStaNetworkControlHandle,
4918 },
4919 SetKeyMgmt {
4920 payload: SupplicantStaNetworkSetKeyMgmtRequest,
4921 control_handle: SupplicantStaNetworkControlHandle,
4922 },
4923 SetPskPassphrase {
4924 payload: SupplicantStaNetworkSetPskPassphraseRequest,
4925 control_handle: SupplicantStaNetworkControlHandle,
4926 },
4927 SetSaePassword {
4928 payload: SupplicantStaNetworkSetSaePasswordRequest,
4929 control_handle: SupplicantStaNetworkControlHandle,
4930 },
4931 SetWepKey {
4932 payload: SupplicantStaNetworkSetWepKeyRequest,
4933 control_handle: SupplicantStaNetworkControlHandle,
4934 },
4935 SetWepTxKeyIdx {
4938 payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4939 control_handle: SupplicantStaNetworkControlHandle,
4940 },
4941 Select {
4942 responder: SupplicantStaNetworkSelectResponder,
4943 },
4944 #[non_exhaustive]
4946 _UnknownMethod {
4947 ordinal: u64,
4949 control_handle: SupplicantStaNetworkControlHandle,
4950 method_type: fidl::MethodType,
4951 },
4952}
4953
4954impl SupplicantStaNetworkRequest {
4955 #[allow(irrefutable_let_patterns)]
4956 pub fn into_set_bssid(
4957 self,
4958 ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4959 if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4960 Some((payload, control_handle))
4961 } else {
4962 None
4963 }
4964 }
4965
4966 #[allow(irrefutable_let_patterns)]
4967 pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4968 if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4969 Some((control_handle))
4970 } else {
4971 None
4972 }
4973 }
4974
4975 #[allow(irrefutable_let_patterns)]
4976 pub fn into_set_ssid(
4977 self,
4978 ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4979 if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4980 Some((payload, control_handle))
4981 } else {
4982 None
4983 }
4984 }
4985
4986 #[allow(irrefutable_let_patterns)]
4987 pub fn into_set_key_mgmt(
4988 self,
4989 ) -> Option<(SupplicantStaNetworkSetKeyMgmtRequest, SupplicantStaNetworkControlHandle)> {
4990 if let SupplicantStaNetworkRequest::SetKeyMgmt { payload, control_handle } = self {
4991 Some((payload, control_handle))
4992 } else {
4993 None
4994 }
4995 }
4996
4997 #[allow(irrefutable_let_patterns)]
4998 pub fn into_set_psk_passphrase(
4999 self,
5000 ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
5001 {
5002 if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
5003 Some((payload, control_handle))
5004 } else {
5005 None
5006 }
5007 }
5008
5009 #[allow(irrefutable_let_patterns)]
5010 pub fn into_set_sae_password(
5011 self,
5012 ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
5013 {
5014 if let SupplicantStaNetworkRequest::SetSaePassword { payload, control_handle } = self {
5015 Some((payload, control_handle))
5016 } else {
5017 None
5018 }
5019 }
5020
5021 #[allow(irrefutable_let_patterns)]
5022 pub fn into_set_wep_key(
5023 self,
5024 ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
5025 if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
5026 Some((payload, control_handle))
5027 } else {
5028 None
5029 }
5030 }
5031
5032 #[allow(irrefutable_let_patterns)]
5033 pub fn into_set_wep_tx_key_idx(
5034 self,
5035 ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
5036 {
5037 if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
5038 Some((payload, control_handle))
5039 } else {
5040 None
5041 }
5042 }
5043
5044 #[allow(irrefutable_let_patterns)]
5045 pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
5046 if let SupplicantStaNetworkRequest::Select { responder } = self {
5047 Some((responder))
5048 } else {
5049 None
5050 }
5051 }
5052
5053 pub fn method_name(&self) -> &'static str {
5055 match *self {
5056 SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
5057 SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
5058 SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
5059 SupplicantStaNetworkRequest::SetKeyMgmt { .. } => "set_key_mgmt",
5060 SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
5061 SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
5062 SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
5063 SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
5064 SupplicantStaNetworkRequest::Select { .. } => "select",
5065 SupplicantStaNetworkRequest::_UnknownMethod {
5066 method_type: fidl::MethodType::OneWay,
5067 ..
5068 } => "unknown one-way method",
5069 SupplicantStaNetworkRequest::_UnknownMethod {
5070 method_type: fidl::MethodType::TwoWay,
5071 ..
5072 } => "unknown two-way method",
5073 }
5074 }
5075}
5076
5077#[derive(Debug, Clone)]
5078pub struct SupplicantStaNetworkControlHandle {
5079 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5080}
5081
5082impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
5083 fn shutdown(&self) {
5084 self.inner.shutdown()
5085 }
5086
5087 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5088 self.inner.shutdown_with_epitaph(status)
5089 }
5090
5091 fn is_closed(&self) -> bool {
5092 self.inner.channel().is_closed()
5093 }
5094 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5095 self.inner.channel().on_closed()
5096 }
5097
5098 #[cfg(target_os = "fuchsia")]
5099 fn signal_peer(
5100 &self,
5101 clear_mask: zx::Signals,
5102 set_mask: zx::Signals,
5103 ) -> Result<(), zx_status::Status> {
5104 use fidl::Peered;
5105 self.inner.channel().signal_peer(clear_mask, set_mask)
5106 }
5107}
5108
5109impl SupplicantStaNetworkControlHandle {}
5110
5111#[must_use = "FIDL methods require a response to be sent"]
5112#[derive(Debug)]
5113pub struct SupplicantStaNetworkSelectResponder {
5114 control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
5115 tx_id: u32,
5116}
5117
5118impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
5122 fn drop(&mut self) {
5123 self.control_handle.shutdown();
5124 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5126 }
5127}
5128
5129impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
5130 type ControlHandle = SupplicantStaNetworkControlHandle;
5131
5132 fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
5133 &self.control_handle
5134 }
5135
5136 fn drop_without_shutdown(mut self) {
5137 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5139 std::mem::forget(self);
5141 }
5142}
5143
5144impl SupplicantStaNetworkSelectResponder {
5145 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5149 let _result = self.send_raw(result);
5150 if _result.is_err() {
5151 self.control_handle.shutdown();
5152 }
5153 self.drop_without_shutdown();
5154 _result
5155 }
5156
5157 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5159 let _result = self.send_raw(result);
5160 self.drop_without_shutdown();
5161 _result
5162 }
5163
5164 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5165 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5166 fidl::encoding::EmptyStruct,
5167 i32,
5168 >>(
5169 fidl::encoding::FlexibleResult::new(result),
5170 self.tx_id,
5171 0x354bc361a0c77b45,
5172 fidl::encoding::DynamicFlags::FLEXIBLE,
5173 )
5174 }
5175}
5176
5177#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5178pub struct WifiMarker;
5179
5180impl fidl::endpoints::ProtocolMarker for WifiMarker {
5181 type Proxy = WifiProxy;
5182 type RequestStream = WifiRequestStream;
5183 #[cfg(target_os = "fuchsia")]
5184 type SynchronousProxy = WifiSynchronousProxy;
5185
5186 const DEBUG_NAME: &'static str = "(anonymous) Wifi";
5187}
5188pub type WifiStartResult = Result<(), i32>;
5189pub type WifiStopResult = Result<(), i32>;
5190pub type WifiGetChipResult = Result<(), i32>;
5191
5192pub trait WifiProxyInterface: Send + Sync {
5193 fn r#register_event_callback(
5194 &self,
5195 payload: WifiRegisterEventCallbackRequest,
5196 ) -> Result<(), fidl::Error>;
5197 type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
5198 fn r#start(&self) -> Self::StartResponseFut;
5199 type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
5200 fn r#stop(&self) -> Self::StopResponseFut;
5201 type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
5202 + Send;
5203 fn r#get_state(&self) -> Self::GetStateResponseFut;
5204 type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
5205 + Send;
5206 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
5207 type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
5208 + Send;
5209 fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
5210}
5211#[derive(Debug)]
5212#[cfg(target_os = "fuchsia")]
5213pub struct WifiSynchronousProxy {
5214 client: fidl::client::sync::Client,
5215}
5216
5217#[cfg(target_os = "fuchsia")]
5218impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
5219 type Proxy = WifiProxy;
5220 type Protocol = WifiMarker;
5221
5222 fn from_channel(inner: fidl::Channel) -> Self {
5223 Self::new(inner)
5224 }
5225
5226 fn into_channel(self) -> fidl::Channel {
5227 self.client.into_channel()
5228 }
5229
5230 fn as_channel(&self) -> &fidl::Channel {
5231 self.client.as_channel()
5232 }
5233}
5234
5235#[cfg(target_os = "fuchsia")]
5236impl WifiSynchronousProxy {
5237 pub fn new(channel: fidl::Channel) -> Self {
5238 Self { client: fidl::client::sync::Client::new(channel) }
5239 }
5240
5241 pub fn into_channel(self) -> fidl::Channel {
5242 self.client.into_channel()
5243 }
5244
5245 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
5248 WifiEvent::decode(self.client.wait_for_event::<WifiMarker>(deadline)?)
5249 }
5250
5251 pub fn r#register_event_callback(
5254 &self,
5255 mut payload: WifiRegisterEventCallbackRequest,
5256 ) -> Result<(), fidl::Error> {
5257 self.client.send::<WifiRegisterEventCallbackRequest>(
5258 &mut payload,
5259 0x12abbdea948dd67b,
5260 fidl::encoding::DynamicFlags::FLEXIBLE,
5261 )
5262 }
5263
5264 pub fn r#start(
5268 &self,
5269 ___deadline: zx::MonotonicInstant,
5270 ) -> Result<WifiStartResult, fidl::Error> {
5271 let _response = self.client.send_query::<
5272 fidl::encoding::EmptyPayload,
5273 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5274 WifiMarker,
5275 >(
5276 (),
5277 0x427030e4dc6ec07a,
5278 fidl::encoding::DynamicFlags::FLEXIBLE,
5279 ___deadline,
5280 )?
5281 .into_result::<WifiMarker>("start")?;
5282 Ok(_response.map(|x| x))
5283 }
5284
5285 pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
5289 let _response = self.client.send_query::<
5290 fidl::encoding::EmptyPayload,
5291 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5292 WifiMarker,
5293 >(
5294 (),
5295 0x67c9bdf61b2888d,
5296 fidl::encoding::DynamicFlags::FLEXIBLE,
5297 ___deadline,
5298 )?
5299 .into_result::<WifiMarker>("stop")?;
5300 Ok(_response.map(|x| x))
5301 }
5302
5303 pub fn r#get_state(
5305 &self,
5306 ___deadline: zx::MonotonicInstant,
5307 ) -> Result<WifiGetStateResponse, fidl::Error> {
5308 let _response = self.client.send_query::<
5309 fidl::encoding::EmptyPayload,
5310 fidl::encoding::FlexibleType<WifiGetStateResponse>,
5311 WifiMarker,
5312 >(
5313 (),
5314 0x4616114a937d1fb0,
5315 fidl::encoding::DynamicFlags::FLEXIBLE,
5316 ___deadline,
5317 )?
5318 .into_result::<WifiMarker>("get_state")?;
5319 Ok(_response)
5320 }
5321
5322 pub fn r#get_chip_ids(
5324 &self,
5325 ___deadline: zx::MonotonicInstant,
5326 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5327 let _response = self.client.send_query::<
5328 fidl::encoding::EmptyPayload,
5329 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5330 WifiMarker,
5331 >(
5332 (),
5333 0x2fb4f92351d802b5,
5334 fidl::encoding::DynamicFlags::FLEXIBLE,
5335 ___deadline,
5336 )?
5337 .into_result::<WifiMarker>("get_chip_ids")?;
5338 Ok(_response)
5339 }
5340
5341 pub fn r#get_chip(
5344 &self,
5345 mut payload: WifiGetChipRequest,
5346 ___deadline: zx::MonotonicInstant,
5347 ) -> Result<WifiGetChipResult, fidl::Error> {
5348 let _response = self.client.send_query::<
5349 WifiGetChipRequest,
5350 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5351 WifiMarker,
5352 >(
5353 &mut payload,
5354 0xef95d8246612540,
5355 fidl::encoding::DynamicFlags::FLEXIBLE,
5356 ___deadline,
5357 )?
5358 .into_result::<WifiMarker>("get_chip")?;
5359 Ok(_response.map(|x| x))
5360 }
5361}
5362
5363#[cfg(target_os = "fuchsia")]
5364impl From<WifiSynchronousProxy> for zx::NullableHandle {
5365 fn from(value: WifiSynchronousProxy) -> Self {
5366 value.into_channel().into()
5367 }
5368}
5369
5370#[cfg(target_os = "fuchsia")]
5371impl From<fidl::Channel> for WifiSynchronousProxy {
5372 fn from(value: fidl::Channel) -> Self {
5373 Self::new(value)
5374 }
5375}
5376
5377#[cfg(target_os = "fuchsia")]
5378impl fidl::endpoints::FromClient for WifiSynchronousProxy {
5379 type Protocol = WifiMarker;
5380
5381 fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
5382 Self::new(value.into_channel())
5383 }
5384}
5385
5386#[derive(Debug, Clone)]
5387pub struct WifiProxy {
5388 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5389}
5390
5391impl fidl::endpoints::Proxy for WifiProxy {
5392 type Protocol = WifiMarker;
5393
5394 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5395 Self::new(inner)
5396 }
5397
5398 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5399 self.client.into_channel().map_err(|client| Self { client })
5400 }
5401
5402 fn as_channel(&self) -> &::fidl::AsyncChannel {
5403 self.client.as_channel()
5404 }
5405}
5406
5407impl WifiProxy {
5408 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5410 let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5411 Self { client: fidl::client::Client::new(channel, protocol_name) }
5412 }
5413
5414 pub fn take_event_stream(&self) -> WifiEventStream {
5420 WifiEventStream { event_receiver: self.client.take_event_receiver() }
5421 }
5422
5423 pub fn r#register_event_callback(
5426 &self,
5427 mut payload: WifiRegisterEventCallbackRequest,
5428 ) -> Result<(), fidl::Error> {
5429 WifiProxyInterface::r#register_event_callback(self, payload)
5430 }
5431
5432 pub fn r#start(
5436 &self,
5437 ) -> fidl::client::QueryResponseFut<
5438 WifiStartResult,
5439 fidl::encoding::DefaultFuchsiaResourceDialect,
5440 > {
5441 WifiProxyInterface::r#start(self)
5442 }
5443
5444 pub fn r#stop(
5448 &self,
5449 ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5450 {
5451 WifiProxyInterface::r#stop(self)
5452 }
5453
5454 pub fn r#get_state(
5456 &self,
5457 ) -> fidl::client::QueryResponseFut<
5458 WifiGetStateResponse,
5459 fidl::encoding::DefaultFuchsiaResourceDialect,
5460 > {
5461 WifiProxyInterface::r#get_state(self)
5462 }
5463
5464 pub fn r#get_chip_ids(
5466 &self,
5467 ) -> fidl::client::QueryResponseFut<
5468 WifiGetChipIdsResponse,
5469 fidl::encoding::DefaultFuchsiaResourceDialect,
5470 > {
5471 WifiProxyInterface::r#get_chip_ids(self)
5472 }
5473
5474 pub fn r#get_chip(
5477 &self,
5478 mut payload: WifiGetChipRequest,
5479 ) -> fidl::client::QueryResponseFut<
5480 WifiGetChipResult,
5481 fidl::encoding::DefaultFuchsiaResourceDialect,
5482 > {
5483 WifiProxyInterface::r#get_chip(self, payload)
5484 }
5485}
5486
5487impl WifiProxyInterface for WifiProxy {
5488 fn r#register_event_callback(
5489 &self,
5490 mut payload: WifiRegisterEventCallbackRequest,
5491 ) -> Result<(), fidl::Error> {
5492 self.client.send::<WifiRegisterEventCallbackRequest>(
5493 &mut payload,
5494 0x12abbdea948dd67b,
5495 fidl::encoding::DynamicFlags::FLEXIBLE,
5496 )
5497 }
5498
5499 type StartResponseFut = fidl::client::QueryResponseFut<
5500 WifiStartResult,
5501 fidl::encoding::DefaultFuchsiaResourceDialect,
5502 >;
5503 fn r#start(&self) -> Self::StartResponseFut {
5504 fn _decode(
5505 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5506 ) -> Result<WifiStartResult, fidl::Error> {
5507 let _response = fidl::client::decode_transaction_body::<
5508 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5509 fidl::encoding::DefaultFuchsiaResourceDialect,
5510 0x427030e4dc6ec07a,
5511 >(_buf?)?
5512 .into_result::<WifiMarker>("start")?;
5513 Ok(_response.map(|x| x))
5514 }
5515 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5516 (),
5517 0x427030e4dc6ec07a,
5518 fidl::encoding::DynamicFlags::FLEXIBLE,
5519 _decode,
5520 )
5521 }
5522
5523 type StopResponseFut = fidl::client::QueryResponseFut<
5524 WifiStopResult,
5525 fidl::encoding::DefaultFuchsiaResourceDialect,
5526 >;
5527 fn r#stop(&self) -> Self::StopResponseFut {
5528 fn _decode(
5529 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5530 ) -> Result<WifiStopResult, fidl::Error> {
5531 let _response = fidl::client::decode_transaction_body::<
5532 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5533 fidl::encoding::DefaultFuchsiaResourceDialect,
5534 0x67c9bdf61b2888d,
5535 >(_buf?)?
5536 .into_result::<WifiMarker>("stop")?;
5537 Ok(_response.map(|x| x))
5538 }
5539 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5540 (),
5541 0x67c9bdf61b2888d,
5542 fidl::encoding::DynamicFlags::FLEXIBLE,
5543 _decode,
5544 )
5545 }
5546
5547 type GetStateResponseFut = fidl::client::QueryResponseFut<
5548 WifiGetStateResponse,
5549 fidl::encoding::DefaultFuchsiaResourceDialect,
5550 >;
5551 fn r#get_state(&self) -> Self::GetStateResponseFut {
5552 fn _decode(
5553 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5554 ) -> Result<WifiGetStateResponse, fidl::Error> {
5555 let _response = fidl::client::decode_transaction_body::<
5556 fidl::encoding::FlexibleType<WifiGetStateResponse>,
5557 fidl::encoding::DefaultFuchsiaResourceDialect,
5558 0x4616114a937d1fb0,
5559 >(_buf?)?
5560 .into_result::<WifiMarker>("get_state")?;
5561 Ok(_response)
5562 }
5563 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5564 (),
5565 0x4616114a937d1fb0,
5566 fidl::encoding::DynamicFlags::FLEXIBLE,
5567 _decode,
5568 )
5569 }
5570
5571 type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5572 WifiGetChipIdsResponse,
5573 fidl::encoding::DefaultFuchsiaResourceDialect,
5574 >;
5575 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5576 fn _decode(
5577 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5578 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5579 let _response = fidl::client::decode_transaction_body::<
5580 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5581 fidl::encoding::DefaultFuchsiaResourceDialect,
5582 0x2fb4f92351d802b5,
5583 >(_buf?)?
5584 .into_result::<WifiMarker>("get_chip_ids")?;
5585 Ok(_response)
5586 }
5587 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5588 (),
5589 0x2fb4f92351d802b5,
5590 fidl::encoding::DynamicFlags::FLEXIBLE,
5591 _decode,
5592 )
5593 }
5594
5595 type GetChipResponseFut = fidl::client::QueryResponseFut<
5596 WifiGetChipResult,
5597 fidl::encoding::DefaultFuchsiaResourceDialect,
5598 >;
5599 fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5600 fn _decode(
5601 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5602 ) -> Result<WifiGetChipResult, fidl::Error> {
5603 let _response = fidl::client::decode_transaction_body::<
5604 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5605 fidl::encoding::DefaultFuchsiaResourceDialect,
5606 0xef95d8246612540,
5607 >(_buf?)?
5608 .into_result::<WifiMarker>("get_chip")?;
5609 Ok(_response.map(|x| x))
5610 }
5611 self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5612 &mut payload,
5613 0xef95d8246612540,
5614 fidl::encoding::DynamicFlags::FLEXIBLE,
5615 _decode,
5616 )
5617 }
5618}
5619
5620pub struct WifiEventStream {
5621 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5622}
5623
5624impl std::marker::Unpin for WifiEventStream {}
5625
5626impl futures::stream::FusedStream for WifiEventStream {
5627 fn is_terminated(&self) -> bool {
5628 self.event_receiver.is_terminated()
5629 }
5630}
5631
5632impl futures::Stream for WifiEventStream {
5633 type Item = Result<WifiEvent, fidl::Error>;
5634
5635 fn poll_next(
5636 mut self: std::pin::Pin<&mut Self>,
5637 cx: &mut std::task::Context<'_>,
5638 ) -> std::task::Poll<Option<Self::Item>> {
5639 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5640 &mut self.event_receiver,
5641 cx
5642 )?) {
5643 Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5644 None => std::task::Poll::Ready(None),
5645 }
5646 }
5647}
5648
5649#[derive(Debug)]
5650pub enum WifiEvent {
5651 #[non_exhaustive]
5652 _UnknownEvent {
5653 ordinal: u64,
5655 },
5656}
5657
5658impl WifiEvent {
5659 fn decode(
5661 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5662 ) -> Result<WifiEvent, fidl::Error> {
5663 let (bytes, _handles) = buf.split_mut();
5664 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5665 debug_assert_eq!(tx_header.tx_id, 0);
5666 match tx_header.ordinal {
5667 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5668 Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5669 }
5670 _ => Err(fidl::Error::UnknownOrdinal {
5671 ordinal: tx_header.ordinal,
5672 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5673 }),
5674 }
5675 }
5676}
5677
5678pub struct WifiRequestStream {
5680 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5681 is_terminated: bool,
5682}
5683
5684impl std::marker::Unpin for WifiRequestStream {}
5685
5686impl futures::stream::FusedStream for WifiRequestStream {
5687 fn is_terminated(&self) -> bool {
5688 self.is_terminated
5689 }
5690}
5691
5692impl fidl::endpoints::RequestStream for WifiRequestStream {
5693 type Protocol = WifiMarker;
5694 type ControlHandle = WifiControlHandle;
5695
5696 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5697 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5698 }
5699
5700 fn control_handle(&self) -> Self::ControlHandle {
5701 WifiControlHandle { inner: self.inner.clone() }
5702 }
5703
5704 fn into_inner(
5705 self,
5706 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5707 {
5708 (self.inner, self.is_terminated)
5709 }
5710
5711 fn from_inner(
5712 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5713 is_terminated: bool,
5714 ) -> Self {
5715 Self { inner, is_terminated }
5716 }
5717}
5718
5719impl futures::Stream for WifiRequestStream {
5720 type Item = Result<WifiRequest, fidl::Error>;
5721
5722 fn poll_next(
5723 mut self: std::pin::Pin<&mut Self>,
5724 cx: &mut std::task::Context<'_>,
5725 ) -> std::task::Poll<Option<Self::Item>> {
5726 let this = &mut *self;
5727 if this.inner.check_shutdown(cx) {
5728 this.is_terminated = true;
5729 return std::task::Poll::Ready(None);
5730 }
5731 if this.is_terminated {
5732 panic!("polled WifiRequestStream after completion");
5733 }
5734 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5735 |bytes, handles| {
5736 match this.inner.channel().read_etc(cx, bytes, handles) {
5737 std::task::Poll::Ready(Ok(())) => {}
5738 std::task::Poll::Pending => return std::task::Poll::Pending,
5739 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5740 this.is_terminated = true;
5741 return std::task::Poll::Ready(None);
5742 }
5743 std::task::Poll::Ready(Err(e)) => {
5744 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5745 e.into(),
5746 ))));
5747 }
5748 }
5749
5750 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5752
5753 std::task::Poll::Ready(Some(match header.ordinal {
5754 0x12abbdea948dd67b => {
5755 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5756 let mut req = fidl::new_empty!(
5757 WifiRegisterEventCallbackRequest,
5758 fidl::encoding::DefaultFuchsiaResourceDialect
5759 );
5760 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5761 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5762 Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5763 }
5764 0x427030e4dc6ec07a => {
5765 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5766 let mut req = fidl::new_empty!(
5767 fidl::encoding::EmptyPayload,
5768 fidl::encoding::DefaultFuchsiaResourceDialect
5769 );
5770 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5771 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5772 Ok(WifiRequest::Start {
5773 responder: WifiStartResponder {
5774 control_handle: std::mem::ManuallyDrop::new(control_handle),
5775 tx_id: header.tx_id,
5776 },
5777 })
5778 }
5779 0x67c9bdf61b2888d => {
5780 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5781 let mut req = fidl::new_empty!(
5782 fidl::encoding::EmptyPayload,
5783 fidl::encoding::DefaultFuchsiaResourceDialect
5784 );
5785 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5786 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5787 Ok(WifiRequest::Stop {
5788 responder: WifiStopResponder {
5789 control_handle: std::mem::ManuallyDrop::new(control_handle),
5790 tx_id: header.tx_id,
5791 },
5792 })
5793 }
5794 0x4616114a937d1fb0 => {
5795 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5796 let mut req = fidl::new_empty!(
5797 fidl::encoding::EmptyPayload,
5798 fidl::encoding::DefaultFuchsiaResourceDialect
5799 );
5800 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5801 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5802 Ok(WifiRequest::GetState {
5803 responder: WifiGetStateResponder {
5804 control_handle: std::mem::ManuallyDrop::new(control_handle),
5805 tx_id: header.tx_id,
5806 },
5807 })
5808 }
5809 0x2fb4f92351d802b5 => {
5810 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5811 let mut req = fidl::new_empty!(
5812 fidl::encoding::EmptyPayload,
5813 fidl::encoding::DefaultFuchsiaResourceDialect
5814 );
5815 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5816 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5817 Ok(WifiRequest::GetChipIds {
5818 responder: WifiGetChipIdsResponder {
5819 control_handle: std::mem::ManuallyDrop::new(control_handle),
5820 tx_id: header.tx_id,
5821 },
5822 })
5823 }
5824 0xef95d8246612540 => {
5825 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5826 let mut req = fidl::new_empty!(
5827 WifiGetChipRequest,
5828 fidl::encoding::DefaultFuchsiaResourceDialect
5829 );
5830 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5831 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5832 Ok(WifiRequest::GetChip {
5833 payload: req,
5834 responder: WifiGetChipResponder {
5835 control_handle: std::mem::ManuallyDrop::new(control_handle),
5836 tx_id: header.tx_id,
5837 },
5838 })
5839 }
5840 _ if header.tx_id == 0
5841 && header
5842 .dynamic_flags()
5843 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5844 {
5845 Ok(WifiRequest::_UnknownMethod {
5846 ordinal: header.ordinal,
5847 control_handle: WifiControlHandle { inner: this.inner.clone() },
5848 method_type: fidl::MethodType::OneWay,
5849 })
5850 }
5851 _ if header
5852 .dynamic_flags()
5853 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5854 {
5855 this.inner.send_framework_err(
5856 fidl::encoding::FrameworkErr::UnknownMethod,
5857 header.tx_id,
5858 header.ordinal,
5859 header.dynamic_flags(),
5860 (bytes, handles),
5861 )?;
5862 Ok(WifiRequest::_UnknownMethod {
5863 ordinal: header.ordinal,
5864 control_handle: WifiControlHandle { inner: this.inner.clone() },
5865 method_type: fidl::MethodType::TwoWay,
5866 })
5867 }
5868 _ => Err(fidl::Error::UnknownOrdinal {
5869 ordinal: header.ordinal,
5870 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5871 }),
5872 }))
5873 },
5874 )
5875 }
5876}
5877
5878#[derive(Debug)]
5879pub enum WifiRequest {
5880 RegisterEventCallback {
5883 payload: WifiRegisterEventCallbackRequest,
5884 control_handle: WifiControlHandle,
5885 },
5886 Start { responder: WifiStartResponder },
5890 Stop { responder: WifiStopResponder },
5894 GetState { responder: WifiGetStateResponder },
5896 GetChipIds { responder: WifiGetChipIdsResponder },
5898 GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5901 #[non_exhaustive]
5903 _UnknownMethod {
5904 ordinal: u64,
5906 control_handle: WifiControlHandle,
5907 method_type: fidl::MethodType,
5908 },
5909}
5910
5911impl WifiRequest {
5912 #[allow(irrefutable_let_patterns)]
5913 pub fn into_register_event_callback(
5914 self,
5915 ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5916 if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5917 Some((payload, control_handle))
5918 } else {
5919 None
5920 }
5921 }
5922
5923 #[allow(irrefutable_let_patterns)]
5924 pub fn into_start(self) -> Option<(WifiStartResponder)> {
5925 if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5926 }
5927
5928 #[allow(irrefutable_let_patterns)]
5929 pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5930 if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5931 }
5932
5933 #[allow(irrefutable_let_patterns)]
5934 pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5935 if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5936 }
5937
5938 #[allow(irrefutable_let_patterns)]
5939 pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5940 if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5941 }
5942
5943 #[allow(irrefutable_let_patterns)]
5944 pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5945 if let WifiRequest::GetChip { payload, responder } = self {
5946 Some((payload, responder))
5947 } else {
5948 None
5949 }
5950 }
5951
5952 pub fn method_name(&self) -> &'static str {
5954 match *self {
5955 WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5956 WifiRequest::Start { .. } => "start",
5957 WifiRequest::Stop { .. } => "stop",
5958 WifiRequest::GetState { .. } => "get_state",
5959 WifiRequest::GetChipIds { .. } => "get_chip_ids",
5960 WifiRequest::GetChip { .. } => "get_chip",
5961 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5962 "unknown one-way method"
5963 }
5964 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5965 "unknown two-way method"
5966 }
5967 }
5968 }
5969}
5970
5971#[derive(Debug, Clone)]
5972pub struct WifiControlHandle {
5973 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5974}
5975
5976impl fidl::endpoints::ControlHandle for WifiControlHandle {
5977 fn shutdown(&self) {
5978 self.inner.shutdown()
5979 }
5980
5981 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5982 self.inner.shutdown_with_epitaph(status)
5983 }
5984
5985 fn is_closed(&self) -> bool {
5986 self.inner.channel().is_closed()
5987 }
5988 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5989 self.inner.channel().on_closed()
5990 }
5991
5992 #[cfg(target_os = "fuchsia")]
5993 fn signal_peer(
5994 &self,
5995 clear_mask: zx::Signals,
5996 set_mask: zx::Signals,
5997 ) -> Result<(), zx_status::Status> {
5998 use fidl::Peered;
5999 self.inner.channel().signal_peer(clear_mask, set_mask)
6000 }
6001}
6002
6003impl WifiControlHandle {}
6004
6005#[must_use = "FIDL methods require a response to be sent"]
6006#[derive(Debug)]
6007pub struct WifiStartResponder {
6008 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6009 tx_id: u32,
6010}
6011
6012impl std::ops::Drop for WifiStartResponder {
6016 fn drop(&mut self) {
6017 self.control_handle.shutdown();
6018 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6020 }
6021}
6022
6023impl fidl::endpoints::Responder for WifiStartResponder {
6024 type ControlHandle = WifiControlHandle;
6025
6026 fn control_handle(&self) -> &WifiControlHandle {
6027 &self.control_handle
6028 }
6029
6030 fn drop_without_shutdown(mut self) {
6031 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6033 std::mem::forget(self);
6035 }
6036}
6037
6038impl WifiStartResponder {
6039 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6043 let _result = self.send_raw(result);
6044 if _result.is_err() {
6045 self.control_handle.shutdown();
6046 }
6047 self.drop_without_shutdown();
6048 _result
6049 }
6050
6051 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6053 let _result = self.send_raw(result);
6054 self.drop_without_shutdown();
6055 _result
6056 }
6057
6058 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6059 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6060 fidl::encoding::EmptyStruct,
6061 i32,
6062 >>(
6063 fidl::encoding::FlexibleResult::new(result),
6064 self.tx_id,
6065 0x427030e4dc6ec07a,
6066 fidl::encoding::DynamicFlags::FLEXIBLE,
6067 )
6068 }
6069}
6070
6071#[must_use = "FIDL methods require a response to be sent"]
6072#[derive(Debug)]
6073pub struct WifiStopResponder {
6074 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6075 tx_id: u32,
6076}
6077
6078impl std::ops::Drop for WifiStopResponder {
6082 fn drop(&mut self) {
6083 self.control_handle.shutdown();
6084 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6086 }
6087}
6088
6089impl fidl::endpoints::Responder for WifiStopResponder {
6090 type ControlHandle = WifiControlHandle;
6091
6092 fn control_handle(&self) -> &WifiControlHandle {
6093 &self.control_handle
6094 }
6095
6096 fn drop_without_shutdown(mut self) {
6097 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6099 std::mem::forget(self);
6101 }
6102}
6103
6104impl WifiStopResponder {
6105 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6109 let _result = self.send_raw(result);
6110 if _result.is_err() {
6111 self.control_handle.shutdown();
6112 }
6113 self.drop_without_shutdown();
6114 _result
6115 }
6116
6117 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6119 let _result = self.send_raw(result);
6120 self.drop_without_shutdown();
6121 _result
6122 }
6123
6124 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6125 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6126 fidl::encoding::EmptyStruct,
6127 i32,
6128 >>(
6129 fidl::encoding::FlexibleResult::new(result),
6130 self.tx_id,
6131 0x67c9bdf61b2888d,
6132 fidl::encoding::DynamicFlags::FLEXIBLE,
6133 )
6134 }
6135}
6136
6137#[must_use = "FIDL methods require a response to be sent"]
6138#[derive(Debug)]
6139pub struct WifiGetStateResponder {
6140 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6141 tx_id: u32,
6142}
6143
6144impl std::ops::Drop for WifiGetStateResponder {
6148 fn drop(&mut self) {
6149 self.control_handle.shutdown();
6150 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6152 }
6153}
6154
6155impl fidl::endpoints::Responder for WifiGetStateResponder {
6156 type ControlHandle = WifiControlHandle;
6157
6158 fn control_handle(&self) -> &WifiControlHandle {
6159 &self.control_handle
6160 }
6161
6162 fn drop_without_shutdown(mut self) {
6163 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6165 std::mem::forget(self);
6167 }
6168}
6169
6170impl WifiGetStateResponder {
6171 pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6175 let _result = self.send_raw(payload);
6176 if _result.is_err() {
6177 self.control_handle.shutdown();
6178 }
6179 self.drop_without_shutdown();
6180 _result
6181 }
6182
6183 pub fn send_no_shutdown_on_err(
6185 self,
6186 mut payload: &WifiGetStateResponse,
6187 ) -> Result<(), fidl::Error> {
6188 let _result = self.send_raw(payload);
6189 self.drop_without_shutdown();
6190 _result
6191 }
6192
6193 fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6194 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
6195 fidl::encoding::Flexible::new(payload),
6196 self.tx_id,
6197 0x4616114a937d1fb0,
6198 fidl::encoding::DynamicFlags::FLEXIBLE,
6199 )
6200 }
6201}
6202
6203#[must_use = "FIDL methods require a response to be sent"]
6204#[derive(Debug)]
6205pub struct WifiGetChipIdsResponder {
6206 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6207 tx_id: u32,
6208}
6209
6210impl std::ops::Drop for WifiGetChipIdsResponder {
6214 fn drop(&mut self) {
6215 self.control_handle.shutdown();
6216 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6218 }
6219}
6220
6221impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
6222 type ControlHandle = WifiControlHandle;
6223
6224 fn control_handle(&self) -> &WifiControlHandle {
6225 &self.control_handle
6226 }
6227
6228 fn drop_without_shutdown(mut self) {
6229 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6231 std::mem::forget(self);
6233 }
6234}
6235
6236impl WifiGetChipIdsResponder {
6237 pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6241 let _result = self.send_raw(payload);
6242 if _result.is_err() {
6243 self.control_handle.shutdown();
6244 }
6245 self.drop_without_shutdown();
6246 _result
6247 }
6248
6249 pub fn send_no_shutdown_on_err(
6251 self,
6252 mut payload: &WifiGetChipIdsResponse,
6253 ) -> Result<(), fidl::Error> {
6254 let _result = self.send_raw(payload);
6255 self.drop_without_shutdown();
6256 _result
6257 }
6258
6259 fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6260 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
6261 fidl::encoding::Flexible::new(payload),
6262 self.tx_id,
6263 0x2fb4f92351d802b5,
6264 fidl::encoding::DynamicFlags::FLEXIBLE,
6265 )
6266 }
6267}
6268
6269#[must_use = "FIDL methods require a response to be sent"]
6270#[derive(Debug)]
6271pub struct WifiGetChipResponder {
6272 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6273 tx_id: u32,
6274}
6275
6276impl std::ops::Drop for WifiGetChipResponder {
6280 fn drop(&mut self) {
6281 self.control_handle.shutdown();
6282 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6284 }
6285}
6286
6287impl fidl::endpoints::Responder for WifiGetChipResponder {
6288 type ControlHandle = WifiControlHandle;
6289
6290 fn control_handle(&self) -> &WifiControlHandle {
6291 &self.control_handle
6292 }
6293
6294 fn drop_without_shutdown(mut self) {
6295 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6297 std::mem::forget(self);
6299 }
6300}
6301
6302impl WifiGetChipResponder {
6303 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6307 let _result = self.send_raw(result);
6308 if _result.is_err() {
6309 self.control_handle.shutdown();
6310 }
6311 self.drop_without_shutdown();
6312 _result
6313 }
6314
6315 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6317 let _result = self.send_raw(result);
6318 self.drop_without_shutdown();
6319 _result
6320 }
6321
6322 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6323 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6324 fidl::encoding::EmptyStruct,
6325 i32,
6326 >>(
6327 fidl::encoding::FlexibleResult::new(result),
6328 self.tx_id,
6329 0xef95d8246612540,
6330 fidl::encoding::DynamicFlags::FLEXIBLE,
6331 )
6332 }
6333}
6334
6335#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6336pub struct WifiChipMarker;
6337
6338impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
6339 type Proxy = WifiChipProxy;
6340 type RequestStream = WifiChipRequestStream;
6341 #[cfg(target_os = "fuchsia")]
6342 type SynchronousProxy = WifiChipSynchronousProxy;
6343
6344 const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
6345}
6346pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
6347pub type WifiChipGetStaIfaceResult = Result<(), i32>;
6348pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
6349pub type WifiChipSetCountryCodeResult = Result<(), i32>;
6350pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
6351
6352pub trait WifiChipProxyInterface: Send + Sync {
6353 type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
6354 + Send;
6355 fn r#create_sta_iface(
6356 &self,
6357 payload: WifiChipCreateStaIfaceRequest,
6358 ) -> Self::CreateStaIfaceResponseFut;
6359 type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
6360 + Send;
6361 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
6362 type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
6363 + Send;
6364 fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
6365 type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
6366 + Send;
6367 fn r#remove_sta_iface(
6368 &self,
6369 payload: WifiChipRemoveStaIfaceRequest,
6370 ) -> Self::RemoveStaIfaceResponseFut;
6371 type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
6372 + Send;
6373 fn r#set_country_code(
6374 &self,
6375 payload: WifiChipSetCountryCodeRequest,
6376 ) -> Self::SetCountryCodeResponseFut;
6377 type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
6378 + Send;
6379 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
6380 type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
6381 + Send;
6382 fn r#get_id(&self) -> Self::GetIdResponseFut;
6383 type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
6384 + Send;
6385 fn r#get_mode(&self) -> Self::GetModeResponseFut;
6386 type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
6387 + Send;
6388 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
6389 type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
6390 + Send;
6391 fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
6392 type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6393 + Send;
6394 fn r#select_tx_power_scenario(
6395 &self,
6396 scenario: WifiChipTxPowerScenario,
6397 ) -> Self::SelectTxPowerScenarioResponseFut;
6398 type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6399 + Send;
6400 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
6401}
6402#[derive(Debug)]
6403#[cfg(target_os = "fuchsia")]
6404pub struct WifiChipSynchronousProxy {
6405 client: fidl::client::sync::Client,
6406}
6407
6408#[cfg(target_os = "fuchsia")]
6409impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6410 type Proxy = WifiChipProxy;
6411 type Protocol = WifiChipMarker;
6412
6413 fn from_channel(inner: fidl::Channel) -> Self {
6414 Self::new(inner)
6415 }
6416
6417 fn into_channel(self) -> fidl::Channel {
6418 self.client.into_channel()
6419 }
6420
6421 fn as_channel(&self) -> &fidl::Channel {
6422 self.client.as_channel()
6423 }
6424}
6425
6426#[cfg(target_os = "fuchsia")]
6427impl WifiChipSynchronousProxy {
6428 pub fn new(channel: fidl::Channel) -> Self {
6429 Self { client: fidl::client::sync::Client::new(channel) }
6430 }
6431
6432 pub fn into_channel(self) -> fidl::Channel {
6433 self.client.into_channel()
6434 }
6435
6436 pub fn wait_for_event(
6439 &self,
6440 deadline: zx::MonotonicInstant,
6441 ) -> Result<WifiChipEvent, fidl::Error> {
6442 WifiChipEvent::decode(self.client.wait_for_event::<WifiChipMarker>(deadline)?)
6443 }
6444
6445 pub fn r#create_sta_iface(
6447 &self,
6448 mut payload: WifiChipCreateStaIfaceRequest,
6449 ___deadline: zx::MonotonicInstant,
6450 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6451 let _response = self.client.send_query::<
6452 WifiChipCreateStaIfaceRequest,
6453 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6454 WifiChipMarker,
6455 >(
6456 &mut payload,
6457 0x6fb2d5892face7af,
6458 fidl::encoding::DynamicFlags::FLEXIBLE,
6459 ___deadline,
6460 )?
6461 .into_result::<WifiChipMarker>("create_sta_iface")?;
6462 Ok(_response.map(|x| x))
6463 }
6464
6465 pub fn r#get_sta_iface_names(
6467 &self,
6468 ___deadline: zx::MonotonicInstant,
6469 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6470 let _response = self.client.send_query::<
6471 fidl::encoding::EmptyPayload,
6472 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6473 WifiChipMarker,
6474 >(
6475 (),
6476 0x349257482df6a000,
6477 fidl::encoding::DynamicFlags::FLEXIBLE,
6478 ___deadline,
6479 )?
6480 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6481 Ok(_response)
6482 }
6483
6484 pub fn r#get_sta_iface(
6486 &self,
6487 mut payload: WifiChipGetStaIfaceRequest,
6488 ___deadline: zx::MonotonicInstant,
6489 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6490 let _response = self.client.send_query::<
6491 WifiChipGetStaIfaceRequest,
6492 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6493 WifiChipMarker,
6494 >(
6495 &mut payload,
6496 0x6d9704eeb36f28a2,
6497 fidl::encoding::DynamicFlags::FLEXIBLE,
6498 ___deadline,
6499 )?
6500 .into_result::<WifiChipMarker>("get_sta_iface")?;
6501 Ok(_response.map(|x| x))
6502 }
6503
6504 pub fn r#remove_sta_iface(
6506 &self,
6507 mut payload: WifiChipRemoveStaIfaceRequest,
6508 ___deadline: zx::MonotonicInstant,
6509 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6510 let _response = self.client.send_query::<
6511 WifiChipRemoveStaIfaceRequest,
6512 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6513 WifiChipMarker,
6514 >(
6515 &mut payload,
6516 0x4cd8eee466f8b04c,
6517 fidl::encoding::DynamicFlags::FLEXIBLE,
6518 ___deadline,
6519 )?
6520 .into_result::<WifiChipMarker>("remove_sta_iface")?;
6521 Ok(_response.map(|x| x))
6522 }
6523
6524 pub fn r#set_country_code(
6525 &self,
6526 mut payload: WifiChipSetCountryCodeRequest,
6527 ___deadline: zx::MonotonicInstant,
6528 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6529 let _response = self.client.send_query::<
6530 WifiChipSetCountryCodeRequest,
6531 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6532 WifiChipMarker,
6533 >(
6534 &mut payload,
6535 0x1dfe372d1d61a490,
6536 fidl::encoding::DynamicFlags::FLEXIBLE,
6537 ___deadline,
6538 )?
6539 .into_result::<WifiChipMarker>("set_country_code")?;
6540 Ok(_response.map(|x| x))
6541 }
6542
6543 pub fn r#get_available_modes(
6547 &self,
6548 ___deadline: zx::MonotonicInstant,
6549 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6550 let _response = self.client.send_query::<
6551 fidl::encoding::EmptyPayload,
6552 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6553 WifiChipMarker,
6554 >(
6555 (),
6556 0x1701095b452a3acd,
6557 fidl::encoding::DynamicFlags::FLEXIBLE,
6558 ___deadline,
6559 )?
6560 .into_result::<WifiChipMarker>("get_available_modes")?;
6561 Ok(_response)
6562 }
6563
6564 pub fn r#get_id(
6566 &self,
6567 ___deadline: zx::MonotonicInstant,
6568 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6569 let _response = self.client.send_query::<
6570 fidl::encoding::EmptyPayload,
6571 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6572 WifiChipMarker,
6573 >(
6574 (),
6575 0x37d5197325bb3370,
6576 fidl::encoding::DynamicFlags::FLEXIBLE,
6577 ___deadline,
6578 )?
6579 .into_result::<WifiChipMarker>("get_id")?;
6580 Ok(_response)
6581 }
6582
6583 pub fn r#get_mode(
6585 &self,
6586 ___deadline: zx::MonotonicInstant,
6587 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6588 let _response = self.client.send_query::<
6589 fidl::encoding::EmptyPayload,
6590 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6591 WifiChipMarker,
6592 >(
6593 (),
6594 0x4d209e0f3ac84d6f,
6595 fidl::encoding::DynamicFlags::FLEXIBLE,
6596 ___deadline,
6597 )?
6598 .into_result::<WifiChipMarker>("get_mode")?;
6599 Ok(_response)
6600 }
6601
6602 pub fn r#get_capabilities(
6604 &self,
6605 ___deadline: zx::MonotonicInstant,
6606 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6607 let _response = self.client.send_query::<
6608 fidl::encoding::EmptyPayload,
6609 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6610 WifiChipMarker,
6611 >(
6612 (),
6613 0x1b253f396dcaa2e0,
6614 fidl::encoding::DynamicFlags::FLEXIBLE,
6615 ___deadline,
6616 )?
6617 .into_result::<WifiChipMarker>("get_capabilities")?;
6618 Ok(_response)
6619 }
6620
6621 pub fn r#trigger_subsystem_restart(
6624 &self,
6625 ___deadline: zx::MonotonicInstant,
6626 ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6627 let _response = self.client.send_query::<
6628 fidl::encoding::EmptyPayload,
6629 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6630 WifiChipMarker,
6631 >(
6632 (),
6633 0x42ffcae5aad196f9,
6634 fidl::encoding::DynamicFlags::FLEXIBLE,
6635 ___deadline,
6636 )?
6637 .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6638 Ok(_response.map(|x| x))
6639 }
6640
6641 pub fn r#select_tx_power_scenario(
6643 &self,
6644 mut scenario: WifiChipTxPowerScenario,
6645 ___deadline: zx::MonotonicInstant,
6646 ) -> Result<(), fidl::Error> {
6647 let _response = self.client.send_query::<
6648 WifiChipSelectTxPowerScenarioRequest,
6649 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6650 WifiChipMarker,
6651 >(
6652 (scenario,),
6653 0x19287ab52ea72281,
6654 fidl::encoding::DynamicFlags::FLEXIBLE,
6655 ___deadline,
6656 )?
6657 .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6658 Ok(_response)
6659 }
6660
6661 pub fn r#reset_tx_power_scenario(
6663 &self,
6664 ___deadline: zx::MonotonicInstant,
6665 ) -> Result<(), fidl::Error> {
6666 let _response = self.client.send_query::<
6667 fidl::encoding::EmptyPayload,
6668 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6669 WifiChipMarker,
6670 >(
6671 (),
6672 0x46408a2fb1eb9d09,
6673 fidl::encoding::DynamicFlags::FLEXIBLE,
6674 ___deadline,
6675 )?
6676 .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6677 Ok(_response)
6678 }
6679}
6680
6681#[cfg(target_os = "fuchsia")]
6682impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6683 fn from(value: WifiChipSynchronousProxy) -> Self {
6684 value.into_channel().into()
6685 }
6686}
6687
6688#[cfg(target_os = "fuchsia")]
6689impl From<fidl::Channel> for WifiChipSynchronousProxy {
6690 fn from(value: fidl::Channel) -> Self {
6691 Self::new(value)
6692 }
6693}
6694
6695#[cfg(target_os = "fuchsia")]
6696impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6697 type Protocol = WifiChipMarker;
6698
6699 fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6700 Self::new(value.into_channel())
6701 }
6702}
6703
6704#[derive(Debug, Clone)]
6705pub struct WifiChipProxy {
6706 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6707}
6708
6709impl fidl::endpoints::Proxy for WifiChipProxy {
6710 type Protocol = WifiChipMarker;
6711
6712 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6713 Self::new(inner)
6714 }
6715
6716 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6717 self.client.into_channel().map_err(|client| Self { client })
6718 }
6719
6720 fn as_channel(&self) -> &::fidl::AsyncChannel {
6721 self.client.as_channel()
6722 }
6723}
6724
6725impl WifiChipProxy {
6726 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6728 let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6729 Self { client: fidl::client::Client::new(channel, protocol_name) }
6730 }
6731
6732 pub fn take_event_stream(&self) -> WifiChipEventStream {
6738 WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6739 }
6740
6741 pub fn r#create_sta_iface(
6743 &self,
6744 mut payload: WifiChipCreateStaIfaceRequest,
6745 ) -> fidl::client::QueryResponseFut<
6746 WifiChipCreateStaIfaceResult,
6747 fidl::encoding::DefaultFuchsiaResourceDialect,
6748 > {
6749 WifiChipProxyInterface::r#create_sta_iface(self, payload)
6750 }
6751
6752 pub fn r#get_sta_iface_names(
6754 &self,
6755 ) -> fidl::client::QueryResponseFut<
6756 WifiChipGetStaIfaceNamesResponse,
6757 fidl::encoding::DefaultFuchsiaResourceDialect,
6758 > {
6759 WifiChipProxyInterface::r#get_sta_iface_names(self)
6760 }
6761
6762 pub fn r#get_sta_iface(
6764 &self,
6765 mut payload: WifiChipGetStaIfaceRequest,
6766 ) -> fidl::client::QueryResponseFut<
6767 WifiChipGetStaIfaceResult,
6768 fidl::encoding::DefaultFuchsiaResourceDialect,
6769 > {
6770 WifiChipProxyInterface::r#get_sta_iface(self, payload)
6771 }
6772
6773 pub fn r#remove_sta_iface(
6775 &self,
6776 mut payload: WifiChipRemoveStaIfaceRequest,
6777 ) -> fidl::client::QueryResponseFut<
6778 WifiChipRemoveStaIfaceResult,
6779 fidl::encoding::DefaultFuchsiaResourceDialect,
6780 > {
6781 WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6782 }
6783
6784 pub fn r#set_country_code(
6785 &self,
6786 mut payload: WifiChipSetCountryCodeRequest,
6787 ) -> fidl::client::QueryResponseFut<
6788 WifiChipSetCountryCodeResult,
6789 fidl::encoding::DefaultFuchsiaResourceDialect,
6790 > {
6791 WifiChipProxyInterface::r#set_country_code(self, payload)
6792 }
6793
6794 pub fn r#get_available_modes(
6798 &self,
6799 ) -> fidl::client::QueryResponseFut<
6800 WifiChipGetAvailableModesResponse,
6801 fidl::encoding::DefaultFuchsiaResourceDialect,
6802 > {
6803 WifiChipProxyInterface::r#get_available_modes(self)
6804 }
6805
6806 pub fn r#get_id(
6808 &self,
6809 ) -> fidl::client::QueryResponseFut<
6810 WifiChipGetIdResponse,
6811 fidl::encoding::DefaultFuchsiaResourceDialect,
6812 > {
6813 WifiChipProxyInterface::r#get_id(self)
6814 }
6815
6816 pub fn r#get_mode(
6818 &self,
6819 ) -> fidl::client::QueryResponseFut<
6820 WifiChipGetModeResponse,
6821 fidl::encoding::DefaultFuchsiaResourceDialect,
6822 > {
6823 WifiChipProxyInterface::r#get_mode(self)
6824 }
6825
6826 pub fn r#get_capabilities(
6828 &self,
6829 ) -> fidl::client::QueryResponseFut<
6830 WifiChipGetCapabilitiesResponse,
6831 fidl::encoding::DefaultFuchsiaResourceDialect,
6832 > {
6833 WifiChipProxyInterface::r#get_capabilities(self)
6834 }
6835
6836 pub fn r#trigger_subsystem_restart(
6839 &self,
6840 ) -> fidl::client::QueryResponseFut<
6841 WifiChipTriggerSubsystemRestartResult,
6842 fidl::encoding::DefaultFuchsiaResourceDialect,
6843 > {
6844 WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6845 }
6846
6847 pub fn r#select_tx_power_scenario(
6849 &self,
6850 mut scenario: WifiChipTxPowerScenario,
6851 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6852 WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6853 }
6854
6855 pub fn r#reset_tx_power_scenario(
6857 &self,
6858 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6859 WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6860 }
6861}
6862
6863impl WifiChipProxyInterface for WifiChipProxy {
6864 type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6865 WifiChipCreateStaIfaceResult,
6866 fidl::encoding::DefaultFuchsiaResourceDialect,
6867 >;
6868 fn r#create_sta_iface(
6869 &self,
6870 mut payload: WifiChipCreateStaIfaceRequest,
6871 ) -> Self::CreateStaIfaceResponseFut {
6872 fn _decode(
6873 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6874 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6875 let _response = fidl::client::decode_transaction_body::<
6876 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6877 fidl::encoding::DefaultFuchsiaResourceDialect,
6878 0x6fb2d5892face7af,
6879 >(_buf?)?
6880 .into_result::<WifiChipMarker>("create_sta_iface")?;
6881 Ok(_response.map(|x| x))
6882 }
6883 self.client
6884 .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6885 &mut payload,
6886 0x6fb2d5892face7af,
6887 fidl::encoding::DynamicFlags::FLEXIBLE,
6888 _decode,
6889 )
6890 }
6891
6892 type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6893 WifiChipGetStaIfaceNamesResponse,
6894 fidl::encoding::DefaultFuchsiaResourceDialect,
6895 >;
6896 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6897 fn _decode(
6898 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6899 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6900 let _response = fidl::client::decode_transaction_body::<
6901 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6902 fidl::encoding::DefaultFuchsiaResourceDialect,
6903 0x349257482df6a000,
6904 >(_buf?)?
6905 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6906 Ok(_response)
6907 }
6908 self.client.send_query_and_decode::<
6909 fidl::encoding::EmptyPayload,
6910 WifiChipGetStaIfaceNamesResponse,
6911 >(
6912 (),
6913 0x349257482df6a000,
6914 fidl::encoding::DynamicFlags::FLEXIBLE,
6915 _decode,
6916 )
6917 }
6918
6919 type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6920 WifiChipGetStaIfaceResult,
6921 fidl::encoding::DefaultFuchsiaResourceDialect,
6922 >;
6923 fn r#get_sta_iface(
6924 &self,
6925 mut payload: WifiChipGetStaIfaceRequest,
6926 ) -> Self::GetStaIfaceResponseFut {
6927 fn _decode(
6928 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6929 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6930 let _response = fidl::client::decode_transaction_body::<
6931 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6932 fidl::encoding::DefaultFuchsiaResourceDialect,
6933 0x6d9704eeb36f28a2,
6934 >(_buf?)?
6935 .into_result::<WifiChipMarker>("get_sta_iface")?;
6936 Ok(_response.map(|x| x))
6937 }
6938 self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6939 &mut payload,
6940 0x6d9704eeb36f28a2,
6941 fidl::encoding::DynamicFlags::FLEXIBLE,
6942 _decode,
6943 )
6944 }
6945
6946 type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6947 WifiChipRemoveStaIfaceResult,
6948 fidl::encoding::DefaultFuchsiaResourceDialect,
6949 >;
6950 fn r#remove_sta_iface(
6951 &self,
6952 mut payload: WifiChipRemoveStaIfaceRequest,
6953 ) -> Self::RemoveStaIfaceResponseFut {
6954 fn _decode(
6955 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6956 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6957 let _response = fidl::client::decode_transaction_body::<
6958 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6959 fidl::encoding::DefaultFuchsiaResourceDialect,
6960 0x4cd8eee466f8b04c,
6961 >(_buf?)?
6962 .into_result::<WifiChipMarker>("remove_sta_iface")?;
6963 Ok(_response.map(|x| x))
6964 }
6965 self.client
6966 .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6967 &mut payload,
6968 0x4cd8eee466f8b04c,
6969 fidl::encoding::DynamicFlags::FLEXIBLE,
6970 _decode,
6971 )
6972 }
6973
6974 type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6975 WifiChipSetCountryCodeResult,
6976 fidl::encoding::DefaultFuchsiaResourceDialect,
6977 >;
6978 fn r#set_country_code(
6979 &self,
6980 mut payload: WifiChipSetCountryCodeRequest,
6981 ) -> Self::SetCountryCodeResponseFut {
6982 fn _decode(
6983 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6984 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6985 let _response = fidl::client::decode_transaction_body::<
6986 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6987 fidl::encoding::DefaultFuchsiaResourceDialect,
6988 0x1dfe372d1d61a490,
6989 >(_buf?)?
6990 .into_result::<WifiChipMarker>("set_country_code")?;
6991 Ok(_response.map(|x| x))
6992 }
6993 self.client
6994 .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6995 &mut payload,
6996 0x1dfe372d1d61a490,
6997 fidl::encoding::DynamicFlags::FLEXIBLE,
6998 _decode,
6999 )
7000 }
7001
7002 type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
7003 WifiChipGetAvailableModesResponse,
7004 fidl::encoding::DefaultFuchsiaResourceDialect,
7005 >;
7006 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
7007 fn _decode(
7008 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7009 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
7010 let _response = fidl::client::decode_transaction_body::<
7011 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
7012 fidl::encoding::DefaultFuchsiaResourceDialect,
7013 0x1701095b452a3acd,
7014 >(_buf?)?
7015 .into_result::<WifiChipMarker>("get_available_modes")?;
7016 Ok(_response)
7017 }
7018 self.client.send_query_and_decode::<
7019 fidl::encoding::EmptyPayload,
7020 WifiChipGetAvailableModesResponse,
7021 >(
7022 (),
7023 0x1701095b452a3acd,
7024 fidl::encoding::DynamicFlags::FLEXIBLE,
7025 _decode,
7026 )
7027 }
7028
7029 type GetIdResponseFut = fidl::client::QueryResponseFut<
7030 WifiChipGetIdResponse,
7031 fidl::encoding::DefaultFuchsiaResourceDialect,
7032 >;
7033 fn r#get_id(&self) -> Self::GetIdResponseFut {
7034 fn _decode(
7035 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7036 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
7037 let _response = fidl::client::decode_transaction_body::<
7038 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
7039 fidl::encoding::DefaultFuchsiaResourceDialect,
7040 0x37d5197325bb3370,
7041 >(_buf?)?
7042 .into_result::<WifiChipMarker>("get_id")?;
7043 Ok(_response)
7044 }
7045 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
7046 (),
7047 0x37d5197325bb3370,
7048 fidl::encoding::DynamicFlags::FLEXIBLE,
7049 _decode,
7050 )
7051 }
7052
7053 type GetModeResponseFut = fidl::client::QueryResponseFut<
7054 WifiChipGetModeResponse,
7055 fidl::encoding::DefaultFuchsiaResourceDialect,
7056 >;
7057 fn r#get_mode(&self) -> Self::GetModeResponseFut {
7058 fn _decode(
7059 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7060 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
7061 let _response = fidl::client::decode_transaction_body::<
7062 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
7063 fidl::encoding::DefaultFuchsiaResourceDialect,
7064 0x4d209e0f3ac84d6f,
7065 >(_buf?)?
7066 .into_result::<WifiChipMarker>("get_mode")?;
7067 Ok(_response)
7068 }
7069 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
7070 (),
7071 0x4d209e0f3ac84d6f,
7072 fidl::encoding::DynamicFlags::FLEXIBLE,
7073 _decode,
7074 )
7075 }
7076
7077 type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
7078 WifiChipGetCapabilitiesResponse,
7079 fidl::encoding::DefaultFuchsiaResourceDialect,
7080 >;
7081 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
7082 fn _decode(
7083 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7084 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
7085 let _response = fidl::client::decode_transaction_body::<
7086 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
7087 fidl::encoding::DefaultFuchsiaResourceDialect,
7088 0x1b253f396dcaa2e0,
7089 >(_buf?)?
7090 .into_result::<WifiChipMarker>("get_capabilities")?;
7091 Ok(_response)
7092 }
7093 self.client
7094 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
7095 (),
7096 0x1b253f396dcaa2e0,
7097 fidl::encoding::DynamicFlags::FLEXIBLE,
7098 _decode,
7099 )
7100 }
7101
7102 type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
7103 WifiChipTriggerSubsystemRestartResult,
7104 fidl::encoding::DefaultFuchsiaResourceDialect,
7105 >;
7106 fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
7107 fn _decode(
7108 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7109 ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
7110 let _response = fidl::client::decode_transaction_body::<
7111 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7112 fidl::encoding::DefaultFuchsiaResourceDialect,
7113 0x42ffcae5aad196f9,
7114 >(_buf?)?
7115 .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
7116 Ok(_response.map(|x| x))
7117 }
7118 self.client.send_query_and_decode::<
7119 fidl::encoding::EmptyPayload,
7120 WifiChipTriggerSubsystemRestartResult,
7121 >(
7122 (),
7123 0x42ffcae5aad196f9,
7124 fidl::encoding::DynamicFlags::FLEXIBLE,
7125 _decode,
7126 )
7127 }
7128
7129 type SelectTxPowerScenarioResponseFut =
7130 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7131 fn r#select_tx_power_scenario(
7132 &self,
7133 mut scenario: WifiChipTxPowerScenario,
7134 ) -> Self::SelectTxPowerScenarioResponseFut {
7135 fn _decode(
7136 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7137 ) -> Result<(), fidl::Error> {
7138 let _response = fidl::client::decode_transaction_body::<
7139 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
7140 fidl::encoding::DefaultFuchsiaResourceDialect,
7141 0x19287ab52ea72281,
7142 >(_buf?)?
7143 .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
7144 Ok(_response)
7145 }
7146 self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
7147 (scenario,),
7148 0x19287ab52ea72281,
7149 fidl::encoding::DynamicFlags::FLEXIBLE,
7150 _decode,
7151 )
7152 }
7153
7154 type ResetTxPowerScenarioResponseFut =
7155 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7156 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
7157 fn _decode(
7158 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7159 ) -> Result<(), fidl::Error> {
7160 let _response = fidl::client::decode_transaction_body::<
7161 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
7162 fidl::encoding::DefaultFuchsiaResourceDialect,
7163 0x46408a2fb1eb9d09,
7164 >(_buf?)?
7165 .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
7166 Ok(_response)
7167 }
7168 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7169 (),
7170 0x46408a2fb1eb9d09,
7171 fidl::encoding::DynamicFlags::FLEXIBLE,
7172 _decode,
7173 )
7174 }
7175}
7176
7177pub struct WifiChipEventStream {
7178 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7179}
7180
7181impl std::marker::Unpin for WifiChipEventStream {}
7182
7183impl futures::stream::FusedStream for WifiChipEventStream {
7184 fn is_terminated(&self) -> bool {
7185 self.event_receiver.is_terminated()
7186 }
7187}
7188
7189impl futures::Stream for WifiChipEventStream {
7190 type Item = Result<WifiChipEvent, fidl::Error>;
7191
7192 fn poll_next(
7193 mut self: std::pin::Pin<&mut Self>,
7194 cx: &mut std::task::Context<'_>,
7195 ) -> std::task::Poll<Option<Self::Item>> {
7196 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7197 &mut self.event_receiver,
7198 cx
7199 )?) {
7200 Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
7201 None => std::task::Poll::Ready(None),
7202 }
7203 }
7204}
7205
7206#[derive(Debug)]
7207pub enum WifiChipEvent {
7208 #[non_exhaustive]
7209 _UnknownEvent {
7210 ordinal: u64,
7212 },
7213}
7214
7215impl WifiChipEvent {
7216 fn decode(
7218 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7219 ) -> Result<WifiChipEvent, fidl::Error> {
7220 let (bytes, _handles) = buf.split_mut();
7221 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7222 debug_assert_eq!(tx_header.tx_id, 0);
7223 match tx_header.ordinal {
7224 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7225 Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7226 }
7227 _ => Err(fidl::Error::UnknownOrdinal {
7228 ordinal: tx_header.ordinal,
7229 protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7230 }),
7231 }
7232 }
7233}
7234
7235pub struct WifiChipRequestStream {
7237 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7238 is_terminated: bool,
7239}
7240
7241impl std::marker::Unpin for WifiChipRequestStream {}
7242
7243impl futures::stream::FusedStream for WifiChipRequestStream {
7244 fn is_terminated(&self) -> bool {
7245 self.is_terminated
7246 }
7247}
7248
7249impl fidl::endpoints::RequestStream for WifiChipRequestStream {
7250 type Protocol = WifiChipMarker;
7251 type ControlHandle = WifiChipControlHandle;
7252
7253 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7254 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7255 }
7256
7257 fn control_handle(&self) -> Self::ControlHandle {
7258 WifiChipControlHandle { inner: self.inner.clone() }
7259 }
7260
7261 fn into_inner(
7262 self,
7263 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7264 {
7265 (self.inner, self.is_terminated)
7266 }
7267
7268 fn from_inner(
7269 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7270 is_terminated: bool,
7271 ) -> Self {
7272 Self { inner, is_terminated }
7273 }
7274}
7275
7276impl futures::Stream for WifiChipRequestStream {
7277 type Item = Result<WifiChipRequest, fidl::Error>;
7278
7279 fn poll_next(
7280 mut self: std::pin::Pin<&mut Self>,
7281 cx: &mut std::task::Context<'_>,
7282 ) -> std::task::Poll<Option<Self::Item>> {
7283 let this = &mut *self;
7284 if this.inner.check_shutdown(cx) {
7285 this.is_terminated = true;
7286 return std::task::Poll::Ready(None);
7287 }
7288 if this.is_terminated {
7289 panic!("polled WifiChipRequestStream after completion");
7290 }
7291 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7292 |bytes, handles| {
7293 match this.inner.channel().read_etc(cx, bytes, handles) {
7294 std::task::Poll::Ready(Ok(())) => {}
7295 std::task::Poll::Pending => return std::task::Poll::Pending,
7296 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7297 this.is_terminated = true;
7298 return std::task::Poll::Ready(None);
7299 }
7300 std::task::Poll::Ready(Err(e)) => {
7301 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7302 e.into(),
7303 ))));
7304 }
7305 }
7306
7307 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7309
7310 std::task::Poll::Ready(Some(match header.ordinal {
7311 0x6fb2d5892face7af => {
7312 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7313 let mut req = fidl::new_empty!(
7314 WifiChipCreateStaIfaceRequest,
7315 fidl::encoding::DefaultFuchsiaResourceDialect
7316 );
7317 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7318 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7319 Ok(WifiChipRequest::CreateStaIface {
7320 payload: req,
7321 responder: WifiChipCreateStaIfaceResponder {
7322 control_handle: std::mem::ManuallyDrop::new(control_handle),
7323 tx_id: header.tx_id,
7324 },
7325 })
7326 }
7327 0x349257482df6a000 => {
7328 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7329 let mut req = fidl::new_empty!(
7330 fidl::encoding::EmptyPayload,
7331 fidl::encoding::DefaultFuchsiaResourceDialect
7332 );
7333 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7334 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7335 Ok(WifiChipRequest::GetStaIfaceNames {
7336 responder: WifiChipGetStaIfaceNamesResponder {
7337 control_handle: std::mem::ManuallyDrop::new(control_handle),
7338 tx_id: header.tx_id,
7339 },
7340 })
7341 }
7342 0x6d9704eeb36f28a2 => {
7343 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7344 let mut req = fidl::new_empty!(
7345 WifiChipGetStaIfaceRequest,
7346 fidl::encoding::DefaultFuchsiaResourceDialect
7347 );
7348 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7349 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7350 Ok(WifiChipRequest::GetStaIface {
7351 payload: req,
7352 responder: WifiChipGetStaIfaceResponder {
7353 control_handle: std::mem::ManuallyDrop::new(control_handle),
7354 tx_id: header.tx_id,
7355 },
7356 })
7357 }
7358 0x4cd8eee466f8b04c => {
7359 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7360 let mut req = fidl::new_empty!(
7361 WifiChipRemoveStaIfaceRequest,
7362 fidl::encoding::DefaultFuchsiaResourceDialect
7363 );
7364 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7365 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7366 Ok(WifiChipRequest::RemoveStaIface {
7367 payload: req,
7368 responder: WifiChipRemoveStaIfaceResponder {
7369 control_handle: std::mem::ManuallyDrop::new(control_handle),
7370 tx_id: header.tx_id,
7371 },
7372 })
7373 }
7374 0x1dfe372d1d61a490 => {
7375 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7376 let mut req = fidl::new_empty!(
7377 WifiChipSetCountryCodeRequest,
7378 fidl::encoding::DefaultFuchsiaResourceDialect
7379 );
7380 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
7381 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7382 Ok(WifiChipRequest::SetCountryCode {
7383 payload: req,
7384 responder: WifiChipSetCountryCodeResponder {
7385 control_handle: std::mem::ManuallyDrop::new(control_handle),
7386 tx_id: header.tx_id,
7387 },
7388 })
7389 }
7390 0x1701095b452a3acd => {
7391 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7392 let mut req = fidl::new_empty!(
7393 fidl::encoding::EmptyPayload,
7394 fidl::encoding::DefaultFuchsiaResourceDialect
7395 );
7396 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7397 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7398 Ok(WifiChipRequest::GetAvailableModes {
7399 responder: WifiChipGetAvailableModesResponder {
7400 control_handle: std::mem::ManuallyDrop::new(control_handle),
7401 tx_id: header.tx_id,
7402 },
7403 })
7404 }
7405 0x37d5197325bb3370 => {
7406 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7407 let mut req = fidl::new_empty!(
7408 fidl::encoding::EmptyPayload,
7409 fidl::encoding::DefaultFuchsiaResourceDialect
7410 );
7411 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7412 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7413 Ok(WifiChipRequest::GetId {
7414 responder: WifiChipGetIdResponder {
7415 control_handle: std::mem::ManuallyDrop::new(control_handle),
7416 tx_id: header.tx_id,
7417 },
7418 })
7419 }
7420 0x4d209e0f3ac84d6f => {
7421 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7422 let mut req = fidl::new_empty!(
7423 fidl::encoding::EmptyPayload,
7424 fidl::encoding::DefaultFuchsiaResourceDialect
7425 );
7426 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7427 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7428 Ok(WifiChipRequest::GetMode {
7429 responder: WifiChipGetModeResponder {
7430 control_handle: std::mem::ManuallyDrop::new(control_handle),
7431 tx_id: header.tx_id,
7432 },
7433 })
7434 }
7435 0x1b253f396dcaa2e0 => {
7436 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7437 let mut req = fidl::new_empty!(
7438 fidl::encoding::EmptyPayload,
7439 fidl::encoding::DefaultFuchsiaResourceDialect
7440 );
7441 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7442 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7443 Ok(WifiChipRequest::GetCapabilities {
7444 responder: WifiChipGetCapabilitiesResponder {
7445 control_handle: std::mem::ManuallyDrop::new(control_handle),
7446 tx_id: header.tx_id,
7447 },
7448 })
7449 }
7450 0x42ffcae5aad196f9 => {
7451 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7452 let mut req = fidl::new_empty!(
7453 fidl::encoding::EmptyPayload,
7454 fidl::encoding::DefaultFuchsiaResourceDialect
7455 );
7456 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7457 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7458 Ok(WifiChipRequest::TriggerSubsystemRestart {
7459 responder: WifiChipTriggerSubsystemRestartResponder {
7460 control_handle: std::mem::ManuallyDrop::new(control_handle),
7461 tx_id: header.tx_id,
7462 },
7463 })
7464 }
7465 0x19287ab52ea72281 => {
7466 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7467 let mut req = fidl::new_empty!(
7468 WifiChipSelectTxPowerScenarioRequest,
7469 fidl::encoding::DefaultFuchsiaResourceDialect
7470 );
7471 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7472 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7473 Ok(WifiChipRequest::SelectTxPowerScenario {
7474 scenario: req.scenario,
7475
7476 responder: WifiChipSelectTxPowerScenarioResponder {
7477 control_handle: std::mem::ManuallyDrop::new(control_handle),
7478 tx_id: header.tx_id,
7479 },
7480 })
7481 }
7482 0x46408a2fb1eb9d09 => {
7483 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7484 let mut req = fidl::new_empty!(
7485 fidl::encoding::EmptyPayload,
7486 fidl::encoding::DefaultFuchsiaResourceDialect
7487 );
7488 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7489 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7490 Ok(WifiChipRequest::ResetTxPowerScenario {
7491 responder: WifiChipResetTxPowerScenarioResponder {
7492 control_handle: std::mem::ManuallyDrop::new(control_handle),
7493 tx_id: header.tx_id,
7494 },
7495 })
7496 }
7497 _ if header.tx_id == 0
7498 && header
7499 .dynamic_flags()
7500 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7501 {
7502 Ok(WifiChipRequest::_UnknownMethod {
7503 ordinal: header.ordinal,
7504 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7505 method_type: fidl::MethodType::OneWay,
7506 })
7507 }
7508 _ if header
7509 .dynamic_flags()
7510 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7511 {
7512 this.inner.send_framework_err(
7513 fidl::encoding::FrameworkErr::UnknownMethod,
7514 header.tx_id,
7515 header.ordinal,
7516 header.dynamic_flags(),
7517 (bytes, handles),
7518 )?;
7519 Ok(WifiChipRequest::_UnknownMethod {
7520 ordinal: header.ordinal,
7521 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7522 method_type: fidl::MethodType::TwoWay,
7523 })
7524 }
7525 _ => Err(fidl::Error::UnknownOrdinal {
7526 ordinal: header.ordinal,
7527 protocol_name:
7528 <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7529 }),
7530 }))
7531 },
7532 )
7533 }
7534}
7535
7536#[derive(Debug)]
7537pub enum WifiChipRequest {
7538 CreateStaIface {
7540 payload: WifiChipCreateStaIfaceRequest,
7541 responder: WifiChipCreateStaIfaceResponder,
7542 },
7543 GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7545 GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7547 RemoveStaIface {
7549 payload: WifiChipRemoveStaIfaceRequest,
7550 responder: WifiChipRemoveStaIfaceResponder,
7551 },
7552 SetCountryCode {
7553 payload: WifiChipSetCountryCodeRequest,
7554 responder: WifiChipSetCountryCodeResponder,
7555 },
7556 GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7560 GetId { responder: WifiChipGetIdResponder },
7562 GetMode { responder: WifiChipGetModeResponder },
7564 GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7566 TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7569 SelectTxPowerScenario {
7571 scenario: WifiChipTxPowerScenario,
7572 responder: WifiChipSelectTxPowerScenarioResponder,
7573 },
7574 ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7576 #[non_exhaustive]
7578 _UnknownMethod {
7579 ordinal: u64,
7581 control_handle: WifiChipControlHandle,
7582 method_type: fidl::MethodType,
7583 },
7584}
7585
7586impl WifiChipRequest {
7587 #[allow(irrefutable_let_patterns)]
7588 pub fn into_create_sta_iface(
7589 self,
7590 ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7591 if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7592 Some((payload, responder))
7593 } else {
7594 None
7595 }
7596 }
7597
7598 #[allow(irrefutable_let_patterns)]
7599 pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7600 if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7601 Some((responder))
7602 } else {
7603 None
7604 }
7605 }
7606
7607 #[allow(irrefutable_let_patterns)]
7608 pub fn into_get_sta_iface(
7609 self,
7610 ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7611 if let WifiChipRequest::GetStaIface { payload, responder } = self {
7612 Some((payload, responder))
7613 } else {
7614 None
7615 }
7616 }
7617
7618 #[allow(irrefutable_let_patterns)]
7619 pub fn into_remove_sta_iface(
7620 self,
7621 ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7622 if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7623 Some((payload, responder))
7624 } else {
7625 None
7626 }
7627 }
7628
7629 #[allow(irrefutable_let_patterns)]
7630 pub fn into_set_country_code(
7631 self,
7632 ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7633 if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7634 Some((payload, responder))
7635 } else {
7636 None
7637 }
7638 }
7639
7640 #[allow(irrefutable_let_patterns)]
7641 pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7642 if let WifiChipRequest::GetAvailableModes { responder } = self {
7643 Some((responder))
7644 } else {
7645 None
7646 }
7647 }
7648
7649 #[allow(irrefutable_let_patterns)]
7650 pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7651 if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7652 }
7653
7654 #[allow(irrefutable_let_patterns)]
7655 pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7656 if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7657 }
7658
7659 #[allow(irrefutable_let_patterns)]
7660 pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7661 if let WifiChipRequest::GetCapabilities { responder } = self {
7662 Some((responder))
7663 } else {
7664 None
7665 }
7666 }
7667
7668 #[allow(irrefutable_let_patterns)]
7669 pub fn into_trigger_subsystem_restart(
7670 self,
7671 ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7672 if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7673 Some((responder))
7674 } else {
7675 None
7676 }
7677 }
7678
7679 #[allow(irrefutable_let_patterns)]
7680 pub fn into_select_tx_power_scenario(
7681 self,
7682 ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7683 if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7684 Some((scenario, responder))
7685 } else {
7686 None
7687 }
7688 }
7689
7690 #[allow(irrefutable_let_patterns)]
7691 pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7692 if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7693 Some((responder))
7694 } else {
7695 None
7696 }
7697 }
7698
7699 pub fn method_name(&self) -> &'static str {
7701 match *self {
7702 WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7703 WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7704 WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7705 WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7706 WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7707 WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7708 WifiChipRequest::GetId { .. } => "get_id",
7709 WifiChipRequest::GetMode { .. } => "get_mode",
7710 WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7711 WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7712 WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7713 WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7714 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7715 "unknown one-way method"
7716 }
7717 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7718 "unknown two-way method"
7719 }
7720 }
7721 }
7722}
7723
7724#[derive(Debug, Clone)]
7725pub struct WifiChipControlHandle {
7726 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7727}
7728
7729impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7730 fn shutdown(&self) {
7731 self.inner.shutdown()
7732 }
7733
7734 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7735 self.inner.shutdown_with_epitaph(status)
7736 }
7737
7738 fn is_closed(&self) -> bool {
7739 self.inner.channel().is_closed()
7740 }
7741 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7742 self.inner.channel().on_closed()
7743 }
7744
7745 #[cfg(target_os = "fuchsia")]
7746 fn signal_peer(
7747 &self,
7748 clear_mask: zx::Signals,
7749 set_mask: zx::Signals,
7750 ) -> Result<(), zx_status::Status> {
7751 use fidl::Peered;
7752 self.inner.channel().signal_peer(clear_mask, set_mask)
7753 }
7754}
7755
7756impl WifiChipControlHandle {}
7757
7758#[must_use = "FIDL methods require a response to be sent"]
7759#[derive(Debug)]
7760pub struct WifiChipCreateStaIfaceResponder {
7761 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7762 tx_id: u32,
7763}
7764
7765impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7769 fn drop(&mut self) {
7770 self.control_handle.shutdown();
7771 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7773 }
7774}
7775
7776impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7777 type ControlHandle = WifiChipControlHandle;
7778
7779 fn control_handle(&self) -> &WifiChipControlHandle {
7780 &self.control_handle
7781 }
7782
7783 fn drop_without_shutdown(mut self) {
7784 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7786 std::mem::forget(self);
7788 }
7789}
7790
7791impl WifiChipCreateStaIfaceResponder {
7792 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7796 let _result = self.send_raw(result);
7797 if _result.is_err() {
7798 self.control_handle.shutdown();
7799 }
7800 self.drop_without_shutdown();
7801 _result
7802 }
7803
7804 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7806 let _result = self.send_raw(result);
7807 self.drop_without_shutdown();
7808 _result
7809 }
7810
7811 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7812 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7813 fidl::encoding::EmptyStruct,
7814 i32,
7815 >>(
7816 fidl::encoding::FlexibleResult::new(result),
7817 self.tx_id,
7818 0x6fb2d5892face7af,
7819 fidl::encoding::DynamicFlags::FLEXIBLE,
7820 )
7821 }
7822}
7823
7824#[must_use = "FIDL methods require a response to be sent"]
7825#[derive(Debug)]
7826pub struct WifiChipGetStaIfaceNamesResponder {
7827 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7828 tx_id: u32,
7829}
7830
7831impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7835 fn drop(&mut self) {
7836 self.control_handle.shutdown();
7837 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7839 }
7840}
7841
7842impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7843 type ControlHandle = WifiChipControlHandle;
7844
7845 fn control_handle(&self) -> &WifiChipControlHandle {
7846 &self.control_handle
7847 }
7848
7849 fn drop_without_shutdown(mut self) {
7850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7852 std::mem::forget(self);
7854 }
7855}
7856
7857impl WifiChipGetStaIfaceNamesResponder {
7858 pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7862 let _result = self.send_raw(payload);
7863 if _result.is_err() {
7864 self.control_handle.shutdown();
7865 }
7866 self.drop_without_shutdown();
7867 _result
7868 }
7869
7870 pub fn send_no_shutdown_on_err(
7872 self,
7873 mut payload: &WifiChipGetStaIfaceNamesResponse,
7874 ) -> Result<(), fidl::Error> {
7875 let _result = self.send_raw(payload);
7876 self.drop_without_shutdown();
7877 _result
7878 }
7879
7880 fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7881 self.control_handle
7882 .inner
7883 .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7884 fidl::encoding::Flexible::new(payload),
7885 self.tx_id,
7886 0x349257482df6a000,
7887 fidl::encoding::DynamicFlags::FLEXIBLE,
7888 )
7889 }
7890}
7891
7892#[must_use = "FIDL methods require a response to be sent"]
7893#[derive(Debug)]
7894pub struct WifiChipGetStaIfaceResponder {
7895 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7896 tx_id: u32,
7897}
7898
7899impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7903 fn drop(&mut self) {
7904 self.control_handle.shutdown();
7905 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7907 }
7908}
7909
7910impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7911 type ControlHandle = WifiChipControlHandle;
7912
7913 fn control_handle(&self) -> &WifiChipControlHandle {
7914 &self.control_handle
7915 }
7916
7917 fn drop_without_shutdown(mut self) {
7918 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7920 std::mem::forget(self);
7922 }
7923}
7924
7925impl WifiChipGetStaIfaceResponder {
7926 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7930 let _result = self.send_raw(result);
7931 if _result.is_err() {
7932 self.control_handle.shutdown();
7933 }
7934 self.drop_without_shutdown();
7935 _result
7936 }
7937
7938 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7940 let _result = self.send_raw(result);
7941 self.drop_without_shutdown();
7942 _result
7943 }
7944
7945 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7946 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7947 fidl::encoding::EmptyStruct,
7948 i32,
7949 >>(
7950 fidl::encoding::FlexibleResult::new(result),
7951 self.tx_id,
7952 0x6d9704eeb36f28a2,
7953 fidl::encoding::DynamicFlags::FLEXIBLE,
7954 )
7955 }
7956}
7957
7958#[must_use = "FIDL methods require a response to be sent"]
7959#[derive(Debug)]
7960pub struct WifiChipRemoveStaIfaceResponder {
7961 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7962 tx_id: u32,
7963}
7964
7965impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
7969 fn drop(&mut self) {
7970 self.control_handle.shutdown();
7971 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7973 }
7974}
7975
7976impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
7977 type ControlHandle = WifiChipControlHandle;
7978
7979 fn control_handle(&self) -> &WifiChipControlHandle {
7980 &self.control_handle
7981 }
7982
7983 fn drop_without_shutdown(mut self) {
7984 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7986 std::mem::forget(self);
7988 }
7989}
7990
7991impl WifiChipRemoveStaIfaceResponder {
7992 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7996 let _result = self.send_raw(result);
7997 if _result.is_err() {
7998 self.control_handle.shutdown();
7999 }
8000 self.drop_without_shutdown();
8001 _result
8002 }
8003
8004 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8006 let _result = self.send_raw(result);
8007 self.drop_without_shutdown();
8008 _result
8009 }
8010
8011 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8012 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8013 fidl::encoding::EmptyStruct,
8014 i32,
8015 >>(
8016 fidl::encoding::FlexibleResult::new(result),
8017 self.tx_id,
8018 0x4cd8eee466f8b04c,
8019 fidl::encoding::DynamicFlags::FLEXIBLE,
8020 )
8021 }
8022}
8023
8024#[must_use = "FIDL methods require a response to be sent"]
8025#[derive(Debug)]
8026pub struct WifiChipSetCountryCodeResponder {
8027 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8028 tx_id: u32,
8029}
8030
8031impl std::ops::Drop for WifiChipSetCountryCodeResponder {
8035 fn drop(&mut self) {
8036 self.control_handle.shutdown();
8037 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8039 }
8040}
8041
8042impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
8043 type ControlHandle = WifiChipControlHandle;
8044
8045 fn control_handle(&self) -> &WifiChipControlHandle {
8046 &self.control_handle
8047 }
8048
8049 fn drop_without_shutdown(mut self) {
8050 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8052 std::mem::forget(self);
8054 }
8055}
8056
8057impl WifiChipSetCountryCodeResponder {
8058 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8062 let _result = self.send_raw(result);
8063 if _result.is_err() {
8064 self.control_handle.shutdown();
8065 }
8066 self.drop_without_shutdown();
8067 _result
8068 }
8069
8070 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8072 let _result = self.send_raw(result);
8073 self.drop_without_shutdown();
8074 _result
8075 }
8076
8077 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8078 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8079 fidl::encoding::EmptyStruct,
8080 i32,
8081 >>(
8082 fidl::encoding::FlexibleResult::new(result),
8083 self.tx_id,
8084 0x1dfe372d1d61a490,
8085 fidl::encoding::DynamicFlags::FLEXIBLE,
8086 )
8087 }
8088}
8089
8090#[must_use = "FIDL methods require a response to be sent"]
8091#[derive(Debug)]
8092pub struct WifiChipGetAvailableModesResponder {
8093 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8094 tx_id: u32,
8095}
8096
8097impl std::ops::Drop for WifiChipGetAvailableModesResponder {
8101 fn drop(&mut self) {
8102 self.control_handle.shutdown();
8103 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8105 }
8106}
8107
8108impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
8109 type ControlHandle = WifiChipControlHandle;
8110
8111 fn control_handle(&self) -> &WifiChipControlHandle {
8112 &self.control_handle
8113 }
8114
8115 fn drop_without_shutdown(mut self) {
8116 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8118 std::mem::forget(self);
8120 }
8121}
8122
8123impl WifiChipGetAvailableModesResponder {
8124 pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
8128 let _result = self.send_raw(payload);
8129 if _result.is_err() {
8130 self.control_handle.shutdown();
8131 }
8132 self.drop_without_shutdown();
8133 _result
8134 }
8135
8136 pub fn send_no_shutdown_on_err(
8138 self,
8139 mut payload: &WifiChipGetAvailableModesResponse,
8140 ) -> Result<(), fidl::Error> {
8141 let _result = self.send_raw(payload);
8142 self.drop_without_shutdown();
8143 _result
8144 }
8145
8146 fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
8147 self.control_handle
8148 .inner
8149 .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
8150 fidl::encoding::Flexible::new(payload),
8151 self.tx_id,
8152 0x1701095b452a3acd,
8153 fidl::encoding::DynamicFlags::FLEXIBLE,
8154 )
8155 }
8156}
8157
8158#[must_use = "FIDL methods require a response to be sent"]
8159#[derive(Debug)]
8160pub struct WifiChipGetIdResponder {
8161 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8162 tx_id: u32,
8163}
8164
8165impl std::ops::Drop for WifiChipGetIdResponder {
8169 fn drop(&mut self) {
8170 self.control_handle.shutdown();
8171 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8173 }
8174}
8175
8176impl fidl::endpoints::Responder for WifiChipGetIdResponder {
8177 type ControlHandle = WifiChipControlHandle;
8178
8179 fn control_handle(&self) -> &WifiChipControlHandle {
8180 &self.control_handle
8181 }
8182
8183 fn drop_without_shutdown(mut self) {
8184 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8186 std::mem::forget(self);
8188 }
8189}
8190
8191impl WifiChipGetIdResponder {
8192 pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8196 let _result = self.send_raw(payload);
8197 if _result.is_err() {
8198 self.control_handle.shutdown();
8199 }
8200 self.drop_without_shutdown();
8201 _result
8202 }
8203
8204 pub fn send_no_shutdown_on_err(
8206 self,
8207 mut payload: &WifiChipGetIdResponse,
8208 ) -> Result<(), fidl::Error> {
8209 let _result = self.send_raw(payload);
8210 self.drop_without_shutdown();
8211 _result
8212 }
8213
8214 fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8215 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
8216 fidl::encoding::Flexible::new(payload),
8217 self.tx_id,
8218 0x37d5197325bb3370,
8219 fidl::encoding::DynamicFlags::FLEXIBLE,
8220 )
8221 }
8222}
8223
8224#[must_use = "FIDL methods require a response to be sent"]
8225#[derive(Debug)]
8226pub struct WifiChipGetModeResponder {
8227 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8228 tx_id: u32,
8229}
8230
8231impl std::ops::Drop for WifiChipGetModeResponder {
8235 fn drop(&mut self) {
8236 self.control_handle.shutdown();
8237 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8239 }
8240}
8241
8242impl fidl::endpoints::Responder for WifiChipGetModeResponder {
8243 type ControlHandle = WifiChipControlHandle;
8244
8245 fn control_handle(&self) -> &WifiChipControlHandle {
8246 &self.control_handle
8247 }
8248
8249 fn drop_without_shutdown(mut self) {
8250 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8252 std::mem::forget(self);
8254 }
8255}
8256
8257impl WifiChipGetModeResponder {
8258 pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8262 let _result = self.send_raw(payload);
8263 if _result.is_err() {
8264 self.control_handle.shutdown();
8265 }
8266 self.drop_without_shutdown();
8267 _result
8268 }
8269
8270 pub fn send_no_shutdown_on_err(
8272 self,
8273 mut payload: &WifiChipGetModeResponse,
8274 ) -> Result<(), fidl::Error> {
8275 let _result = self.send_raw(payload);
8276 self.drop_without_shutdown();
8277 _result
8278 }
8279
8280 fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8281 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
8282 fidl::encoding::Flexible::new(payload),
8283 self.tx_id,
8284 0x4d209e0f3ac84d6f,
8285 fidl::encoding::DynamicFlags::FLEXIBLE,
8286 )
8287 }
8288}
8289
8290#[must_use = "FIDL methods require a response to be sent"]
8291#[derive(Debug)]
8292pub struct WifiChipGetCapabilitiesResponder {
8293 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8294 tx_id: u32,
8295}
8296
8297impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
8301 fn drop(&mut self) {
8302 self.control_handle.shutdown();
8303 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8305 }
8306}
8307
8308impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
8309 type ControlHandle = WifiChipControlHandle;
8310
8311 fn control_handle(&self) -> &WifiChipControlHandle {
8312 &self.control_handle
8313 }
8314
8315 fn drop_without_shutdown(mut self) {
8316 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8318 std::mem::forget(self);
8320 }
8321}
8322
8323impl WifiChipGetCapabilitiesResponder {
8324 pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8328 let _result = self.send_raw(payload);
8329 if _result.is_err() {
8330 self.control_handle.shutdown();
8331 }
8332 self.drop_without_shutdown();
8333 _result
8334 }
8335
8336 pub fn send_no_shutdown_on_err(
8338 self,
8339 mut payload: &WifiChipGetCapabilitiesResponse,
8340 ) -> Result<(), fidl::Error> {
8341 let _result = self.send_raw(payload);
8342 self.drop_without_shutdown();
8343 _result
8344 }
8345
8346 fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8347 self.control_handle
8348 .inner
8349 .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
8350 fidl::encoding::Flexible::new(payload),
8351 self.tx_id,
8352 0x1b253f396dcaa2e0,
8353 fidl::encoding::DynamicFlags::FLEXIBLE,
8354 )
8355 }
8356}
8357
8358#[must_use = "FIDL methods require a response to be sent"]
8359#[derive(Debug)]
8360pub struct WifiChipTriggerSubsystemRestartResponder {
8361 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8362 tx_id: u32,
8363}
8364
8365impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
8369 fn drop(&mut self) {
8370 self.control_handle.shutdown();
8371 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8373 }
8374}
8375
8376impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
8377 type ControlHandle = WifiChipControlHandle;
8378
8379 fn control_handle(&self) -> &WifiChipControlHandle {
8380 &self.control_handle
8381 }
8382
8383 fn drop_without_shutdown(mut self) {
8384 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8386 std::mem::forget(self);
8388 }
8389}
8390
8391impl WifiChipTriggerSubsystemRestartResponder {
8392 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8396 let _result = self.send_raw(result);
8397 if _result.is_err() {
8398 self.control_handle.shutdown();
8399 }
8400 self.drop_without_shutdown();
8401 _result
8402 }
8403
8404 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8406 let _result = self.send_raw(result);
8407 self.drop_without_shutdown();
8408 _result
8409 }
8410
8411 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8412 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8413 fidl::encoding::EmptyStruct,
8414 i32,
8415 >>(
8416 fidl::encoding::FlexibleResult::new(result),
8417 self.tx_id,
8418 0x42ffcae5aad196f9,
8419 fidl::encoding::DynamicFlags::FLEXIBLE,
8420 )
8421 }
8422}
8423
8424#[must_use = "FIDL methods require a response to be sent"]
8425#[derive(Debug)]
8426pub struct WifiChipSelectTxPowerScenarioResponder {
8427 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8428 tx_id: u32,
8429}
8430
8431impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8435 fn drop(&mut self) {
8436 self.control_handle.shutdown();
8437 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8439 }
8440}
8441
8442impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8443 type ControlHandle = WifiChipControlHandle;
8444
8445 fn control_handle(&self) -> &WifiChipControlHandle {
8446 &self.control_handle
8447 }
8448
8449 fn drop_without_shutdown(mut self) {
8450 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8452 std::mem::forget(self);
8454 }
8455}
8456
8457impl WifiChipSelectTxPowerScenarioResponder {
8458 pub fn send(self) -> Result<(), fidl::Error> {
8462 let _result = self.send_raw();
8463 if _result.is_err() {
8464 self.control_handle.shutdown();
8465 }
8466 self.drop_without_shutdown();
8467 _result
8468 }
8469
8470 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8472 let _result = self.send_raw();
8473 self.drop_without_shutdown();
8474 _result
8475 }
8476
8477 fn send_raw(&self) -> Result<(), fidl::Error> {
8478 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8479 fidl::encoding::Flexible::new(()),
8480 self.tx_id,
8481 0x19287ab52ea72281,
8482 fidl::encoding::DynamicFlags::FLEXIBLE,
8483 )
8484 }
8485}
8486
8487#[must_use = "FIDL methods require a response to be sent"]
8488#[derive(Debug)]
8489pub struct WifiChipResetTxPowerScenarioResponder {
8490 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8491 tx_id: u32,
8492}
8493
8494impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8498 fn drop(&mut self) {
8499 self.control_handle.shutdown();
8500 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8502 }
8503}
8504
8505impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8506 type ControlHandle = WifiChipControlHandle;
8507
8508 fn control_handle(&self) -> &WifiChipControlHandle {
8509 &self.control_handle
8510 }
8511
8512 fn drop_without_shutdown(mut self) {
8513 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8515 std::mem::forget(self);
8517 }
8518}
8519
8520impl WifiChipResetTxPowerScenarioResponder {
8521 pub fn send(self) -> Result<(), fidl::Error> {
8525 let _result = self.send_raw();
8526 if _result.is_err() {
8527 self.control_handle.shutdown();
8528 }
8529 self.drop_without_shutdown();
8530 _result
8531 }
8532
8533 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8535 let _result = self.send_raw();
8536 self.drop_without_shutdown();
8537 _result
8538 }
8539
8540 fn send_raw(&self) -> Result<(), fidl::Error> {
8541 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8542 fidl::encoding::Flexible::new(()),
8543 self.tx_id,
8544 0x46408a2fb1eb9d09,
8545 fidl::encoding::DynamicFlags::FLEXIBLE,
8546 )
8547 }
8548}
8549
8550#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8551pub struct WifiEventCallbackMarker;
8552
8553impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8554 type Proxy = WifiEventCallbackProxy;
8555 type RequestStream = WifiEventCallbackRequestStream;
8556 #[cfg(target_os = "fuchsia")]
8557 type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8558
8559 const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8560}
8561
8562pub trait WifiEventCallbackProxyInterface: Send + Sync {
8563 fn r#on_start(&self) -> Result<(), fidl::Error>;
8564 fn r#on_stop(&self) -> Result<(), fidl::Error>;
8565 fn r#on_subsystem_restart(
8566 &self,
8567 payload: WifiEventCallbackOnSubsystemRestartRequest,
8568 ) -> Result<(), fidl::Error>;
8569}
8570#[derive(Debug)]
8571#[cfg(target_os = "fuchsia")]
8572pub struct WifiEventCallbackSynchronousProxy {
8573 client: fidl::client::sync::Client,
8574}
8575
8576#[cfg(target_os = "fuchsia")]
8577impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8578 type Proxy = WifiEventCallbackProxy;
8579 type Protocol = WifiEventCallbackMarker;
8580
8581 fn from_channel(inner: fidl::Channel) -> Self {
8582 Self::new(inner)
8583 }
8584
8585 fn into_channel(self) -> fidl::Channel {
8586 self.client.into_channel()
8587 }
8588
8589 fn as_channel(&self) -> &fidl::Channel {
8590 self.client.as_channel()
8591 }
8592}
8593
8594#[cfg(target_os = "fuchsia")]
8595impl WifiEventCallbackSynchronousProxy {
8596 pub fn new(channel: fidl::Channel) -> Self {
8597 Self { client: fidl::client::sync::Client::new(channel) }
8598 }
8599
8600 pub fn into_channel(self) -> fidl::Channel {
8601 self.client.into_channel()
8602 }
8603
8604 pub fn wait_for_event(
8607 &self,
8608 deadline: zx::MonotonicInstant,
8609 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8610 WifiEventCallbackEvent::decode(
8611 self.client.wait_for_event::<WifiEventCallbackMarker>(deadline)?,
8612 )
8613 }
8614
8615 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8616 self.client.send::<fidl::encoding::EmptyPayload>(
8617 (),
8618 0x61189ff44f9d35f3,
8619 fidl::encoding::DynamicFlags::FLEXIBLE,
8620 )
8621 }
8622
8623 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8624 self.client.send::<fidl::encoding::EmptyPayload>(
8625 (),
8626 0x58b697bcd475e0f9,
8627 fidl::encoding::DynamicFlags::FLEXIBLE,
8628 )
8629 }
8630
8631 pub fn r#on_subsystem_restart(
8632 &self,
8633 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8634 ) -> Result<(), fidl::Error> {
8635 self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8636 &mut payload,
8637 0x69dfee4d3475db21,
8638 fidl::encoding::DynamicFlags::FLEXIBLE,
8639 )
8640 }
8641}
8642
8643#[cfg(target_os = "fuchsia")]
8644impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8645 fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8646 value.into_channel().into()
8647 }
8648}
8649
8650#[cfg(target_os = "fuchsia")]
8651impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8652 fn from(value: fidl::Channel) -> Self {
8653 Self::new(value)
8654 }
8655}
8656
8657#[cfg(target_os = "fuchsia")]
8658impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8659 type Protocol = WifiEventCallbackMarker;
8660
8661 fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8662 Self::new(value.into_channel())
8663 }
8664}
8665
8666#[derive(Debug, Clone)]
8667pub struct WifiEventCallbackProxy {
8668 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8669}
8670
8671impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8672 type Protocol = WifiEventCallbackMarker;
8673
8674 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8675 Self::new(inner)
8676 }
8677
8678 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8679 self.client.into_channel().map_err(|client| Self { client })
8680 }
8681
8682 fn as_channel(&self) -> &::fidl::AsyncChannel {
8683 self.client.as_channel()
8684 }
8685}
8686
8687impl WifiEventCallbackProxy {
8688 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8690 let protocol_name =
8691 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8692 Self { client: fidl::client::Client::new(channel, protocol_name) }
8693 }
8694
8695 pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8701 WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8702 }
8703
8704 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8705 WifiEventCallbackProxyInterface::r#on_start(self)
8706 }
8707
8708 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8709 WifiEventCallbackProxyInterface::r#on_stop(self)
8710 }
8711
8712 pub fn r#on_subsystem_restart(
8713 &self,
8714 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8715 ) -> Result<(), fidl::Error> {
8716 WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8717 }
8718}
8719
8720impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8721 fn r#on_start(&self) -> Result<(), fidl::Error> {
8722 self.client.send::<fidl::encoding::EmptyPayload>(
8723 (),
8724 0x61189ff44f9d35f3,
8725 fidl::encoding::DynamicFlags::FLEXIBLE,
8726 )
8727 }
8728
8729 fn r#on_stop(&self) -> Result<(), fidl::Error> {
8730 self.client.send::<fidl::encoding::EmptyPayload>(
8731 (),
8732 0x58b697bcd475e0f9,
8733 fidl::encoding::DynamicFlags::FLEXIBLE,
8734 )
8735 }
8736
8737 fn r#on_subsystem_restart(
8738 &self,
8739 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8740 ) -> Result<(), fidl::Error> {
8741 self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8742 &mut payload,
8743 0x69dfee4d3475db21,
8744 fidl::encoding::DynamicFlags::FLEXIBLE,
8745 )
8746 }
8747}
8748
8749pub struct WifiEventCallbackEventStream {
8750 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8751}
8752
8753impl std::marker::Unpin for WifiEventCallbackEventStream {}
8754
8755impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8756 fn is_terminated(&self) -> bool {
8757 self.event_receiver.is_terminated()
8758 }
8759}
8760
8761impl futures::Stream for WifiEventCallbackEventStream {
8762 type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8763
8764 fn poll_next(
8765 mut self: std::pin::Pin<&mut Self>,
8766 cx: &mut std::task::Context<'_>,
8767 ) -> std::task::Poll<Option<Self::Item>> {
8768 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8769 &mut self.event_receiver,
8770 cx
8771 )?) {
8772 Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8773 None => std::task::Poll::Ready(None),
8774 }
8775 }
8776}
8777
8778#[derive(Debug)]
8779pub enum WifiEventCallbackEvent {
8780 #[non_exhaustive]
8781 _UnknownEvent {
8782 ordinal: u64,
8784 },
8785}
8786
8787impl WifiEventCallbackEvent {
8788 fn decode(
8790 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8791 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8792 let (bytes, _handles) = buf.split_mut();
8793 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8794 debug_assert_eq!(tx_header.tx_id, 0);
8795 match tx_header.ordinal {
8796 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8797 Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8798 }
8799 _ => Err(fidl::Error::UnknownOrdinal {
8800 ordinal: tx_header.ordinal,
8801 protocol_name:
8802 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8803 }),
8804 }
8805 }
8806}
8807
8808pub struct WifiEventCallbackRequestStream {
8810 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8811 is_terminated: bool,
8812}
8813
8814impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8815
8816impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8817 fn is_terminated(&self) -> bool {
8818 self.is_terminated
8819 }
8820}
8821
8822impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8823 type Protocol = WifiEventCallbackMarker;
8824 type ControlHandle = WifiEventCallbackControlHandle;
8825
8826 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8827 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8828 }
8829
8830 fn control_handle(&self) -> Self::ControlHandle {
8831 WifiEventCallbackControlHandle { inner: self.inner.clone() }
8832 }
8833
8834 fn into_inner(
8835 self,
8836 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8837 {
8838 (self.inner, self.is_terminated)
8839 }
8840
8841 fn from_inner(
8842 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8843 is_terminated: bool,
8844 ) -> Self {
8845 Self { inner, is_terminated }
8846 }
8847}
8848
8849impl futures::Stream for WifiEventCallbackRequestStream {
8850 type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8851
8852 fn poll_next(
8853 mut self: std::pin::Pin<&mut Self>,
8854 cx: &mut std::task::Context<'_>,
8855 ) -> std::task::Poll<Option<Self::Item>> {
8856 let this = &mut *self;
8857 if this.inner.check_shutdown(cx) {
8858 this.is_terminated = true;
8859 return std::task::Poll::Ready(None);
8860 }
8861 if this.is_terminated {
8862 panic!("polled WifiEventCallbackRequestStream after completion");
8863 }
8864 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8865 |bytes, handles| {
8866 match this.inner.channel().read_etc(cx, bytes, handles) {
8867 std::task::Poll::Ready(Ok(())) => {}
8868 std::task::Poll::Pending => return std::task::Poll::Pending,
8869 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8870 this.is_terminated = true;
8871 return std::task::Poll::Ready(None);
8872 }
8873 std::task::Poll::Ready(Err(e)) => {
8874 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8875 e.into(),
8876 ))));
8877 }
8878 }
8879
8880 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8882
8883 std::task::Poll::Ready(Some(match header.ordinal {
8884 0x61189ff44f9d35f3 => {
8885 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8886 let mut req = fidl::new_empty!(
8887 fidl::encoding::EmptyPayload,
8888 fidl::encoding::DefaultFuchsiaResourceDialect
8889 );
8890 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8891 let control_handle =
8892 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8893 Ok(WifiEventCallbackRequest::OnStart { control_handle })
8894 }
8895 0x58b697bcd475e0f9 => {
8896 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8897 let mut req = fidl::new_empty!(
8898 fidl::encoding::EmptyPayload,
8899 fidl::encoding::DefaultFuchsiaResourceDialect
8900 );
8901 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8902 let control_handle =
8903 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8904 Ok(WifiEventCallbackRequest::OnStop { control_handle })
8905 }
8906 0x69dfee4d3475db21 => {
8907 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8908 let mut req = fidl::new_empty!(
8909 WifiEventCallbackOnSubsystemRestartRequest,
8910 fidl::encoding::DefaultFuchsiaResourceDialect
8911 );
8912 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8913 let control_handle =
8914 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8915 Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8916 payload: req,
8917 control_handle,
8918 })
8919 }
8920 _ if header.tx_id == 0
8921 && header
8922 .dynamic_flags()
8923 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8924 {
8925 Ok(WifiEventCallbackRequest::_UnknownMethod {
8926 ordinal: header.ordinal,
8927 control_handle: WifiEventCallbackControlHandle {
8928 inner: this.inner.clone(),
8929 },
8930 method_type: fidl::MethodType::OneWay,
8931 })
8932 }
8933 _ if header
8934 .dynamic_flags()
8935 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8936 {
8937 this.inner.send_framework_err(
8938 fidl::encoding::FrameworkErr::UnknownMethod,
8939 header.tx_id,
8940 header.ordinal,
8941 header.dynamic_flags(),
8942 (bytes, handles),
8943 )?;
8944 Ok(WifiEventCallbackRequest::_UnknownMethod {
8945 ordinal: header.ordinal,
8946 control_handle: WifiEventCallbackControlHandle {
8947 inner: this.inner.clone(),
8948 },
8949 method_type: fidl::MethodType::TwoWay,
8950 })
8951 }
8952 _ => Err(fidl::Error::UnknownOrdinal {
8953 ordinal: header.ordinal,
8954 protocol_name:
8955 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8956 }),
8957 }))
8958 },
8959 )
8960 }
8961}
8962
8963#[derive(Debug)]
8964pub enum WifiEventCallbackRequest {
8965 OnStart {
8966 control_handle: WifiEventCallbackControlHandle,
8967 },
8968 OnStop {
8969 control_handle: WifiEventCallbackControlHandle,
8970 },
8971 OnSubsystemRestart {
8972 payload: WifiEventCallbackOnSubsystemRestartRequest,
8973 control_handle: WifiEventCallbackControlHandle,
8974 },
8975 #[non_exhaustive]
8977 _UnknownMethod {
8978 ordinal: u64,
8980 control_handle: WifiEventCallbackControlHandle,
8981 method_type: fidl::MethodType,
8982 },
8983}
8984
8985impl WifiEventCallbackRequest {
8986 #[allow(irrefutable_let_patterns)]
8987 pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
8988 if let WifiEventCallbackRequest::OnStart { control_handle } = self {
8989 Some((control_handle))
8990 } else {
8991 None
8992 }
8993 }
8994
8995 #[allow(irrefutable_let_patterns)]
8996 pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
8997 if let WifiEventCallbackRequest::OnStop { control_handle } = self {
8998 Some((control_handle))
8999 } else {
9000 None
9001 }
9002 }
9003
9004 #[allow(irrefutable_let_patterns)]
9005 pub fn into_on_subsystem_restart(
9006 self,
9007 ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
9008 if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
9009 Some((payload, control_handle))
9010 } else {
9011 None
9012 }
9013 }
9014
9015 pub fn method_name(&self) -> &'static str {
9017 match *self {
9018 WifiEventCallbackRequest::OnStart { .. } => "on_start",
9019 WifiEventCallbackRequest::OnStop { .. } => "on_stop",
9020 WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
9021 WifiEventCallbackRequest::_UnknownMethod {
9022 method_type: fidl::MethodType::OneWay,
9023 ..
9024 } => "unknown one-way method",
9025 WifiEventCallbackRequest::_UnknownMethod {
9026 method_type: fidl::MethodType::TwoWay,
9027 ..
9028 } => "unknown two-way method",
9029 }
9030 }
9031}
9032
9033#[derive(Debug, Clone)]
9034pub struct WifiEventCallbackControlHandle {
9035 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9036}
9037
9038impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
9039 fn shutdown(&self) {
9040 self.inner.shutdown()
9041 }
9042
9043 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9044 self.inner.shutdown_with_epitaph(status)
9045 }
9046
9047 fn is_closed(&self) -> bool {
9048 self.inner.channel().is_closed()
9049 }
9050 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9051 self.inner.channel().on_closed()
9052 }
9053
9054 #[cfg(target_os = "fuchsia")]
9055 fn signal_peer(
9056 &self,
9057 clear_mask: zx::Signals,
9058 set_mask: zx::Signals,
9059 ) -> Result<(), zx_status::Status> {
9060 use fidl::Peered;
9061 self.inner.channel().signal_peer(clear_mask, set_mask)
9062 }
9063}
9064
9065impl WifiEventCallbackControlHandle {}
9066
9067#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9068pub struct WifiLegacyHalMarker;
9069
9070impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
9071 type Proxy = WifiLegacyHalProxy;
9072 type RequestStream = WifiLegacyHalRequestStream;
9073 #[cfg(target_os = "fuchsia")]
9074 type SynchronousProxy = WifiLegacyHalSynchronousProxy;
9075
9076 const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
9077}
9078pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
9079pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
9080
9081pub trait WifiLegacyHalProxyInterface: Send + Sync {
9082 type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
9083 + Send;
9084 fn r#select_tx_power_scenario(
9085 &self,
9086 payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9087 ) -> Self::SelectTxPowerScenarioResponseFut;
9088 type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
9089 + Send;
9090 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
9091}
9092#[derive(Debug)]
9093#[cfg(target_os = "fuchsia")]
9094pub struct WifiLegacyHalSynchronousProxy {
9095 client: fidl::client::sync::Client,
9096}
9097
9098#[cfg(target_os = "fuchsia")]
9099impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
9100 type Proxy = WifiLegacyHalProxy;
9101 type Protocol = WifiLegacyHalMarker;
9102
9103 fn from_channel(inner: fidl::Channel) -> Self {
9104 Self::new(inner)
9105 }
9106
9107 fn into_channel(self) -> fidl::Channel {
9108 self.client.into_channel()
9109 }
9110
9111 fn as_channel(&self) -> &fidl::Channel {
9112 self.client.as_channel()
9113 }
9114}
9115
9116#[cfg(target_os = "fuchsia")]
9117impl WifiLegacyHalSynchronousProxy {
9118 pub fn new(channel: fidl::Channel) -> Self {
9119 Self { client: fidl::client::sync::Client::new(channel) }
9120 }
9121
9122 pub fn into_channel(self) -> fidl::Channel {
9123 self.client.into_channel()
9124 }
9125
9126 pub fn wait_for_event(
9129 &self,
9130 deadline: zx::MonotonicInstant,
9131 ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9132 WifiLegacyHalEvent::decode(self.client.wait_for_event::<WifiLegacyHalMarker>(deadline)?)
9133 }
9134
9135 pub fn r#select_tx_power_scenario(
9137 &self,
9138 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9139 ___deadline: zx::MonotonicInstant,
9140 ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9141 let _response = self.client.send_query::<
9142 WifiLegacyHalSelectTxPowerScenarioRequest,
9143 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
9144 WifiLegacyHalMarker,
9145 >(
9146 &mut payload,
9147 0x49f42620e0a3caf9,
9148 fidl::encoding::DynamicFlags::FLEXIBLE,
9149 ___deadline,
9150 )?
9151 .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9152 Ok(_response.map(|x| x))
9153 }
9154
9155 pub fn r#reset_tx_power_scenario(
9157 &self,
9158 ___deadline: zx::MonotonicInstant,
9159 ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9160 let _response =
9161 self.client
9162 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9163 fidl::encoding::EmptyStruct,
9164 WifiLegacyHalStatus,
9165 >, WifiLegacyHalMarker>(
9166 (),
9167 0x6c0f8e9203167d8e,
9168 fidl::encoding::DynamicFlags::FLEXIBLE,
9169 ___deadline,
9170 )?
9171 .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9172 Ok(_response.map(|x| x))
9173 }
9174}
9175
9176#[cfg(target_os = "fuchsia")]
9177impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
9178 fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
9179 value.into_channel().into()
9180 }
9181}
9182
9183#[cfg(target_os = "fuchsia")]
9184impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
9185 fn from(value: fidl::Channel) -> Self {
9186 Self::new(value)
9187 }
9188}
9189
9190#[cfg(target_os = "fuchsia")]
9191impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
9192 type Protocol = WifiLegacyHalMarker;
9193
9194 fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
9195 Self::new(value.into_channel())
9196 }
9197}
9198
9199#[derive(Debug, Clone)]
9200pub struct WifiLegacyHalProxy {
9201 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9202}
9203
9204impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
9205 type Protocol = WifiLegacyHalMarker;
9206
9207 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9208 Self::new(inner)
9209 }
9210
9211 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9212 self.client.into_channel().map_err(|client| Self { client })
9213 }
9214
9215 fn as_channel(&self) -> &::fidl::AsyncChannel {
9216 self.client.as_channel()
9217 }
9218}
9219
9220impl WifiLegacyHalProxy {
9221 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9223 let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9224 Self { client: fidl::client::Client::new(channel, protocol_name) }
9225 }
9226
9227 pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
9233 WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
9234 }
9235
9236 pub fn r#select_tx_power_scenario(
9238 &self,
9239 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9240 ) -> fidl::client::QueryResponseFut<
9241 WifiLegacyHalSelectTxPowerScenarioResult,
9242 fidl::encoding::DefaultFuchsiaResourceDialect,
9243 > {
9244 WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
9245 }
9246
9247 pub fn r#reset_tx_power_scenario(
9249 &self,
9250 ) -> fidl::client::QueryResponseFut<
9251 WifiLegacyHalResetTxPowerScenarioResult,
9252 fidl::encoding::DefaultFuchsiaResourceDialect,
9253 > {
9254 WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
9255 }
9256}
9257
9258impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
9259 type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9260 WifiLegacyHalSelectTxPowerScenarioResult,
9261 fidl::encoding::DefaultFuchsiaResourceDialect,
9262 >;
9263 fn r#select_tx_power_scenario(
9264 &self,
9265 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9266 ) -> Self::SelectTxPowerScenarioResponseFut {
9267 fn _decode(
9268 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9269 ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9270 let _response = fidl::client::decode_transaction_body::<
9271 fidl::encoding::FlexibleResultType<
9272 fidl::encoding::EmptyStruct,
9273 WifiLegacyHalStatus,
9274 >,
9275 fidl::encoding::DefaultFuchsiaResourceDialect,
9276 0x49f42620e0a3caf9,
9277 >(_buf?)?
9278 .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9279 Ok(_response.map(|x| x))
9280 }
9281 self.client.send_query_and_decode::<
9282 WifiLegacyHalSelectTxPowerScenarioRequest,
9283 WifiLegacyHalSelectTxPowerScenarioResult,
9284 >(
9285 &mut payload,
9286 0x49f42620e0a3caf9,
9287 fidl::encoding::DynamicFlags::FLEXIBLE,
9288 _decode,
9289 )
9290 }
9291
9292 type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9293 WifiLegacyHalResetTxPowerScenarioResult,
9294 fidl::encoding::DefaultFuchsiaResourceDialect,
9295 >;
9296 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
9297 fn _decode(
9298 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9299 ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9300 let _response = fidl::client::decode_transaction_body::<
9301 fidl::encoding::FlexibleResultType<
9302 fidl::encoding::EmptyStruct,
9303 WifiLegacyHalStatus,
9304 >,
9305 fidl::encoding::DefaultFuchsiaResourceDialect,
9306 0x6c0f8e9203167d8e,
9307 >(_buf?)?
9308 .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9309 Ok(_response.map(|x| x))
9310 }
9311 self.client.send_query_and_decode::<
9312 fidl::encoding::EmptyPayload,
9313 WifiLegacyHalResetTxPowerScenarioResult,
9314 >(
9315 (),
9316 0x6c0f8e9203167d8e,
9317 fidl::encoding::DynamicFlags::FLEXIBLE,
9318 _decode,
9319 )
9320 }
9321}
9322
9323pub struct WifiLegacyHalEventStream {
9324 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9325}
9326
9327impl std::marker::Unpin for WifiLegacyHalEventStream {}
9328
9329impl futures::stream::FusedStream for WifiLegacyHalEventStream {
9330 fn is_terminated(&self) -> bool {
9331 self.event_receiver.is_terminated()
9332 }
9333}
9334
9335impl futures::Stream for WifiLegacyHalEventStream {
9336 type Item = Result<WifiLegacyHalEvent, fidl::Error>;
9337
9338 fn poll_next(
9339 mut self: std::pin::Pin<&mut Self>,
9340 cx: &mut std::task::Context<'_>,
9341 ) -> std::task::Poll<Option<Self::Item>> {
9342 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9343 &mut self.event_receiver,
9344 cx
9345 )?) {
9346 Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
9347 None => std::task::Poll::Ready(None),
9348 }
9349 }
9350}
9351
9352#[derive(Debug)]
9353pub enum WifiLegacyHalEvent {
9354 #[non_exhaustive]
9355 _UnknownEvent {
9356 ordinal: u64,
9358 },
9359}
9360
9361impl WifiLegacyHalEvent {
9362 fn decode(
9364 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9365 ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9366 let (bytes, _handles) = buf.split_mut();
9367 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9368 debug_assert_eq!(tx_header.tx_id, 0);
9369 match tx_header.ordinal {
9370 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9371 Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9372 }
9373 _ => Err(fidl::Error::UnknownOrdinal {
9374 ordinal: tx_header.ordinal,
9375 protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9376 }),
9377 }
9378 }
9379}
9380
9381pub struct WifiLegacyHalRequestStream {
9383 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9384 is_terminated: bool,
9385}
9386
9387impl std::marker::Unpin for WifiLegacyHalRequestStream {}
9388
9389impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
9390 fn is_terminated(&self) -> bool {
9391 self.is_terminated
9392 }
9393}
9394
9395impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
9396 type Protocol = WifiLegacyHalMarker;
9397 type ControlHandle = WifiLegacyHalControlHandle;
9398
9399 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9400 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9401 }
9402
9403 fn control_handle(&self) -> Self::ControlHandle {
9404 WifiLegacyHalControlHandle { inner: self.inner.clone() }
9405 }
9406
9407 fn into_inner(
9408 self,
9409 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9410 {
9411 (self.inner, self.is_terminated)
9412 }
9413
9414 fn from_inner(
9415 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9416 is_terminated: bool,
9417 ) -> Self {
9418 Self { inner, is_terminated }
9419 }
9420}
9421
9422impl futures::Stream for WifiLegacyHalRequestStream {
9423 type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9424
9425 fn poll_next(
9426 mut self: std::pin::Pin<&mut Self>,
9427 cx: &mut std::task::Context<'_>,
9428 ) -> std::task::Poll<Option<Self::Item>> {
9429 let this = &mut *self;
9430 if this.inner.check_shutdown(cx) {
9431 this.is_terminated = true;
9432 return std::task::Poll::Ready(None);
9433 }
9434 if this.is_terminated {
9435 panic!("polled WifiLegacyHalRequestStream after completion");
9436 }
9437 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9438 |bytes, handles| {
9439 match this.inner.channel().read_etc(cx, bytes, handles) {
9440 std::task::Poll::Ready(Ok(())) => {}
9441 std::task::Poll::Pending => return std::task::Poll::Pending,
9442 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9443 this.is_terminated = true;
9444 return std::task::Poll::Ready(None);
9445 }
9446 std::task::Poll::Ready(Err(e)) => {
9447 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9448 e.into(),
9449 ))));
9450 }
9451 }
9452
9453 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9455
9456 std::task::Poll::Ready(Some(match header.ordinal {
9457 0x49f42620e0a3caf9 => {
9458 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9459 let mut req = fidl::new_empty!(
9460 WifiLegacyHalSelectTxPowerScenarioRequest,
9461 fidl::encoding::DefaultFuchsiaResourceDialect
9462 );
9463 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9464 let control_handle =
9465 WifiLegacyHalControlHandle { inner: this.inner.clone() };
9466 Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9467 payload: req,
9468 responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9469 control_handle: std::mem::ManuallyDrop::new(control_handle),
9470 tx_id: header.tx_id,
9471 },
9472 })
9473 }
9474 0x6c0f8e9203167d8e => {
9475 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9476 let mut req = fidl::new_empty!(
9477 fidl::encoding::EmptyPayload,
9478 fidl::encoding::DefaultFuchsiaResourceDialect
9479 );
9480 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9481 let control_handle =
9482 WifiLegacyHalControlHandle { inner: this.inner.clone() };
9483 Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9484 responder: WifiLegacyHalResetTxPowerScenarioResponder {
9485 control_handle: std::mem::ManuallyDrop::new(control_handle),
9486 tx_id: header.tx_id,
9487 },
9488 })
9489 }
9490 _ if header.tx_id == 0
9491 && header
9492 .dynamic_flags()
9493 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9494 {
9495 Ok(WifiLegacyHalRequest::_UnknownMethod {
9496 ordinal: header.ordinal,
9497 control_handle: WifiLegacyHalControlHandle {
9498 inner: this.inner.clone(),
9499 },
9500 method_type: fidl::MethodType::OneWay,
9501 })
9502 }
9503 _ if header
9504 .dynamic_flags()
9505 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9506 {
9507 this.inner.send_framework_err(
9508 fidl::encoding::FrameworkErr::UnknownMethod,
9509 header.tx_id,
9510 header.ordinal,
9511 header.dynamic_flags(),
9512 (bytes, handles),
9513 )?;
9514 Ok(WifiLegacyHalRequest::_UnknownMethod {
9515 ordinal: header.ordinal,
9516 control_handle: WifiLegacyHalControlHandle {
9517 inner: this.inner.clone(),
9518 },
9519 method_type: fidl::MethodType::TwoWay,
9520 })
9521 }
9522 _ => Err(fidl::Error::UnknownOrdinal {
9523 ordinal: header.ordinal,
9524 protocol_name:
9525 <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9526 }),
9527 }))
9528 },
9529 )
9530 }
9531}
9532
9533#[derive(Debug)]
9534pub enum WifiLegacyHalRequest {
9535 SelectTxPowerScenario {
9537 payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9538 responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9539 },
9540 ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9542 #[non_exhaustive]
9544 _UnknownMethod {
9545 ordinal: u64,
9547 control_handle: WifiLegacyHalControlHandle,
9548 method_type: fidl::MethodType,
9549 },
9550}
9551
9552impl WifiLegacyHalRequest {
9553 #[allow(irrefutable_let_patterns)]
9554 pub fn into_select_tx_power_scenario(
9555 self,
9556 ) -> Option<(
9557 WifiLegacyHalSelectTxPowerScenarioRequest,
9558 WifiLegacyHalSelectTxPowerScenarioResponder,
9559 )> {
9560 if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9561 Some((payload, responder))
9562 } else {
9563 None
9564 }
9565 }
9566
9567 #[allow(irrefutable_let_patterns)]
9568 pub fn into_reset_tx_power_scenario(
9569 self,
9570 ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9571 if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9572 Some((responder))
9573 } else {
9574 None
9575 }
9576 }
9577
9578 pub fn method_name(&self) -> &'static str {
9580 match *self {
9581 WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9582 WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9583 WifiLegacyHalRequest::_UnknownMethod {
9584 method_type: fidl::MethodType::OneWay, ..
9585 } => "unknown one-way method",
9586 WifiLegacyHalRequest::_UnknownMethod {
9587 method_type: fidl::MethodType::TwoWay, ..
9588 } => "unknown two-way method",
9589 }
9590 }
9591}
9592
9593#[derive(Debug, Clone)]
9594pub struct WifiLegacyHalControlHandle {
9595 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9596}
9597
9598impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9599 fn shutdown(&self) {
9600 self.inner.shutdown()
9601 }
9602
9603 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9604 self.inner.shutdown_with_epitaph(status)
9605 }
9606
9607 fn is_closed(&self) -> bool {
9608 self.inner.channel().is_closed()
9609 }
9610 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9611 self.inner.channel().on_closed()
9612 }
9613
9614 #[cfg(target_os = "fuchsia")]
9615 fn signal_peer(
9616 &self,
9617 clear_mask: zx::Signals,
9618 set_mask: zx::Signals,
9619 ) -> Result<(), zx_status::Status> {
9620 use fidl::Peered;
9621 self.inner.channel().signal_peer(clear_mask, set_mask)
9622 }
9623}
9624
9625impl WifiLegacyHalControlHandle {}
9626
9627#[must_use = "FIDL methods require a response to be sent"]
9628#[derive(Debug)]
9629pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9630 control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9631 tx_id: u32,
9632}
9633
9634impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9638 fn drop(&mut self) {
9639 self.control_handle.shutdown();
9640 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9642 }
9643}
9644
9645impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9646 type ControlHandle = WifiLegacyHalControlHandle;
9647
9648 fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9649 &self.control_handle
9650 }
9651
9652 fn drop_without_shutdown(mut self) {
9653 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9655 std::mem::forget(self);
9657 }
9658}
9659
9660impl WifiLegacyHalSelectTxPowerScenarioResponder {
9661 pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9665 let _result = self.send_raw(result);
9666 if _result.is_err() {
9667 self.control_handle.shutdown();
9668 }
9669 self.drop_without_shutdown();
9670 _result
9671 }
9672
9673 pub fn send_no_shutdown_on_err(
9675 self,
9676 mut result: Result<(), WifiLegacyHalStatus>,
9677 ) -> Result<(), fidl::Error> {
9678 let _result = self.send_raw(result);
9679 self.drop_without_shutdown();
9680 _result
9681 }
9682
9683 fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9684 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9685 fidl::encoding::EmptyStruct,
9686 WifiLegacyHalStatus,
9687 >>(
9688 fidl::encoding::FlexibleResult::new(result),
9689 self.tx_id,
9690 0x49f42620e0a3caf9,
9691 fidl::encoding::DynamicFlags::FLEXIBLE,
9692 )
9693 }
9694}
9695
9696#[must_use = "FIDL methods require a response to be sent"]
9697#[derive(Debug)]
9698pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9699 control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9700 tx_id: u32,
9701}
9702
9703impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9707 fn drop(&mut self) {
9708 self.control_handle.shutdown();
9709 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9711 }
9712}
9713
9714impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9715 type ControlHandle = WifiLegacyHalControlHandle;
9716
9717 fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9718 &self.control_handle
9719 }
9720
9721 fn drop_without_shutdown(mut self) {
9722 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9724 std::mem::forget(self);
9726 }
9727}
9728
9729impl WifiLegacyHalResetTxPowerScenarioResponder {
9730 pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9734 let _result = self.send_raw(result);
9735 if _result.is_err() {
9736 self.control_handle.shutdown();
9737 }
9738 self.drop_without_shutdown();
9739 _result
9740 }
9741
9742 pub fn send_no_shutdown_on_err(
9744 self,
9745 mut result: Result<(), WifiLegacyHalStatus>,
9746 ) -> Result<(), fidl::Error> {
9747 let _result = self.send_raw(result);
9748 self.drop_without_shutdown();
9749 _result
9750 }
9751
9752 fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9753 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9754 fidl::encoding::EmptyStruct,
9755 WifiLegacyHalStatus,
9756 >>(
9757 fidl::encoding::FlexibleResult::new(result),
9758 self.tx_id,
9759 0x6c0f8e9203167d8e,
9760 fidl::encoding::DynamicFlags::FLEXIBLE,
9761 )
9762 }
9763}
9764
9765#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9766pub struct WifiStaIfaceMarker;
9767
9768impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9769 type Proxy = WifiStaIfaceProxy;
9770 type RequestStream = WifiStaIfaceRequestStream;
9771 #[cfg(target_os = "fuchsia")]
9772 type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9773
9774 const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9775}
9776pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9777pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9778pub type WifiStaIfaceGetApfPacketFilterSupportResult =
9779 Result<WifiStaIfaceGetApfPacketFilterSupportResponse, i32>;
9780pub type WifiStaIfaceInstallApfPacketFilterResult = Result<(), i32>;
9781pub type WifiStaIfaceReadApfPacketFilterDataResult =
9782 Result<WifiStaIfaceReadApfPacketFilterDataResponse, i32>;
9783
9784pub trait WifiStaIfaceProxyInterface: Send + Sync {
9785 type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9786 + Send;
9787 fn r#get_name(&self) -> Self::GetNameResponseFut;
9788 type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9789 + Send;
9790 fn r#set_scan_only_mode(
9791 &self,
9792 payload: WifiStaIfaceSetScanOnlyModeRequest,
9793 ) -> Self::SetScanOnlyModeResponseFut;
9794 type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9795 + Send;
9796 fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9797 type GetApfPacketFilterSupportResponseFut: std::future::Future<
9798 Output = Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error>,
9799 > + Send;
9800 fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut;
9801 type InstallApfPacketFilterResponseFut: std::future::Future<Output = Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error>>
9802 + Send;
9803 fn r#install_apf_packet_filter(
9804 &self,
9805 payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9806 ) -> Self::InstallApfPacketFilterResponseFut;
9807 type ReadApfPacketFilterDataResponseFut: std::future::Future<Output = Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error>>
9808 + Send;
9809 fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut;
9810}
9811#[derive(Debug)]
9812#[cfg(target_os = "fuchsia")]
9813pub struct WifiStaIfaceSynchronousProxy {
9814 client: fidl::client::sync::Client,
9815}
9816
9817#[cfg(target_os = "fuchsia")]
9818impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9819 type Proxy = WifiStaIfaceProxy;
9820 type Protocol = WifiStaIfaceMarker;
9821
9822 fn from_channel(inner: fidl::Channel) -> Self {
9823 Self::new(inner)
9824 }
9825
9826 fn into_channel(self) -> fidl::Channel {
9827 self.client.into_channel()
9828 }
9829
9830 fn as_channel(&self) -> &fidl::Channel {
9831 self.client.as_channel()
9832 }
9833}
9834
9835#[cfg(target_os = "fuchsia")]
9836impl WifiStaIfaceSynchronousProxy {
9837 pub fn new(channel: fidl::Channel) -> Self {
9838 Self { client: fidl::client::sync::Client::new(channel) }
9839 }
9840
9841 pub fn into_channel(self) -> fidl::Channel {
9842 self.client.into_channel()
9843 }
9844
9845 pub fn wait_for_event(
9848 &self,
9849 deadline: zx::MonotonicInstant,
9850 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9851 WifiStaIfaceEvent::decode(self.client.wait_for_event::<WifiStaIfaceMarker>(deadline)?)
9852 }
9853
9854 pub fn r#get_name(
9856 &self,
9857 ___deadline: zx::MonotonicInstant,
9858 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9859 let _response = self.client.send_query::<
9860 fidl::encoding::EmptyPayload,
9861 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9862 WifiStaIfaceMarker,
9863 >(
9864 (),
9865 0x5c150b91c80c5789,
9866 fidl::encoding::DynamicFlags::FLEXIBLE,
9867 ___deadline,
9868 )?
9869 .into_result::<WifiStaIfaceMarker>("get_name")?;
9870 Ok(_response)
9871 }
9872
9873 pub fn r#set_scan_only_mode(
9874 &self,
9875 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9876 ___deadline: zx::MonotonicInstant,
9877 ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9878 let _response = self.client.send_query::<
9879 WifiStaIfaceSetScanOnlyModeRequest,
9880 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9881 WifiStaIfaceMarker,
9882 >(
9883 &mut payload,
9884 0x22550328583bf0e3,
9885 fidl::encoding::DynamicFlags::FLEXIBLE,
9886 ___deadline,
9887 )?
9888 .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9889 Ok(_response.map(|x| x))
9890 }
9891
9892 pub fn r#set_mac_address(
9896 &self,
9897 mut mac_addr: &[u8; 6],
9898 ___deadline: zx::MonotonicInstant,
9899 ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9900 let _response = self.client.send_query::<
9901 WifiStaIfaceSetMacAddressRequest,
9902 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9903 WifiStaIfaceMarker,
9904 >(
9905 (mac_addr,),
9906 0x39c4f355079421b9,
9907 fidl::encoding::DynamicFlags::FLEXIBLE,
9908 ___deadline,
9909 )?
9910 .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9911 Ok(_response.map(|x| x))
9912 }
9913
9914 pub fn r#get_apf_packet_filter_support(
9915 &self,
9916 ___deadline: zx::MonotonicInstant,
9917 ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
9918 let _response =
9919 self.client
9920 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9921 WifiStaIfaceGetApfPacketFilterSupportResponse,
9922 i32,
9923 >, WifiStaIfaceMarker>(
9924 (),
9925 0x205c538d31d76c8c,
9926 fidl::encoding::DynamicFlags::FLEXIBLE,
9927 ___deadline,
9928 )?
9929 .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
9930 Ok(_response.map(|x| x))
9931 }
9932
9933 pub fn r#install_apf_packet_filter(
9937 &self,
9938 mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9939 ___deadline: zx::MonotonicInstant,
9940 ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
9941 let _response = self.client.send_query::<
9942 WifiStaIfaceInstallApfPacketFilterRequest,
9943 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9944 WifiStaIfaceMarker,
9945 >(
9946 payload,
9947 0x6306fbfdb65631ba,
9948 fidl::encoding::DynamicFlags::FLEXIBLE,
9949 ___deadline,
9950 )?
9951 .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
9952 Ok(_response.map(|x| x))
9953 }
9954
9955 pub fn r#read_apf_packet_filter_data(
9964 &self,
9965 ___deadline: zx::MonotonicInstant,
9966 ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
9967 let _response =
9968 self.client
9969 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9970 WifiStaIfaceReadApfPacketFilterDataResponse,
9971 i32,
9972 >, WifiStaIfaceMarker>(
9973 (),
9974 0x4f39e558ddbca39,
9975 fidl::encoding::DynamicFlags::FLEXIBLE,
9976 ___deadline,
9977 )?
9978 .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
9979 Ok(_response.map(|x| x))
9980 }
9981}
9982
9983#[cfg(target_os = "fuchsia")]
9984impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
9985 fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
9986 value.into_channel().into()
9987 }
9988}
9989
9990#[cfg(target_os = "fuchsia")]
9991impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
9992 fn from(value: fidl::Channel) -> Self {
9993 Self::new(value)
9994 }
9995}
9996
9997#[cfg(target_os = "fuchsia")]
9998impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
9999 type Protocol = WifiStaIfaceMarker;
10000
10001 fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
10002 Self::new(value.into_channel())
10003 }
10004}
10005
10006#[derive(Debug, Clone)]
10007pub struct WifiStaIfaceProxy {
10008 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10009}
10010
10011impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
10012 type Protocol = WifiStaIfaceMarker;
10013
10014 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10015 Self::new(inner)
10016 }
10017
10018 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10019 self.client.into_channel().map_err(|client| Self { client })
10020 }
10021
10022 fn as_channel(&self) -> &::fidl::AsyncChannel {
10023 self.client.as_channel()
10024 }
10025}
10026
10027impl WifiStaIfaceProxy {
10028 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10030 let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10031 Self { client: fidl::client::Client::new(channel, protocol_name) }
10032 }
10033
10034 pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
10040 WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
10041 }
10042
10043 pub fn r#get_name(
10045 &self,
10046 ) -> fidl::client::QueryResponseFut<
10047 WifiStaIfaceGetNameResponse,
10048 fidl::encoding::DefaultFuchsiaResourceDialect,
10049 > {
10050 WifiStaIfaceProxyInterface::r#get_name(self)
10051 }
10052
10053 pub fn r#set_scan_only_mode(
10054 &self,
10055 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10056 ) -> fidl::client::QueryResponseFut<
10057 WifiStaIfaceSetScanOnlyModeResult,
10058 fidl::encoding::DefaultFuchsiaResourceDialect,
10059 > {
10060 WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
10061 }
10062
10063 pub fn r#set_mac_address(
10067 &self,
10068 mut mac_addr: &[u8; 6],
10069 ) -> fidl::client::QueryResponseFut<
10070 WifiStaIfaceSetMacAddressResult,
10071 fidl::encoding::DefaultFuchsiaResourceDialect,
10072 > {
10073 WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
10074 }
10075
10076 pub fn r#get_apf_packet_filter_support(
10077 &self,
10078 ) -> fidl::client::QueryResponseFut<
10079 WifiStaIfaceGetApfPacketFilterSupportResult,
10080 fidl::encoding::DefaultFuchsiaResourceDialect,
10081 > {
10082 WifiStaIfaceProxyInterface::r#get_apf_packet_filter_support(self)
10083 }
10084
10085 pub fn r#install_apf_packet_filter(
10089 &self,
10090 mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10091 ) -> fidl::client::QueryResponseFut<
10092 WifiStaIfaceInstallApfPacketFilterResult,
10093 fidl::encoding::DefaultFuchsiaResourceDialect,
10094 > {
10095 WifiStaIfaceProxyInterface::r#install_apf_packet_filter(self, payload)
10096 }
10097
10098 pub fn r#read_apf_packet_filter_data(
10107 &self,
10108 ) -> fidl::client::QueryResponseFut<
10109 WifiStaIfaceReadApfPacketFilterDataResult,
10110 fidl::encoding::DefaultFuchsiaResourceDialect,
10111 > {
10112 WifiStaIfaceProxyInterface::r#read_apf_packet_filter_data(self)
10113 }
10114}
10115
10116impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
10117 type GetNameResponseFut = fidl::client::QueryResponseFut<
10118 WifiStaIfaceGetNameResponse,
10119 fidl::encoding::DefaultFuchsiaResourceDialect,
10120 >;
10121 fn r#get_name(&self) -> Self::GetNameResponseFut {
10122 fn _decode(
10123 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10124 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
10125 let _response = fidl::client::decode_transaction_body::<
10126 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
10127 fidl::encoding::DefaultFuchsiaResourceDialect,
10128 0x5c150b91c80c5789,
10129 >(_buf?)?
10130 .into_result::<WifiStaIfaceMarker>("get_name")?;
10131 Ok(_response)
10132 }
10133 self.client
10134 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
10135 (),
10136 0x5c150b91c80c5789,
10137 fidl::encoding::DynamicFlags::FLEXIBLE,
10138 _decode,
10139 )
10140 }
10141
10142 type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
10143 WifiStaIfaceSetScanOnlyModeResult,
10144 fidl::encoding::DefaultFuchsiaResourceDialect,
10145 >;
10146 fn r#set_scan_only_mode(
10147 &self,
10148 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10149 ) -> Self::SetScanOnlyModeResponseFut {
10150 fn _decode(
10151 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10152 ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
10153 let _response = fidl::client::decode_transaction_body::<
10154 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10155 fidl::encoding::DefaultFuchsiaResourceDialect,
10156 0x22550328583bf0e3,
10157 >(_buf?)?
10158 .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
10159 Ok(_response.map(|x| x))
10160 }
10161 self.client.send_query_and_decode::<
10162 WifiStaIfaceSetScanOnlyModeRequest,
10163 WifiStaIfaceSetScanOnlyModeResult,
10164 >(
10165 &mut payload,
10166 0x22550328583bf0e3,
10167 fidl::encoding::DynamicFlags::FLEXIBLE,
10168 _decode,
10169 )
10170 }
10171
10172 type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
10173 WifiStaIfaceSetMacAddressResult,
10174 fidl::encoding::DefaultFuchsiaResourceDialect,
10175 >;
10176 fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
10177 fn _decode(
10178 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10179 ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
10180 let _response = fidl::client::decode_transaction_body::<
10181 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10182 fidl::encoding::DefaultFuchsiaResourceDialect,
10183 0x39c4f355079421b9,
10184 >(_buf?)?
10185 .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
10186 Ok(_response.map(|x| x))
10187 }
10188 self.client.send_query_and_decode::<
10189 WifiStaIfaceSetMacAddressRequest,
10190 WifiStaIfaceSetMacAddressResult,
10191 >(
10192 (mac_addr,),
10193 0x39c4f355079421b9,
10194 fidl::encoding::DynamicFlags::FLEXIBLE,
10195 _decode,
10196 )
10197 }
10198
10199 type GetApfPacketFilterSupportResponseFut = fidl::client::QueryResponseFut<
10200 WifiStaIfaceGetApfPacketFilterSupportResult,
10201 fidl::encoding::DefaultFuchsiaResourceDialect,
10202 >;
10203 fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut {
10204 fn _decode(
10205 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10206 ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
10207 let _response = fidl::client::decode_transaction_body::<
10208 fidl::encoding::FlexibleResultType<
10209 WifiStaIfaceGetApfPacketFilterSupportResponse,
10210 i32,
10211 >,
10212 fidl::encoding::DefaultFuchsiaResourceDialect,
10213 0x205c538d31d76c8c,
10214 >(_buf?)?
10215 .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
10216 Ok(_response.map(|x| x))
10217 }
10218 self.client.send_query_and_decode::<
10219 fidl::encoding::EmptyPayload,
10220 WifiStaIfaceGetApfPacketFilterSupportResult,
10221 >(
10222 (),
10223 0x205c538d31d76c8c,
10224 fidl::encoding::DynamicFlags::FLEXIBLE,
10225 _decode,
10226 )
10227 }
10228
10229 type InstallApfPacketFilterResponseFut = fidl::client::QueryResponseFut<
10230 WifiStaIfaceInstallApfPacketFilterResult,
10231 fidl::encoding::DefaultFuchsiaResourceDialect,
10232 >;
10233 fn r#install_apf_packet_filter(
10234 &self,
10235 mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10236 ) -> Self::InstallApfPacketFilterResponseFut {
10237 fn _decode(
10238 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10239 ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10240 let _response = fidl::client::decode_transaction_body::<
10241 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10242 fidl::encoding::DefaultFuchsiaResourceDialect,
10243 0x6306fbfdb65631ba,
10244 >(_buf?)?
10245 .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10246 Ok(_response.map(|x| x))
10247 }
10248 self.client.send_query_and_decode::<
10249 WifiStaIfaceInstallApfPacketFilterRequest,
10250 WifiStaIfaceInstallApfPacketFilterResult,
10251 >(
10252 payload,
10253 0x6306fbfdb65631ba,
10254 fidl::encoding::DynamicFlags::FLEXIBLE,
10255 _decode,
10256 )
10257 }
10258
10259 type ReadApfPacketFilterDataResponseFut = fidl::client::QueryResponseFut<
10260 WifiStaIfaceReadApfPacketFilterDataResult,
10261 fidl::encoding::DefaultFuchsiaResourceDialect,
10262 >;
10263 fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut {
10264 fn _decode(
10265 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10266 ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10267 let _response = fidl::client::decode_transaction_body::<
10268 fidl::encoding::FlexibleResultType<
10269 WifiStaIfaceReadApfPacketFilterDataResponse,
10270 i32,
10271 >,
10272 fidl::encoding::DefaultFuchsiaResourceDialect,
10273 0x4f39e558ddbca39,
10274 >(_buf?)?
10275 .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10276 Ok(_response.map(|x| x))
10277 }
10278 self.client.send_query_and_decode::<
10279 fidl::encoding::EmptyPayload,
10280 WifiStaIfaceReadApfPacketFilterDataResult,
10281 >(
10282 (),
10283 0x4f39e558ddbca39,
10284 fidl::encoding::DynamicFlags::FLEXIBLE,
10285 _decode,
10286 )
10287 }
10288}
10289
10290pub struct WifiStaIfaceEventStream {
10291 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10292}
10293
10294impl std::marker::Unpin for WifiStaIfaceEventStream {}
10295
10296impl futures::stream::FusedStream for WifiStaIfaceEventStream {
10297 fn is_terminated(&self) -> bool {
10298 self.event_receiver.is_terminated()
10299 }
10300}
10301
10302impl futures::Stream for WifiStaIfaceEventStream {
10303 type Item = Result<WifiStaIfaceEvent, fidl::Error>;
10304
10305 fn poll_next(
10306 mut self: std::pin::Pin<&mut Self>,
10307 cx: &mut std::task::Context<'_>,
10308 ) -> std::task::Poll<Option<Self::Item>> {
10309 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10310 &mut self.event_receiver,
10311 cx
10312 )?) {
10313 Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
10314 None => std::task::Poll::Ready(None),
10315 }
10316 }
10317}
10318
10319#[derive(Debug)]
10320pub enum WifiStaIfaceEvent {
10321 #[non_exhaustive]
10322 _UnknownEvent {
10323 ordinal: u64,
10325 },
10326}
10327
10328impl WifiStaIfaceEvent {
10329 fn decode(
10331 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10332 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
10333 let (bytes, _handles) = buf.split_mut();
10334 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10335 debug_assert_eq!(tx_header.tx_id, 0);
10336 match tx_header.ordinal {
10337 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10338 Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10339 }
10340 _ => Err(fidl::Error::UnknownOrdinal {
10341 ordinal: tx_header.ordinal,
10342 protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10343 }),
10344 }
10345 }
10346}
10347
10348pub struct WifiStaIfaceRequestStream {
10350 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10351 is_terminated: bool,
10352}
10353
10354impl std::marker::Unpin for WifiStaIfaceRequestStream {}
10355
10356impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
10357 fn is_terminated(&self) -> bool {
10358 self.is_terminated
10359 }
10360}
10361
10362impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
10363 type Protocol = WifiStaIfaceMarker;
10364 type ControlHandle = WifiStaIfaceControlHandle;
10365
10366 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10367 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10368 }
10369
10370 fn control_handle(&self) -> Self::ControlHandle {
10371 WifiStaIfaceControlHandle { inner: self.inner.clone() }
10372 }
10373
10374 fn into_inner(
10375 self,
10376 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10377 {
10378 (self.inner, self.is_terminated)
10379 }
10380
10381 fn from_inner(
10382 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10383 is_terminated: bool,
10384 ) -> Self {
10385 Self { inner, is_terminated }
10386 }
10387}
10388
10389impl futures::Stream for WifiStaIfaceRequestStream {
10390 type Item = Result<WifiStaIfaceRequest, fidl::Error>;
10391
10392 fn poll_next(
10393 mut self: std::pin::Pin<&mut Self>,
10394 cx: &mut std::task::Context<'_>,
10395 ) -> std::task::Poll<Option<Self::Item>> {
10396 let this = &mut *self;
10397 if this.inner.check_shutdown(cx) {
10398 this.is_terminated = true;
10399 return std::task::Poll::Ready(None);
10400 }
10401 if this.is_terminated {
10402 panic!("polled WifiStaIfaceRequestStream after completion");
10403 }
10404 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10405 |bytes, handles| {
10406 match this.inner.channel().read_etc(cx, bytes, handles) {
10407 std::task::Poll::Ready(Ok(())) => {}
10408 std::task::Poll::Pending => return std::task::Poll::Pending,
10409 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10410 this.is_terminated = true;
10411 return std::task::Poll::Ready(None);
10412 }
10413 std::task::Poll::Ready(Err(e)) => {
10414 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10415 e.into(),
10416 ))));
10417 }
10418 }
10419
10420 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10422
10423 std::task::Poll::Ready(Some(match header.ordinal {
10424 0x5c150b91c80c5789 => {
10425 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10426 let mut req = fidl::new_empty!(
10427 fidl::encoding::EmptyPayload,
10428 fidl::encoding::DefaultFuchsiaResourceDialect
10429 );
10430 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10431 let control_handle =
10432 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10433 Ok(WifiStaIfaceRequest::GetName {
10434 responder: WifiStaIfaceGetNameResponder {
10435 control_handle: std::mem::ManuallyDrop::new(control_handle),
10436 tx_id: header.tx_id,
10437 },
10438 })
10439 }
10440 0x22550328583bf0e3 => {
10441 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10442 let mut req = fidl::new_empty!(
10443 WifiStaIfaceSetScanOnlyModeRequest,
10444 fidl::encoding::DefaultFuchsiaResourceDialect
10445 );
10446 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
10447 let control_handle =
10448 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10449 Ok(WifiStaIfaceRequest::SetScanOnlyMode {
10450 payload: req,
10451 responder: WifiStaIfaceSetScanOnlyModeResponder {
10452 control_handle: std::mem::ManuallyDrop::new(control_handle),
10453 tx_id: header.tx_id,
10454 },
10455 })
10456 }
10457 0x39c4f355079421b9 => {
10458 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10459 let mut req = fidl::new_empty!(
10460 WifiStaIfaceSetMacAddressRequest,
10461 fidl::encoding::DefaultFuchsiaResourceDialect
10462 );
10463 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
10464 let control_handle =
10465 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10466 Ok(WifiStaIfaceRequest::SetMacAddress {
10467 mac_addr: req.mac_addr,
10468
10469 responder: WifiStaIfaceSetMacAddressResponder {
10470 control_handle: std::mem::ManuallyDrop::new(control_handle),
10471 tx_id: header.tx_id,
10472 },
10473 })
10474 }
10475 0x205c538d31d76c8c => {
10476 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10477 let mut req = fidl::new_empty!(
10478 fidl::encoding::EmptyPayload,
10479 fidl::encoding::DefaultFuchsiaResourceDialect
10480 );
10481 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10482 let control_handle =
10483 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10484 Ok(WifiStaIfaceRequest::GetApfPacketFilterSupport {
10485 responder: WifiStaIfaceGetApfPacketFilterSupportResponder {
10486 control_handle: std::mem::ManuallyDrop::new(control_handle),
10487 tx_id: header.tx_id,
10488 },
10489 })
10490 }
10491 0x6306fbfdb65631ba => {
10492 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10493 let mut req = fidl::new_empty!(
10494 WifiStaIfaceInstallApfPacketFilterRequest,
10495 fidl::encoding::DefaultFuchsiaResourceDialect
10496 );
10497 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceInstallApfPacketFilterRequest>(&header, _body_bytes, handles, &mut req)?;
10498 let control_handle =
10499 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10500 Ok(WifiStaIfaceRequest::InstallApfPacketFilter {
10501 payload: req,
10502 responder: WifiStaIfaceInstallApfPacketFilterResponder {
10503 control_handle: std::mem::ManuallyDrop::new(control_handle),
10504 tx_id: header.tx_id,
10505 },
10506 })
10507 }
10508 0x4f39e558ddbca39 => {
10509 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10510 let mut req = fidl::new_empty!(
10511 fidl::encoding::EmptyPayload,
10512 fidl::encoding::DefaultFuchsiaResourceDialect
10513 );
10514 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10515 let control_handle =
10516 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10517 Ok(WifiStaIfaceRequest::ReadApfPacketFilterData {
10518 responder: WifiStaIfaceReadApfPacketFilterDataResponder {
10519 control_handle: std::mem::ManuallyDrop::new(control_handle),
10520 tx_id: header.tx_id,
10521 },
10522 })
10523 }
10524 _ if header.tx_id == 0
10525 && header
10526 .dynamic_flags()
10527 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10528 {
10529 Ok(WifiStaIfaceRequest::_UnknownMethod {
10530 ordinal: header.ordinal,
10531 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10532 method_type: fidl::MethodType::OneWay,
10533 })
10534 }
10535 _ if header
10536 .dynamic_flags()
10537 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10538 {
10539 this.inner.send_framework_err(
10540 fidl::encoding::FrameworkErr::UnknownMethod,
10541 header.tx_id,
10542 header.ordinal,
10543 header.dynamic_flags(),
10544 (bytes, handles),
10545 )?;
10546 Ok(WifiStaIfaceRequest::_UnknownMethod {
10547 ordinal: header.ordinal,
10548 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10549 method_type: fidl::MethodType::TwoWay,
10550 })
10551 }
10552 _ => Err(fidl::Error::UnknownOrdinal {
10553 ordinal: header.ordinal,
10554 protocol_name:
10555 <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10556 }),
10557 }))
10558 },
10559 )
10560 }
10561}
10562
10563#[derive(Debug)]
10564pub enum WifiStaIfaceRequest {
10565 GetName {
10567 responder: WifiStaIfaceGetNameResponder,
10568 },
10569 SetScanOnlyMode {
10570 payload: WifiStaIfaceSetScanOnlyModeRequest,
10571 responder: WifiStaIfaceSetScanOnlyModeResponder,
10572 },
10573 SetMacAddress {
10577 mac_addr: [u8; 6],
10578 responder: WifiStaIfaceSetMacAddressResponder,
10579 },
10580 GetApfPacketFilterSupport {
10581 responder: WifiStaIfaceGetApfPacketFilterSupportResponder,
10582 },
10583 InstallApfPacketFilter {
10587 payload: WifiStaIfaceInstallApfPacketFilterRequest,
10588 responder: WifiStaIfaceInstallApfPacketFilterResponder,
10589 },
10590 ReadApfPacketFilterData {
10599 responder: WifiStaIfaceReadApfPacketFilterDataResponder,
10600 },
10601 #[non_exhaustive]
10603 _UnknownMethod {
10604 ordinal: u64,
10606 control_handle: WifiStaIfaceControlHandle,
10607 method_type: fidl::MethodType,
10608 },
10609}
10610
10611impl WifiStaIfaceRequest {
10612 #[allow(irrefutable_let_patterns)]
10613 pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
10614 if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
10615 }
10616
10617 #[allow(irrefutable_let_patterns)]
10618 pub fn into_set_scan_only_mode(
10619 self,
10620 ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
10621 if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
10622 Some((payload, responder))
10623 } else {
10624 None
10625 }
10626 }
10627
10628 #[allow(irrefutable_let_patterns)]
10629 pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
10630 if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
10631 Some((mac_addr, responder))
10632 } else {
10633 None
10634 }
10635 }
10636
10637 #[allow(irrefutable_let_patterns)]
10638 pub fn into_get_apf_packet_filter_support(
10639 self,
10640 ) -> Option<(WifiStaIfaceGetApfPacketFilterSupportResponder)> {
10641 if let WifiStaIfaceRequest::GetApfPacketFilterSupport { responder } = self {
10642 Some((responder))
10643 } else {
10644 None
10645 }
10646 }
10647
10648 #[allow(irrefutable_let_patterns)]
10649 pub fn into_install_apf_packet_filter(
10650 self,
10651 ) -> Option<(
10652 WifiStaIfaceInstallApfPacketFilterRequest,
10653 WifiStaIfaceInstallApfPacketFilterResponder,
10654 )> {
10655 if let WifiStaIfaceRequest::InstallApfPacketFilter { payload, responder } = self {
10656 Some((payload, responder))
10657 } else {
10658 None
10659 }
10660 }
10661
10662 #[allow(irrefutable_let_patterns)]
10663 pub fn into_read_apf_packet_filter_data(
10664 self,
10665 ) -> Option<(WifiStaIfaceReadApfPacketFilterDataResponder)> {
10666 if let WifiStaIfaceRequest::ReadApfPacketFilterData { responder } = self {
10667 Some((responder))
10668 } else {
10669 None
10670 }
10671 }
10672
10673 pub fn method_name(&self) -> &'static str {
10675 match *self {
10676 WifiStaIfaceRequest::GetName { .. } => "get_name",
10677 WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
10678 WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
10679 WifiStaIfaceRequest::GetApfPacketFilterSupport { .. } => {
10680 "get_apf_packet_filter_support"
10681 }
10682 WifiStaIfaceRequest::InstallApfPacketFilter { .. } => "install_apf_packet_filter",
10683 WifiStaIfaceRequest::ReadApfPacketFilterData { .. } => "read_apf_packet_filter_data",
10684 WifiStaIfaceRequest::_UnknownMethod {
10685 method_type: fidl::MethodType::OneWay, ..
10686 } => "unknown one-way method",
10687 WifiStaIfaceRequest::_UnknownMethod {
10688 method_type: fidl::MethodType::TwoWay, ..
10689 } => "unknown two-way method",
10690 }
10691 }
10692}
10693
10694#[derive(Debug, Clone)]
10695pub struct WifiStaIfaceControlHandle {
10696 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10697}
10698
10699impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
10700 fn shutdown(&self) {
10701 self.inner.shutdown()
10702 }
10703
10704 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10705 self.inner.shutdown_with_epitaph(status)
10706 }
10707
10708 fn is_closed(&self) -> bool {
10709 self.inner.channel().is_closed()
10710 }
10711 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10712 self.inner.channel().on_closed()
10713 }
10714
10715 #[cfg(target_os = "fuchsia")]
10716 fn signal_peer(
10717 &self,
10718 clear_mask: zx::Signals,
10719 set_mask: zx::Signals,
10720 ) -> Result<(), zx_status::Status> {
10721 use fidl::Peered;
10722 self.inner.channel().signal_peer(clear_mask, set_mask)
10723 }
10724}
10725
10726impl WifiStaIfaceControlHandle {}
10727
10728#[must_use = "FIDL methods require a response to be sent"]
10729#[derive(Debug)]
10730pub struct WifiStaIfaceGetNameResponder {
10731 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10732 tx_id: u32,
10733}
10734
10735impl std::ops::Drop for WifiStaIfaceGetNameResponder {
10739 fn drop(&mut self) {
10740 self.control_handle.shutdown();
10741 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10743 }
10744}
10745
10746impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
10747 type ControlHandle = WifiStaIfaceControlHandle;
10748
10749 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10750 &self.control_handle
10751 }
10752
10753 fn drop_without_shutdown(mut self) {
10754 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10756 std::mem::forget(self);
10758 }
10759}
10760
10761impl WifiStaIfaceGetNameResponder {
10762 pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10766 let _result = self.send_raw(payload);
10767 if _result.is_err() {
10768 self.control_handle.shutdown();
10769 }
10770 self.drop_without_shutdown();
10771 _result
10772 }
10773
10774 pub fn send_no_shutdown_on_err(
10776 self,
10777 mut payload: &WifiStaIfaceGetNameResponse,
10778 ) -> Result<(), fidl::Error> {
10779 let _result = self.send_raw(payload);
10780 self.drop_without_shutdown();
10781 _result
10782 }
10783
10784 fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10785 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10786 fidl::encoding::Flexible::new(payload),
10787 self.tx_id,
10788 0x5c150b91c80c5789,
10789 fidl::encoding::DynamicFlags::FLEXIBLE,
10790 )
10791 }
10792}
10793
10794#[must_use = "FIDL methods require a response to be sent"]
10795#[derive(Debug)]
10796pub struct WifiStaIfaceSetScanOnlyModeResponder {
10797 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10798 tx_id: u32,
10799}
10800
10801impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10805 fn drop(&mut self) {
10806 self.control_handle.shutdown();
10807 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10809 }
10810}
10811
10812impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10813 type ControlHandle = WifiStaIfaceControlHandle;
10814
10815 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10816 &self.control_handle
10817 }
10818
10819 fn drop_without_shutdown(mut self) {
10820 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10822 std::mem::forget(self);
10824 }
10825}
10826
10827impl WifiStaIfaceSetScanOnlyModeResponder {
10828 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10832 let _result = self.send_raw(result);
10833 if _result.is_err() {
10834 self.control_handle.shutdown();
10835 }
10836 self.drop_without_shutdown();
10837 _result
10838 }
10839
10840 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10842 let _result = self.send_raw(result);
10843 self.drop_without_shutdown();
10844 _result
10845 }
10846
10847 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10848 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10849 fidl::encoding::EmptyStruct,
10850 i32,
10851 >>(
10852 fidl::encoding::FlexibleResult::new(result),
10853 self.tx_id,
10854 0x22550328583bf0e3,
10855 fidl::encoding::DynamicFlags::FLEXIBLE,
10856 )
10857 }
10858}
10859
10860#[must_use = "FIDL methods require a response to be sent"]
10861#[derive(Debug)]
10862pub struct WifiStaIfaceSetMacAddressResponder {
10863 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10864 tx_id: u32,
10865}
10866
10867impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
10871 fn drop(&mut self) {
10872 self.control_handle.shutdown();
10873 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10875 }
10876}
10877
10878impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
10879 type ControlHandle = WifiStaIfaceControlHandle;
10880
10881 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10882 &self.control_handle
10883 }
10884
10885 fn drop_without_shutdown(mut self) {
10886 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10888 std::mem::forget(self);
10890 }
10891}
10892
10893impl WifiStaIfaceSetMacAddressResponder {
10894 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10898 let _result = self.send_raw(result);
10899 if _result.is_err() {
10900 self.control_handle.shutdown();
10901 }
10902 self.drop_without_shutdown();
10903 _result
10904 }
10905
10906 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10908 let _result = self.send_raw(result);
10909 self.drop_without_shutdown();
10910 _result
10911 }
10912
10913 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10914 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10915 fidl::encoding::EmptyStruct,
10916 i32,
10917 >>(
10918 fidl::encoding::FlexibleResult::new(result),
10919 self.tx_id,
10920 0x39c4f355079421b9,
10921 fidl::encoding::DynamicFlags::FLEXIBLE,
10922 )
10923 }
10924}
10925
10926#[must_use = "FIDL methods require a response to be sent"]
10927#[derive(Debug)]
10928pub struct WifiStaIfaceGetApfPacketFilterSupportResponder {
10929 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10930 tx_id: u32,
10931}
10932
10933impl std::ops::Drop for WifiStaIfaceGetApfPacketFilterSupportResponder {
10937 fn drop(&mut self) {
10938 self.control_handle.shutdown();
10939 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10941 }
10942}
10943
10944impl fidl::endpoints::Responder for WifiStaIfaceGetApfPacketFilterSupportResponder {
10945 type ControlHandle = WifiStaIfaceControlHandle;
10946
10947 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10948 &self.control_handle
10949 }
10950
10951 fn drop_without_shutdown(mut self) {
10952 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10954 std::mem::forget(self);
10956 }
10957}
10958
10959impl WifiStaIfaceGetApfPacketFilterSupportResponder {
10960 pub fn send(
10964 self,
10965 mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10966 ) -> Result<(), fidl::Error> {
10967 let _result = self.send_raw(result);
10968 if _result.is_err() {
10969 self.control_handle.shutdown();
10970 }
10971 self.drop_without_shutdown();
10972 _result
10973 }
10974
10975 pub fn send_no_shutdown_on_err(
10977 self,
10978 mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10979 ) -> Result<(), fidl::Error> {
10980 let _result = self.send_raw(result);
10981 self.drop_without_shutdown();
10982 _result
10983 }
10984
10985 fn send_raw(
10986 &self,
10987 mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10988 ) -> Result<(), fidl::Error> {
10989 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10990 WifiStaIfaceGetApfPacketFilterSupportResponse,
10991 i32,
10992 >>(
10993 fidl::encoding::FlexibleResult::new(result),
10994 self.tx_id,
10995 0x205c538d31d76c8c,
10996 fidl::encoding::DynamicFlags::FLEXIBLE,
10997 )
10998 }
10999}
11000
11001#[must_use = "FIDL methods require a response to be sent"]
11002#[derive(Debug)]
11003pub struct WifiStaIfaceInstallApfPacketFilterResponder {
11004 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11005 tx_id: u32,
11006}
11007
11008impl std::ops::Drop for WifiStaIfaceInstallApfPacketFilterResponder {
11012 fn drop(&mut self) {
11013 self.control_handle.shutdown();
11014 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11016 }
11017}
11018
11019impl fidl::endpoints::Responder for WifiStaIfaceInstallApfPacketFilterResponder {
11020 type ControlHandle = WifiStaIfaceControlHandle;
11021
11022 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11023 &self.control_handle
11024 }
11025
11026 fn drop_without_shutdown(mut self) {
11027 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11029 std::mem::forget(self);
11031 }
11032}
11033
11034impl WifiStaIfaceInstallApfPacketFilterResponder {
11035 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11039 let _result = self.send_raw(result);
11040 if _result.is_err() {
11041 self.control_handle.shutdown();
11042 }
11043 self.drop_without_shutdown();
11044 _result
11045 }
11046
11047 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11049 let _result = self.send_raw(result);
11050 self.drop_without_shutdown();
11051 _result
11052 }
11053
11054 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11055 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11056 fidl::encoding::EmptyStruct,
11057 i32,
11058 >>(
11059 fidl::encoding::FlexibleResult::new(result),
11060 self.tx_id,
11061 0x6306fbfdb65631ba,
11062 fidl::encoding::DynamicFlags::FLEXIBLE,
11063 )
11064 }
11065}
11066
11067#[must_use = "FIDL methods require a response to be sent"]
11068#[derive(Debug)]
11069pub struct WifiStaIfaceReadApfPacketFilterDataResponder {
11070 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11071 tx_id: u32,
11072}
11073
11074impl std::ops::Drop for WifiStaIfaceReadApfPacketFilterDataResponder {
11078 fn drop(&mut self) {
11079 self.control_handle.shutdown();
11080 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11082 }
11083}
11084
11085impl fidl::endpoints::Responder for WifiStaIfaceReadApfPacketFilterDataResponder {
11086 type ControlHandle = WifiStaIfaceControlHandle;
11087
11088 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11089 &self.control_handle
11090 }
11091
11092 fn drop_without_shutdown(mut self) {
11093 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11095 std::mem::forget(self);
11097 }
11098}
11099
11100impl WifiStaIfaceReadApfPacketFilterDataResponder {
11101 pub fn send(
11105 self,
11106 mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11107 ) -> Result<(), fidl::Error> {
11108 let _result = self.send_raw(result);
11109 if _result.is_err() {
11110 self.control_handle.shutdown();
11111 }
11112 self.drop_without_shutdown();
11113 _result
11114 }
11115
11116 pub fn send_no_shutdown_on_err(
11118 self,
11119 mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11120 ) -> Result<(), fidl::Error> {
11121 let _result = self.send_raw(result);
11122 self.drop_without_shutdown();
11123 _result
11124 }
11125
11126 fn send_raw(
11127 &self,
11128 mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11129 ) -> Result<(), fidl::Error> {
11130 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11131 WifiStaIfaceReadApfPacketFilterDataResponse,
11132 i32,
11133 >>(
11134 fidl::encoding::FlexibleResult::new(result),
11135 self.tx_id,
11136 0x4f39e558ddbca39,
11137 fidl::encoding::DynamicFlags::FLEXIBLE,
11138 )
11139 }
11140}
11141
11142#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
11143pub struct WlanixMarker;
11144
11145impl fidl::endpoints::ProtocolMarker for WlanixMarker {
11146 type Proxy = WlanixProxy;
11147 type RequestStream = WlanixRequestStream;
11148 #[cfg(target_os = "fuchsia")]
11149 type SynchronousProxy = WlanixSynchronousProxy;
11150
11151 const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
11152}
11153impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
11154
11155pub trait WlanixProxyInterface: Send + Sync {
11156 fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
11157 fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
11158 fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
11159 fn r#get_wifi_legacy_hal(
11160 &self,
11161 payload: WlanixGetWifiLegacyHalRequest,
11162 ) -> Result<(), fidl::Error>;
11163}
11164#[derive(Debug)]
11165#[cfg(target_os = "fuchsia")]
11166pub struct WlanixSynchronousProxy {
11167 client: fidl::client::sync::Client,
11168}
11169
11170#[cfg(target_os = "fuchsia")]
11171impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
11172 type Proxy = WlanixProxy;
11173 type Protocol = WlanixMarker;
11174
11175 fn from_channel(inner: fidl::Channel) -> Self {
11176 Self::new(inner)
11177 }
11178
11179 fn into_channel(self) -> fidl::Channel {
11180 self.client.into_channel()
11181 }
11182
11183 fn as_channel(&self) -> &fidl::Channel {
11184 self.client.as_channel()
11185 }
11186}
11187
11188#[cfg(target_os = "fuchsia")]
11189impl WlanixSynchronousProxy {
11190 pub fn new(channel: fidl::Channel) -> Self {
11191 Self { client: fidl::client::sync::Client::new(channel) }
11192 }
11193
11194 pub fn into_channel(self) -> fidl::Channel {
11195 self.client.into_channel()
11196 }
11197
11198 pub fn wait_for_event(
11201 &self,
11202 deadline: zx::MonotonicInstant,
11203 ) -> Result<WlanixEvent, fidl::Error> {
11204 WlanixEvent::decode(self.client.wait_for_event::<WlanixMarker>(deadline)?)
11205 }
11206
11207 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11209 self.client.send::<WlanixGetWifiRequest>(
11210 &mut payload,
11211 0x142511f44b2c338c,
11212 fidl::encoding::DynamicFlags::FLEXIBLE,
11213 )
11214 }
11215
11216 pub fn r#get_supplicant(
11217 &self,
11218 mut payload: WlanixGetSupplicantRequest,
11219 ) -> Result<(), fidl::Error> {
11220 self.client.send::<WlanixGetSupplicantRequest>(
11221 &mut payload,
11222 0x55554b37c4021d3d,
11223 fidl::encoding::DynamicFlags::FLEXIBLE,
11224 )
11225 }
11226
11227 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11228 self.client.send::<WlanixGetNl80211Request>(
11229 &mut payload,
11230 0x48028a25bd855ef9,
11231 fidl::encoding::DynamicFlags::FLEXIBLE,
11232 )
11233 }
11234
11235 pub fn r#get_wifi_legacy_hal(
11236 &self,
11237 mut payload: WlanixGetWifiLegacyHalRequest,
11238 ) -> Result<(), fidl::Error> {
11239 self.client.send::<WlanixGetWifiLegacyHalRequest>(
11240 &mut payload,
11241 0x7302d9bb3b8d1edc,
11242 fidl::encoding::DynamicFlags::FLEXIBLE,
11243 )
11244 }
11245}
11246
11247#[cfg(target_os = "fuchsia")]
11248impl From<WlanixSynchronousProxy> for zx::NullableHandle {
11249 fn from(value: WlanixSynchronousProxy) -> Self {
11250 value.into_channel().into()
11251 }
11252}
11253
11254#[cfg(target_os = "fuchsia")]
11255impl From<fidl::Channel> for WlanixSynchronousProxy {
11256 fn from(value: fidl::Channel) -> Self {
11257 Self::new(value)
11258 }
11259}
11260
11261#[cfg(target_os = "fuchsia")]
11262impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
11263 type Protocol = WlanixMarker;
11264
11265 fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
11266 Self::new(value.into_channel())
11267 }
11268}
11269
11270#[derive(Debug, Clone)]
11271pub struct WlanixProxy {
11272 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
11273}
11274
11275impl fidl::endpoints::Proxy for WlanixProxy {
11276 type Protocol = WlanixMarker;
11277
11278 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
11279 Self::new(inner)
11280 }
11281
11282 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
11283 self.client.into_channel().map_err(|client| Self { client })
11284 }
11285
11286 fn as_channel(&self) -> &::fidl::AsyncChannel {
11287 self.client.as_channel()
11288 }
11289}
11290
11291impl WlanixProxy {
11292 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
11294 let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11295 Self { client: fidl::client::Client::new(channel, protocol_name) }
11296 }
11297
11298 pub fn take_event_stream(&self) -> WlanixEventStream {
11304 WlanixEventStream { event_receiver: self.client.take_event_receiver() }
11305 }
11306
11307 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11309 WlanixProxyInterface::r#get_wifi(self, payload)
11310 }
11311
11312 pub fn r#get_supplicant(
11313 &self,
11314 mut payload: WlanixGetSupplicantRequest,
11315 ) -> Result<(), fidl::Error> {
11316 WlanixProxyInterface::r#get_supplicant(self, payload)
11317 }
11318
11319 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11320 WlanixProxyInterface::r#get_nl80211(self, payload)
11321 }
11322
11323 pub fn r#get_wifi_legacy_hal(
11324 &self,
11325 mut payload: WlanixGetWifiLegacyHalRequest,
11326 ) -> Result<(), fidl::Error> {
11327 WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
11328 }
11329}
11330
11331impl WlanixProxyInterface for WlanixProxy {
11332 fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11333 self.client.send::<WlanixGetWifiRequest>(
11334 &mut payload,
11335 0x142511f44b2c338c,
11336 fidl::encoding::DynamicFlags::FLEXIBLE,
11337 )
11338 }
11339
11340 fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
11341 self.client.send::<WlanixGetSupplicantRequest>(
11342 &mut payload,
11343 0x55554b37c4021d3d,
11344 fidl::encoding::DynamicFlags::FLEXIBLE,
11345 )
11346 }
11347
11348 fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11349 self.client.send::<WlanixGetNl80211Request>(
11350 &mut payload,
11351 0x48028a25bd855ef9,
11352 fidl::encoding::DynamicFlags::FLEXIBLE,
11353 )
11354 }
11355
11356 fn r#get_wifi_legacy_hal(
11357 &self,
11358 mut payload: WlanixGetWifiLegacyHalRequest,
11359 ) -> Result<(), fidl::Error> {
11360 self.client.send::<WlanixGetWifiLegacyHalRequest>(
11361 &mut payload,
11362 0x7302d9bb3b8d1edc,
11363 fidl::encoding::DynamicFlags::FLEXIBLE,
11364 )
11365 }
11366}
11367
11368pub struct WlanixEventStream {
11369 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
11370}
11371
11372impl std::marker::Unpin for WlanixEventStream {}
11373
11374impl futures::stream::FusedStream for WlanixEventStream {
11375 fn is_terminated(&self) -> bool {
11376 self.event_receiver.is_terminated()
11377 }
11378}
11379
11380impl futures::Stream for WlanixEventStream {
11381 type Item = Result<WlanixEvent, fidl::Error>;
11382
11383 fn poll_next(
11384 mut self: std::pin::Pin<&mut Self>,
11385 cx: &mut std::task::Context<'_>,
11386 ) -> std::task::Poll<Option<Self::Item>> {
11387 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11388 &mut self.event_receiver,
11389 cx
11390 )?) {
11391 Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
11392 None => std::task::Poll::Ready(None),
11393 }
11394 }
11395}
11396
11397#[derive(Debug)]
11398pub enum WlanixEvent {
11399 #[non_exhaustive]
11400 _UnknownEvent {
11401 ordinal: u64,
11403 },
11404}
11405
11406impl WlanixEvent {
11407 fn decode(
11409 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11410 ) -> Result<WlanixEvent, fidl::Error> {
11411 let (bytes, _handles) = buf.split_mut();
11412 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11413 debug_assert_eq!(tx_header.tx_id, 0);
11414 match tx_header.ordinal {
11415 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11416 Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11417 }
11418 _ => Err(fidl::Error::UnknownOrdinal {
11419 ordinal: tx_header.ordinal,
11420 protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11421 }),
11422 }
11423 }
11424}
11425
11426pub struct WlanixRequestStream {
11428 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11429 is_terminated: bool,
11430}
11431
11432impl std::marker::Unpin for WlanixRequestStream {}
11433
11434impl futures::stream::FusedStream for WlanixRequestStream {
11435 fn is_terminated(&self) -> bool {
11436 self.is_terminated
11437 }
11438}
11439
11440impl fidl::endpoints::RequestStream for WlanixRequestStream {
11441 type Protocol = WlanixMarker;
11442 type ControlHandle = WlanixControlHandle;
11443
11444 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
11445 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11446 }
11447
11448 fn control_handle(&self) -> Self::ControlHandle {
11449 WlanixControlHandle { inner: self.inner.clone() }
11450 }
11451
11452 fn into_inner(
11453 self,
11454 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
11455 {
11456 (self.inner, self.is_terminated)
11457 }
11458
11459 fn from_inner(
11460 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11461 is_terminated: bool,
11462 ) -> Self {
11463 Self { inner, is_terminated }
11464 }
11465}
11466
11467impl futures::Stream for WlanixRequestStream {
11468 type Item = Result<WlanixRequest, fidl::Error>;
11469
11470 fn poll_next(
11471 mut self: std::pin::Pin<&mut Self>,
11472 cx: &mut std::task::Context<'_>,
11473 ) -> std::task::Poll<Option<Self::Item>> {
11474 let this = &mut *self;
11475 if this.inner.check_shutdown(cx) {
11476 this.is_terminated = true;
11477 return std::task::Poll::Ready(None);
11478 }
11479 if this.is_terminated {
11480 panic!("polled WlanixRequestStream after completion");
11481 }
11482 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
11483 |bytes, handles| {
11484 match this.inner.channel().read_etc(cx, bytes, handles) {
11485 std::task::Poll::Ready(Ok(())) => {}
11486 std::task::Poll::Pending => return std::task::Poll::Pending,
11487 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
11488 this.is_terminated = true;
11489 return std::task::Poll::Ready(None);
11490 }
11491 std::task::Poll::Ready(Err(e)) => {
11492 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11493 e.into(),
11494 ))));
11495 }
11496 }
11497
11498 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11500
11501 std::task::Poll::Ready(Some(match header.ordinal {
11502 0x142511f44b2c338c => {
11503 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11504 let mut req = fidl::new_empty!(
11505 WlanixGetWifiRequest,
11506 fidl::encoding::DefaultFuchsiaResourceDialect
11507 );
11508 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
11509 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11510 Ok(WlanixRequest::GetWifi { payload: req, control_handle })
11511 }
11512 0x55554b37c4021d3d => {
11513 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11514 let mut req = fidl::new_empty!(
11515 WlanixGetSupplicantRequest,
11516 fidl::encoding::DefaultFuchsiaResourceDialect
11517 );
11518 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
11519 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11520 Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
11521 }
11522 0x48028a25bd855ef9 => {
11523 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11524 let mut req = fidl::new_empty!(
11525 WlanixGetNl80211Request,
11526 fidl::encoding::DefaultFuchsiaResourceDialect
11527 );
11528 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
11529 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11530 Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
11531 }
11532 0x7302d9bb3b8d1edc => {
11533 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11534 let mut req = fidl::new_empty!(
11535 WlanixGetWifiLegacyHalRequest,
11536 fidl::encoding::DefaultFuchsiaResourceDialect
11537 );
11538 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
11539 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11540 Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
11541 }
11542 _ if header.tx_id == 0
11543 && header
11544 .dynamic_flags()
11545 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11546 {
11547 Ok(WlanixRequest::_UnknownMethod {
11548 ordinal: header.ordinal,
11549 control_handle: WlanixControlHandle { inner: this.inner.clone() },
11550 method_type: fidl::MethodType::OneWay,
11551 })
11552 }
11553 _ if header
11554 .dynamic_flags()
11555 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11556 {
11557 this.inner.send_framework_err(
11558 fidl::encoding::FrameworkErr::UnknownMethod,
11559 header.tx_id,
11560 header.ordinal,
11561 header.dynamic_flags(),
11562 (bytes, handles),
11563 )?;
11564 Ok(WlanixRequest::_UnknownMethod {
11565 ordinal: header.ordinal,
11566 control_handle: WlanixControlHandle { inner: this.inner.clone() },
11567 method_type: fidl::MethodType::TwoWay,
11568 })
11569 }
11570 _ => Err(fidl::Error::UnknownOrdinal {
11571 ordinal: header.ordinal,
11572 protocol_name:
11573 <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11574 }),
11575 }))
11576 },
11577 )
11578 }
11579}
11580
11581#[derive(Debug)]
11583pub enum WlanixRequest {
11584 GetWifi {
11586 payload: WlanixGetWifiRequest,
11587 control_handle: WlanixControlHandle,
11588 },
11589 GetSupplicant {
11590 payload: WlanixGetSupplicantRequest,
11591 control_handle: WlanixControlHandle,
11592 },
11593 GetNl80211 {
11594 payload: WlanixGetNl80211Request,
11595 control_handle: WlanixControlHandle,
11596 },
11597 GetWifiLegacyHal {
11598 payload: WlanixGetWifiLegacyHalRequest,
11599 control_handle: WlanixControlHandle,
11600 },
11601 #[non_exhaustive]
11603 _UnknownMethod {
11604 ordinal: u64,
11606 control_handle: WlanixControlHandle,
11607 method_type: fidl::MethodType,
11608 },
11609}
11610
11611impl WlanixRequest {
11612 #[allow(irrefutable_let_patterns)]
11613 pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
11614 if let WlanixRequest::GetWifi { payload, control_handle } = self {
11615 Some((payload, control_handle))
11616 } else {
11617 None
11618 }
11619 }
11620
11621 #[allow(irrefutable_let_patterns)]
11622 pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
11623 if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
11624 Some((payload, control_handle))
11625 } else {
11626 None
11627 }
11628 }
11629
11630 #[allow(irrefutable_let_patterns)]
11631 pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
11632 if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
11633 Some((payload, control_handle))
11634 } else {
11635 None
11636 }
11637 }
11638
11639 #[allow(irrefutable_let_patterns)]
11640 pub fn into_get_wifi_legacy_hal(
11641 self,
11642 ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
11643 if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
11644 Some((payload, control_handle))
11645 } else {
11646 None
11647 }
11648 }
11649
11650 pub fn method_name(&self) -> &'static str {
11652 match *self {
11653 WlanixRequest::GetWifi { .. } => "get_wifi",
11654 WlanixRequest::GetSupplicant { .. } => "get_supplicant",
11655 WlanixRequest::GetNl80211 { .. } => "get_nl80211",
11656 WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
11657 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
11658 "unknown one-way method"
11659 }
11660 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
11661 "unknown two-way method"
11662 }
11663 }
11664 }
11665}
11666
11667#[derive(Debug, Clone)]
11668pub struct WlanixControlHandle {
11669 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11670}
11671
11672impl fidl::endpoints::ControlHandle for WlanixControlHandle {
11673 fn shutdown(&self) {
11674 self.inner.shutdown()
11675 }
11676
11677 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
11678 self.inner.shutdown_with_epitaph(status)
11679 }
11680
11681 fn is_closed(&self) -> bool {
11682 self.inner.channel().is_closed()
11683 }
11684 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11685 self.inner.channel().on_closed()
11686 }
11687
11688 #[cfg(target_os = "fuchsia")]
11689 fn signal_peer(
11690 &self,
11691 clear_mask: zx::Signals,
11692 set_mask: zx::Signals,
11693 ) -> Result<(), zx_status::Status> {
11694 use fidl::Peered;
11695 self.inner.channel().signal_peer(clear_mask, set_mask)
11696 }
11697}
11698
11699impl WlanixControlHandle {}
11700
11701mod internal {
11702 use super::*;
11703
11704 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
11705 type Borrowed<'a> = &'a mut Self;
11706 fn take_or_borrow<'a>(
11707 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11708 ) -> Self::Borrowed<'a> {
11709 value
11710 }
11711 }
11712
11713 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
11714 type Owned = Self;
11715
11716 #[inline(always)]
11717 fn inline_align(_context: fidl::encoding::Context) -> usize {
11718 8
11719 }
11720
11721 #[inline(always)]
11722 fn inline_size(_context: fidl::encoding::Context) -> usize {
11723 16
11724 }
11725 }
11726
11727 unsafe impl
11728 fidl::encoding::Encode<
11729 Nl80211MessageV2Request,
11730 fidl::encoding::DefaultFuchsiaResourceDialect,
11731 > for &mut Nl80211MessageV2Request
11732 {
11733 #[inline]
11734 unsafe fn encode(
11735 self,
11736 encoder: &mut fidl::encoding::Encoder<
11737 '_,
11738 fidl::encoding::DefaultFuchsiaResourceDialect,
11739 >,
11740 offset: usize,
11741 _depth: fidl::encoding::Depth,
11742 ) -> fidl::Result<()> {
11743 encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11744 fidl::encoding::Encode::<
11746 Nl80211MessageV2Request,
11747 fidl::encoding::DefaultFuchsiaResourceDialect,
11748 >::encode(
11749 (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
11750 encoder,
11751 offset,
11752 _depth,
11753 )
11754 }
11755 }
11756 unsafe impl<
11757 T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
11758 >
11759 fidl::encoding::Encode<
11760 Nl80211MessageV2Request,
11761 fidl::encoding::DefaultFuchsiaResourceDialect,
11762 > for (T0,)
11763 {
11764 #[inline]
11765 unsafe fn encode(
11766 self,
11767 encoder: &mut fidl::encoding::Encoder<
11768 '_,
11769 fidl::encoding::DefaultFuchsiaResourceDialect,
11770 >,
11771 offset: usize,
11772 depth: fidl::encoding::Depth,
11773 ) -> fidl::Result<()> {
11774 encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11775 self.0.encode(encoder, offset + 0, depth)?;
11779 Ok(())
11780 }
11781 }
11782
11783 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11784 for Nl80211MessageV2Request
11785 {
11786 #[inline(always)]
11787 fn new_empty() -> Self {
11788 Self {
11789 message: fidl::new_empty!(
11790 Nl80211Message,
11791 fidl::encoding::DefaultFuchsiaResourceDialect
11792 ),
11793 }
11794 }
11795
11796 #[inline]
11797 unsafe fn decode(
11798 &mut self,
11799 decoder: &mut fidl::encoding::Decoder<
11800 '_,
11801 fidl::encoding::DefaultFuchsiaResourceDialect,
11802 >,
11803 offset: usize,
11804 _depth: fidl::encoding::Depth,
11805 ) -> fidl::Result<()> {
11806 decoder.debug_check_bounds::<Self>(offset);
11807 fidl::decode!(
11809 Nl80211Message,
11810 fidl::encoding::DefaultFuchsiaResourceDialect,
11811 &mut self.message,
11812 decoder,
11813 offset + 0,
11814 _depth
11815 )?;
11816 Ok(())
11817 }
11818 }
11819
11820 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
11821 type Borrowed<'a> = &'a mut Self;
11822 fn take_or_borrow<'a>(
11823 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11824 ) -> Self::Borrowed<'a> {
11825 value
11826 }
11827 }
11828
11829 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
11830 type Owned = Self;
11831
11832 #[inline(always)]
11833 fn inline_align(_context: fidl::encoding::Context) -> usize {
11834 4
11835 }
11836
11837 #[inline(always)]
11838 fn inline_size(_context: fidl::encoding::Context) -> usize {
11839 4
11840 }
11841 }
11842
11843 unsafe impl
11844 fidl::encoding::Encode<
11845 Nl80211MessageV2Response,
11846 fidl::encoding::DefaultFuchsiaResourceDialect,
11847 > for &mut Nl80211MessageV2Response
11848 {
11849 #[inline]
11850 unsafe fn encode(
11851 self,
11852 encoder: &mut fidl::encoding::Encoder<
11853 '_,
11854 fidl::encoding::DefaultFuchsiaResourceDialect,
11855 >,
11856 offset: usize,
11857 _depth: fidl::encoding::Depth,
11858 ) -> fidl::Result<()> {
11859 encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11860 fidl::encoding::Encode::<
11862 Nl80211MessageV2Response,
11863 fidl::encoding::DefaultFuchsiaResourceDialect,
11864 >::encode(
11865 (<fidl::encoding::HandleType<
11866 fidl::Vmo,
11867 { fidl::ObjectType::VMO.into_raw() },
11868 2147483648,
11869 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11870 &mut self.response
11871 ),),
11872 encoder,
11873 offset,
11874 _depth,
11875 )
11876 }
11877 }
11878 unsafe impl<
11879 T0: fidl::encoding::Encode<
11880 fidl::encoding::HandleType<
11881 fidl::Vmo,
11882 { fidl::ObjectType::VMO.into_raw() },
11883 2147483648,
11884 >,
11885 fidl::encoding::DefaultFuchsiaResourceDialect,
11886 >,
11887 >
11888 fidl::encoding::Encode<
11889 Nl80211MessageV2Response,
11890 fidl::encoding::DefaultFuchsiaResourceDialect,
11891 > for (T0,)
11892 {
11893 #[inline]
11894 unsafe fn encode(
11895 self,
11896 encoder: &mut fidl::encoding::Encoder<
11897 '_,
11898 fidl::encoding::DefaultFuchsiaResourceDialect,
11899 >,
11900 offset: usize,
11901 depth: fidl::encoding::Depth,
11902 ) -> fidl::Result<()> {
11903 encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11904 self.0.encode(encoder, offset + 0, depth)?;
11908 Ok(())
11909 }
11910 }
11911
11912 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11913 for Nl80211MessageV2Response
11914 {
11915 #[inline(always)]
11916 fn new_empty() -> Self {
11917 Self {
11918 response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11919 }
11920 }
11921
11922 #[inline]
11923 unsafe fn decode(
11924 &mut self,
11925 decoder: &mut fidl::encoding::Decoder<
11926 '_,
11927 fidl::encoding::DefaultFuchsiaResourceDialect,
11928 >,
11929 offset: usize,
11930 _depth: fidl::encoding::Depth,
11931 ) -> fidl::Result<()> {
11932 decoder.debug_check_bounds::<Self>(offset);
11933 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
11935 Ok(())
11936 }
11937 }
11938
11939 impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
11940 type Borrowed<'a> = &'a mut Self;
11941 fn take_or_borrow<'a>(
11942 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11943 ) -> Self::Borrowed<'a> {
11944 value
11945 }
11946 }
11947
11948 unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
11949 type Owned = Self;
11950
11951 #[inline(always)]
11952 fn inline_align(_context: fidl::encoding::Context) -> usize {
11953 1
11954 }
11955
11956 #[inline(always)]
11957 fn inline_size(_context: fidl::encoding::Context) -> usize {
11958 6
11959 }
11960 #[inline(always)]
11961 fn encode_is_copy() -> bool {
11962 true
11963 }
11964
11965 #[inline(always)]
11966 fn decode_is_copy() -> bool {
11967 true
11968 }
11969 }
11970
11971 unsafe impl
11972 fidl::encoding::Encode<
11973 WifiStaIfaceSetMacAddressRequest,
11974 fidl::encoding::DefaultFuchsiaResourceDialect,
11975 > for &mut WifiStaIfaceSetMacAddressRequest
11976 {
11977 #[inline]
11978 unsafe fn encode(
11979 self,
11980 encoder: &mut fidl::encoding::Encoder<
11981 '_,
11982 fidl::encoding::DefaultFuchsiaResourceDialect,
11983 >,
11984 offset: usize,
11985 _depth: fidl::encoding::Depth,
11986 ) -> fidl::Result<()> {
11987 encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11988 unsafe {
11989 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11991 (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
11992 .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
11993 }
11996 Ok(())
11997 }
11998 }
11999 unsafe impl<
12000 T0: fidl::encoding::Encode<
12001 fidl::encoding::Array<u8, 6>,
12002 fidl::encoding::DefaultFuchsiaResourceDialect,
12003 >,
12004 >
12005 fidl::encoding::Encode<
12006 WifiStaIfaceSetMacAddressRequest,
12007 fidl::encoding::DefaultFuchsiaResourceDialect,
12008 > for (T0,)
12009 {
12010 #[inline]
12011 unsafe fn encode(
12012 self,
12013 encoder: &mut fidl::encoding::Encoder<
12014 '_,
12015 fidl::encoding::DefaultFuchsiaResourceDialect,
12016 >,
12017 offset: usize,
12018 depth: fidl::encoding::Depth,
12019 ) -> fidl::Result<()> {
12020 encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
12021 self.0.encode(encoder, offset + 0, depth)?;
12025 Ok(())
12026 }
12027 }
12028
12029 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12030 for WifiStaIfaceSetMacAddressRequest
12031 {
12032 #[inline(always)]
12033 fn new_empty() -> Self {
12034 Self {
12035 mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
12036 }
12037 }
12038
12039 #[inline]
12040 unsafe fn decode(
12041 &mut self,
12042 decoder: &mut fidl::encoding::Decoder<
12043 '_,
12044 fidl::encoding::DefaultFuchsiaResourceDialect,
12045 >,
12046 offset: usize,
12047 _depth: fidl::encoding::Depth,
12048 ) -> fidl::Result<()> {
12049 decoder.debug_check_bounds::<Self>(offset);
12050 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12051 unsafe {
12054 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
12055 }
12056 Ok(())
12057 }
12058 }
12059
12060 impl Nl80211GetMulticastRequest {
12061 #[inline(always)]
12062 fn max_ordinal_present(&self) -> u64 {
12063 if let Some(_) = self.multicast {
12064 return 2;
12065 }
12066 if let Some(_) = self.group {
12067 return 1;
12068 }
12069 0
12070 }
12071 }
12072
12073 impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
12074 type Borrowed<'a> = &'a mut Self;
12075 fn take_or_borrow<'a>(
12076 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12077 ) -> Self::Borrowed<'a> {
12078 value
12079 }
12080 }
12081
12082 unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
12083 type Owned = Self;
12084
12085 #[inline(always)]
12086 fn inline_align(_context: fidl::encoding::Context) -> usize {
12087 8
12088 }
12089
12090 #[inline(always)]
12091 fn inline_size(_context: fidl::encoding::Context) -> usize {
12092 16
12093 }
12094 }
12095
12096 unsafe impl
12097 fidl::encoding::Encode<
12098 Nl80211GetMulticastRequest,
12099 fidl::encoding::DefaultFuchsiaResourceDialect,
12100 > for &mut Nl80211GetMulticastRequest
12101 {
12102 unsafe fn encode(
12103 self,
12104 encoder: &mut fidl::encoding::Encoder<
12105 '_,
12106 fidl::encoding::DefaultFuchsiaResourceDialect,
12107 >,
12108 offset: usize,
12109 mut depth: fidl::encoding::Depth,
12110 ) -> fidl::Result<()> {
12111 encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
12112 let max_ordinal: u64 = self.max_ordinal_present();
12114 encoder.write_num(max_ordinal, offset);
12115 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12116 if max_ordinal == 0 {
12118 return Ok(());
12119 }
12120 depth.increment()?;
12121 let envelope_size = 8;
12122 let bytes_len = max_ordinal as usize * envelope_size;
12123 #[allow(unused_variables)]
12124 let offset = encoder.out_of_line_offset(bytes_len);
12125 let mut _prev_end_offset: usize = 0;
12126 if 1 > max_ordinal {
12127 return Ok(());
12128 }
12129
12130 let cur_offset: usize = (1 - 1) * envelope_size;
12133
12134 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12136
12137 fidl::encoding::encode_in_envelope_optional::<
12142 fidl::encoding::BoundedString<32>,
12143 fidl::encoding::DefaultFuchsiaResourceDialect,
12144 >(
12145 self.group.as_ref().map(
12146 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
12147 ),
12148 encoder,
12149 offset + cur_offset,
12150 depth,
12151 )?;
12152
12153 _prev_end_offset = cur_offset + envelope_size;
12154 if 2 > max_ordinal {
12155 return Ok(());
12156 }
12157
12158 let cur_offset: usize = (2 - 1) * envelope_size;
12161
12162 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12164
12165 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12170 self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12171 encoder, offset + cur_offset, depth
12172 )?;
12173
12174 _prev_end_offset = cur_offset + envelope_size;
12175
12176 Ok(())
12177 }
12178 }
12179
12180 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12181 for Nl80211GetMulticastRequest
12182 {
12183 #[inline(always)]
12184 fn new_empty() -> Self {
12185 Self::default()
12186 }
12187
12188 unsafe fn decode(
12189 &mut self,
12190 decoder: &mut fidl::encoding::Decoder<
12191 '_,
12192 fidl::encoding::DefaultFuchsiaResourceDialect,
12193 >,
12194 offset: usize,
12195 mut depth: fidl::encoding::Depth,
12196 ) -> fidl::Result<()> {
12197 decoder.debug_check_bounds::<Self>(offset);
12198 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12199 None => return Err(fidl::Error::NotNullable),
12200 Some(len) => len,
12201 };
12202 if len == 0 {
12204 return Ok(());
12205 };
12206 depth.increment()?;
12207 let envelope_size = 8;
12208 let bytes_len = len * envelope_size;
12209 let offset = decoder.out_of_line_offset(bytes_len)?;
12210 let mut _next_ordinal_to_read = 0;
12212 let mut next_offset = offset;
12213 let end_offset = offset + bytes_len;
12214 _next_ordinal_to_read += 1;
12215 if next_offset >= end_offset {
12216 return Ok(());
12217 }
12218
12219 while _next_ordinal_to_read < 1 {
12221 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12222 _next_ordinal_to_read += 1;
12223 next_offset += envelope_size;
12224 }
12225
12226 let next_out_of_line = decoder.next_out_of_line();
12227 let handles_before = decoder.remaining_handles();
12228 if let Some((inlined, num_bytes, num_handles)) =
12229 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12230 {
12231 let member_inline_size =
12232 <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
12233 decoder.context,
12234 );
12235 if inlined != (member_inline_size <= 4) {
12236 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12237 }
12238 let inner_offset;
12239 let mut inner_depth = depth.clone();
12240 if inlined {
12241 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12242 inner_offset = next_offset;
12243 } else {
12244 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12245 inner_depth.increment()?;
12246 }
12247 let val_ref = self.group.get_or_insert_with(|| {
12248 fidl::new_empty!(
12249 fidl::encoding::BoundedString<32>,
12250 fidl::encoding::DefaultFuchsiaResourceDialect
12251 )
12252 });
12253 fidl::decode!(
12254 fidl::encoding::BoundedString<32>,
12255 fidl::encoding::DefaultFuchsiaResourceDialect,
12256 val_ref,
12257 decoder,
12258 inner_offset,
12259 inner_depth
12260 )?;
12261 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12262 {
12263 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12264 }
12265 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12266 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12267 }
12268 }
12269
12270 next_offset += envelope_size;
12271 _next_ordinal_to_read += 1;
12272 if next_offset >= end_offset {
12273 return Ok(());
12274 }
12275
12276 while _next_ordinal_to_read < 2 {
12278 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12279 _next_ordinal_to_read += 1;
12280 next_offset += envelope_size;
12281 }
12282
12283 let next_out_of_line = decoder.next_out_of_line();
12284 let handles_before = decoder.remaining_handles();
12285 if let Some((inlined, num_bytes, num_handles)) =
12286 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12287 {
12288 let member_inline_size = <fidl::encoding::Endpoint<
12289 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12290 > as fidl::encoding::TypeMarker>::inline_size(
12291 decoder.context
12292 );
12293 if inlined != (member_inline_size <= 4) {
12294 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12295 }
12296 let inner_offset;
12297 let mut inner_depth = depth.clone();
12298 if inlined {
12299 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12300 inner_offset = next_offset;
12301 } else {
12302 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12303 inner_depth.increment()?;
12304 }
12305 let val_ref = self.multicast.get_or_insert_with(|| {
12306 fidl::new_empty!(
12307 fidl::encoding::Endpoint<
12308 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12309 >,
12310 fidl::encoding::DefaultFuchsiaResourceDialect
12311 )
12312 });
12313 fidl::decode!(
12314 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
12315 fidl::encoding::DefaultFuchsiaResourceDialect,
12316 val_ref,
12317 decoder,
12318 inner_offset,
12319 inner_depth
12320 )?;
12321 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12322 {
12323 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12324 }
12325 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12326 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12327 }
12328 }
12329
12330 next_offset += envelope_size;
12331
12332 while next_offset < end_offset {
12334 _next_ordinal_to_read += 1;
12335 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12336 next_offset += envelope_size;
12337 }
12338
12339 Ok(())
12340 }
12341 }
12342
12343 impl Nl80211MessageRequest {
12344 #[inline(always)]
12345 fn max_ordinal_present(&self) -> u64 {
12346 if let Some(_) = self.message {
12347 return 1;
12348 }
12349 0
12350 }
12351 }
12352
12353 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
12354 type Borrowed<'a> = &'a mut Self;
12355 fn take_or_borrow<'a>(
12356 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12357 ) -> Self::Borrowed<'a> {
12358 value
12359 }
12360 }
12361
12362 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
12363 type Owned = Self;
12364
12365 #[inline(always)]
12366 fn inline_align(_context: fidl::encoding::Context) -> usize {
12367 8
12368 }
12369
12370 #[inline(always)]
12371 fn inline_size(_context: fidl::encoding::Context) -> usize {
12372 16
12373 }
12374 }
12375
12376 unsafe impl
12377 fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12378 for &mut Nl80211MessageRequest
12379 {
12380 unsafe fn encode(
12381 self,
12382 encoder: &mut fidl::encoding::Encoder<
12383 '_,
12384 fidl::encoding::DefaultFuchsiaResourceDialect,
12385 >,
12386 offset: usize,
12387 mut depth: fidl::encoding::Depth,
12388 ) -> fidl::Result<()> {
12389 encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
12390 let max_ordinal: u64 = self.max_ordinal_present();
12392 encoder.write_num(max_ordinal, offset);
12393 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12394 if max_ordinal == 0 {
12396 return Ok(());
12397 }
12398 depth.increment()?;
12399 let envelope_size = 8;
12400 let bytes_len = max_ordinal as usize * envelope_size;
12401 #[allow(unused_variables)]
12402 let offset = encoder.out_of_line_offset(bytes_len);
12403 let mut _prev_end_offset: usize = 0;
12404 if 1 > max_ordinal {
12405 return Ok(());
12406 }
12407
12408 let cur_offset: usize = (1 - 1) * envelope_size;
12411
12412 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12414
12415 fidl::encoding::encode_in_envelope_optional::<
12420 Nl80211Message,
12421 fidl::encoding::DefaultFuchsiaResourceDialect,
12422 >(
12423 self.message
12424 .as_ref()
12425 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12426 encoder,
12427 offset + cur_offset,
12428 depth,
12429 )?;
12430
12431 _prev_end_offset = cur_offset + envelope_size;
12432
12433 Ok(())
12434 }
12435 }
12436
12437 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12438 for Nl80211MessageRequest
12439 {
12440 #[inline(always)]
12441 fn new_empty() -> Self {
12442 Self::default()
12443 }
12444
12445 unsafe fn decode(
12446 &mut self,
12447 decoder: &mut fidl::encoding::Decoder<
12448 '_,
12449 fidl::encoding::DefaultFuchsiaResourceDialect,
12450 >,
12451 offset: usize,
12452 mut depth: fidl::encoding::Depth,
12453 ) -> fidl::Result<()> {
12454 decoder.debug_check_bounds::<Self>(offset);
12455 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12456 None => return Err(fidl::Error::NotNullable),
12457 Some(len) => len,
12458 };
12459 if len == 0 {
12461 return Ok(());
12462 };
12463 depth.increment()?;
12464 let envelope_size = 8;
12465 let bytes_len = len * envelope_size;
12466 let offset = decoder.out_of_line_offset(bytes_len)?;
12467 let mut _next_ordinal_to_read = 0;
12469 let mut next_offset = offset;
12470 let end_offset = offset + bytes_len;
12471 _next_ordinal_to_read += 1;
12472 if next_offset >= end_offset {
12473 return Ok(());
12474 }
12475
12476 while _next_ordinal_to_read < 1 {
12478 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12479 _next_ordinal_to_read += 1;
12480 next_offset += envelope_size;
12481 }
12482
12483 let next_out_of_line = decoder.next_out_of_line();
12484 let handles_before = decoder.remaining_handles();
12485 if let Some((inlined, num_bytes, num_handles)) =
12486 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12487 {
12488 let member_inline_size =
12489 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12490 if inlined != (member_inline_size <= 4) {
12491 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12492 }
12493 let inner_offset;
12494 let mut inner_depth = depth.clone();
12495 if inlined {
12496 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12497 inner_offset = next_offset;
12498 } else {
12499 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12500 inner_depth.increment()?;
12501 }
12502 let val_ref = self.message.get_or_insert_with(|| {
12503 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12504 });
12505 fidl::decode!(
12506 Nl80211Message,
12507 fidl::encoding::DefaultFuchsiaResourceDialect,
12508 val_ref,
12509 decoder,
12510 inner_offset,
12511 inner_depth
12512 )?;
12513 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12514 {
12515 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12516 }
12517 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12518 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12519 }
12520 }
12521
12522 next_offset += envelope_size;
12523
12524 while next_offset < end_offset {
12526 _next_ordinal_to_read += 1;
12527 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12528 next_offset += envelope_size;
12529 }
12530
12531 Ok(())
12532 }
12533 }
12534
12535 impl Nl80211MulticastMessageRequest {
12536 #[inline(always)]
12537 fn max_ordinal_present(&self) -> u64 {
12538 if let Some(_) = self.message {
12539 return 1;
12540 }
12541 0
12542 }
12543 }
12544
12545 impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
12546 type Borrowed<'a> = &'a mut Self;
12547 fn take_or_borrow<'a>(
12548 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12549 ) -> Self::Borrowed<'a> {
12550 value
12551 }
12552 }
12553
12554 unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
12555 type Owned = Self;
12556
12557 #[inline(always)]
12558 fn inline_align(_context: fidl::encoding::Context) -> usize {
12559 8
12560 }
12561
12562 #[inline(always)]
12563 fn inline_size(_context: fidl::encoding::Context) -> usize {
12564 16
12565 }
12566 }
12567
12568 unsafe impl
12569 fidl::encoding::Encode<
12570 Nl80211MulticastMessageRequest,
12571 fidl::encoding::DefaultFuchsiaResourceDialect,
12572 > for &mut Nl80211MulticastMessageRequest
12573 {
12574 unsafe fn encode(
12575 self,
12576 encoder: &mut fidl::encoding::Encoder<
12577 '_,
12578 fidl::encoding::DefaultFuchsiaResourceDialect,
12579 >,
12580 offset: usize,
12581 mut depth: fidl::encoding::Depth,
12582 ) -> fidl::Result<()> {
12583 encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
12584 let max_ordinal: u64 = self.max_ordinal_present();
12586 encoder.write_num(max_ordinal, offset);
12587 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12588 if max_ordinal == 0 {
12590 return Ok(());
12591 }
12592 depth.increment()?;
12593 let envelope_size = 8;
12594 let bytes_len = max_ordinal as usize * envelope_size;
12595 #[allow(unused_variables)]
12596 let offset = encoder.out_of_line_offset(bytes_len);
12597 let mut _prev_end_offset: usize = 0;
12598 if 1 > max_ordinal {
12599 return Ok(());
12600 }
12601
12602 let cur_offset: usize = (1 - 1) * envelope_size;
12605
12606 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12608
12609 fidl::encoding::encode_in_envelope_optional::<
12614 Nl80211Message,
12615 fidl::encoding::DefaultFuchsiaResourceDialect,
12616 >(
12617 self.message
12618 .as_ref()
12619 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12620 encoder,
12621 offset + cur_offset,
12622 depth,
12623 )?;
12624
12625 _prev_end_offset = cur_offset + envelope_size;
12626
12627 Ok(())
12628 }
12629 }
12630
12631 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12632 for Nl80211MulticastMessageRequest
12633 {
12634 #[inline(always)]
12635 fn new_empty() -> Self {
12636 Self::default()
12637 }
12638
12639 unsafe fn decode(
12640 &mut self,
12641 decoder: &mut fidl::encoding::Decoder<
12642 '_,
12643 fidl::encoding::DefaultFuchsiaResourceDialect,
12644 >,
12645 offset: usize,
12646 mut depth: fidl::encoding::Depth,
12647 ) -> fidl::Result<()> {
12648 decoder.debug_check_bounds::<Self>(offset);
12649 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12650 None => return Err(fidl::Error::NotNullable),
12651 Some(len) => len,
12652 };
12653 if len == 0 {
12655 return Ok(());
12656 };
12657 depth.increment()?;
12658 let envelope_size = 8;
12659 let bytes_len = len * envelope_size;
12660 let offset = decoder.out_of_line_offset(bytes_len)?;
12661 let mut _next_ordinal_to_read = 0;
12663 let mut next_offset = offset;
12664 let end_offset = offset + bytes_len;
12665 _next_ordinal_to_read += 1;
12666 if next_offset >= end_offset {
12667 return Ok(());
12668 }
12669
12670 while _next_ordinal_to_read < 1 {
12672 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12673 _next_ordinal_to_read += 1;
12674 next_offset += envelope_size;
12675 }
12676
12677 let next_out_of_line = decoder.next_out_of_line();
12678 let handles_before = decoder.remaining_handles();
12679 if let Some((inlined, num_bytes, num_handles)) =
12680 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12681 {
12682 let member_inline_size =
12683 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12684 if inlined != (member_inline_size <= 4) {
12685 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12686 }
12687 let inner_offset;
12688 let mut inner_depth = depth.clone();
12689 if inlined {
12690 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12691 inner_offset = next_offset;
12692 } else {
12693 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12694 inner_depth.increment()?;
12695 }
12696 let val_ref = self.message.get_or_insert_with(|| {
12697 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12698 });
12699 fidl::decode!(
12700 Nl80211Message,
12701 fidl::encoding::DefaultFuchsiaResourceDialect,
12702 val_ref,
12703 decoder,
12704 inner_offset,
12705 inner_depth
12706 )?;
12707 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12708 {
12709 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12710 }
12711 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12712 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12713 }
12714 }
12715
12716 next_offset += envelope_size;
12717
12718 while next_offset < end_offset {
12720 _next_ordinal_to_read += 1;
12721 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12722 next_offset += envelope_size;
12723 }
12724
12725 Ok(())
12726 }
12727 }
12728
12729 impl Nl80211MessageResponse {
12730 #[inline(always)]
12731 fn max_ordinal_present(&self) -> u64 {
12732 if let Some(_) = self.responses {
12733 return 1;
12734 }
12735 0
12736 }
12737 }
12738
12739 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
12740 type Borrowed<'a> = &'a mut Self;
12741 fn take_or_borrow<'a>(
12742 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12743 ) -> Self::Borrowed<'a> {
12744 value
12745 }
12746 }
12747
12748 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
12749 type Owned = Self;
12750
12751 #[inline(always)]
12752 fn inline_align(_context: fidl::encoding::Context) -> usize {
12753 8
12754 }
12755
12756 #[inline(always)]
12757 fn inline_size(_context: fidl::encoding::Context) -> usize {
12758 16
12759 }
12760 }
12761
12762 unsafe impl
12763 fidl::encoding::Encode<
12764 Nl80211MessageResponse,
12765 fidl::encoding::DefaultFuchsiaResourceDialect,
12766 > for &mut Nl80211MessageResponse
12767 {
12768 unsafe fn encode(
12769 self,
12770 encoder: &mut fidl::encoding::Encoder<
12771 '_,
12772 fidl::encoding::DefaultFuchsiaResourceDialect,
12773 >,
12774 offset: usize,
12775 mut depth: fidl::encoding::Depth,
12776 ) -> fidl::Result<()> {
12777 encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
12778 let max_ordinal: u64 = self.max_ordinal_present();
12780 encoder.write_num(max_ordinal, offset);
12781 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12782 if max_ordinal == 0 {
12784 return Ok(());
12785 }
12786 depth.increment()?;
12787 let envelope_size = 8;
12788 let bytes_len = max_ordinal as usize * envelope_size;
12789 #[allow(unused_variables)]
12790 let offset = encoder.out_of_line_offset(bytes_len);
12791 let mut _prev_end_offset: usize = 0;
12792 if 1 > max_ordinal {
12793 return Ok(());
12794 }
12795
12796 let cur_offset: usize = (1 - 1) * envelope_size;
12799
12800 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12802
12803 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12808 self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
12809 encoder, offset + cur_offset, depth
12810 )?;
12811
12812 _prev_end_offset = cur_offset + envelope_size;
12813
12814 Ok(())
12815 }
12816 }
12817
12818 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12819 for Nl80211MessageResponse
12820 {
12821 #[inline(always)]
12822 fn new_empty() -> Self {
12823 Self::default()
12824 }
12825
12826 unsafe fn decode(
12827 &mut self,
12828 decoder: &mut fidl::encoding::Decoder<
12829 '_,
12830 fidl::encoding::DefaultFuchsiaResourceDialect,
12831 >,
12832 offset: usize,
12833 mut depth: fidl::encoding::Depth,
12834 ) -> fidl::Result<()> {
12835 decoder.debug_check_bounds::<Self>(offset);
12836 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12837 None => return Err(fidl::Error::NotNullable),
12838 Some(len) => len,
12839 };
12840 if len == 0 {
12842 return Ok(());
12843 };
12844 depth.increment()?;
12845 let envelope_size = 8;
12846 let bytes_len = len * envelope_size;
12847 let offset = decoder.out_of_line_offset(bytes_len)?;
12848 let mut _next_ordinal_to_read = 0;
12850 let mut next_offset = offset;
12851 let end_offset = offset + bytes_len;
12852 _next_ordinal_to_read += 1;
12853 if next_offset >= end_offset {
12854 return Ok(());
12855 }
12856
12857 while _next_ordinal_to_read < 1 {
12859 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12860 _next_ordinal_to_read += 1;
12861 next_offset += envelope_size;
12862 }
12863
12864 let next_out_of_line = decoder.next_out_of_line();
12865 let handles_before = decoder.remaining_handles();
12866 if let Some((inlined, num_bytes, num_handles)) =
12867 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12868 {
12869 let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12870 if inlined != (member_inline_size <= 4) {
12871 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12872 }
12873 let inner_offset;
12874 let mut inner_depth = depth.clone();
12875 if inlined {
12876 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12877 inner_offset = next_offset;
12878 } else {
12879 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12880 inner_depth.increment()?;
12881 }
12882 let val_ref = self.responses.get_or_insert_with(|| {
12883 fidl::new_empty!(
12884 fidl::encoding::UnboundedVector<Nl80211Message>,
12885 fidl::encoding::DefaultFuchsiaResourceDialect
12886 )
12887 });
12888 fidl::decode!(
12889 fidl::encoding::UnboundedVector<Nl80211Message>,
12890 fidl::encoding::DefaultFuchsiaResourceDialect,
12891 val_ref,
12892 decoder,
12893 inner_offset,
12894 inner_depth
12895 )?;
12896 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12897 {
12898 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12899 }
12900 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12901 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12902 }
12903 }
12904
12905 next_offset += envelope_size;
12906
12907 while next_offset < end_offset {
12909 _next_ordinal_to_read += 1;
12910 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12911 next_offset += envelope_size;
12912 }
12913
12914 Ok(())
12915 }
12916 }
12917
12918 impl SupplicantAddStaInterfaceRequest {
12919 #[inline(always)]
12920 fn max_ordinal_present(&self) -> u64 {
12921 if let Some(_) = self.iface_name {
12922 return 2;
12923 }
12924 if let Some(_) = self.iface {
12925 return 1;
12926 }
12927 0
12928 }
12929 }
12930
12931 impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
12932 type Borrowed<'a> = &'a mut Self;
12933 fn take_or_borrow<'a>(
12934 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12935 ) -> Self::Borrowed<'a> {
12936 value
12937 }
12938 }
12939
12940 unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
12941 type Owned = Self;
12942
12943 #[inline(always)]
12944 fn inline_align(_context: fidl::encoding::Context) -> usize {
12945 8
12946 }
12947
12948 #[inline(always)]
12949 fn inline_size(_context: fidl::encoding::Context) -> usize {
12950 16
12951 }
12952 }
12953
12954 unsafe impl
12955 fidl::encoding::Encode<
12956 SupplicantAddStaInterfaceRequest,
12957 fidl::encoding::DefaultFuchsiaResourceDialect,
12958 > for &mut SupplicantAddStaInterfaceRequest
12959 {
12960 unsafe fn encode(
12961 self,
12962 encoder: &mut fidl::encoding::Encoder<
12963 '_,
12964 fidl::encoding::DefaultFuchsiaResourceDialect,
12965 >,
12966 offset: usize,
12967 mut depth: fidl::encoding::Depth,
12968 ) -> fidl::Result<()> {
12969 encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
12970 let max_ordinal: u64 = self.max_ordinal_present();
12972 encoder.write_num(max_ordinal, offset);
12973 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12974 if max_ordinal == 0 {
12976 return Ok(());
12977 }
12978 depth.increment()?;
12979 let envelope_size = 8;
12980 let bytes_len = max_ordinal as usize * envelope_size;
12981 #[allow(unused_variables)]
12982 let offset = encoder.out_of_line_offset(bytes_len);
12983 let mut _prev_end_offset: usize = 0;
12984 if 1 > max_ordinal {
12985 return Ok(());
12986 }
12987
12988 let cur_offset: usize = (1 - 1) * envelope_size;
12991
12992 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12994
12995 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13000 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13001 encoder, offset + cur_offset, depth
13002 )?;
13003
13004 _prev_end_offset = cur_offset + envelope_size;
13005 if 2 > max_ordinal {
13006 return Ok(());
13007 }
13008
13009 let cur_offset: usize = (2 - 1) * envelope_size;
13012
13013 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13015
13016 fidl::encoding::encode_in_envelope_optional::<
13021 fidl::encoding::BoundedString<16>,
13022 fidl::encoding::DefaultFuchsiaResourceDialect,
13023 >(
13024 self.iface_name.as_ref().map(
13025 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13026 ),
13027 encoder,
13028 offset + cur_offset,
13029 depth,
13030 )?;
13031
13032 _prev_end_offset = cur_offset + envelope_size;
13033
13034 Ok(())
13035 }
13036 }
13037
13038 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13039 for SupplicantAddStaInterfaceRequest
13040 {
13041 #[inline(always)]
13042 fn new_empty() -> Self {
13043 Self::default()
13044 }
13045
13046 unsafe fn decode(
13047 &mut self,
13048 decoder: &mut fidl::encoding::Decoder<
13049 '_,
13050 fidl::encoding::DefaultFuchsiaResourceDialect,
13051 >,
13052 offset: usize,
13053 mut depth: fidl::encoding::Depth,
13054 ) -> fidl::Result<()> {
13055 decoder.debug_check_bounds::<Self>(offset);
13056 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13057 None => return Err(fidl::Error::NotNullable),
13058 Some(len) => len,
13059 };
13060 if len == 0 {
13062 return Ok(());
13063 };
13064 depth.increment()?;
13065 let envelope_size = 8;
13066 let bytes_len = len * envelope_size;
13067 let offset = decoder.out_of_line_offset(bytes_len)?;
13068 let mut _next_ordinal_to_read = 0;
13070 let mut next_offset = offset;
13071 let end_offset = offset + bytes_len;
13072 _next_ordinal_to_read += 1;
13073 if next_offset >= end_offset {
13074 return Ok(());
13075 }
13076
13077 while _next_ordinal_to_read < 1 {
13079 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13080 _next_ordinal_to_read += 1;
13081 next_offset += envelope_size;
13082 }
13083
13084 let next_out_of_line = decoder.next_out_of_line();
13085 let handles_before = decoder.remaining_handles();
13086 if let Some((inlined, num_bytes, num_handles)) =
13087 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13088 {
13089 let member_inline_size = <fidl::encoding::Endpoint<
13090 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
13091 > as fidl::encoding::TypeMarker>::inline_size(
13092 decoder.context
13093 );
13094 if inlined != (member_inline_size <= 4) {
13095 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13096 }
13097 let inner_offset;
13098 let mut inner_depth = depth.clone();
13099 if inlined {
13100 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13101 inner_offset = next_offset;
13102 } else {
13103 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13104 inner_depth.increment()?;
13105 }
13106 let val_ref = self.iface.get_or_insert_with(|| {
13107 fidl::new_empty!(
13108 fidl::encoding::Endpoint<
13109 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
13110 >,
13111 fidl::encoding::DefaultFuchsiaResourceDialect
13112 )
13113 });
13114 fidl::decode!(
13115 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
13116 fidl::encoding::DefaultFuchsiaResourceDialect,
13117 val_ref,
13118 decoder,
13119 inner_offset,
13120 inner_depth
13121 )?;
13122 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13123 {
13124 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13125 }
13126 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13127 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13128 }
13129 }
13130
13131 next_offset += envelope_size;
13132 _next_ordinal_to_read += 1;
13133 if next_offset >= end_offset {
13134 return Ok(());
13135 }
13136
13137 while _next_ordinal_to_read < 2 {
13139 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13140 _next_ordinal_to_read += 1;
13141 next_offset += envelope_size;
13142 }
13143
13144 let next_out_of_line = decoder.next_out_of_line();
13145 let handles_before = decoder.remaining_handles();
13146 if let Some((inlined, num_bytes, num_handles)) =
13147 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13148 {
13149 let member_inline_size =
13150 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13151 decoder.context,
13152 );
13153 if inlined != (member_inline_size <= 4) {
13154 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13155 }
13156 let inner_offset;
13157 let mut inner_depth = depth.clone();
13158 if inlined {
13159 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13160 inner_offset = next_offset;
13161 } else {
13162 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13163 inner_depth.increment()?;
13164 }
13165 let val_ref = self.iface_name.get_or_insert_with(|| {
13166 fidl::new_empty!(
13167 fidl::encoding::BoundedString<16>,
13168 fidl::encoding::DefaultFuchsiaResourceDialect
13169 )
13170 });
13171 fidl::decode!(
13172 fidl::encoding::BoundedString<16>,
13173 fidl::encoding::DefaultFuchsiaResourceDialect,
13174 val_ref,
13175 decoder,
13176 inner_offset,
13177 inner_depth
13178 )?;
13179 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13180 {
13181 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13182 }
13183 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13184 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13185 }
13186 }
13187
13188 next_offset += envelope_size;
13189
13190 while next_offset < end_offset {
13192 _next_ordinal_to_read += 1;
13193 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13194 next_offset += envelope_size;
13195 }
13196
13197 Ok(())
13198 }
13199 }
13200
13201 impl SupplicantRemoveInterfaceRequest {
13202 #[inline(always)]
13203 fn max_ordinal_present(&self) -> u64 {
13204 if let Some(_) = self.iface_name {
13205 return 1;
13206 }
13207 0
13208 }
13209 }
13210
13211 impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
13212 type Borrowed<'a> = &'a mut Self;
13213 fn take_or_borrow<'a>(
13214 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13215 ) -> Self::Borrowed<'a> {
13216 value
13217 }
13218 }
13219
13220 unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
13221 type Owned = Self;
13222
13223 #[inline(always)]
13224 fn inline_align(_context: fidl::encoding::Context) -> usize {
13225 8
13226 }
13227
13228 #[inline(always)]
13229 fn inline_size(_context: fidl::encoding::Context) -> usize {
13230 16
13231 }
13232 }
13233
13234 unsafe impl
13235 fidl::encoding::Encode<
13236 SupplicantRemoveInterfaceRequest,
13237 fidl::encoding::DefaultFuchsiaResourceDialect,
13238 > for &mut SupplicantRemoveInterfaceRequest
13239 {
13240 unsafe fn encode(
13241 self,
13242 encoder: &mut fidl::encoding::Encoder<
13243 '_,
13244 fidl::encoding::DefaultFuchsiaResourceDialect,
13245 >,
13246 offset: usize,
13247 mut depth: fidl::encoding::Depth,
13248 ) -> fidl::Result<()> {
13249 encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
13250 let max_ordinal: u64 = self.max_ordinal_present();
13252 encoder.write_num(max_ordinal, offset);
13253 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13254 if max_ordinal == 0 {
13256 return Ok(());
13257 }
13258 depth.increment()?;
13259 let envelope_size = 8;
13260 let bytes_len = max_ordinal as usize * envelope_size;
13261 #[allow(unused_variables)]
13262 let offset = encoder.out_of_line_offset(bytes_len);
13263 let mut _prev_end_offset: usize = 0;
13264 if 1 > max_ordinal {
13265 return Ok(());
13266 }
13267
13268 let cur_offset: usize = (1 - 1) * envelope_size;
13271
13272 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13274
13275 fidl::encoding::encode_in_envelope_optional::<
13280 fidl::encoding::BoundedString<16>,
13281 fidl::encoding::DefaultFuchsiaResourceDialect,
13282 >(
13283 self.iface_name.as_ref().map(
13284 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13285 ),
13286 encoder,
13287 offset + cur_offset,
13288 depth,
13289 )?;
13290
13291 _prev_end_offset = cur_offset + envelope_size;
13292
13293 Ok(())
13294 }
13295 }
13296
13297 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13298 for SupplicantRemoveInterfaceRequest
13299 {
13300 #[inline(always)]
13301 fn new_empty() -> Self {
13302 Self::default()
13303 }
13304
13305 unsafe fn decode(
13306 &mut self,
13307 decoder: &mut fidl::encoding::Decoder<
13308 '_,
13309 fidl::encoding::DefaultFuchsiaResourceDialect,
13310 >,
13311 offset: usize,
13312 mut depth: fidl::encoding::Depth,
13313 ) -> fidl::Result<()> {
13314 decoder.debug_check_bounds::<Self>(offset);
13315 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13316 None => return Err(fidl::Error::NotNullable),
13317 Some(len) => len,
13318 };
13319 if len == 0 {
13321 return Ok(());
13322 };
13323 depth.increment()?;
13324 let envelope_size = 8;
13325 let bytes_len = len * envelope_size;
13326 let offset = decoder.out_of_line_offset(bytes_len)?;
13327 let mut _next_ordinal_to_read = 0;
13329 let mut next_offset = offset;
13330 let end_offset = offset + bytes_len;
13331 _next_ordinal_to_read += 1;
13332 if next_offset >= end_offset {
13333 return Ok(());
13334 }
13335
13336 while _next_ordinal_to_read < 1 {
13338 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13339 _next_ordinal_to_read += 1;
13340 next_offset += envelope_size;
13341 }
13342
13343 let next_out_of_line = decoder.next_out_of_line();
13344 let handles_before = decoder.remaining_handles();
13345 if let Some((inlined, num_bytes, num_handles)) =
13346 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13347 {
13348 let member_inline_size =
13349 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13350 decoder.context,
13351 );
13352 if inlined != (member_inline_size <= 4) {
13353 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13354 }
13355 let inner_offset;
13356 let mut inner_depth = depth.clone();
13357 if inlined {
13358 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13359 inner_offset = next_offset;
13360 } else {
13361 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13362 inner_depth.increment()?;
13363 }
13364 let val_ref = self.iface_name.get_or_insert_with(|| {
13365 fidl::new_empty!(
13366 fidl::encoding::BoundedString<16>,
13367 fidl::encoding::DefaultFuchsiaResourceDialect
13368 )
13369 });
13370 fidl::decode!(
13371 fidl::encoding::BoundedString<16>,
13372 fidl::encoding::DefaultFuchsiaResourceDialect,
13373 val_ref,
13374 decoder,
13375 inner_offset,
13376 inner_depth
13377 )?;
13378 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13379 {
13380 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13381 }
13382 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13383 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13384 }
13385 }
13386
13387 next_offset += envelope_size;
13388
13389 while next_offset < end_offset {
13391 _next_ordinal_to_read += 1;
13392 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13393 next_offset += envelope_size;
13394 }
13395
13396 Ok(())
13397 }
13398 }
13399
13400 impl SupplicantStaIfaceAddNetworkRequest {
13401 #[inline(always)]
13402 fn max_ordinal_present(&self) -> u64 {
13403 if let Some(_) = self.network {
13404 return 1;
13405 }
13406 0
13407 }
13408 }
13409
13410 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
13411 type Borrowed<'a> = &'a mut Self;
13412 fn take_or_borrow<'a>(
13413 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13414 ) -> Self::Borrowed<'a> {
13415 value
13416 }
13417 }
13418
13419 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
13420 type Owned = Self;
13421
13422 #[inline(always)]
13423 fn inline_align(_context: fidl::encoding::Context) -> usize {
13424 8
13425 }
13426
13427 #[inline(always)]
13428 fn inline_size(_context: fidl::encoding::Context) -> usize {
13429 16
13430 }
13431 }
13432
13433 unsafe impl
13434 fidl::encoding::Encode<
13435 SupplicantStaIfaceAddNetworkRequest,
13436 fidl::encoding::DefaultFuchsiaResourceDialect,
13437 > for &mut SupplicantStaIfaceAddNetworkRequest
13438 {
13439 unsafe fn encode(
13440 self,
13441 encoder: &mut fidl::encoding::Encoder<
13442 '_,
13443 fidl::encoding::DefaultFuchsiaResourceDialect,
13444 >,
13445 offset: usize,
13446 mut depth: fidl::encoding::Depth,
13447 ) -> fidl::Result<()> {
13448 encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
13449 let max_ordinal: u64 = self.max_ordinal_present();
13451 encoder.write_num(max_ordinal, offset);
13452 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13453 if max_ordinal == 0 {
13455 return Ok(());
13456 }
13457 depth.increment()?;
13458 let envelope_size = 8;
13459 let bytes_len = max_ordinal as usize * envelope_size;
13460 #[allow(unused_variables)]
13461 let offset = encoder.out_of_line_offset(bytes_len);
13462 let mut _prev_end_offset: usize = 0;
13463 if 1 > max_ordinal {
13464 return Ok(());
13465 }
13466
13467 let cur_offset: usize = (1 - 1) * envelope_size;
13470
13471 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13473
13474 fidl::encoding::encode_in_envelope_optional::<
13479 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
13480 fidl::encoding::DefaultFuchsiaResourceDialect,
13481 >(
13482 self.network.as_mut().map(
13483 <fidl::encoding::Endpoint<
13484 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13485 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13486 ),
13487 encoder,
13488 offset + cur_offset,
13489 depth,
13490 )?;
13491
13492 _prev_end_offset = cur_offset + envelope_size;
13493
13494 Ok(())
13495 }
13496 }
13497
13498 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13499 for SupplicantStaIfaceAddNetworkRequest
13500 {
13501 #[inline(always)]
13502 fn new_empty() -> Self {
13503 Self::default()
13504 }
13505
13506 unsafe fn decode(
13507 &mut self,
13508 decoder: &mut fidl::encoding::Decoder<
13509 '_,
13510 fidl::encoding::DefaultFuchsiaResourceDialect,
13511 >,
13512 offset: usize,
13513 mut depth: fidl::encoding::Depth,
13514 ) -> fidl::Result<()> {
13515 decoder.debug_check_bounds::<Self>(offset);
13516 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13517 None => return Err(fidl::Error::NotNullable),
13518 Some(len) => len,
13519 };
13520 if len == 0 {
13522 return Ok(());
13523 };
13524 depth.increment()?;
13525 let envelope_size = 8;
13526 let bytes_len = len * envelope_size;
13527 let offset = decoder.out_of_line_offset(bytes_len)?;
13528 let mut _next_ordinal_to_read = 0;
13530 let mut next_offset = offset;
13531 let end_offset = offset + bytes_len;
13532 _next_ordinal_to_read += 1;
13533 if next_offset >= end_offset {
13534 return Ok(());
13535 }
13536
13537 while _next_ordinal_to_read < 1 {
13539 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13540 _next_ordinal_to_read += 1;
13541 next_offset += envelope_size;
13542 }
13543
13544 let next_out_of_line = decoder.next_out_of_line();
13545 let handles_before = decoder.remaining_handles();
13546 if let Some((inlined, num_bytes, num_handles)) =
13547 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13548 {
13549 let member_inline_size = <fidl::encoding::Endpoint<
13550 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13551 > as fidl::encoding::TypeMarker>::inline_size(
13552 decoder.context
13553 );
13554 if inlined != (member_inline_size <= 4) {
13555 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13556 }
13557 let inner_offset;
13558 let mut inner_depth = depth.clone();
13559 if inlined {
13560 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13561 inner_offset = next_offset;
13562 } else {
13563 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13564 inner_depth.increment()?;
13565 }
13566 let val_ref = self.network.get_or_insert_with(|| {
13567 fidl::new_empty!(
13568 fidl::encoding::Endpoint<
13569 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13570 >,
13571 fidl::encoding::DefaultFuchsiaResourceDialect
13572 )
13573 });
13574 fidl::decode!(
13575 fidl::encoding::Endpoint<
13576 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13577 >,
13578 fidl::encoding::DefaultFuchsiaResourceDialect,
13579 val_ref,
13580 decoder,
13581 inner_offset,
13582 inner_depth
13583 )?;
13584 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13585 {
13586 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13587 }
13588 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13589 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13590 }
13591 }
13592
13593 next_offset += envelope_size;
13594
13595 while next_offset < end_offset {
13597 _next_ordinal_to_read += 1;
13598 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13599 next_offset += envelope_size;
13600 }
13601
13602 Ok(())
13603 }
13604 }
13605
13606 impl SupplicantStaIfaceRegisterCallbackRequest {
13607 #[inline(always)]
13608 fn max_ordinal_present(&self) -> u64 {
13609 if let Some(_) = self.callback {
13610 return 1;
13611 }
13612 0
13613 }
13614 }
13615
13616 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13617 type Borrowed<'a> = &'a mut Self;
13618 fn take_or_borrow<'a>(
13619 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13620 ) -> Self::Borrowed<'a> {
13621 value
13622 }
13623 }
13624
13625 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13626 type Owned = Self;
13627
13628 #[inline(always)]
13629 fn inline_align(_context: fidl::encoding::Context) -> usize {
13630 8
13631 }
13632
13633 #[inline(always)]
13634 fn inline_size(_context: fidl::encoding::Context) -> usize {
13635 16
13636 }
13637 }
13638
13639 unsafe impl
13640 fidl::encoding::Encode<
13641 SupplicantStaIfaceRegisterCallbackRequest,
13642 fidl::encoding::DefaultFuchsiaResourceDialect,
13643 > for &mut SupplicantStaIfaceRegisterCallbackRequest
13644 {
13645 unsafe fn encode(
13646 self,
13647 encoder: &mut fidl::encoding::Encoder<
13648 '_,
13649 fidl::encoding::DefaultFuchsiaResourceDialect,
13650 >,
13651 offset: usize,
13652 mut depth: fidl::encoding::Depth,
13653 ) -> fidl::Result<()> {
13654 encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
13655 let max_ordinal: u64 = self.max_ordinal_present();
13657 encoder.write_num(max_ordinal, offset);
13658 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13659 if max_ordinal == 0 {
13661 return Ok(());
13662 }
13663 depth.increment()?;
13664 let envelope_size = 8;
13665 let bytes_len = max_ordinal as usize * envelope_size;
13666 #[allow(unused_variables)]
13667 let offset = encoder.out_of_line_offset(bytes_len);
13668 let mut _prev_end_offset: usize = 0;
13669 if 1 > max_ordinal {
13670 return Ok(());
13671 }
13672
13673 let cur_offset: usize = (1 - 1) * envelope_size;
13676
13677 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13679
13680 fidl::encoding::encode_in_envelope_optional::<
13685 fidl::encoding::Endpoint<
13686 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13687 >,
13688 fidl::encoding::DefaultFuchsiaResourceDialect,
13689 >(
13690 self.callback.as_mut().map(
13691 <fidl::encoding::Endpoint<
13692 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13693 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13694 ),
13695 encoder,
13696 offset + cur_offset,
13697 depth,
13698 )?;
13699
13700 _prev_end_offset = cur_offset + envelope_size;
13701
13702 Ok(())
13703 }
13704 }
13705
13706 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13707 for SupplicantStaIfaceRegisterCallbackRequest
13708 {
13709 #[inline(always)]
13710 fn new_empty() -> Self {
13711 Self::default()
13712 }
13713
13714 unsafe fn decode(
13715 &mut self,
13716 decoder: &mut fidl::encoding::Decoder<
13717 '_,
13718 fidl::encoding::DefaultFuchsiaResourceDialect,
13719 >,
13720 offset: usize,
13721 mut depth: fidl::encoding::Depth,
13722 ) -> fidl::Result<()> {
13723 decoder.debug_check_bounds::<Self>(offset);
13724 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13725 None => return Err(fidl::Error::NotNullable),
13726 Some(len) => len,
13727 };
13728 if len == 0 {
13730 return Ok(());
13731 };
13732 depth.increment()?;
13733 let envelope_size = 8;
13734 let bytes_len = len * envelope_size;
13735 let offset = decoder.out_of_line_offset(bytes_len)?;
13736 let mut _next_ordinal_to_read = 0;
13738 let mut next_offset = offset;
13739 let end_offset = offset + bytes_len;
13740 _next_ordinal_to_read += 1;
13741 if next_offset >= end_offset {
13742 return Ok(());
13743 }
13744
13745 while _next_ordinal_to_read < 1 {
13747 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13748 _next_ordinal_to_read += 1;
13749 next_offset += envelope_size;
13750 }
13751
13752 let next_out_of_line = decoder.next_out_of_line();
13753 let handles_before = decoder.remaining_handles();
13754 if let Some((inlined, num_bytes, num_handles)) =
13755 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13756 {
13757 let member_inline_size = <fidl::encoding::Endpoint<
13758 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13759 > as fidl::encoding::TypeMarker>::inline_size(
13760 decoder.context
13761 );
13762 if inlined != (member_inline_size <= 4) {
13763 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13764 }
13765 let inner_offset;
13766 let mut inner_depth = depth.clone();
13767 if inlined {
13768 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13769 inner_offset = next_offset;
13770 } else {
13771 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13772 inner_depth.increment()?;
13773 }
13774 let val_ref = self.callback.get_or_insert_with(|| {
13775 fidl::new_empty!(
13776 fidl::encoding::Endpoint<
13777 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13778 >,
13779 fidl::encoding::DefaultFuchsiaResourceDialect
13780 )
13781 });
13782 fidl::decode!(
13783 fidl::encoding::Endpoint<
13784 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13785 >,
13786 fidl::encoding::DefaultFuchsiaResourceDialect,
13787 val_ref,
13788 decoder,
13789 inner_offset,
13790 inner_depth
13791 )?;
13792 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13793 {
13794 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13795 }
13796 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13797 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13798 }
13799 }
13800
13801 next_offset += envelope_size;
13802
13803 while next_offset < end_offset {
13805 _next_ordinal_to_read += 1;
13806 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13807 next_offset += envelope_size;
13808 }
13809
13810 Ok(())
13811 }
13812 }
13813
13814 impl SupplicantStaIfaceSetPowerSaveRequest {
13815 #[inline(always)]
13816 fn max_ordinal_present(&self) -> u64 {
13817 if let Some(_) = self.enable {
13818 return 1;
13819 }
13820 0
13821 }
13822 }
13823
13824 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13825 type Borrowed<'a> = &'a mut Self;
13826 fn take_or_borrow<'a>(
13827 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13828 ) -> Self::Borrowed<'a> {
13829 value
13830 }
13831 }
13832
13833 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13834 type Owned = Self;
13835
13836 #[inline(always)]
13837 fn inline_align(_context: fidl::encoding::Context) -> usize {
13838 8
13839 }
13840
13841 #[inline(always)]
13842 fn inline_size(_context: fidl::encoding::Context) -> usize {
13843 16
13844 }
13845 }
13846
13847 unsafe impl
13848 fidl::encoding::Encode<
13849 SupplicantStaIfaceSetPowerSaveRequest,
13850 fidl::encoding::DefaultFuchsiaResourceDialect,
13851 > for &mut SupplicantStaIfaceSetPowerSaveRequest
13852 {
13853 unsafe fn encode(
13854 self,
13855 encoder: &mut fidl::encoding::Encoder<
13856 '_,
13857 fidl::encoding::DefaultFuchsiaResourceDialect,
13858 >,
13859 offset: usize,
13860 mut depth: fidl::encoding::Depth,
13861 ) -> fidl::Result<()> {
13862 encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
13863 let max_ordinal: u64 = self.max_ordinal_present();
13865 encoder.write_num(max_ordinal, offset);
13866 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13867 if max_ordinal == 0 {
13869 return Ok(());
13870 }
13871 depth.increment()?;
13872 let envelope_size = 8;
13873 let bytes_len = max_ordinal as usize * envelope_size;
13874 #[allow(unused_variables)]
13875 let offset = encoder.out_of_line_offset(bytes_len);
13876 let mut _prev_end_offset: usize = 0;
13877 if 1 > max_ordinal {
13878 return Ok(());
13879 }
13880
13881 let cur_offset: usize = (1 - 1) * envelope_size;
13884
13885 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13887
13888 fidl::encoding::encode_in_envelope_optional::<
13893 bool,
13894 fidl::encoding::DefaultFuchsiaResourceDialect,
13895 >(
13896 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13897 encoder,
13898 offset + cur_offset,
13899 depth,
13900 )?;
13901
13902 _prev_end_offset = cur_offset + envelope_size;
13903
13904 Ok(())
13905 }
13906 }
13907
13908 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13909 for SupplicantStaIfaceSetPowerSaveRequest
13910 {
13911 #[inline(always)]
13912 fn new_empty() -> Self {
13913 Self::default()
13914 }
13915
13916 unsafe fn decode(
13917 &mut self,
13918 decoder: &mut fidl::encoding::Decoder<
13919 '_,
13920 fidl::encoding::DefaultFuchsiaResourceDialect,
13921 >,
13922 offset: usize,
13923 mut depth: fidl::encoding::Depth,
13924 ) -> fidl::Result<()> {
13925 decoder.debug_check_bounds::<Self>(offset);
13926 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13927 None => return Err(fidl::Error::NotNullable),
13928 Some(len) => len,
13929 };
13930 if len == 0 {
13932 return Ok(());
13933 };
13934 depth.increment()?;
13935 let envelope_size = 8;
13936 let bytes_len = len * envelope_size;
13937 let offset = decoder.out_of_line_offset(bytes_len)?;
13938 let mut _next_ordinal_to_read = 0;
13940 let mut next_offset = offset;
13941 let end_offset = offset + bytes_len;
13942 _next_ordinal_to_read += 1;
13943 if next_offset >= end_offset {
13944 return Ok(());
13945 }
13946
13947 while _next_ordinal_to_read < 1 {
13949 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13950 _next_ordinal_to_read += 1;
13951 next_offset += envelope_size;
13952 }
13953
13954 let next_out_of_line = decoder.next_out_of_line();
13955 let handles_before = decoder.remaining_handles();
13956 if let Some((inlined, num_bytes, num_handles)) =
13957 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13958 {
13959 let member_inline_size =
13960 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13961 if inlined != (member_inline_size <= 4) {
13962 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13963 }
13964 let inner_offset;
13965 let mut inner_depth = depth.clone();
13966 if inlined {
13967 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13968 inner_offset = next_offset;
13969 } else {
13970 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13971 inner_depth.increment()?;
13972 }
13973 let val_ref = self.enable.get_or_insert_with(|| {
13974 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13975 });
13976 fidl::decode!(
13977 bool,
13978 fidl::encoding::DefaultFuchsiaResourceDialect,
13979 val_ref,
13980 decoder,
13981 inner_offset,
13982 inner_depth
13983 )?;
13984 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13985 {
13986 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13987 }
13988 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13989 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13990 }
13991 }
13992
13993 next_offset += envelope_size;
13994
13995 while next_offset < end_offset {
13997 _next_ordinal_to_read += 1;
13998 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13999 next_offset += envelope_size;
14000 }
14001
14002 Ok(())
14003 }
14004 }
14005
14006 impl SupplicantStaIfaceSetStaCountryCodeRequest {
14007 #[inline(always)]
14008 fn max_ordinal_present(&self) -> u64 {
14009 if let Some(_) = self.code {
14010 return 1;
14011 }
14012 0
14013 }
14014 }
14015
14016 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
14017 type Borrowed<'a> = &'a mut Self;
14018 fn take_or_borrow<'a>(
14019 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14020 ) -> Self::Borrowed<'a> {
14021 value
14022 }
14023 }
14024
14025 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
14026 type Owned = Self;
14027
14028 #[inline(always)]
14029 fn inline_align(_context: fidl::encoding::Context) -> usize {
14030 8
14031 }
14032
14033 #[inline(always)]
14034 fn inline_size(_context: fidl::encoding::Context) -> usize {
14035 16
14036 }
14037 }
14038
14039 unsafe impl
14040 fidl::encoding::Encode<
14041 SupplicantStaIfaceSetStaCountryCodeRequest,
14042 fidl::encoding::DefaultFuchsiaResourceDialect,
14043 > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
14044 {
14045 unsafe fn encode(
14046 self,
14047 encoder: &mut fidl::encoding::Encoder<
14048 '_,
14049 fidl::encoding::DefaultFuchsiaResourceDialect,
14050 >,
14051 offset: usize,
14052 mut depth: fidl::encoding::Depth,
14053 ) -> fidl::Result<()> {
14054 encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
14055 let max_ordinal: u64 = self.max_ordinal_present();
14057 encoder.write_num(max_ordinal, offset);
14058 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14059 if max_ordinal == 0 {
14061 return Ok(());
14062 }
14063 depth.increment()?;
14064 let envelope_size = 8;
14065 let bytes_len = max_ordinal as usize * envelope_size;
14066 #[allow(unused_variables)]
14067 let offset = encoder.out_of_line_offset(bytes_len);
14068 let mut _prev_end_offset: usize = 0;
14069 if 1 > max_ordinal {
14070 return Ok(());
14071 }
14072
14073 let cur_offset: usize = (1 - 1) * envelope_size;
14076
14077 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14079
14080 fidl::encoding::encode_in_envelope_optional::<
14085 fidl::encoding::Array<u8, 2>,
14086 fidl::encoding::DefaultFuchsiaResourceDialect,
14087 >(
14088 self.code
14089 .as_ref()
14090 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14091 encoder,
14092 offset + cur_offset,
14093 depth,
14094 )?;
14095
14096 _prev_end_offset = cur_offset + envelope_size;
14097
14098 Ok(())
14099 }
14100 }
14101
14102 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14103 for SupplicantStaIfaceSetStaCountryCodeRequest
14104 {
14105 #[inline(always)]
14106 fn new_empty() -> Self {
14107 Self::default()
14108 }
14109
14110 unsafe fn decode(
14111 &mut self,
14112 decoder: &mut fidl::encoding::Decoder<
14113 '_,
14114 fidl::encoding::DefaultFuchsiaResourceDialect,
14115 >,
14116 offset: usize,
14117 mut depth: fidl::encoding::Depth,
14118 ) -> fidl::Result<()> {
14119 decoder.debug_check_bounds::<Self>(offset);
14120 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14121 None => return Err(fidl::Error::NotNullable),
14122 Some(len) => len,
14123 };
14124 if len == 0 {
14126 return Ok(());
14127 };
14128 depth.increment()?;
14129 let envelope_size = 8;
14130 let bytes_len = len * envelope_size;
14131 let offset = decoder.out_of_line_offset(bytes_len)?;
14132 let mut _next_ordinal_to_read = 0;
14134 let mut next_offset = offset;
14135 let end_offset = offset + bytes_len;
14136 _next_ordinal_to_read += 1;
14137 if next_offset >= end_offset {
14138 return Ok(());
14139 }
14140
14141 while _next_ordinal_to_read < 1 {
14143 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14144 _next_ordinal_to_read += 1;
14145 next_offset += envelope_size;
14146 }
14147
14148 let next_out_of_line = decoder.next_out_of_line();
14149 let handles_before = decoder.remaining_handles();
14150 if let Some((inlined, num_bytes, num_handles)) =
14151 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14152 {
14153 let member_inline_size =
14154 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
14155 decoder.context,
14156 );
14157 if inlined != (member_inline_size <= 4) {
14158 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14159 }
14160 let inner_offset;
14161 let mut inner_depth = depth.clone();
14162 if inlined {
14163 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14164 inner_offset = next_offset;
14165 } else {
14166 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14167 inner_depth.increment()?;
14168 }
14169 let val_ref =
14170 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
14171 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14172 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14173 {
14174 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14175 }
14176 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14177 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14178 }
14179 }
14180
14181 next_offset += envelope_size;
14182
14183 while next_offset < end_offset {
14185 _next_ordinal_to_read += 1;
14186 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14187 next_offset += envelope_size;
14188 }
14189
14190 Ok(())
14191 }
14192 }
14193
14194 impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
14195 #[inline(always)]
14196 fn max_ordinal_present(&self) -> u64 {
14197 if let Some(_) = self.enable {
14198 return 1;
14199 }
14200 0
14201 }
14202 }
14203
14204 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14205 type Borrowed<'a> = &'a mut Self;
14206 fn take_or_borrow<'a>(
14207 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14208 ) -> Self::Borrowed<'a> {
14209 value
14210 }
14211 }
14212
14213 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14214 type Owned = Self;
14215
14216 #[inline(always)]
14217 fn inline_align(_context: fidl::encoding::Context) -> usize {
14218 8
14219 }
14220
14221 #[inline(always)]
14222 fn inline_size(_context: fidl::encoding::Context) -> usize {
14223 16
14224 }
14225 }
14226
14227 unsafe impl
14228 fidl::encoding::Encode<
14229 SupplicantStaIfaceSetSuspendModeEnabledRequest,
14230 fidl::encoding::DefaultFuchsiaResourceDialect,
14231 > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
14232 {
14233 unsafe fn encode(
14234 self,
14235 encoder: &mut fidl::encoding::Encoder<
14236 '_,
14237 fidl::encoding::DefaultFuchsiaResourceDialect,
14238 >,
14239 offset: usize,
14240 mut depth: fidl::encoding::Depth,
14241 ) -> fidl::Result<()> {
14242 encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
14243 let max_ordinal: u64 = self.max_ordinal_present();
14245 encoder.write_num(max_ordinal, offset);
14246 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14247 if max_ordinal == 0 {
14249 return Ok(());
14250 }
14251 depth.increment()?;
14252 let envelope_size = 8;
14253 let bytes_len = max_ordinal as usize * envelope_size;
14254 #[allow(unused_variables)]
14255 let offset = encoder.out_of_line_offset(bytes_len);
14256 let mut _prev_end_offset: usize = 0;
14257 if 1 > max_ordinal {
14258 return Ok(());
14259 }
14260
14261 let cur_offset: usize = (1 - 1) * envelope_size;
14264
14265 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14267
14268 fidl::encoding::encode_in_envelope_optional::<
14273 bool,
14274 fidl::encoding::DefaultFuchsiaResourceDialect,
14275 >(
14276 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
14277 encoder,
14278 offset + cur_offset,
14279 depth,
14280 )?;
14281
14282 _prev_end_offset = cur_offset + envelope_size;
14283
14284 Ok(())
14285 }
14286 }
14287
14288 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14289 for SupplicantStaIfaceSetSuspendModeEnabledRequest
14290 {
14291 #[inline(always)]
14292 fn new_empty() -> Self {
14293 Self::default()
14294 }
14295
14296 unsafe fn decode(
14297 &mut self,
14298 decoder: &mut fidl::encoding::Decoder<
14299 '_,
14300 fidl::encoding::DefaultFuchsiaResourceDialect,
14301 >,
14302 offset: usize,
14303 mut depth: fidl::encoding::Depth,
14304 ) -> fidl::Result<()> {
14305 decoder.debug_check_bounds::<Self>(offset);
14306 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14307 None => return Err(fidl::Error::NotNullable),
14308 Some(len) => len,
14309 };
14310 if len == 0 {
14312 return Ok(());
14313 };
14314 depth.increment()?;
14315 let envelope_size = 8;
14316 let bytes_len = len * envelope_size;
14317 let offset = decoder.out_of_line_offset(bytes_len)?;
14318 let mut _next_ordinal_to_read = 0;
14320 let mut next_offset = offset;
14321 let end_offset = offset + bytes_len;
14322 _next_ordinal_to_read += 1;
14323 if next_offset >= end_offset {
14324 return Ok(());
14325 }
14326
14327 while _next_ordinal_to_read < 1 {
14329 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14330 _next_ordinal_to_read += 1;
14331 next_offset += envelope_size;
14332 }
14333
14334 let next_out_of_line = decoder.next_out_of_line();
14335 let handles_before = decoder.remaining_handles();
14336 if let Some((inlined, num_bytes, num_handles)) =
14337 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14338 {
14339 let member_inline_size =
14340 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14341 if inlined != (member_inline_size <= 4) {
14342 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14343 }
14344 let inner_offset;
14345 let mut inner_depth = depth.clone();
14346 if inlined {
14347 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14348 inner_offset = next_offset;
14349 } else {
14350 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14351 inner_depth.increment()?;
14352 }
14353 let val_ref = self.enable.get_or_insert_with(|| {
14354 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
14355 });
14356 fidl::decode!(
14357 bool,
14358 fidl::encoding::DefaultFuchsiaResourceDialect,
14359 val_ref,
14360 decoder,
14361 inner_offset,
14362 inner_depth
14363 )?;
14364 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14365 {
14366 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14367 }
14368 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14369 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14370 }
14371 }
14372
14373 next_offset += envelope_size;
14374
14375 while next_offset < end_offset {
14377 _next_ordinal_to_read += 1;
14378 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14379 next_offset += envelope_size;
14380 }
14381
14382 Ok(())
14383 }
14384 }
14385
14386 impl WifiChipCreateStaIfaceRequest {
14387 #[inline(always)]
14388 fn max_ordinal_present(&self) -> u64 {
14389 if let Some(_) = self.iface {
14390 return 1;
14391 }
14392 0
14393 }
14394 }
14395
14396 impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
14397 type Borrowed<'a> = &'a mut Self;
14398 fn take_or_borrow<'a>(
14399 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14400 ) -> Self::Borrowed<'a> {
14401 value
14402 }
14403 }
14404
14405 unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
14406 type Owned = Self;
14407
14408 #[inline(always)]
14409 fn inline_align(_context: fidl::encoding::Context) -> usize {
14410 8
14411 }
14412
14413 #[inline(always)]
14414 fn inline_size(_context: fidl::encoding::Context) -> usize {
14415 16
14416 }
14417 }
14418
14419 unsafe impl
14420 fidl::encoding::Encode<
14421 WifiChipCreateStaIfaceRequest,
14422 fidl::encoding::DefaultFuchsiaResourceDialect,
14423 > for &mut WifiChipCreateStaIfaceRequest
14424 {
14425 unsafe fn encode(
14426 self,
14427 encoder: &mut fidl::encoding::Encoder<
14428 '_,
14429 fidl::encoding::DefaultFuchsiaResourceDialect,
14430 >,
14431 offset: usize,
14432 mut depth: fidl::encoding::Depth,
14433 ) -> fidl::Result<()> {
14434 encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
14435 let max_ordinal: u64 = self.max_ordinal_present();
14437 encoder.write_num(max_ordinal, offset);
14438 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14439 if max_ordinal == 0 {
14441 return Ok(());
14442 }
14443 depth.increment()?;
14444 let envelope_size = 8;
14445 let bytes_len = max_ordinal as usize * envelope_size;
14446 #[allow(unused_variables)]
14447 let offset = encoder.out_of_line_offset(bytes_len);
14448 let mut _prev_end_offset: usize = 0;
14449 if 1 > max_ordinal {
14450 return Ok(());
14451 }
14452
14453 let cur_offset: usize = (1 - 1) * envelope_size;
14456
14457 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14459
14460 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14465 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14466 encoder, offset + cur_offset, depth
14467 )?;
14468
14469 _prev_end_offset = cur_offset + envelope_size;
14470
14471 Ok(())
14472 }
14473 }
14474
14475 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14476 for WifiChipCreateStaIfaceRequest
14477 {
14478 #[inline(always)]
14479 fn new_empty() -> Self {
14480 Self::default()
14481 }
14482
14483 unsafe fn decode(
14484 &mut self,
14485 decoder: &mut fidl::encoding::Decoder<
14486 '_,
14487 fidl::encoding::DefaultFuchsiaResourceDialect,
14488 >,
14489 offset: usize,
14490 mut depth: fidl::encoding::Depth,
14491 ) -> fidl::Result<()> {
14492 decoder.debug_check_bounds::<Self>(offset);
14493 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14494 None => return Err(fidl::Error::NotNullable),
14495 Some(len) => len,
14496 };
14497 if len == 0 {
14499 return Ok(());
14500 };
14501 depth.increment()?;
14502 let envelope_size = 8;
14503 let bytes_len = len * envelope_size;
14504 let offset = decoder.out_of_line_offset(bytes_len)?;
14505 let mut _next_ordinal_to_read = 0;
14507 let mut next_offset = offset;
14508 let end_offset = offset + bytes_len;
14509 _next_ordinal_to_read += 1;
14510 if next_offset >= end_offset {
14511 return Ok(());
14512 }
14513
14514 while _next_ordinal_to_read < 1 {
14516 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14517 _next_ordinal_to_read += 1;
14518 next_offset += envelope_size;
14519 }
14520
14521 let next_out_of_line = decoder.next_out_of_line();
14522 let handles_before = decoder.remaining_handles();
14523 if let Some((inlined, num_bytes, num_handles)) =
14524 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14525 {
14526 let member_inline_size = <fidl::encoding::Endpoint<
14527 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14528 > as fidl::encoding::TypeMarker>::inline_size(
14529 decoder.context
14530 );
14531 if inlined != (member_inline_size <= 4) {
14532 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14533 }
14534 let inner_offset;
14535 let mut inner_depth = depth.clone();
14536 if inlined {
14537 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14538 inner_offset = next_offset;
14539 } else {
14540 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14541 inner_depth.increment()?;
14542 }
14543 let val_ref = self.iface.get_or_insert_with(|| {
14544 fidl::new_empty!(
14545 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14546 fidl::encoding::DefaultFuchsiaResourceDialect
14547 )
14548 });
14549 fidl::decode!(
14550 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14551 fidl::encoding::DefaultFuchsiaResourceDialect,
14552 val_ref,
14553 decoder,
14554 inner_offset,
14555 inner_depth
14556 )?;
14557 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14558 {
14559 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14560 }
14561 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14562 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14563 }
14564 }
14565
14566 next_offset += envelope_size;
14567
14568 while next_offset < end_offset {
14570 _next_ordinal_to_read += 1;
14571 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14572 next_offset += envelope_size;
14573 }
14574
14575 Ok(())
14576 }
14577 }
14578
14579 impl WifiChipGetStaIfaceRequest {
14580 #[inline(always)]
14581 fn max_ordinal_present(&self) -> u64 {
14582 if let Some(_) = self.iface {
14583 return 2;
14584 }
14585 if let Some(_) = self.iface_name {
14586 return 1;
14587 }
14588 0
14589 }
14590 }
14591
14592 impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
14593 type Borrowed<'a> = &'a mut Self;
14594 fn take_or_borrow<'a>(
14595 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14596 ) -> Self::Borrowed<'a> {
14597 value
14598 }
14599 }
14600
14601 unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
14602 type Owned = Self;
14603
14604 #[inline(always)]
14605 fn inline_align(_context: fidl::encoding::Context) -> usize {
14606 8
14607 }
14608
14609 #[inline(always)]
14610 fn inline_size(_context: fidl::encoding::Context) -> usize {
14611 16
14612 }
14613 }
14614
14615 unsafe impl
14616 fidl::encoding::Encode<
14617 WifiChipGetStaIfaceRequest,
14618 fidl::encoding::DefaultFuchsiaResourceDialect,
14619 > for &mut WifiChipGetStaIfaceRequest
14620 {
14621 unsafe fn encode(
14622 self,
14623 encoder: &mut fidl::encoding::Encoder<
14624 '_,
14625 fidl::encoding::DefaultFuchsiaResourceDialect,
14626 >,
14627 offset: usize,
14628 mut depth: fidl::encoding::Depth,
14629 ) -> fidl::Result<()> {
14630 encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
14631 let max_ordinal: u64 = self.max_ordinal_present();
14633 encoder.write_num(max_ordinal, offset);
14634 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14635 if max_ordinal == 0 {
14637 return Ok(());
14638 }
14639 depth.increment()?;
14640 let envelope_size = 8;
14641 let bytes_len = max_ordinal as usize * envelope_size;
14642 #[allow(unused_variables)]
14643 let offset = encoder.out_of_line_offset(bytes_len);
14644 let mut _prev_end_offset: usize = 0;
14645 if 1 > max_ordinal {
14646 return Ok(());
14647 }
14648
14649 let cur_offset: usize = (1 - 1) * envelope_size;
14652
14653 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14655
14656 fidl::encoding::encode_in_envelope_optional::<
14661 fidl::encoding::BoundedString<16>,
14662 fidl::encoding::DefaultFuchsiaResourceDialect,
14663 >(
14664 self.iface_name.as_ref().map(
14665 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14666 ),
14667 encoder,
14668 offset + cur_offset,
14669 depth,
14670 )?;
14671
14672 _prev_end_offset = cur_offset + envelope_size;
14673 if 2 > max_ordinal {
14674 return Ok(());
14675 }
14676
14677 let cur_offset: usize = (2 - 1) * envelope_size;
14680
14681 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14683
14684 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14689 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14690 encoder, offset + cur_offset, depth
14691 )?;
14692
14693 _prev_end_offset = cur_offset + envelope_size;
14694
14695 Ok(())
14696 }
14697 }
14698
14699 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14700 for WifiChipGetStaIfaceRequest
14701 {
14702 #[inline(always)]
14703 fn new_empty() -> Self {
14704 Self::default()
14705 }
14706
14707 unsafe fn decode(
14708 &mut self,
14709 decoder: &mut fidl::encoding::Decoder<
14710 '_,
14711 fidl::encoding::DefaultFuchsiaResourceDialect,
14712 >,
14713 offset: usize,
14714 mut depth: fidl::encoding::Depth,
14715 ) -> fidl::Result<()> {
14716 decoder.debug_check_bounds::<Self>(offset);
14717 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14718 None => return Err(fidl::Error::NotNullable),
14719 Some(len) => len,
14720 };
14721 if len == 0 {
14723 return Ok(());
14724 };
14725 depth.increment()?;
14726 let envelope_size = 8;
14727 let bytes_len = len * envelope_size;
14728 let offset = decoder.out_of_line_offset(bytes_len)?;
14729 let mut _next_ordinal_to_read = 0;
14731 let mut next_offset = offset;
14732 let end_offset = offset + bytes_len;
14733 _next_ordinal_to_read += 1;
14734 if next_offset >= end_offset {
14735 return Ok(());
14736 }
14737
14738 while _next_ordinal_to_read < 1 {
14740 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14741 _next_ordinal_to_read += 1;
14742 next_offset += envelope_size;
14743 }
14744
14745 let next_out_of_line = decoder.next_out_of_line();
14746 let handles_before = decoder.remaining_handles();
14747 if let Some((inlined, num_bytes, num_handles)) =
14748 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14749 {
14750 let member_inline_size =
14751 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14752 decoder.context,
14753 );
14754 if inlined != (member_inline_size <= 4) {
14755 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14756 }
14757 let inner_offset;
14758 let mut inner_depth = depth.clone();
14759 if inlined {
14760 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14761 inner_offset = next_offset;
14762 } else {
14763 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14764 inner_depth.increment()?;
14765 }
14766 let val_ref = self.iface_name.get_or_insert_with(|| {
14767 fidl::new_empty!(
14768 fidl::encoding::BoundedString<16>,
14769 fidl::encoding::DefaultFuchsiaResourceDialect
14770 )
14771 });
14772 fidl::decode!(
14773 fidl::encoding::BoundedString<16>,
14774 fidl::encoding::DefaultFuchsiaResourceDialect,
14775 val_ref,
14776 decoder,
14777 inner_offset,
14778 inner_depth
14779 )?;
14780 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14781 {
14782 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14783 }
14784 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14785 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14786 }
14787 }
14788
14789 next_offset += envelope_size;
14790 _next_ordinal_to_read += 1;
14791 if next_offset >= end_offset {
14792 return Ok(());
14793 }
14794
14795 while _next_ordinal_to_read < 2 {
14797 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14798 _next_ordinal_to_read += 1;
14799 next_offset += envelope_size;
14800 }
14801
14802 let next_out_of_line = decoder.next_out_of_line();
14803 let handles_before = decoder.remaining_handles();
14804 if let Some((inlined, num_bytes, num_handles)) =
14805 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14806 {
14807 let member_inline_size = <fidl::encoding::Endpoint<
14808 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14809 > as fidl::encoding::TypeMarker>::inline_size(
14810 decoder.context
14811 );
14812 if inlined != (member_inline_size <= 4) {
14813 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14814 }
14815 let inner_offset;
14816 let mut inner_depth = depth.clone();
14817 if inlined {
14818 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14819 inner_offset = next_offset;
14820 } else {
14821 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14822 inner_depth.increment()?;
14823 }
14824 let val_ref = self.iface.get_or_insert_with(|| {
14825 fidl::new_empty!(
14826 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14827 fidl::encoding::DefaultFuchsiaResourceDialect
14828 )
14829 });
14830 fidl::decode!(
14831 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14832 fidl::encoding::DefaultFuchsiaResourceDialect,
14833 val_ref,
14834 decoder,
14835 inner_offset,
14836 inner_depth
14837 )?;
14838 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14839 {
14840 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14841 }
14842 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14843 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14844 }
14845 }
14846
14847 next_offset += envelope_size;
14848
14849 while next_offset < end_offset {
14851 _next_ordinal_to_read += 1;
14852 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14853 next_offset += envelope_size;
14854 }
14855
14856 Ok(())
14857 }
14858 }
14859
14860 impl WifiChipRemoveStaIfaceRequest {
14861 #[inline(always)]
14862 fn max_ordinal_present(&self) -> u64 {
14863 if let Some(_) = self.iface_name {
14864 return 1;
14865 }
14866 0
14867 }
14868 }
14869
14870 impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
14871 type Borrowed<'a> = &'a mut Self;
14872 fn take_or_borrow<'a>(
14873 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14874 ) -> Self::Borrowed<'a> {
14875 value
14876 }
14877 }
14878
14879 unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
14880 type Owned = Self;
14881
14882 #[inline(always)]
14883 fn inline_align(_context: fidl::encoding::Context) -> usize {
14884 8
14885 }
14886
14887 #[inline(always)]
14888 fn inline_size(_context: fidl::encoding::Context) -> usize {
14889 16
14890 }
14891 }
14892
14893 unsafe impl
14894 fidl::encoding::Encode<
14895 WifiChipRemoveStaIfaceRequest,
14896 fidl::encoding::DefaultFuchsiaResourceDialect,
14897 > for &mut WifiChipRemoveStaIfaceRequest
14898 {
14899 unsafe fn encode(
14900 self,
14901 encoder: &mut fidl::encoding::Encoder<
14902 '_,
14903 fidl::encoding::DefaultFuchsiaResourceDialect,
14904 >,
14905 offset: usize,
14906 mut depth: fidl::encoding::Depth,
14907 ) -> fidl::Result<()> {
14908 encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
14909 let max_ordinal: u64 = self.max_ordinal_present();
14911 encoder.write_num(max_ordinal, offset);
14912 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14913 if max_ordinal == 0 {
14915 return Ok(());
14916 }
14917 depth.increment()?;
14918 let envelope_size = 8;
14919 let bytes_len = max_ordinal as usize * envelope_size;
14920 #[allow(unused_variables)]
14921 let offset = encoder.out_of_line_offset(bytes_len);
14922 let mut _prev_end_offset: usize = 0;
14923 if 1 > max_ordinal {
14924 return Ok(());
14925 }
14926
14927 let cur_offset: usize = (1 - 1) * envelope_size;
14930
14931 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14933
14934 fidl::encoding::encode_in_envelope_optional::<
14939 fidl::encoding::BoundedString<16>,
14940 fidl::encoding::DefaultFuchsiaResourceDialect,
14941 >(
14942 self.iface_name.as_ref().map(
14943 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14944 ),
14945 encoder,
14946 offset + cur_offset,
14947 depth,
14948 )?;
14949
14950 _prev_end_offset = cur_offset + envelope_size;
14951
14952 Ok(())
14953 }
14954 }
14955
14956 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14957 for WifiChipRemoveStaIfaceRequest
14958 {
14959 #[inline(always)]
14960 fn new_empty() -> Self {
14961 Self::default()
14962 }
14963
14964 unsafe fn decode(
14965 &mut self,
14966 decoder: &mut fidl::encoding::Decoder<
14967 '_,
14968 fidl::encoding::DefaultFuchsiaResourceDialect,
14969 >,
14970 offset: usize,
14971 mut depth: fidl::encoding::Depth,
14972 ) -> fidl::Result<()> {
14973 decoder.debug_check_bounds::<Self>(offset);
14974 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14975 None => return Err(fidl::Error::NotNullable),
14976 Some(len) => len,
14977 };
14978 if len == 0 {
14980 return Ok(());
14981 };
14982 depth.increment()?;
14983 let envelope_size = 8;
14984 let bytes_len = len * envelope_size;
14985 let offset = decoder.out_of_line_offset(bytes_len)?;
14986 let mut _next_ordinal_to_read = 0;
14988 let mut next_offset = offset;
14989 let end_offset = offset + bytes_len;
14990 _next_ordinal_to_read += 1;
14991 if next_offset >= end_offset {
14992 return Ok(());
14993 }
14994
14995 while _next_ordinal_to_read < 1 {
14997 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14998 _next_ordinal_to_read += 1;
14999 next_offset += envelope_size;
15000 }
15001
15002 let next_out_of_line = decoder.next_out_of_line();
15003 let handles_before = decoder.remaining_handles();
15004 if let Some((inlined, num_bytes, num_handles)) =
15005 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15006 {
15007 let member_inline_size =
15008 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
15009 decoder.context,
15010 );
15011 if inlined != (member_inline_size <= 4) {
15012 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15013 }
15014 let inner_offset;
15015 let mut inner_depth = depth.clone();
15016 if inlined {
15017 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15018 inner_offset = next_offset;
15019 } else {
15020 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15021 inner_depth.increment()?;
15022 }
15023 let val_ref = self.iface_name.get_or_insert_with(|| {
15024 fidl::new_empty!(
15025 fidl::encoding::BoundedString<16>,
15026 fidl::encoding::DefaultFuchsiaResourceDialect
15027 )
15028 });
15029 fidl::decode!(
15030 fidl::encoding::BoundedString<16>,
15031 fidl::encoding::DefaultFuchsiaResourceDialect,
15032 val_ref,
15033 decoder,
15034 inner_offset,
15035 inner_depth
15036 )?;
15037 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15038 {
15039 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15040 }
15041 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15042 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15043 }
15044 }
15045
15046 next_offset += envelope_size;
15047
15048 while next_offset < end_offset {
15050 _next_ordinal_to_read += 1;
15051 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15052 next_offset += envelope_size;
15053 }
15054
15055 Ok(())
15056 }
15057 }
15058
15059 impl WifiChipSetCountryCodeRequest {
15060 #[inline(always)]
15061 fn max_ordinal_present(&self) -> u64 {
15062 if let Some(_) = self.code {
15063 return 1;
15064 }
15065 0
15066 }
15067 }
15068
15069 impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
15070 type Borrowed<'a> = &'a mut Self;
15071 fn take_or_borrow<'a>(
15072 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15073 ) -> Self::Borrowed<'a> {
15074 value
15075 }
15076 }
15077
15078 unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
15079 type Owned = Self;
15080
15081 #[inline(always)]
15082 fn inline_align(_context: fidl::encoding::Context) -> usize {
15083 8
15084 }
15085
15086 #[inline(always)]
15087 fn inline_size(_context: fidl::encoding::Context) -> usize {
15088 16
15089 }
15090 }
15091
15092 unsafe impl
15093 fidl::encoding::Encode<
15094 WifiChipSetCountryCodeRequest,
15095 fidl::encoding::DefaultFuchsiaResourceDialect,
15096 > for &mut WifiChipSetCountryCodeRequest
15097 {
15098 unsafe fn encode(
15099 self,
15100 encoder: &mut fidl::encoding::Encoder<
15101 '_,
15102 fidl::encoding::DefaultFuchsiaResourceDialect,
15103 >,
15104 offset: usize,
15105 mut depth: fidl::encoding::Depth,
15106 ) -> fidl::Result<()> {
15107 encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
15108 let max_ordinal: u64 = self.max_ordinal_present();
15110 encoder.write_num(max_ordinal, offset);
15111 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15112 if max_ordinal == 0 {
15114 return Ok(());
15115 }
15116 depth.increment()?;
15117 let envelope_size = 8;
15118 let bytes_len = max_ordinal as usize * envelope_size;
15119 #[allow(unused_variables)]
15120 let offset = encoder.out_of_line_offset(bytes_len);
15121 let mut _prev_end_offset: usize = 0;
15122 if 1 > max_ordinal {
15123 return Ok(());
15124 }
15125
15126 let cur_offset: usize = (1 - 1) * envelope_size;
15129
15130 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15132
15133 fidl::encoding::encode_in_envelope_optional::<
15138 fidl::encoding::Array<u8, 2>,
15139 fidl::encoding::DefaultFuchsiaResourceDialect,
15140 >(
15141 self.code
15142 .as_ref()
15143 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
15144 encoder,
15145 offset + cur_offset,
15146 depth,
15147 )?;
15148
15149 _prev_end_offset = cur_offset + envelope_size;
15150
15151 Ok(())
15152 }
15153 }
15154
15155 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15156 for WifiChipSetCountryCodeRequest
15157 {
15158 #[inline(always)]
15159 fn new_empty() -> Self {
15160 Self::default()
15161 }
15162
15163 unsafe fn decode(
15164 &mut self,
15165 decoder: &mut fidl::encoding::Decoder<
15166 '_,
15167 fidl::encoding::DefaultFuchsiaResourceDialect,
15168 >,
15169 offset: usize,
15170 mut depth: fidl::encoding::Depth,
15171 ) -> fidl::Result<()> {
15172 decoder.debug_check_bounds::<Self>(offset);
15173 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15174 None => return Err(fidl::Error::NotNullable),
15175 Some(len) => len,
15176 };
15177 if len == 0 {
15179 return Ok(());
15180 };
15181 depth.increment()?;
15182 let envelope_size = 8;
15183 let bytes_len = len * envelope_size;
15184 let offset = decoder.out_of_line_offset(bytes_len)?;
15185 let mut _next_ordinal_to_read = 0;
15187 let mut next_offset = offset;
15188 let end_offset = offset + bytes_len;
15189 _next_ordinal_to_read += 1;
15190 if next_offset >= end_offset {
15191 return Ok(());
15192 }
15193
15194 while _next_ordinal_to_read < 1 {
15196 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15197 _next_ordinal_to_read += 1;
15198 next_offset += envelope_size;
15199 }
15200
15201 let next_out_of_line = decoder.next_out_of_line();
15202 let handles_before = decoder.remaining_handles();
15203 if let Some((inlined, num_bytes, num_handles)) =
15204 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15205 {
15206 let member_inline_size =
15207 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
15208 decoder.context,
15209 );
15210 if inlined != (member_inline_size <= 4) {
15211 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15212 }
15213 let inner_offset;
15214 let mut inner_depth = depth.clone();
15215 if inlined {
15216 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15217 inner_offset = next_offset;
15218 } else {
15219 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15220 inner_depth.increment()?;
15221 }
15222 let val_ref =
15223 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
15224 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15225 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15226 {
15227 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15228 }
15229 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15230 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15231 }
15232 }
15233
15234 next_offset += envelope_size;
15235
15236 while next_offset < end_offset {
15238 _next_ordinal_to_read += 1;
15239 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15240 next_offset += envelope_size;
15241 }
15242
15243 Ok(())
15244 }
15245 }
15246
15247 impl WifiEventCallbackOnSubsystemRestartRequest {
15248 #[inline(always)]
15249 fn max_ordinal_present(&self) -> u64 {
15250 if let Some(_) = self.status {
15251 return 1;
15252 }
15253 0
15254 }
15255 }
15256
15257 impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15258 type Borrowed<'a> = &'a mut Self;
15259 fn take_or_borrow<'a>(
15260 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15261 ) -> Self::Borrowed<'a> {
15262 value
15263 }
15264 }
15265
15266 unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15267 type Owned = Self;
15268
15269 #[inline(always)]
15270 fn inline_align(_context: fidl::encoding::Context) -> usize {
15271 8
15272 }
15273
15274 #[inline(always)]
15275 fn inline_size(_context: fidl::encoding::Context) -> usize {
15276 16
15277 }
15278 }
15279
15280 unsafe impl
15281 fidl::encoding::Encode<
15282 WifiEventCallbackOnSubsystemRestartRequest,
15283 fidl::encoding::DefaultFuchsiaResourceDialect,
15284 > for &mut WifiEventCallbackOnSubsystemRestartRequest
15285 {
15286 unsafe fn encode(
15287 self,
15288 encoder: &mut fidl::encoding::Encoder<
15289 '_,
15290 fidl::encoding::DefaultFuchsiaResourceDialect,
15291 >,
15292 offset: usize,
15293 mut depth: fidl::encoding::Depth,
15294 ) -> fidl::Result<()> {
15295 encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
15296 let max_ordinal: u64 = self.max_ordinal_present();
15298 encoder.write_num(max_ordinal, offset);
15299 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15300 if max_ordinal == 0 {
15302 return Ok(());
15303 }
15304 depth.increment()?;
15305 let envelope_size = 8;
15306 let bytes_len = max_ordinal as usize * envelope_size;
15307 #[allow(unused_variables)]
15308 let offset = encoder.out_of_line_offset(bytes_len);
15309 let mut _prev_end_offset: usize = 0;
15310 if 1 > max_ordinal {
15311 return Ok(());
15312 }
15313
15314 let cur_offset: usize = (1 - 1) * envelope_size;
15317
15318 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15320
15321 fidl::encoding::encode_in_envelope_optional::<
15326 i32,
15327 fidl::encoding::DefaultFuchsiaResourceDialect,
15328 >(
15329 self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
15330 encoder,
15331 offset + cur_offset,
15332 depth,
15333 )?;
15334
15335 _prev_end_offset = cur_offset + envelope_size;
15336
15337 Ok(())
15338 }
15339 }
15340
15341 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15342 for WifiEventCallbackOnSubsystemRestartRequest
15343 {
15344 #[inline(always)]
15345 fn new_empty() -> Self {
15346 Self::default()
15347 }
15348
15349 unsafe fn decode(
15350 &mut self,
15351 decoder: &mut fidl::encoding::Decoder<
15352 '_,
15353 fidl::encoding::DefaultFuchsiaResourceDialect,
15354 >,
15355 offset: usize,
15356 mut depth: fidl::encoding::Depth,
15357 ) -> fidl::Result<()> {
15358 decoder.debug_check_bounds::<Self>(offset);
15359 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15360 None => return Err(fidl::Error::NotNullable),
15361 Some(len) => len,
15362 };
15363 if len == 0 {
15365 return Ok(());
15366 };
15367 depth.increment()?;
15368 let envelope_size = 8;
15369 let bytes_len = len * envelope_size;
15370 let offset = decoder.out_of_line_offset(bytes_len)?;
15371 let mut _next_ordinal_to_read = 0;
15373 let mut next_offset = offset;
15374 let end_offset = offset + bytes_len;
15375 _next_ordinal_to_read += 1;
15376 if next_offset >= end_offset {
15377 return Ok(());
15378 }
15379
15380 while _next_ordinal_to_read < 1 {
15382 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15383 _next_ordinal_to_read += 1;
15384 next_offset += envelope_size;
15385 }
15386
15387 let next_out_of_line = decoder.next_out_of_line();
15388 let handles_before = decoder.remaining_handles();
15389 if let Some((inlined, num_bytes, num_handles)) =
15390 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15391 {
15392 let member_inline_size =
15393 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15394 if inlined != (member_inline_size <= 4) {
15395 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15396 }
15397 let inner_offset;
15398 let mut inner_depth = depth.clone();
15399 if inlined {
15400 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15401 inner_offset = next_offset;
15402 } else {
15403 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15404 inner_depth.increment()?;
15405 }
15406 let val_ref = self.status.get_or_insert_with(|| {
15407 fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
15408 });
15409 fidl::decode!(
15410 i32,
15411 fidl::encoding::DefaultFuchsiaResourceDialect,
15412 val_ref,
15413 decoder,
15414 inner_offset,
15415 inner_depth
15416 )?;
15417 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15418 {
15419 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15420 }
15421 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15422 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15423 }
15424 }
15425
15426 next_offset += envelope_size;
15427
15428 while next_offset < end_offset {
15430 _next_ordinal_to_read += 1;
15431 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15432 next_offset += envelope_size;
15433 }
15434
15435 Ok(())
15436 }
15437 }
15438
15439 impl WifiGetChipRequest {
15440 #[inline(always)]
15441 fn max_ordinal_present(&self) -> u64 {
15442 if let Some(_) = self.chip {
15443 return 2;
15444 }
15445 if let Some(_) = self.chip_id {
15446 return 1;
15447 }
15448 0
15449 }
15450 }
15451
15452 impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
15453 type Borrowed<'a> = &'a mut Self;
15454 fn take_or_borrow<'a>(
15455 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15456 ) -> Self::Borrowed<'a> {
15457 value
15458 }
15459 }
15460
15461 unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
15462 type Owned = Self;
15463
15464 #[inline(always)]
15465 fn inline_align(_context: fidl::encoding::Context) -> usize {
15466 8
15467 }
15468
15469 #[inline(always)]
15470 fn inline_size(_context: fidl::encoding::Context) -> usize {
15471 16
15472 }
15473 }
15474
15475 unsafe impl
15476 fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
15477 for &mut WifiGetChipRequest
15478 {
15479 unsafe fn encode(
15480 self,
15481 encoder: &mut fidl::encoding::Encoder<
15482 '_,
15483 fidl::encoding::DefaultFuchsiaResourceDialect,
15484 >,
15485 offset: usize,
15486 mut depth: fidl::encoding::Depth,
15487 ) -> fidl::Result<()> {
15488 encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
15489 let max_ordinal: u64 = self.max_ordinal_present();
15491 encoder.write_num(max_ordinal, offset);
15492 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15493 if max_ordinal == 0 {
15495 return Ok(());
15496 }
15497 depth.increment()?;
15498 let envelope_size = 8;
15499 let bytes_len = max_ordinal as usize * envelope_size;
15500 #[allow(unused_variables)]
15501 let offset = encoder.out_of_line_offset(bytes_len);
15502 let mut _prev_end_offset: usize = 0;
15503 if 1 > max_ordinal {
15504 return Ok(());
15505 }
15506
15507 let cur_offset: usize = (1 - 1) * envelope_size;
15510
15511 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15513
15514 fidl::encoding::encode_in_envelope_optional::<
15519 u32,
15520 fidl::encoding::DefaultFuchsiaResourceDialect,
15521 >(
15522 self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
15523 encoder,
15524 offset + cur_offset,
15525 depth,
15526 )?;
15527
15528 _prev_end_offset = cur_offset + envelope_size;
15529 if 2 > max_ordinal {
15530 return Ok(());
15531 }
15532
15533 let cur_offset: usize = (2 - 1) * envelope_size;
15536
15537 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15539
15540 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15545 self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15546 encoder, offset + cur_offset, depth
15547 )?;
15548
15549 _prev_end_offset = cur_offset + envelope_size;
15550
15551 Ok(())
15552 }
15553 }
15554
15555 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15556 for WifiGetChipRequest
15557 {
15558 #[inline(always)]
15559 fn new_empty() -> Self {
15560 Self::default()
15561 }
15562
15563 unsafe fn decode(
15564 &mut self,
15565 decoder: &mut fidl::encoding::Decoder<
15566 '_,
15567 fidl::encoding::DefaultFuchsiaResourceDialect,
15568 >,
15569 offset: usize,
15570 mut depth: fidl::encoding::Depth,
15571 ) -> fidl::Result<()> {
15572 decoder.debug_check_bounds::<Self>(offset);
15573 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15574 None => return Err(fidl::Error::NotNullable),
15575 Some(len) => len,
15576 };
15577 if len == 0 {
15579 return Ok(());
15580 };
15581 depth.increment()?;
15582 let envelope_size = 8;
15583 let bytes_len = len * envelope_size;
15584 let offset = decoder.out_of_line_offset(bytes_len)?;
15585 let mut _next_ordinal_to_read = 0;
15587 let mut next_offset = offset;
15588 let end_offset = offset + bytes_len;
15589 _next_ordinal_to_read += 1;
15590 if next_offset >= end_offset {
15591 return Ok(());
15592 }
15593
15594 while _next_ordinal_to_read < 1 {
15596 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15597 _next_ordinal_to_read += 1;
15598 next_offset += envelope_size;
15599 }
15600
15601 let next_out_of_line = decoder.next_out_of_line();
15602 let handles_before = decoder.remaining_handles();
15603 if let Some((inlined, num_bytes, num_handles)) =
15604 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15605 {
15606 let member_inline_size =
15607 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15608 if inlined != (member_inline_size <= 4) {
15609 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15610 }
15611 let inner_offset;
15612 let mut inner_depth = depth.clone();
15613 if inlined {
15614 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15615 inner_offset = next_offset;
15616 } else {
15617 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15618 inner_depth.increment()?;
15619 }
15620 let val_ref = self.chip_id.get_or_insert_with(|| {
15621 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
15622 });
15623 fidl::decode!(
15624 u32,
15625 fidl::encoding::DefaultFuchsiaResourceDialect,
15626 val_ref,
15627 decoder,
15628 inner_offset,
15629 inner_depth
15630 )?;
15631 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15632 {
15633 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15634 }
15635 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15636 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15637 }
15638 }
15639
15640 next_offset += envelope_size;
15641 _next_ordinal_to_read += 1;
15642 if next_offset >= end_offset {
15643 return Ok(());
15644 }
15645
15646 while _next_ordinal_to_read < 2 {
15648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15649 _next_ordinal_to_read += 1;
15650 next_offset += envelope_size;
15651 }
15652
15653 let next_out_of_line = decoder.next_out_of_line();
15654 let handles_before = decoder.remaining_handles();
15655 if let Some((inlined, num_bytes, num_handles)) =
15656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15657 {
15658 let member_inline_size = <fidl::encoding::Endpoint<
15659 fidl::endpoints::ServerEnd<WifiChipMarker>,
15660 > as fidl::encoding::TypeMarker>::inline_size(
15661 decoder.context
15662 );
15663 if inlined != (member_inline_size <= 4) {
15664 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15665 }
15666 let inner_offset;
15667 let mut inner_depth = depth.clone();
15668 if inlined {
15669 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15670 inner_offset = next_offset;
15671 } else {
15672 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15673 inner_depth.increment()?;
15674 }
15675 let val_ref = self.chip.get_or_insert_with(|| {
15676 fidl::new_empty!(
15677 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15678 fidl::encoding::DefaultFuchsiaResourceDialect
15679 )
15680 });
15681 fidl::decode!(
15682 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15683 fidl::encoding::DefaultFuchsiaResourceDialect,
15684 val_ref,
15685 decoder,
15686 inner_offset,
15687 inner_depth
15688 )?;
15689 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15690 {
15691 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15692 }
15693 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15694 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15695 }
15696 }
15697
15698 next_offset += envelope_size;
15699
15700 while next_offset < end_offset {
15702 _next_ordinal_to_read += 1;
15703 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15704 next_offset += envelope_size;
15705 }
15706
15707 Ok(())
15708 }
15709 }
15710
15711 impl WifiLegacyHalSelectTxPowerScenarioRequest {
15712 #[inline(always)]
15713 fn max_ordinal_present(&self) -> u64 {
15714 if let Some(_) = self.scenario {
15715 return 1;
15716 }
15717 0
15718 }
15719 }
15720
15721 impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15722 type Borrowed<'a> = &'a mut Self;
15723 fn take_or_borrow<'a>(
15724 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15725 ) -> Self::Borrowed<'a> {
15726 value
15727 }
15728 }
15729
15730 unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15731 type Owned = Self;
15732
15733 #[inline(always)]
15734 fn inline_align(_context: fidl::encoding::Context) -> usize {
15735 8
15736 }
15737
15738 #[inline(always)]
15739 fn inline_size(_context: fidl::encoding::Context) -> usize {
15740 16
15741 }
15742 }
15743
15744 unsafe impl
15745 fidl::encoding::Encode<
15746 WifiLegacyHalSelectTxPowerScenarioRequest,
15747 fidl::encoding::DefaultFuchsiaResourceDialect,
15748 > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
15749 {
15750 unsafe fn encode(
15751 self,
15752 encoder: &mut fidl::encoding::Encoder<
15753 '_,
15754 fidl::encoding::DefaultFuchsiaResourceDialect,
15755 >,
15756 offset: usize,
15757 mut depth: fidl::encoding::Depth,
15758 ) -> fidl::Result<()> {
15759 encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
15760 let max_ordinal: u64 = self.max_ordinal_present();
15762 encoder.write_num(max_ordinal, offset);
15763 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15764 if max_ordinal == 0 {
15766 return Ok(());
15767 }
15768 depth.increment()?;
15769 let envelope_size = 8;
15770 let bytes_len = max_ordinal as usize * envelope_size;
15771 #[allow(unused_variables)]
15772 let offset = encoder.out_of_line_offset(bytes_len);
15773 let mut _prev_end_offset: usize = 0;
15774 if 1 > max_ordinal {
15775 return Ok(());
15776 }
15777
15778 let cur_offset: usize = (1 - 1) * envelope_size;
15781
15782 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15784
15785 fidl::encoding::encode_in_envelope_optional::<
15790 WifiLegacyHalTxPowerScenario,
15791 fidl::encoding::DefaultFuchsiaResourceDialect,
15792 >(
15793 self.scenario
15794 .as_ref()
15795 .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
15796 encoder,
15797 offset + cur_offset,
15798 depth,
15799 )?;
15800
15801 _prev_end_offset = cur_offset + envelope_size;
15802
15803 Ok(())
15804 }
15805 }
15806
15807 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15808 for WifiLegacyHalSelectTxPowerScenarioRequest
15809 {
15810 #[inline(always)]
15811 fn new_empty() -> Self {
15812 Self::default()
15813 }
15814
15815 unsafe fn decode(
15816 &mut self,
15817 decoder: &mut fidl::encoding::Decoder<
15818 '_,
15819 fidl::encoding::DefaultFuchsiaResourceDialect,
15820 >,
15821 offset: usize,
15822 mut depth: fidl::encoding::Depth,
15823 ) -> fidl::Result<()> {
15824 decoder.debug_check_bounds::<Self>(offset);
15825 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15826 None => return Err(fidl::Error::NotNullable),
15827 Some(len) => len,
15828 };
15829 if len == 0 {
15831 return Ok(());
15832 };
15833 depth.increment()?;
15834 let envelope_size = 8;
15835 let bytes_len = len * envelope_size;
15836 let offset = decoder.out_of_line_offset(bytes_len)?;
15837 let mut _next_ordinal_to_read = 0;
15839 let mut next_offset = offset;
15840 let end_offset = offset + bytes_len;
15841 _next_ordinal_to_read += 1;
15842 if next_offset >= end_offset {
15843 return Ok(());
15844 }
15845
15846 while _next_ordinal_to_read < 1 {
15848 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15849 _next_ordinal_to_read += 1;
15850 next_offset += envelope_size;
15851 }
15852
15853 let next_out_of_line = decoder.next_out_of_line();
15854 let handles_before = decoder.remaining_handles();
15855 if let Some((inlined, num_bytes, num_handles)) =
15856 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15857 {
15858 let member_inline_size =
15859 <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
15860 decoder.context,
15861 );
15862 if inlined != (member_inline_size <= 4) {
15863 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15864 }
15865 let inner_offset;
15866 let mut inner_depth = depth.clone();
15867 if inlined {
15868 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15869 inner_offset = next_offset;
15870 } else {
15871 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15872 inner_depth.increment()?;
15873 }
15874 let val_ref = self.scenario.get_or_insert_with(|| {
15875 fidl::new_empty!(
15876 WifiLegacyHalTxPowerScenario,
15877 fidl::encoding::DefaultFuchsiaResourceDialect
15878 )
15879 });
15880 fidl::decode!(
15881 WifiLegacyHalTxPowerScenario,
15882 fidl::encoding::DefaultFuchsiaResourceDialect,
15883 val_ref,
15884 decoder,
15885 inner_offset,
15886 inner_depth
15887 )?;
15888 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15889 {
15890 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15891 }
15892 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15893 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15894 }
15895 }
15896
15897 next_offset += envelope_size;
15898
15899 while next_offset < end_offset {
15901 _next_ordinal_to_read += 1;
15902 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15903 next_offset += envelope_size;
15904 }
15905
15906 Ok(())
15907 }
15908 }
15909
15910 impl WifiRegisterEventCallbackRequest {
15911 #[inline(always)]
15912 fn max_ordinal_present(&self) -> u64 {
15913 if let Some(_) = self.callback {
15914 return 1;
15915 }
15916 0
15917 }
15918 }
15919
15920 impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
15921 type Borrowed<'a> = &'a mut Self;
15922 fn take_or_borrow<'a>(
15923 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15924 ) -> Self::Borrowed<'a> {
15925 value
15926 }
15927 }
15928
15929 unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
15930 type Owned = Self;
15931
15932 #[inline(always)]
15933 fn inline_align(_context: fidl::encoding::Context) -> usize {
15934 8
15935 }
15936
15937 #[inline(always)]
15938 fn inline_size(_context: fidl::encoding::Context) -> usize {
15939 16
15940 }
15941 }
15942
15943 unsafe impl
15944 fidl::encoding::Encode<
15945 WifiRegisterEventCallbackRequest,
15946 fidl::encoding::DefaultFuchsiaResourceDialect,
15947 > for &mut WifiRegisterEventCallbackRequest
15948 {
15949 unsafe fn encode(
15950 self,
15951 encoder: &mut fidl::encoding::Encoder<
15952 '_,
15953 fidl::encoding::DefaultFuchsiaResourceDialect,
15954 >,
15955 offset: usize,
15956 mut depth: fidl::encoding::Depth,
15957 ) -> fidl::Result<()> {
15958 encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
15959 let max_ordinal: u64 = self.max_ordinal_present();
15961 encoder.write_num(max_ordinal, offset);
15962 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15963 if max_ordinal == 0 {
15965 return Ok(());
15966 }
15967 depth.increment()?;
15968 let envelope_size = 8;
15969 let bytes_len = max_ordinal as usize * envelope_size;
15970 #[allow(unused_variables)]
15971 let offset = encoder.out_of_line_offset(bytes_len);
15972 let mut _prev_end_offset: usize = 0;
15973 if 1 > max_ordinal {
15974 return Ok(());
15975 }
15976
15977 let cur_offset: usize = (1 - 1) * envelope_size;
15980
15981 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15983
15984 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15989 self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15990 encoder, offset + cur_offset, depth
15991 )?;
15992
15993 _prev_end_offset = cur_offset + envelope_size;
15994
15995 Ok(())
15996 }
15997 }
15998
15999 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16000 for WifiRegisterEventCallbackRequest
16001 {
16002 #[inline(always)]
16003 fn new_empty() -> Self {
16004 Self::default()
16005 }
16006
16007 unsafe fn decode(
16008 &mut self,
16009 decoder: &mut fidl::encoding::Decoder<
16010 '_,
16011 fidl::encoding::DefaultFuchsiaResourceDialect,
16012 >,
16013 offset: usize,
16014 mut depth: fidl::encoding::Depth,
16015 ) -> fidl::Result<()> {
16016 decoder.debug_check_bounds::<Self>(offset);
16017 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16018 None => return Err(fidl::Error::NotNullable),
16019 Some(len) => len,
16020 };
16021 if len == 0 {
16023 return Ok(());
16024 };
16025 depth.increment()?;
16026 let envelope_size = 8;
16027 let bytes_len = len * envelope_size;
16028 let offset = decoder.out_of_line_offset(bytes_len)?;
16029 let mut _next_ordinal_to_read = 0;
16031 let mut next_offset = offset;
16032 let end_offset = offset + bytes_len;
16033 _next_ordinal_to_read += 1;
16034 if next_offset >= end_offset {
16035 return Ok(());
16036 }
16037
16038 while _next_ordinal_to_read < 1 {
16040 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16041 _next_ordinal_to_read += 1;
16042 next_offset += envelope_size;
16043 }
16044
16045 let next_out_of_line = decoder.next_out_of_line();
16046 let handles_before = decoder.remaining_handles();
16047 if let Some((inlined, num_bytes, num_handles)) =
16048 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16049 {
16050 let member_inline_size = <fidl::encoding::Endpoint<
16051 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
16052 > as fidl::encoding::TypeMarker>::inline_size(
16053 decoder.context
16054 );
16055 if inlined != (member_inline_size <= 4) {
16056 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16057 }
16058 let inner_offset;
16059 let mut inner_depth = depth.clone();
16060 if inlined {
16061 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16062 inner_offset = next_offset;
16063 } else {
16064 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16065 inner_depth.increment()?;
16066 }
16067 let val_ref = self.callback.get_or_insert_with(|| {
16068 fidl::new_empty!(
16069 fidl::encoding::Endpoint<
16070 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
16071 >,
16072 fidl::encoding::DefaultFuchsiaResourceDialect
16073 )
16074 });
16075 fidl::decode!(
16076 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
16077 fidl::encoding::DefaultFuchsiaResourceDialect,
16078 val_ref,
16079 decoder,
16080 inner_offset,
16081 inner_depth
16082 )?;
16083 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16084 {
16085 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16086 }
16087 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16088 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16089 }
16090 }
16091
16092 next_offset += envelope_size;
16093
16094 while next_offset < end_offset {
16096 _next_ordinal_to_read += 1;
16097 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16098 next_offset += envelope_size;
16099 }
16100
16101 Ok(())
16102 }
16103 }
16104
16105 impl WifiStaIfaceSetScanOnlyModeRequest {
16106 #[inline(always)]
16107 fn max_ordinal_present(&self) -> u64 {
16108 if let Some(_) = self.enable {
16109 return 1;
16110 }
16111 0
16112 }
16113 }
16114
16115 impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
16116 type Borrowed<'a> = &'a mut Self;
16117 fn take_or_borrow<'a>(
16118 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16119 ) -> Self::Borrowed<'a> {
16120 value
16121 }
16122 }
16123
16124 unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
16125 type Owned = Self;
16126
16127 #[inline(always)]
16128 fn inline_align(_context: fidl::encoding::Context) -> usize {
16129 8
16130 }
16131
16132 #[inline(always)]
16133 fn inline_size(_context: fidl::encoding::Context) -> usize {
16134 16
16135 }
16136 }
16137
16138 unsafe impl
16139 fidl::encoding::Encode<
16140 WifiStaIfaceSetScanOnlyModeRequest,
16141 fidl::encoding::DefaultFuchsiaResourceDialect,
16142 > for &mut WifiStaIfaceSetScanOnlyModeRequest
16143 {
16144 unsafe fn encode(
16145 self,
16146 encoder: &mut fidl::encoding::Encoder<
16147 '_,
16148 fidl::encoding::DefaultFuchsiaResourceDialect,
16149 >,
16150 offset: usize,
16151 mut depth: fidl::encoding::Depth,
16152 ) -> fidl::Result<()> {
16153 encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
16154 let max_ordinal: u64 = self.max_ordinal_present();
16156 encoder.write_num(max_ordinal, offset);
16157 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16158 if max_ordinal == 0 {
16160 return Ok(());
16161 }
16162 depth.increment()?;
16163 let envelope_size = 8;
16164 let bytes_len = max_ordinal as usize * envelope_size;
16165 #[allow(unused_variables)]
16166 let offset = encoder.out_of_line_offset(bytes_len);
16167 let mut _prev_end_offset: usize = 0;
16168 if 1 > max_ordinal {
16169 return Ok(());
16170 }
16171
16172 let cur_offset: usize = (1 - 1) * envelope_size;
16175
16176 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16178
16179 fidl::encoding::encode_in_envelope_optional::<
16184 bool,
16185 fidl::encoding::DefaultFuchsiaResourceDialect,
16186 >(
16187 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
16188 encoder,
16189 offset + cur_offset,
16190 depth,
16191 )?;
16192
16193 _prev_end_offset = cur_offset + envelope_size;
16194
16195 Ok(())
16196 }
16197 }
16198
16199 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16200 for WifiStaIfaceSetScanOnlyModeRequest
16201 {
16202 #[inline(always)]
16203 fn new_empty() -> Self {
16204 Self::default()
16205 }
16206
16207 unsafe fn decode(
16208 &mut self,
16209 decoder: &mut fidl::encoding::Decoder<
16210 '_,
16211 fidl::encoding::DefaultFuchsiaResourceDialect,
16212 >,
16213 offset: usize,
16214 mut depth: fidl::encoding::Depth,
16215 ) -> fidl::Result<()> {
16216 decoder.debug_check_bounds::<Self>(offset);
16217 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16218 None => return Err(fidl::Error::NotNullable),
16219 Some(len) => len,
16220 };
16221 if len == 0 {
16223 return Ok(());
16224 };
16225 depth.increment()?;
16226 let envelope_size = 8;
16227 let bytes_len = len * envelope_size;
16228 let offset = decoder.out_of_line_offset(bytes_len)?;
16229 let mut _next_ordinal_to_read = 0;
16231 let mut next_offset = offset;
16232 let end_offset = offset + bytes_len;
16233 _next_ordinal_to_read += 1;
16234 if next_offset >= end_offset {
16235 return Ok(());
16236 }
16237
16238 while _next_ordinal_to_read < 1 {
16240 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16241 _next_ordinal_to_read += 1;
16242 next_offset += envelope_size;
16243 }
16244
16245 let next_out_of_line = decoder.next_out_of_line();
16246 let handles_before = decoder.remaining_handles();
16247 if let Some((inlined, num_bytes, num_handles)) =
16248 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16249 {
16250 let member_inline_size =
16251 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16252 if inlined != (member_inline_size <= 4) {
16253 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16254 }
16255 let inner_offset;
16256 let mut inner_depth = depth.clone();
16257 if inlined {
16258 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16259 inner_offset = next_offset;
16260 } else {
16261 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16262 inner_depth.increment()?;
16263 }
16264 let val_ref = self.enable.get_or_insert_with(|| {
16265 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
16266 });
16267 fidl::decode!(
16268 bool,
16269 fidl::encoding::DefaultFuchsiaResourceDialect,
16270 val_ref,
16271 decoder,
16272 inner_offset,
16273 inner_depth
16274 )?;
16275 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16276 {
16277 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16278 }
16279 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16280 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16281 }
16282 }
16283
16284 next_offset += envelope_size;
16285
16286 while next_offset < end_offset {
16288 _next_ordinal_to_read += 1;
16289 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16290 next_offset += envelope_size;
16291 }
16292
16293 Ok(())
16294 }
16295 }
16296
16297 impl WlanixGetNl80211Request {
16298 #[inline(always)]
16299 fn max_ordinal_present(&self) -> u64 {
16300 if let Some(_) = self.nl80211 {
16301 return 1;
16302 }
16303 0
16304 }
16305 }
16306
16307 impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
16308 type Borrowed<'a> = &'a mut Self;
16309 fn take_or_borrow<'a>(
16310 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16311 ) -> Self::Borrowed<'a> {
16312 value
16313 }
16314 }
16315
16316 unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
16317 type Owned = Self;
16318
16319 #[inline(always)]
16320 fn inline_align(_context: fidl::encoding::Context) -> usize {
16321 8
16322 }
16323
16324 #[inline(always)]
16325 fn inline_size(_context: fidl::encoding::Context) -> usize {
16326 16
16327 }
16328 }
16329
16330 unsafe impl
16331 fidl::encoding::Encode<
16332 WlanixGetNl80211Request,
16333 fidl::encoding::DefaultFuchsiaResourceDialect,
16334 > for &mut WlanixGetNl80211Request
16335 {
16336 unsafe fn encode(
16337 self,
16338 encoder: &mut fidl::encoding::Encoder<
16339 '_,
16340 fidl::encoding::DefaultFuchsiaResourceDialect,
16341 >,
16342 offset: usize,
16343 mut depth: fidl::encoding::Depth,
16344 ) -> fidl::Result<()> {
16345 encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
16346 let max_ordinal: u64 = self.max_ordinal_present();
16348 encoder.write_num(max_ordinal, offset);
16349 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16350 if max_ordinal == 0 {
16352 return Ok(());
16353 }
16354 depth.increment()?;
16355 let envelope_size = 8;
16356 let bytes_len = max_ordinal as usize * envelope_size;
16357 #[allow(unused_variables)]
16358 let offset = encoder.out_of_line_offset(bytes_len);
16359 let mut _prev_end_offset: usize = 0;
16360 if 1 > max_ordinal {
16361 return Ok(());
16362 }
16363
16364 let cur_offset: usize = (1 - 1) * envelope_size;
16367
16368 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16370
16371 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16376 self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16377 encoder, offset + cur_offset, depth
16378 )?;
16379
16380 _prev_end_offset = cur_offset + envelope_size;
16381
16382 Ok(())
16383 }
16384 }
16385
16386 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16387 for WlanixGetNl80211Request
16388 {
16389 #[inline(always)]
16390 fn new_empty() -> Self {
16391 Self::default()
16392 }
16393
16394 unsafe fn decode(
16395 &mut self,
16396 decoder: &mut fidl::encoding::Decoder<
16397 '_,
16398 fidl::encoding::DefaultFuchsiaResourceDialect,
16399 >,
16400 offset: usize,
16401 mut depth: fidl::encoding::Depth,
16402 ) -> fidl::Result<()> {
16403 decoder.debug_check_bounds::<Self>(offset);
16404 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16405 None => return Err(fidl::Error::NotNullable),
16406 Some(len) => len,
16407 };
16408 if len == 0 {
16410 return Ok(());
16411 };
16412 depth.increment()?;
16413 let envelope_size = 8;
16414 let bytes_len = len * envelope_size;
16415 let offset = decoder.out_of_line_offset(bytes_len)?;
16416 let mut _next_ordinal_to_read = 0;
16418 let mut next_offset = offset;
16419 let end_offset = offset + bytes_len;
16420 _next_ordinal_to_read += 1;
16421 if next_offset >= end_offset {
16422 return Ok(());
16423 }
16424
16425 while _next_ordinal_to_read < 1 {
16427 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16428 _next_ordinal_to_read += 1;
16429 next_offset += envelope_size;
16430 }
16431
16432 let next_out_of_line = decoder.next_out_of_line();
16433 let handles_before = decoder.remaining_handles();
16434 if let Some((inlined, num_bytes, num_handles)) =
16435 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16436 {
16437 let member_inline_size = <fidl::encoding::Endpoint<
16438 fidl::endpoints::ServerEnd<Nl80211Marker>,
16439 > as fidl::encoding::TypeMarker>::inline_size(
16440 decoder.context
16441 );
16442 if inlined != (member_inline_size <= 4) {
16443 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16444 }
16445 let inner_offset;
16446 let mut inner_depth = depth.clone();
16447 if inlined {
16448 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16449 inner_offset = next_offset;
16450 } else {
16451 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16452 inner_depth.increment()?;
16453 }
16454 let val_ref = self.nl80211.get_or_insert_with(|| {
16455 fidl::new_empty!(
16456 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16457 fidl::encoding::DefaultFuchsiaResourceDialect
16458 )
16459 });
16460 fidl::decode!(
16461 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16462 fidl::encoding::DefaultFuchsiaResourceDialect,
16463 val_ref,
16464 decoder,
16465 inner_offset,
16466 inner_depth
16467 )?;
16468 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16469 {
16470 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16471 }
16472 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16473 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16474 }
16475 }
16476
16477 next_offset += envelope_size;
16478
16479 while next_offset < end_offset {
16481 _next_ordinal_to_read += 1;
16482 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16483 next_offset += envelope_size;
16484 }
16485
16486 Ok(())
16487 }
16488 }
16489
16490 impl WlanixGetSupplicantRequest {
16491 #[inline(always)]
16492 fn max_ordinal_present(&self) -> u64 {
16493 if let Some(_) = self.supplicant {
16494 return 1;
16495 }
16496 0
16497 }
16498 }
16499
16500 impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
16501 type Borrowed<'a> = &'a mut Self;
16502 fn take_or_borrow<'a>(
16503 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16504 ) -> Self::Borrowed<'a> {
16505 value
16506 }
16507 }
16508
16509 unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
16510 type Owned = Self;
16511
16512 #[inline(always)]
16513 fn inline_align(_context: fidl::encoding::Context) -> usize {
16514 8
16515 }
16516
16517 #[inline(always)]
16518 fn inline_size(_context: fidl::encoding::Context) -> usize {
16519 16
16520 }
16521 }
16522
16523 unsafe impl
16524 fidl::encoding::Encode<
16525 WlanixGetSupplicantRequest,
16526 fidl::encoding::DefaultFuchsiaResourceDialect,
16527 > for &mut WlanixGetSupplicantRequest
16528 {
16529 unsafe fn encode(
16530 self,
16531 encoder: &mut fidl::encoding::Encoder<
16532 '_,
16533 fidl::encoding::DefaultFuchsiaResourceDialect,
16534 >,
16535 offset: usize,
16536 mut depth: fidl::encoding::Depth,
16537 ) -> fidl::Result<()> {
16538 encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
16539 let max_ordinal: u64 = self.max_ordinal_present();
16541 encoder.write_num(max_ordinal, offset);
16542 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16543 if max_ordinal == 0 {
16545 return Ok(());
16546 }
16547 depth.increment()?;
16548 let envelope_size = 8;
16549 let bytes_len = max_ordinal as usize * envelope_size;
16550 #[allow(unused_variables)]
16551 let offset = encoder.out_of_line_offset(bytes_len);
16552 let mut _prev_end_offset: usize = 0;
16553 if 1 > max_ordinal {
16554 return Ok(());
16555 }
16556
16557 let cur_offset: usize = (1 - 1) * envelope_size;
16560
16561 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16563
16564 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16569 self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16570 encoder, offset + cur_offset, depth
16571 )?;
16572
16573 _prev_end_offset = cur_offset + envelope_size;
16574
16575 Ok(())
16576 }
16577 }
16578
16579 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16580 for WlanixGetSupplicantRequest
16581 {
16582 #[inline(always)]
16583 fn new_empty() -> Self {
16584 Self::default()
16585 }
16586
16587 unsafe fn decode(
16588 &mut self,
16589 decoder: &mut fidl::encoding::Decoder<
16590 '_,
16591 fidl::encoding::DefaultFuchsiaResourceDialect,
16592 >,
16593 offset: usize,
16594 mut depth: fidl::encoding::Depth,
16595 ) -> fidl::Result<()> {
16596 decoder.debug_check_bounds::<Self>(offset);
16597 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16598 None => return Err(fidl::Error::NotNullable),
16599 Some(len) => len,
16600 };
16601 if len == 0 {
16603 return Ok(());
16604 };
16605 depth.increment()?;
16606 let envelope_size = 8;
16607 let bytes_len = len * envelope_size;
16608 let offset = decoder.out_of_line_offset(bytes_len)?;
16609 let mut _next_ordinal_to_read = 0;
16611 let mut next_offset = offset;
16612 let end_offset = offset + bytes_len;
16613 _next_ordinal_to_read += 1;
16614 if next_offset >= end_offset {
16615 return Ok(());
16616 }
16617
16618 while _next_ordinal_to_read < 1 {
16620 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16621 _next_ordinal_to_read += 1;
16622 next_offset += envelope_size;
16623 }
16624
16625 let next_out_of_line = decoder.next_out_of_line();
16626 let handles_before = decoder.remaining_handles();
16627 if let Some((inlined, num_bytes, num_handles)) =
16628 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16629 {
16630 let member_inline_size = <fidl::encoding::Endpoint<
16631 fidl::endpoints::ServerEnd<SupplicantMarker>,
16632 > as fidl::encoding::TypeMarker>::inline_size(
16633 decoder.context
16634 );
16635 if inlined != (member_inline_size <= 4) {
16636 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16637 }
16638 let inner_offset;
16639 let mut inner_depth = depth.clone();
16640 if inlined {
16641 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16642 inner_offset = next_offset;
16643 } else {
16644 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16645 inner_depth.increment()?;
16646 }
16647 let val_ref = self.supplicant.get_or_insert_with(|| {
16648 fidl::new_empty!(
16649 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16650 fidl::encoding::DefaultFuchsiaResourceDialect
16651 )
16652 });
16653 fidl::decode!(
16654 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16655 fidl::encoding::DefaultFuchsiaResourceDialect,
16656 val_ref,
16657 decoder,
16658 inner_offset,
16659 inner_depth
16660 )?;
16661 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16662 {
16663 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16664 }
16665 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16666 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16667 }
16668 }
16669
16670 next_offset += envelope_size;
16671
16672 while next_offset < end_offset {
16674 _next_ordinal_to_read += 1;
16675 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16676 next_offset += envelope_size;
16677 }
16678
16679 Ok(())
16680 }
16681 }
16682
16683 impl WlanixGetWifiLegacyHalRequest {
16684 #[inline(always)]
16685 fn max_ordinal_present(&self) -> u64 {
16686 if let Some(_) = self.legacy_hal {
16687 return 1;
16688 }
16689 0
16690 }
16691 }
16692
16693 impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
16694 type Borrowed<'a> = &'a mut Self;
16695 fn take_or_borrow<'a>(
16696 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16697 ) -> Self::Borrowed<'a> {
16698 value
16699 }
16700 }
16701
16702 unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
16703 type Owned = Self;
16704
16705 #[inline(always)]
16706 fn inline_align(_context: fidl::encoding::Context) -> usize {
16707 8
16708 }
16709
16710 #[inline(always)]
16711 fn inline_size(_context: fidl::encoding::Context) -> usize {
16712 16
16713 }
16714 }
16715
16716 unsafe impl
16717 fidl::encoding::Encode<
16718 WlanixGetWifiLegacyHalRequest,
16719 fidl::encoding::DefaultFuchsiaResourceDialect,
16720 > for &mut WlanixGetWifiLegacyHalRequest
16721 {
16722 unsafe fn encode(
16723 self,
16724 encoder: &mut fidl::encoding::Encoder<
16725 '_,
16726 fidl::encoding::DefaultFuchsiaResourceDialect,
16727 >,
16728 offset: usize,
16729 mut depth: fidl::encoding::Depth,
16730 ) -> fidl::Result<()> {
16731 encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
16732 let max_ordinal: u64 = self.max_ordinal_present();
16734 encoder.write_num(max_ordinal, offset);
16735 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16736 if max_ordinal == 0 {
16738 return Ok(());
16739 }
16740 depth.increment()?;
16741 let envelope_size = 8;
16742 let bytes_len = max_ordinal as usize * envelope_size;
16743 #[allow(unused_variables)]
16744 let offset = encoder.out_of_line_offset(bytes_len);
16745 let mut _prev_end_offset: usize = 0;
16746 if 1 > max_ordinal {
16747 return Ok(());
16748 }
16749
16750 let cur_offset: usize = (1 - 1) * envelope_size;
16753
16754 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16756
16757 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16762 self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16763 encoder, offset + cur_offset, depth
16764 )?;
16765
16766 _prev_end_offset = cur_offset + envelope_size;
16767
16768 Ok(())
16769 }
16770 }
16771
16772 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16773 for WlanixGetWifiLegacyHalRequest
16774 {
16775 #[inline(always)]
16776 fn new_empty() -> Self {
16777 Self::default()
16778 }
16779
16780 unsafe fn decode(
16781 &mut self,
16782 decoder: &mut fidl::encoding::Decoder<
16783 '_,
16784 fidl::encoding::DefaultFuchsiaResourceDialect,
16785 >,
16786 offset: usize,
16787 mut depth: fidl::encoding::Depth,
16788 ) -> fidl::Result<()> {
16789 decoder.debug_check_bounds::<Self>(offset);
16790 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16791 None => return Err(fidl::Error::NotNullable),
16792 Some(len) => len,
16793 };
16794 if len == 0 {
16796 return Ok(());
16797 };
16798 depth.increment()?;
16799 let envelope_size = 8;
16800 let bytes_len = len * envelope_size;
16801 let offset = decoder.out_of_line_offset(bytes_len)?;
16802 let mut _next_ordinal_to_read = 0;
16804 let mut next_offset = offset;
16805 let end_offset = offset + bytes_len;
16806 _next_ordinal_to_read += 1;
16807 if next_offset >= end_offset {
16808 return Ok(());
16809 }
16810
16811 while _next_ordinal_to_read < 1 {
16813 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16814 _next_ordinal_to_read += 1;
16815 next_offset += envelope_size;
16816 }
16817
16818 let next_out_of_line = decoder.next_out_of_line();
16819 let handles_before = decoder.remaining_handles();
16820 if let Some((inlined, num_bytes, num_handles)) =
16821 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16822 {
16823 let member_inline_size = <fidl::encoding::Endpoint<
16824 fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
16825 > as fidl::encoding::TypeMarker>::inline_size(
16826 decoder.context
16827 );
16828 if inlined != (member_inline_size <= 4) {
16829 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16830 }
16831 let inner_offset;
16832 let mut inner_depth = depth.clone();
16833 if inlined {
16834 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16835 inner_offset = next_offset;
16836 } else {
16837 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16838 inner_depth.increment()?;
16839 }
16840 let val_ref = self.legacy_hal.get_or_insert_with(|| {
16841 fidl::new_empty!(
16842 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16843 fidl::encoding::DefaultFuchsiaResourceDialect
16844 )
16845 });
16846 fidl::decode!(
16847 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16848 fidl::encoding::DefaultFuchsiaResourceDialect,
16849 val_ref,
16850 decoder,
16851 inner_offset,
16852 inner_depth
16853 )?;
16854 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16855 {
16856 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16857 }
16858 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16859 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16860 }
16861 }
16862
16863 next_offset += envelope_size;
16864
16865 while next_offset < end_offset {
16867 _next_ordinal_to_read += 1;
16868 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16869 next_offset += envelope_size;
16870 }
16871
16872 Ok(())
16873 }
16874 }
16875
16876 impl WlanixGetWifiRequest {
16877 #[inline(always)]
16878 fn max_ordinal_present(&self) -> u64 {
16879 if let Some(_) = self.wifi {
16880 return 1;
16881 }
16882 0
16883 }
16884 }
16885
16886 impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
16887 type Borrowed<'a> = &'a mut Self;
16888 fn take_or_borrow<'a>(
16889 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16890 ) -> Self::Borrowed<'a> {
16891 value
16892 }
16893 }
16894
16895 unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
16896 type Owned = Self;
16897
16898 #[inline(always)]
16899 fn inline_align(_context: fidl::encoding::Context) -> usize {
16900 8
16901 }
16902
16903 #[inline(always)]
16904 fn inline_size(_context: fidl::encoding::Context) -> usize {
16905 16
16906 }
16907 }
16908
16909 unsafe impl
16910 fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
16911 for &mut WlanixGetWifiRequest
16912 {
16913 unsafe fn encode(
16914 self,
16915 encoder: &mut fidl::encoding::Encoder<
16916 '_,
16917 fidl::encoding::DefaultFuchsiaResourceDialect,
16918 >,
16919 offset: usize,
16920 mut depth: fidl::encoding::Depth,
16921 ) -> fidl::Result<()> {
16922 encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
16923 let max_ordinal: u64 = self.max_ordinal_present();
16925 encoder.write_num(max_ordinal, offset);
16926 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16927 if max_ordinal == 0 {
16929 return Ok(());
16930 }
16931 depth.increment()?;
16932 let envelope_size = 8;
16933 let bytes_len = max_ordinal as usize * envelope_size;
16934 #[allow(unused_variables)]
16935 let offset = encoder.out_of_line_offset(bytes_len);
16936 let mut _prev_end_offset: usize = 0;
16937 if 1 > max_ordinal {
16938 return Ok(());
16939 }
16940
16941 let cur_offset: usize = (1 - 1) * envelope_size;
16944
16945 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16947
16948 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16953 self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16954 encoder, offset + cur_offset, depth
16955 )?;
16956
16957 _prev_end_offset = cur_offset + envelope_size;
16958
16959 Ok(())
16960 }
16961 }
16962
16963 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16964 for WlanixGetWifiRequest
16965 {
16966 #[inline(always)]
16967 fn new_empty() -> Self {
16968 Self::default()
16969 }
16970
16971 unsafe fn decode(
16972 &mut self,
16973 decoder: &mut fidl::encoding::Decoder<
16974 '_,
16975 fidl::encoding::DefaultFuchsiaResourceDialect,
16976 >,
16977 offset: usize,
16978 mut depth: fidl::encoding::Depth,
16979 ) -> fidl::Result<()> {
16980 decoder.debug_check_bounds::<Self>(offset);
16981 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16982 None => return Err(fidl::Error::NotNullable),
16983 Some(len) => len,
16984 };
16985 if len == 0 {
16987 return Ok(());
16988 };
16989 depth.increment()?;
16990 let envelope_size = 8;
16991 let bytes_len = len * envelope_size;
16992 let offset = decoder.out_of_line_offset(bytes_len)?;
16993 let mut _next_ordinal_to_read = 0;
16995 let mut next_offset = offset;
16996 let end_offset = offset + bytes_len;
16997 _next_ordinal_to_read += 1;
16998 if next_offset >= end_offset {
16999 return Ok(());
17000 }
17001
17002 while _next_ordinal_to_read < 1 {
17004 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17005 _next_ordinal_to_read += 1;
17006 next_offset += envelope_size;
17007 }
17008
17009 let next_out_of_line = decoder.next_out_of_line();
17010 let handles_before = decoder.remaining_handles();
17011 if let Some((inlined, num_bytes, num_handles)) =
17012 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17013 {
17014 let member_inline_size = <fidl::encoding::Endpoint<
17015 fidl::endpoints::ServerEnd<WifiMarker>,
17016 > as fidl::encoding::TypeMarker>::inline_size(
17017 decoder.context
17018 );
17019 if inlined != (member_inline_size <= 4) {
17020 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17021 }
17022 let inner_offset;
17023 let mut inner_depth = depth.clone();
17024 if inlined {
17025 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17026 inner_offset = next_offset;
17027 } else {
17028 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17029 inner_depth.increment()?;
17030 }
17031 let val_ref = self.wifi.get_or_insert_with(|| {
17032 fidl::new_empty!(
17033 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
17034 fidl::encoding::DefaultFuchsiaResourceDialect
17035 )
17036 });
17037 fidl::decode!(
17038 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
17039 fidl::encoding::DefaultFuchsiaResourceDialect,
17040 val_ref,
17041 decoder,
17042 inner_offset,
17043 inner_depth
17044 )?;
17045 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17046 {
17047 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17048 }
17049 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17050 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17051 }
17052 }
17053
17054 next_offset += envelope_size;
17055
17056 while next_offset < end_offset {
17058 _next_ordinal_to_read += 1;
17059 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17060 next_offset += envelope_size;
17061 }
17062
17063 Ok(())
17064 }
17065 }
17066}