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>;
1937
1938pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1939 fn r#register_callback(
1940 &self,
1941 payload: SupplicantStaIfaceRegisterCallbackRequest,
1942 ) -> Result<(), fidl::Error>;
1943 fn r#add_network(
1944 &self,
1945 payload: SupplicantStaIfaceAddNetworkRequest,
1946 ) -> Result<(), fidl::Error>;
1947 type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1948 fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1949 type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1950 + Send;
1951 fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1952 type GetFactoryMacAddressResponseFut: std::future::Future<
1953 Output = Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error>,
1954 > + Send;
1955 fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut;
1956 type SetBtCoexistenceModeResponseFut: std::future::Future<
1957 Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1958 > + Send;
1959 fn r#set_bt_coexistence_mode(
1960 &self,
1961 payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1962 ) -> Self::SetBtCoexistenceModeResponseFut;
1963 type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1964 fn r#set_power_save(
1965 &self,
1966 payload: SupplicantStaIfaceSetPowerSaveRequest,
1967 ) -> Self::SetPowerSaveResponseFut;
1968 type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1969 + Send;
1970 fn r#set_suspend_mode_enabled(
1971 &self,
1972 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1973 ) -> Self::SetSuspendModeEnabledResponseFut;
1974 type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1975 + Send;
1976 fn r#set_sta_country_code(
1977 &self,
1978 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1979 ) -> Self::SetStaCountryCodeResponseFut;
1980}
1981#[derive(Debug)]
1982#[cfg(target_os = "fuchsia")]
1983pub struct SupplicantStaIfaceSynchronousProxy {
1984 client: fidl::client::sync::Client,
1985}
1986
1987#[cfg(target_os = "fuchsia")]
1988impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1989 type Proxy = SupplicantStaIfaceProxy;
1990 type Protocol = SupplicantStaIfaceMarker;
1991
1992 fn from_channel(inner: fidl::Channel) -> Self {
1993 Self::new(inner)
1994 }
1995
1996 fn into_channel(self) -> fidl::Channel {
1997 self.client.into_channel()
1998 }
1999
2000 fn as_channel(&self) -> &fidl::Channel {
2001 self.client.as_channel()
2002 }
2003}
2004
2005#[cfg(target_os = "fuchsia")]
2006impl SupplicantStaIfaceSynchronousProxy {
2007 pub fn new(channel: fidl::Channel) -> Self {
2008 Self { client: fidl::client::sync::Client::new(channel) }
2009 }
2010
2011 pub fn into_channel(self) -> fidl::Channel {
2012 self.client.into_channel()
2013 }
2014
2015 pub fn wait_for_event(
2018 &self,
2019 deadline: zx::MonotonicInstant,
2020 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2021 SupplicantStaIfaceEvent::decode(
2022 self.client.wait_for_event::<SupplicantStaIfaceMarker>(deadline)?,
2023 )
2024 }
2025
2026 pub fn r#register_callback(
2027 &self,
2028 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2029 ) -> Result<(), fidl::Error> {
2030 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2031 &mut payload,
2032 0x1be680e863a8e71,
2033 fidl::encoding::DynamicFlags::FLEXIBLE,
2034 )
2035 }
2036
2037 pub fn r#add_network(
2038 &self,
2039 mut payload: SupplicantStaIfaceAddNetworkRequest,
2040 ) -> Result<(), fidl::Error> {
2041 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2042 &mut payload,
2043 0xa77cf60628766dc,
2044 fidl::encoding::DynamicFlags::FLEXIBLE,
2045 )
2046 }
2047
2048 pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2049 let _response = self.client.send_query::<
2050 fidl::encoding::EmptyPayload,
2051 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2052 SupplicantStaIfaceMarker,
2053 >(
2054 (),
2055 0x52a1d38e0b4871fa,
2056 fidl::encoding::DynamicFlags::FLEXIBLE,
2057 ___deadline,
2058 )?
2059 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2060 Ok(_response)
2061 }
2062
2063 pub fn r#get_mac_address(
2064 &self,
2065 ___deadline: zx::MonotonicInstant,
2066 ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2067 let _response = self.client.send_query::<
2068 fidl::encoding::EmptyPayload,
2069 fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2070 SupplicantStaIfaceMarker,
2071 >(
2072 (),
2073 0x60591d204a3f537f,
2074 fidl::encoding::DynamicFlags::FLEXIBLE,
2075 ___deadline,
2076 )?
2077 .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2078 Ok(_response.map(|x| x))
2079 }
2080
2081 pub fn r#get_factory_mac_address(
2082 &self,
2083 ___deadline: zx::MonotonicInstant,
2084 ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2085 let _response =
2086 self.client
2087 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2088 SupplicantStaIfaceGetFactoryMacAddressResponse,
2089 i32,
2090 >, SupplicantStaIfaceMarker>(
2091 (),
2092 0x58857179ad71e624,
2093 fidl::encoding::DynamicFlags::FLEXIBLE,
2094 ___deadline,
2095 )?
2096 .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2097 Ok(_response.map(|x| x.mac_addr))
2098 }
2099
2100 pub fn r#set_bt_coexistence_mode(
2101 &self,
2102 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2103 ___deadline: zx::MonotonicInstant,
2104 ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2105 let _response = self.client.send_query::<
2106 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2107 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2108 SupplicantStaIfaceMarker,
2109 >(
2110 payload,
2111 0x14567ff593a9b154,
2112 fidl::encoding::DynamicFlags::FLEXIBLE,
2113 ___deadline,
2114 )?
2115 .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2116 Ok(_response.map(|x| x))
2117 }
2118
2119 pub fn r#set_power_save(
2120 &self,
2121 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2122 ___deadline: zx::MonotonicInstant,
2123 ) -> Result<(), fidl::Error> {
2124 let _response = self.client.send_query::<
2125 SupplicantStaIfaceSetPowerSaveRequest,
2126 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2127 SupplicantStaIfaceMarker,
2128 >(
2129 &mut payload,
2130 0x5a04c29320085298,
2131 fidl::encoding::DynamicFlags::FLEXIBLE,
2132 ___deadline,
2133 )?
2134 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2135 Ok(_response)
2136 }
2137
2138 pub fn r#set_suspend_mode_enabled(
2139 &self,
2140 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2141 ___deadline: zx::MonotonicInstant,
2142 ) -> Result<(), fidl::Error> {
2143 let _response = self.client.send_query::<
2144 SupplicantStaIfaceSetSuspendModeEnabledRequest,
2145 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2146 SupplicantStaIfaceMarker,
2147 >(
2148 &mut payload,
2149 0xaf10de85bb7023a,
2150 fidl::encoding::DynamicFlags::FLEXIBLE,
2151 ___deadline,
2152 )?
2153 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2154 Ok(_response)
2155 }
2156
2157 pub fn r#set_sta_country_code(
2158 &self,
2159 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2160 ___deadline: zx::MonotonicInstant,
2161 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2162 let _response = self.client.send_query::<
2163 SupplicantStaIfaceSetStaCountryCodeRequest,
2164 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2165 SupplicantStaIfaceMarker,
2166 >(
2167 &mut payload,
2168 0x977e22f9b79b26e,
2169 fidl::encoding::DynamicFlags::FLEXIBLE,
2170 ___deadline,
2171 )?
2172 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2173 Ok(_response.map(|x| x))
2174 }
2175}
2176
2177#[cfg(target_os = "fuchsia")]
2178impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2179 fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2180 value.into_channel().into()
2181 }
2182}
2183
2184#[cfg(target_os = "fuchsia")]
2185impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2186 fn from(value: fidl::Channel) -> Self {
2187 Self::new(value)
2188 }
2189}
2190
2191#[cfg(target_os = "fuchsia")]
2192impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2193 type Protocol = SupplicantStaIfaceMarker;
2194
2195 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2196 Self::new(value.into_channel())
2197 }
2198}
2199
2200#[derive(Debug, Clone)]
2201pub struct SupplicantStaIfaceProxy {
2202 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2203}
2204
2205impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2206 type Protocol = SupplicantStaIfaceMarker;
2207
2208 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2209 Self::new(inner)
2210 }
2211
2212 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2213 self.client.into_channel().map_err(|client| Self { client })
2214 }
2215
2216 fn as_channel(&self) -> &::fidl::AsyncChannel {
2217 self.client.as_channel()
2218 }
2219}
2220
2221impl SupplicantStaIfaceProxy {
2222 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2224 let protocol_name =
2225 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2226 Self { client: fidl::client::Client::new(channel, protocol_name) }
2227 }
2228
2229 pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2235 SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2236 }
2237
2238 pub fn r#register_callback(
2239 &self,
2240 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2241 ) -> Result<(), fidl::Error> {
2242 SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2243 }
2244
2245 pub fn r#add_network(
2246 &self,
2247 mut payload: SupplicantStaIfaceAddNetworkRequest,
2248 ) -> Result<(), fidl::Error> {
2249 SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2250 }
2251
2252 pub fn r#disconnect(
2253 &self,
2254 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2255 SupplicantStaIfaceProxyInterface::r#disconnect(self)
2256 }
2257
2258 pub fn r#get_mac_address(
2259 &self,
2260 ) -> fidl::client::QueryResponseFut<
2261 SupplicantStaIfaceGetMacAddressResult,
2262 fidl::encoding::DefaultFuchsiaResourceDialect,
2263 > {
2264 SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2265 }
2266
2267 pub fn r#get_factory_mac_address(
2268 &self,
2269 ) -> fidl::client::QueryResponseFut<
2270 SupplicantStaIfaceGetFactoryMacAddressResult,
2271 fidl::encoding::DefaultFuchsiaResourceDialect,
2272 > {
2273 SupplicantStaIfaceProxyInterface::r#get_factory_mac_address(self)
2274 }
2275
2276 pub fn r#set_bt_coexistence_mode(
2277 &self,
2278 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2279 ) -> fidl::client::QueryResponseFut<
2280 SupplicantStaIfaceSetBtCoexistenceModeResult,
2281 fidl::encoding::DefaultFuchsiaResourceDialect,
2282 > {
2283 SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2284 }
2285
2286 pub fn r#set_power_save(
2287 &self,
2288 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2289 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2290 SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2291 }
2292
2293 pub fn r#set_suspend_mode_enabled(
2294 &self,
2295 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2296 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2297 SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2298 }
2299
2300 pub fn r#set_sta_country_code(
2301 &self,
2302 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2303 ) -> fidl::client::QueryResponseFut<
2304 SupplicantStaIfaceSetStaCountryCodeResult,
2305 fidl::encoding::DefaultFuchsiaResourceDialect,
2306 > {
2307 SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2308 }
2309}
2310
2311impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2312 fn r#register_callback(
2313 &self,
2314 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2315 ) -> Result<(), fidl::Error> {
2316 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2317 &mut payload,
2318 0x1be680e863a8e71,
2319 fidl::encoding::DynamicFlags::FLEXIBLE,
2320 )
2321 }
2322
2323 fn r#add_network(
2324 &self,
2325 mut payload: SupplicantStaIfaceAddNetworkRequest,
2326 ) -> Result<(), fidl::Error> {
2327 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2328 &mut payload,
2329 0xa77cf60628766dc,
2330 fidl::encoding::DynamicFlags::FLEXIBLE,
2331 )
2332 }
2333
2334 type DisconnectResponseFut =
2335 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2336 fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2337 fn _decode(
2338 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2339 ) -> Result<(), fidl::Error> {
2340 let _response = fidl::client::decode_transaction_body::<
2341 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2342 fidl::encoding::DefaultFuchsiaResourceDialect,
2343 0x52a1d38e0b4871fa,
2344 >(_buf?)?
2345 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2346 Ok(_response)
2347 }
2348 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2349 (),
2350 0x52a1d38e0b4871fa,
2351 fidl::encoding::DynamicFlags::FLEXIBLE,
2352 _decode,
2353 )
2354 }
2355
2356 type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2357 SupplicantStaIfaceGetMacAddressResult,
2358 fidl::encoding::DefaultFuchsiaResourceDialect,
2359 >;
2360 fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2361 fn _decode(
2362 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2363 ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2364 let _response = fidl::client::decode_transaction_body::<
2365 fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2366 fidl::encoding::DefaultFuchsiaResourceDialect,
2367 0x60591d204a3f537f,
2368 >(_buf?)?
2369 .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2370 Ok(_response.map(|x| x))
2371 }
2372 self.client.send_query_and_decode::<
2373 fidl::encoding::EmptyPayload,
2374 SupplicantStaIfaceGetMacAddressResult,
2375 >(
2376 (),
2377 0x60591d204a3f537f,
2378 fidl::encoding::DynamicFlags::FLEXIBLE,
2379 _decode,
2380 )
2381 }
2382
2383 type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
2384 SupplicantStaIfaceGetFactoryMacAddressResult,
2385 fidl::encoding::DefaultFuchsiaResourceDialect,
2386 >;
2387 fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
2388 fn _decode(
2389 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2390 ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2391 let _response = fidl::client::decode_transaction_body::<
2392 fidl::encoding::FlexibleResultType<
2393 SupplicantStaIfaceGetFactoryMacAddressResponse,
2394 i32,
2395 >,
2396 fidl::encoding::DefaultFuchsiaResourceDialect,
2397 0x58857179ad71e624,
2398 >(_buf?)?
2399 .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2400 Ok(_response.map(|x| x.mac_addr))
2401 }
2402 self.client.send_query_and_decode::<
2403 fidl::encoding::EmptyPayload,
2404 SupplicantStaIfaceGetFactoryMacAddressResult,
2405 >(
2406 (),
2407 0x58857179ad71e624,
2408 fidl::encoding::DynamicFlags::FLEXIBLE,
2409 _decode,
2410 )
2411 }
2412
2413 type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2414 SupplicantStaIfaceSetBtCoexistenceModeResult,
2415 fidl::encoding::DefaultFuchsiaResourceDialect,
2416 >;
2417 fn r#set_bt_coexistence_mode(
2418 &self,
2419 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2420 ) -> Self::SetBtCoexistenceModeResponseFut {
2421 fn _decode(
2422 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2423 ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2424 let _response = fidl::client::decode_transaction_body::<
2425 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2426 fidl::encoding::DefaultFuchsiaResourceDialect,
2427 0x14567ff593a9b154,
2428 >(_buf?)?
2429 .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2430 Ok(_response.map(|x| x))
2431 }
2432 self.client.send_query_and_decode::<
2433 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2434 SupplicantStaIfaceSetBtCoexistenceModeResult,
2435 >(
2436 payload,
2437 0x14567ff593a9b154,
2438 fidl::encoding::DynamicFlags::FLEXIBLE,
2439 _decode,
2440 )
2441 }
2442
2443 type SetPowerSaveResponseFut =
2444 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2445 fn r#set_power_save(
2446 &self,
2447 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2448 ) -> Self::SetPowerSaveResponseFut {
2449 fn _decode(
2450 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2451 ) -> Result<(), fidl::Error> {
2452 let _response = fidl::client::decode_transaction_body::<
2453 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2454 fidl::encoding::DefaultFuchsiaResourceDialect,
2455 0x5a04c29320085298,
2456 >(_buf?)?
2457 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2458 Ok(_response)
2459 }
2460 self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2461 &mut payload,
2462 0x5a04c29320085298,
2463 fidl::encoding::DynamicFlags::FLEXIBLE,
2464 _decode,
2465 )
2466 }
2467
2468 type SetSuspendModeEnabledResponseFut =
2469 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2470 fn r#set_suspend_mode_enabled(
2471 &self,
2472 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2473 ) -> Self::SetSuspendModeEnabledResponseFut {
2474 fn _decode(
2475 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2476 ) -> Result<(), fidl::Error> {
2477 let _response = fidl::client::decode_transaction_body::<
2478 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2479 fidl::encoding::DefaultFuchsiaResourceDialect,
2480 0xaf10de85bb7023a,
2481 >(_buf?)?
2482 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2483 Ok(_response)
2484 }
2485 self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2486 &mut payload,
2487 0xaf10de85bb7023a,
2488 fidl::encoding::DynamicFlags::FLEXIBLE,
2489 _decode,
2490 )
2491 }
2492
2493 type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2494 SupplicantStaIfaceSetStaCountryCodeResult,
2495 fidl::encoding::DefaultFuchsiaResourceDialect,
2496 >;
2497 fn r#set_sta_country_code(
2498 &self,
2499 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2500 ) -> Self::SetStaCountryCodeResponseFut {
2501 fn _decode(
2502 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2503 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2504 let _response = fidl::client::decode_transaction_body::<
2505 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2506 fidl::encoding::DefaultFuchsiaResourceDialect,
2507 0x977e22f9b79b26e,
2508 >(_buf?)?
2509 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2510 Ok(_response.map(|x| x))
2511 }
2512 self.client.send_query_and_decode::<
2513 SupplicantStaIfaceSetStaCountryCodeRequest,
2514 SupplicantStaIfaceSetStaCountryCodeResult,
2515 >(
2516 &mut payload,
2517 0x977e22f9b79b26e,
2518 fidl::encoding::DynamicFlags::FLEXIBLE,
2519 _decode,
2520 )
2521 }
2522}
2523
2524pub struct SupplicantStaIfaceEventStream {
2525 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2526}
2527
2528impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2529
2530impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2531 fn is_terminated(&self) -> bool {
2532 self.event_receiver.is_terminated()
2533 }
2534}
2535
2536impl futures::Stream for SupplicantStaIfaceEventStream {
2537 type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2538
2539 fn poll_next(
2540 mut self: std::pin::Pin<&mut Self>,
2541 cx: &mut std::task::Context<'_>,
2542 ) -> std::task::Poll<Option<Self::Item>> {
2543 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2544 &mut self.event_receiver,
2545 cx
2546 )?) {
2547 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2548 None => std::task::Poll::Ready(None),
2549 }
2550 }
2551}
2552
2553#[derive(Debug)]
2554pub enum SupplicantStaIfaceEvent {
2555 #[non_exhaustive]
2556 _UnknownEvent {
2557 ordinal: u64,
2559 },
2560}
2561
2562impl SupplicantStaIfaceEvent {
2563 fn decode(
2565 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2566 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2567 let (bytes, _handles) = buf.split_mut();
2568 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2569 debug_assert_eq!(tx_header.tx_id, 0);
2570 match tx_header.ordinal {
2571 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2572 Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2573 }
2574 _ => Err(fidl::Error::UnknownOrdinal {
2575 ordinal: tx_header.ordinal,
2576 protocol_name:
2577 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2578 }),
2579 }
2580 }
2581}
2582
2583pub struct SupplicantStaIfaceRequestStream {
2585 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2586 is_terminated: bool,
2587}
2588
2589impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2590
2591impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2592 fn is_terminated(&self) -> bool {
2593 self.is_terminated
2594 }
2595}
2596
2597impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2598 type Protocol = SupplicantStaIfaceMarker;
2599 type ControlHandle = SupplicantStaIfaceControlHandle;
2600
2601 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2602 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2603 }
2604
2605 fn control_handle(&self) -> Self::ControlHandle {
2606 SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2607 }
2608
2609 fn into_inner(
2610 self,
2611 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2612 {
2613 (self.inner, self.is_terminated)
2614 }
2615
2616 fn from_inner(
2617 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2618 is_terminated: bool,
2619 ) -> Self {
2620 Self { inner, is_terminated }
2621 }
2622}
2623
2624impl futures::Stream for SupplicantStaIfaceRequestStream {
2625 type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2626
2627 fn poll_next(
2628 mut self: std::pin::Pin<&mut Self>,
2629 cx: &mut std::task::Context<'_>,
2630 ) -> std::task::Poll<Option<Self::Item>> {
2631 let this = &mut *self;
2632 if this.inner.check_shutdown(cx) {
2633 this.is_terminated = true;
2634 return std::task::Poll::Ready(None);
2635 }
2636 if this.is_terminated {
2637 panic!("polled SupplicantStaIfaceRequestStream after completion");
2638 }
2639 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2640 |bytes, handles| {
2641 match this.inner.channel().read_etc(cx, bytes, handles) {
2642 std::task::Poll::Ready(Ok(())) => {}
2643 std::task::Poll::Pending => return std::task::Poll::Pending,
2644 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2645 this.is_terminated = true;
2646 return std::task::Poll::Ready(None);
2647 }
2648 std::task::Poll::Ready(Err(e)) => {
2649 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2650 e.into(),
2651 ))));
2652 }
2653 }
2654
2655 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2657
2658 std::task::Poll::Ready(Some(match header.ordinal {
2659 0x1be680e863a8e71 => {
2660 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2661 let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2662 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2663 let control_handle = SupplicantStaIfaceControlHandle {
2664 inner: this.inner.clone(),
2665 };
2666 Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2667 control_handle,
2668 })
2669 }
2670 0xa77cf60628766dc => {
2671 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2672 let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2673 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2674 let control_handle = SupplicantStaIfaceControlHandle {
2675 inner: this.inner.clone(),
2676 };
2677 Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2678 control_handle,
2679 })
2680 }
2681 0x52a1d38e0b4871fa => {
2682 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2683 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2684 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2685 let control_handle = SupplicantStaIfaceControlHandle {
2686 inner: this.inner.clone(),
2687 };
2688 Ok(SupplicantStaIfaceRequest::Disconnect {
2689 responder: SupplicantStaIfaceDisconnectResponder {
2690 control_handle: std::mem::ManuallyDrop::new(control_handle),
2691 tx_id: header.tx_id,
2692 },
2693 })
2694 }
2695 0x60591d204a3f537f => {
2696 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2697 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2698 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2699 let control_handle = SupplicantStaIfaceControlHandle {
2700 inner: this.inner.clone(),
2701 };
2702 Ok(SupplicantStaIfaceRequest::GetMacAddress {
2703 responder: SupplicantStaIfaceGetMacAddressResponder {
2704 control_handle: std::mem::ManuallyDrop::new(control_handle),
2705 tx_id: header.tx_id,
2706 },
2707 })
2708 }
2709 0x58857179ad71e624 => {
2710 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2711 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2712 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2713 let control_handle = SupplicantStaIfaceControlHandle {
2714 inner: this.inner.clone(),
2715 };
2716 Ok(SupplicantStaIfaceRequest::GetFactoryMacAddress {
2717 responder: SupplicantStaIfaceGetFactoryMacAddressResponder {
2718 control_handle: std::mem::ManuallyDrop::new(control_handle),
2719 tx_id: header.tx_id,
2720 },
2721 })
2722 }
2723 0x14567ff593a9b154 => {
2724 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2725 let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2726 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2727 let control_handle = SupplicantStaIfaceControlHandle {
2728 inner: this.inner.clone(),
2729 };
2730 Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2731 responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2732 control_handle: std::mem::ManuallyDrop::new(control_handle),
2733 tx_id: header.tx_id,
2734 },
2735 })
2736 }
2737 0x5a04c29320085298 => {
2738 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2739 let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2740 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2741 let control_handle = SupplicantStaIfaceControlHandle {
2742 inner: this.inner.clone(),
2743 };
2744 Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2745 responder: SupplicantStaIfaceSetPowerSaveResponder {
2746 control_handle: std::mem::ManuallyDrop::new(control_handle),
2747 tx_id: header.tx_id,
2748 },
2749 })
2750 }
2751 0xaf10de85bb7023a => {
2752 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2753 let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2754 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2755 let control_handle = SupplicantStaIfaceControlHandle {
2756 inner: this.inner.clone(),
2757 };
2758 Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2759 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2760 control_handle: std::mem::ManuallyDrop::new(control_handle),
2761 tx_id: header.tx_id,
2762 },
2763 })
2764 }
2765 0x977e22f9b79b26e => {
2766 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2767 let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2768 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2769 let control_handle = SupplicantStaIfaceControlHandle {
2770 inner: this.inner.clone(),
2771 };
2772 Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2773 responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2774 control_handle: std::mem::ManuallyDrop::new(control_handle),
2775 tx_id: header.tx_id,
2776 },
2777 })
2778 }
2779 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2780 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2781 ordinal: header.ordinal,
2782 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2783 method_type: fidl::MethodType::OneWay,
2784 })
2785 }
2786 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2787 this.inner.send_framework_err(
2788 fidl::encoding::FrameworkErr::UnknownMethod,
2789 header.tx_id,
2790 header.ordinal,
2791 header.dynamic_flags(),
2792 (bytes, handles),
2793 )?;
2794 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2795 ordinal: header.ordinal,
2796 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2797 method_type: fidl::MethodType::TwoWay,
2798 })
2799 }
2800 _ => Err(fidl::Error::UnknownOrdinal {
2801 ordinal: header.ordinal,
2802 protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2803 }),
2804 }))
2805 },
2806 )
2807 }
2808}
2809
2810#[derive(Debug)]
2811pub enum SupplicantStaIfaceRequest {
2812 RegisterCallback {
2813 payload: SupplicantStaIfaceRegisterCallbackRequest,
2814 control_handle: SupplicantStaIfaceControlHandle,
2815 },
2816 AddNetwork {
2817 payload: SupplicantStaIfaceAddNetworkRequest,
2818 control_handle: SupplicantStaIfaceControlHandle,
2819 },
2820 Disconnect {
2821 responder: SupplicantStaIfaceDisconnectResponder,
2822 },
2823 GetMacAddress {
2824 responder: SupplicantStaIfaceGetMacAddressResponder,
2825 },
2826 GetFactoryMacAddress {
2827 responder: SupplicantStaIfaceGetFactoryMacAddressResponder,
2828 },
2829 SetBtCoexistenceMode {
2830 payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2831 responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2832 },
2833 SetPowerSave {
2834 payload: SupplicantStaIfaceSetPowerSaveRequest,
2835 responder: SupplicantStaIfaceSetPowerSaveResponder,
2836 },
2837 SetSuspendModeEnabled {
2838 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2839 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2840 },
2841 SetStaCountryCode {
2842 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2843 responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2844 },
2845 #[non_exhaustive]
2847 _UnknownMethod {
2848 ordinal: u64,
2850 control_handle: SupplicantStaIfaceControlHandle,
2851 method_type: fidl::MethodType,
2852 },
2853}
2854
2855impl SupplicantStaIfaceRequest {
2856 #[allow(irrefutable_let_patterns)]
2857 pub fn into_register_callback(
2858 self,
2859 ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2860 if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2861 Some((payload, control_handle))
2862 } else {
2863 None
2864 }
2865 }
2866
2867 #[allow(irrefutable_let_patterns)]
2868 pub fn into_add_network(
2869 self,
2870 ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2871 if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2872 Some((payload, control_handle))
2873 } else {
2874 None
2875 }
2876 }
2877
2878 #[allow(irrefutable_let_patterns)]
2879 pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2880 if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2881 Some((responder))
2882 } else {
2883 None
2884 }
2885 }
2886
2887 #[allow(irrefutable_let_patterns)]
2888 pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2889 if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2890 Some((responder))
2891 } else {
2892 None
2893 }
2894 }
2895
2896 #[allow(irrefutable_let_patterns)]
2897 pub fn into_get_factory_mac_address(
2898 self,
2899 ) -> Option<(SupplicantStaIfaceGetFactoryMacAddressResponder)> {
2900 if let SupplicantStaIfaceRequest::GetFactoryMacAddress { responder } = self {
2901 Some((responder))
2902 } else {
2903 None
2904 }
2905 }
2906
2907 #[allow(irrefutable_let_patterns)]
2908 pub fn into_set_bt_coexistence_mode(
2909 self,
2910 ) -> Option<(
2911 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2912 SupplicantStaIfaceSetBtCoexistenceModeResponder,
2913 )> {
2914 if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
2915 Some((payload, responder))
2916 } else {
2917 None
2918 }
2919 }
2920
2921 #[allow(irrefutable_let_patterns)]
2922 pub fn into_set_power_save(
2923 self,
2924 ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
2925 {
2926 if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
2927 Some((payload, responder))
2928 } else {
2929 None
2930 }
2931 }
2932
2933 #[allow(irrefutable_let_patterns)]
2934 pub fn into_set_suspend_mode_enabled(
2935 self,
2936 ) -> Option<(
2937 SupplicantStaIfaceSetSuspendModeEnabledRequest,
2938 SupplicantStaIfaceSetSuspendModeEnabledResponder,
2939 )> {
2940 if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
2941 Some((payload, responder))
2942 } else {
2943 None
2944 }
2945 }
2946
2947 #[allow(irrefutable_let_patterns)]
2948 pub fn into_set_sta_country_code(
2949 self,
2950 ) -> Option<(
2951 SupplicantStaIfaceSetStaCountryCodeRequest,
2952 SupplicantStaIfaceSetStaCountryCodeResponder,
2953 )> {
2954 if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
2955 Some((payload, responder))
2956 } else {
2957 None
2958 }
2959 }
2960
2961 pub fn method_name(&self) -> &'static str {
2963 match *self {
2964 SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
2965 SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
2966 SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
2967 SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
2968 SupplicantStaIfaceRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
2969 SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
2970 SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
2971 SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
2972 SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
2973 SupplicantStaIfaceRequest::_UnknownMethod {
2974 method_type: fidl::MethodType::OneWay,
2975 ..
2976 } => "unknown one-way method",
2977 SupplicantStaIfaceRequest::_UnknownMethod {
2978 method_type: fidl::MethodType::TwoWay,
2979 ..
2980 } => "unknown two-way method",
2981 }
2982 }
2983}
2984
2985#[derive(Debug, Clone)]
2986pub struct SupplicantStaIfaceControlHandle {
2987 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2988}
2989
2990impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
2991 fn shutdown(&self) {
2992 self.inner.shutdown()
2993 }
2994
2995 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2996 self.inner.shutdown_with_epitaph(status)
2997 }
2998
2999 fn is_closed(&self) -> bool {
3000 self.inner.channel().is_closed()
3001 }
3002 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3003 self.inner.channel().on_closed()
3004 }
3005
3006 #[cfg(target_os = "fuchsia")]
3007 fn signal_peer(
3008 &self,
3009 clear_mask: zx::Signals,
3010 set_mask: zx::Signals,
3011 ) -> Result<(), zx_status::Status> {
3012 use fidl::Peered;
3013 self.inner.channel().signal_peer(clear_mask, set_mask)
3014 }
3015}
3016
3017impl SupplicantStaIfaceControlHandle {}
3018
3019#[must_use = "FIDL methods require a response to be sent"]
3020#[derive(Debug)]
3021pub struct SupplicantStaIfaceDisconnectResponder {
3022 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3023 tx_id: u32,
3024}
3025
3026impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
3030 fn drop(&mut self) {
3031 self.control_handle.shutdown();
3032 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3034 }
3035}
3036
3037impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
3038 type ControlHandle = SupplicantStaIfaceControlHandle;
3039
3040 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3041 &self.control_handle
3042 }
3043
3044 fn drop_without_shutdown(mut self) {
3045 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3047 std::mem::forget(self);
3049 }
3050}
3051
3052impl SupplicantStaIfaceDisconnectResponder {
3053 pub fn send(self) -> Result<(), fidl::Error> {
3057 let _result = self.send_raw();
3058 if _result.is_err() {
3059 self.control_handle.shutdown();
3060 }
3061 self.drop_without_shutdown();
3062 _result
3063 }
3064
3065 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3067 let _result = self.send_raw();
3068 self.drop_without_shutdown();
3069 _result
3070 }
3071
3072 fn send_raw(&self) -> Result<(), fidl::Error> {
3073 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3074 fidl::encoding::Flexible::new(()),
3075 self.tx_id,
3076 0x52a1d38e0b4871fa,
3077 fidl::encoding::DynamicFlags::FLEXIBLE,
3078 )
3079 }
3080}
3081
3082#[must_use = "FIDL methods require a response to be sent"]
3083#[derive(Debug)]
3084pub struct SupplicantStaIfaceGetMacAddressResponder {
3085 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3086 tx_id: u32,
3087}
3088
3089impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
3093 fn drop(&mut self) {
3094 self.control_handle.shutdown();
3095 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3097 }
3098}
3099
3100impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
3101 type ControlHandle = SupplicantStaIfaceControlHandle;
3102
3103 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3104 &self.control_handle
3105 }
3106
3107 fn drop_without_shutdown(mut self) {
3108 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3110 std::mem::forget(self);
3112 }
3113}
3114
3115impl SupplicantStaIfaceGetMacAddressResponder {
3116 pub fn send(
3120 self,
3121 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3122 ) -> Result<(), fidl::Error> {
3123 let _result = self.send_raw(result);
3124 if _result.is_err() {
3125 self.control_handle.shutdown();
3126 }
3127 self.drop_without_shutdown();
3128 _result
3129 }
3130
3131 pub fn send_no_shutdown_on_err(
3133 self,
3134 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3135 ) -> Result<(), fidl::Error> {
3136 let _result = self.send_raw(result);
3137 self.drop_without_shutdown();
3138 _result
3139 }
3140
3141 fn send_raw(
3142 &self,
3143 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3144 ) -> Result<(), fidl::Error> {
3145 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3146 SupplicantStaIfaceGetMacAddressResponse,
3147 i32,
3148 >>(
3149 fidl::encoding::FlexibleResult::new(result),
3150 self.tx_id,
3151 0x60591d204a3f537f,
3152 fidl::encoding::DynamicFlags::FLEXIBLE,
3153 )
3154 }
3155}
3156
3157#[must_use = "FIDL methods require a response to be sent"]
3158#[derive(Debug)]
3159pub struct SupplicantStaIfaceGetFactoryMacAddressResponder {
3160 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3161 tx_id: u32,
3162}
3163
3164impl std::ops::Drop for SupplicantStaIfaceGetFactoryMacAddressResponder {
3168 fn drop(&mut self) {
3169 self.control_handle.shutdown();
3170 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3172 }
3173}
3174
3175impl fidl::endpoints::Responder for SupplicantStaIfaceGetFactoryMacAddressResponder {
3176 type ControlHandle = SupplicantStaIfaceControlHandle;
3177
3178 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3179 &self.control_handle
3180 }
3181
3182 fn drop_without_shutdown(mut self) {
3183 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3185 std::mem::forget(self);
3187 }
3188}
3189
3190impl SupplicantStaIfaceGetFactoryMacAddressResponder {
3191 pub fn send(self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3195 let _result = self.send_raw(result);
3196 if _result.is_err() {
3197 self.control_handle.shutdown();
3198 }
3199 self.drop_without_shutdown();
3200 _result
3201 }
3202
3203 pub fn send_no_shutdown_on_err(
3205 self,
3206 mut result: Result<&[u8; 6], i32>,
3207 ) -> Result<(), fidl::Error> {
3208 let _result = self.send_raw(result);
3209 self.drop_without_shutdown();
3210 _result
3211 }
3212
3213 fn send_raw(&self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3214 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3215 SupplicantStaIfaceGetFactoryMacAddressResponse,
3216 i32,
3217 >>(
3218 fidl::encoding::FlexibleResult::new(result.map(|mac_addr| (mac_addr,))),
3219 self.tx_id,
3220 0x58857179ad71e624,
3221 fidl::encoding::DynamicFlags::FLEXIBLE,
3222 )
3223 }
3224}
3225
3226#[must_use = "FIDL methods require a response to be sent"]
3227#[derive(Debug)]
3228pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3229 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3230 tx_id: u32,
3231}
3232
3233impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3237 fn drop(&mut self) {
3238 self.control_handle.shutdown();
3239 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3241 }
3242}
3243
3244impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3245 type ControlHandle = SupplicantStaIfaceControlHandle;
3246
3247 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3248 &self.control_handle
3249 }
3250
3251 fn drop_without_shutdown(mut self) {
3252 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3254 std::mem::forget(self);
3256 }
3257}
3258
3259impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3260 pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3264 let _result = self.send_raw(result);
3265 if _result.is_err() {
3266 self.control_handle.shutdown();
3267 }
3268 self.drop_without_shutdown();
3269 _result
3270 }
3271
3272 pub fn send_no_shutdown_on_err(
3274 self,
3275 mut result: Result<(), WlanixError>,
3276 ) -> Result<(), fidl::Error> {
3277 let _result = self.send_raw(result);
3278 self.drop_without_shutdown();
3279 _result
3280 }
3281
3282 fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3283 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3284 fidl::encoding::EmptyStruct,
3285 WlanixError,
3286 >>(
3287 fidl::encoding::FlexibleResult::new(result),
3288 self.tx_id,
3289 0x14567ff593a9b154,
3290 fidl::encoding::DynamicFlags::FLEXIBLE,
3291 )
3292 }
3293}
3294
3295#[must_use = "FIDL methods require a response to be sent"]
3296#[derive(Debug)]
3297pub struct SupplicantStaIfaceSetPowerSaveResponder {
3298 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3299 tx_id: u32,
3300}
3301
3302impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3306 fn drop(&mut self) {
3307 self.control_handle.shutdown();
3308 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3310 }
3311}
3312
3313impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3314 type ControlHandle = SupplicantStaIfaceControlHandle;
3315
3316 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3317 &self.control_handle
3318 }
3319
3320 fn drop_without_shutdown(mut self) {
3321 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3323 std::mem::forget(self);
3325 }
3326}
3327
3328impl SupplicantStaIfaceSetPowerSaveResponder {
3329 pub fn send(self) -> Result<(), fidl::Error> {
3333 let _result = self.send_raw();
3334 if _result.is_err() {
3335 self.control_handle.shutdown();
3336 }
3337 self.drop_without_shutdown();
3338 _result
3339 }
3340
3341 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3343 let _result = self.send_raw();
3344 self.drop_without_shutdown();
3345 _result
3346 }
3347
3348 fn send_raw(&self) -> Result<(), fidl::Error> {
3349 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3350 fidl::encoding::Flexible::new(()),
3351 self.tx_id,
3352 0x5a04c29320085298,
3353 fidl::encoding::DynamicFlags::FLEXIBLE,
3354 )
3355 }
3356}
3357
3358#[must_use = "FIDL methods require a response to be sent"]
3359#[derive(Debug)]
3360pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3361 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3362 tx_id: u32,
3363}
3364
3365impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3369 fn drop(&mut self) {
3370 self.control_handle.shutdown();
3371 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3373 }
3374}
3375
3376impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3377 type ControlHandle = SupplicantStaIfaceControlHandle;
3378
3379 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3380 &self.control_handle
3381 }
3382
3383 fn drop_without_shutdown(mut self) {
3384 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3386 std::mem::forget(self);
3388 }
3389}
3390
3391impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3392 pub fn send(self) -> Result<(), fidl::Error> {
3396 let _result = self.send_raw();
3397 if _result.is_err() {
3398 self.control_handle.shutdown();
3399 }
3400 self.drop_without_shutdown();
3401 _result
3402 }
3403
3404 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3406 let _result = self.send_raw();
3407 self.drop_without_shutdown();
3408 _result
3409 }
3410
3411 fn send_raw(&self) -> Result<(), fidl::Error> {
3412 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3413 fidl::encoding::Flexible::new(()),
3414 self.tx_id,
3415 0xaf10de85bb7023a,
3416 fidl::encoding::DynamicFlags::FLEXIBLE,
3417 )
3418 }
3419}
3420
3421#[must_use = "FIDL methods require a response to be sent"]
3422#[derive(Debug)]
3423pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3424 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3425 tx_id: u32,
3426}
3427
3428impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3432 fn drop(&mut self) {
3433 self.control_handle.shutdown();
3434 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3436 }
3437}
3438
3439impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3440 type ControlHandle = SupplicantStaIfaceControlHandle;
3441
3442 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3443 &self.control_handle
3444 }
3445
3446 fn drop_without_shutdown(mut self) {
3447 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3449 std::mem::forget(self);
3451 }
3452}
3453
3454impl SupplicantStaIfaceSetStaCountryCodeResponder {
3455 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3459 let _result = self.send_raw(result);
3460 if _result.is_err() {
3461 self.control_handle.shutdown();
3462 }
3463 self.drop_without_shutdown();
3464 _result
3465 }
3466
3467 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3469 let _result = self.send_raw(result);
3470 self.drop_without_shutdown();
3471 _result
3472 }
3473
3474 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3475 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3476 fidl::encoding::EmptyStruct,
3477 i32,
3478 >>(
3479 fidl::encoding::FlexibleResult::new(result),
3480 self.tx_id,
3481 0x977e22f9b79b26e,
3482 fidl::encoding::DynamicFlags::FLEXIBLE,
3483 )
3484 }
3485}
3486
3487#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3488pub struct SupplicantStaIfaceCallbackMarker;
3489
3490impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3491 type Proxy = SupplicantStaIfaceCallbackProxy;
3492 type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3493 #[cfg(target_os = "fuchsia")]
3494 type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3495
3496 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3497}
3498
3499pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3500 fn r#on_state_changed(
3501 &self,
3502 payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3503 ) -> Result<(), fidl::Error>;
3504 fn r#on_disconnected(
3505 &self,
3506 payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3507 ) -> Result<(), fidl::Error>;
3508 fn r#on_association_rejected(
3509 &self,
3510 payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3511 ) -> Result<(), fidl::Error>;
3512}
3513#[derive(Debug)]
3514#[cfg(target_os = "fuchsia")]
3515pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3516 client: fidl::client::sync::Client,
3517}
3518
3519#[cfg(target_os = "fuchsia")]
3520impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3521 type Proxy = SupplicantStaIfaceCallbackProxy;
3522 type Protocol = SupplicantStaIfaceCallbackMarker;
3523
3524 fn from_channel(inner: fidl::Channel) -> Self {
3525 Self::new(inner)
3526 }
3527
3528 fn into_channel(self) -> fidl::Channel {
3529 self.client.into_channel()
3530 }
3531
3532 fn as_channel(&self) -> &fidl::Channel {
3533 self.client.as_channel()
3534 }
3535}
3536
3537#[cfg(target_os = "fuchsia")]
3538impl SupplicantStaIfaceCallbackSynchronousProxy {
3539 pub fn new(channel: fidl::Channel) -> Self {
3540 Self { client: fidl::client::sync::Client::new(channel) }
3541 }
3542
3543 pub fn into_channel(self) -> fidl::Channel {
3544 self.client.into_channel()
3545 }
3546
3547 pub fn wait_for_event(
3550 &self,
3551 deadline: zx::MonotonicInstant,
3552 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3553 SupplicantStaIfaceCallbackEvent::decode(
3554 self.client.wait_for_event::<SupplicantStaIfaceCallbackMarker>(deadline)?,
3555 )
3556 }
3557
3558 pub fn r#on_state_changed(
3559 &self,
3560 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3561 ) -> Result<(), fidl::Error> {
3562 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3563 payload,
3564 0x27e086d26c49eb6c,
3565 fidl::encoding::DynamicFlags::FLEXIBLE,
3566 )
3567 }
3568
3569 pub fn r#on_disconnected(
3570 &self,
3571 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3572 ) -> Result<(), fidl::Error> {
3573 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3574 payload,
3575 0x69546475f4dee0cc,
3576 fidl::encoding::DynamicFlags::FLEXIBLE,
3577 )
3578 }
3579
3580 pub fn r#on_association_rejected(
3581 &self,
3582 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3583 ) -> Result<(), fidl::Error> {
3584 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3585 payload,
3586 0x7ef3961518bed988,
3587 fidl::encoding::DynamicFlags::FLEXIBLE,
3588 )
3589 }
3590}
3591
3592#[cfg(target_os = "fuchsia")]
3593impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3594 fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3595 value.into_channel().into()
3596 }
3597}
3598
3599#[cfg(target_os = "fuchsia")]
3600impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3601 fn from(value: fidl::Channel) -> Self {
3602 Self::new(value)
3603 }
3604}
3605
3606#[cfg(target_os = "fuchsia")]
3607impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3608 type Protocol = SupplicantStaIfaceCallbackMarker;
3609
3610 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3611 Self::new(value.into_channel())
3612 }
3613}
3614
3615#[derive(Debug, Clone)]
3616pub struct SupplicantStaIfaceCallbackProxy {
3617 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3618}
3619
3620impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3621 type Protocol = SupplicantStaIfaceCallbackMarker;
3622
3623 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3624 Self::new(inner)
3625 }
3626
3627 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3628 self.client.into_channel().map_err(|client| Self { client })
3629 }
3630
3631 fn as_channel(&self) -> &::fidl::AsyncChannel {
3632 self.client.as_channel()
3633 }
3634}
3635
3636impl SupplicantStaIfaceCallbackProxy {
3637 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3639 let protocol_name =
3640 <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3641 Self { client: fidl::client::Client::new(channel, protocol_name) }
3642 }
3643
3644 pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3650 SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3651 }
3652
3653 pub fn r#on_state_changed(
3654 &self,
3655 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3656 ) -> Result<(), fidl::Error> {
3657 SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3658 }
3659
3660 pub fn r#on_disconnected(
3661 &self,
3662 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3663 ) -> Result<(), fidl::Error> {
3664 SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3665 }
3666
3667 pub fn r#on_association_rejected(
3668 &self,
3669 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3670 ) -> Result<(), fidl::Error> {
3671 SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3672 }
3673}
3674
3675impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3676 fn r#on_state_changed(
3677 &self,
3678 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3679 ) -> Result<(), fidl::Error> {
3680 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3681 payload,
3682 0x27e086d26c49eb6c,
3683 fidl::encoding::DynamicFlags::FLEXIBLE,
3684 )
3685 }
3686
3687 fn r#on_disconnected(
3688 &self,
3689 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3690 ) -> Result<(), fidl::Error> {
3691 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3692 payload,
3693 0x69546475f4dee0cc,
3694 fidl::encoding::DynamicFlags::FLEXIBLE,
3695 )
3696 }
3697
3698 fn r#on_association_rejected(
3699 &self,
3700 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3701 ) -> Result<(), fidl::Error> {
3702 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3703 payload,
3704 0x7ef3961518bed988,
3705 fidl::encoding::DynamicFlags::FLEXIBLE,
3706 )
3707 }
3708}
3709
3710pub struct SupplicantStaIfaceCallbackEventStream {
3711 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3712}
3713
3714impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3715
3716impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3717 fn is_terminated(&self) -> bool {
3718 self.event_receiver.is_terminated()
3719 }
3720}
3721
3722impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3723 type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3724
3725 fn poll_next(
3726 mut self: std::pin::Pin<&mut Self>,
3727 cx: &mut std::task::Context<'_>,
3728 ) -> std::task::Poll<Option<Self::Item>> {
3729 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3730 &mut self.event_receiver,
3731 cx
3732 )?) {
3733 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3734 None => std::task::Poll::Ready(None),
3735 }
3736 }
3737}
3738
3739#[derive(Debug)]
3740pub enum SupplicantStaIfaceCallbackEvent {
3741 #[non_exhaustive]
3742 _UnknownEvent {
3743 ordinal: u64,
3745 },
3746}
3747
3748impl SupplicantStaIfaceCallbackEvent {
3749 fn decode(
3751 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3752 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3753 let (bytes, _handles) = buf.split_mut();
3754 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3755 debug_assert_eq!(tx_header.tx_id, 0);
3756 match tx_header.ordinal {
3757 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3758 Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3759 ordinal: tx_header.ordinal,
3760 })
3761 }
3762 _ => Err(fidl::Error::UnknownOrdinal {
3763 ordinal: tx_header.ordinal,
3764 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3765 })
3766 }
3767 }
3768}
3769
3770pub struct SupplicantStaIfaceCallbackRequestStream {
3772 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3773 is_terminated: bool,
3774}
3775
3776impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3777
3778impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3779 fn is_terminated(&self) -> bool {
3780 self.is_terminated
3781 }
3782}
3783
3784impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3785 type Protocol = SupplicantStaIfaceCallbackMarker;
3786 type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3787
3788 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3789 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3790 }
3791
3792 fn control_handle(&self) -> Self::ControlHandle {
3793 SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3794 }
3795
3796 fn into_inner(
3797 self,
3798 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3799 {
3800 (self.inner, self.is_terminated)
3801 }
3802
3803 fn from_inner(
3804 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3805 is_terminated: bool,
3806 ) -> Self {
3807 Self { inner, is_terminated }
3808 }
3809}
3810
3811impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
3812 type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
3813
3814 fn poll_next(
3815 mut self: std::pin::Pin<&mut Self>,
3816 cx: &mut std::task::Context<'_>,
3817 ) -> std::task::Poll<Option<Self::Item>> {
3818 let this = &mut *self;
3819 if this.inner.check_shutdown(cx) {
3820 this.is_terminated = true;
3821 return std::task::Poll::Ready(None);
3822 }
3823 if this.is_terminated {
3824 panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
3825 }
3826 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3827 |bytes, handles| {
3828 match this.inner.channel().read_etc(cx, bytes, handles) {
3829 std::task::Poll::Ready(Ok(())) => {}
3830 std::task::Poll::Pending => return std::task::Poll::Pending,
3831 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3832 this.is_terminated = true;
3833 return std::task::Poll::Ready(None);
3834 }
3835 std::task::Poll::Ready(Err(e)) => {
3836 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3837 e.into(),
3838 ))));
3839 }
3840 }
3841
3842 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3844
3845 std::task::Poll::Ready(Some(match header.ordinal {
3846 0x27e086d26c49eb6c => {
3847 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3848 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3849 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
3850 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3851 inner: this.inner.clone(),
3852 };
3853 Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
3854 control_handle,
3855 })
3856 }
3857 0x69546475f4dee0cc => {
3858 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3859 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3860 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
3861 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3862 inner: this.inner.clone(),
3863 };
3864 Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
3865 control_handle,
3866 })
3867 }
3868 0x7ef3961518bed988 => {
3869 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3870 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3871 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
3872 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3873 inner: this.inner.clone(),
3874 };
3875 Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
3876 control_handle,
3877 })
3878 }
3879 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3880 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3881 ordinal: header.ordinal,
3882 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3883 method_type: fidl::MethodType::OneWay,
3884 })
3885 }
3886 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3887 this.inner.send_framework_err(
3888 fidl::encoding::FrameworkErr::UnknownMethod,
3889 header.tx_id,
3890 header.ordinal,
3891 header.dynamic_flags(),
3892 (bytes, handles),
3893 )?;
3894 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3895 ordinal: header.ordinal,
3896 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3897 method_type: fidl::MethodType::TwoWay,
3898 })
3899 }
3900 _ => Err(fidl::Error::UnknownOrdinal {
3901 ordinal: header.ordinal,
3902 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3903 }),
3904 }))
3905 },
3906 )
3907 }
3908}
3909
3910#[derive(Debug)]
3911pub enum SupplicantStaIfaceCallbackRequest {
3912 OnStateChanged {
3913 payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
3914 control_handle: SupplicantStaIfaceCallbackControlHandle,
3915 },
3916 OnDisconnected {
3917 payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
3918 control_handle: SupplicantStaIfaceCallbackControlHandle,
3919 },
3920 OnAssociationRejected {
3921 payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3922 control_handle: SupplicantStaIfaceCallbackControlHandle,
3923 },
3924 #[non_exhaustive]
3926 _UnknownMethod {
3927 ordinal: u64,
3929 control_handle: SupplicantStaIfaceCallbackControlHandle,
3930 method_type: fidl::MethodType,
3931 },
3932}
3933
3934impl SupplicantStaIfaceCallbackRequest {
3935 #[allow(irrefutable_let_patterns)]
3936 pub fn into_on_state_changed(
3937 self,
3938 ) -> Option<(
3939 SupplicantStaIfaceCallbackOnStateChangedRequest,
3940 SupplicantStaIfaceCallbackControlHandle,
3941 )> {
3942 if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
3943 {
3944 Some((payload, control_handle))
3945 } else {
3946 None
3947 }
3948 }
3949
3950 #[allow(irrefutable_let_patterns)]
3951 pub fn into_on_disconnected(
3952 self,
3953 ) -> Option<(
3954 SupplicantStaIfaceCallbackOnDisconnectedRequest,
3955 SupplicantStaIfaceCallbackControlHandle,
3956 )> {
3957 if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
3958 {
3959 Some((payload, control_handle))
3960 } else {
3961 None
3962 }
3963 }
3964
3965 #[allow(irrefutable_let_patterns)]
3966 pub fn into_on_association_rejected(
3967 self,
3968 ) -> Option<(
3969 SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3970 SupplicantStaIfaceCallbackControlHandle,
3971 )> {
3972 if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
3973 payload,
3974 control_handle,
3975 } = self
3976 {
3977 Some((payload, control_handle))
3978 } else {
3979 None
3980 }
3981 }
3982
3983 pub fn method_name(&self) -> &'static str {
3985 match *self {
3986 SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
3987 SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
3988 SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
3989 "on_association_rejected"
3990 }
3991 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3992 method_type: fidl::MethodType::OneWay,
3993 ..
3994 } => "unknown one-way method",
3995 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3996 method_type: fidl::MethodType::TwoWay,
3997 ..
3998 } => "unknown two-way method",
3999 }
4000 }
4001}
4002
4003#[derive(Debug, Clone)]
4004pub struct SupplicantStaIfaceCallbackControlHandle {
4005 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4006}
4007
4008impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
4009 fn shutdown(&self) {
4010 self.inner.shutdown()
4011 }
4012
4013 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4014 self.inner.shutdown_with_epitaph(status)
4015 }
4016
4017 fn is_closed(&self) -> bool {
4018 self.inner.channel().is_closed()
4019 }
4020 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4021 self.inner.channel().on_closed()
4022 }
4023
4024 #[cfg(target_os = "fuchsia")]
4025 fn signal_peer(
4026 &self,
4027 clear_mask: zx::Signals,
4028 set_mask: zx::Signals,
4029 ) -> Result<(), zx_status::Status> {
4030 use fidl::Peered;
4031 self.inner.channel().signal_peer(clear_mask, set_mask)
4032 }
4033}
4034
4035impl SupplicantStaIfaceCallbackControlHandle {}
4036
4037#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4038pub struct SupplicantStaNetworkMarker;
4039
4040impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
4041 type Proxy = SupplicantStaNetworkProxy;
4042 type RequestStream = SupplicantStaNetworkRequestStream;
4043 #[cfg(target_os = "fuchsia")]
4044 type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
4045
4046 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
4047}
4048pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
4049
4050pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
4051 fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
4052 -> Result<(), fidl::Error>;
4053 fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
4054 fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
4055 fn r#set_key_mgmt(
4056 &self,
4057 payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4058 ) -> Result<(), fidl::Error>;
4059 fn r#set_psk_passphrase(
4060 &self,
4061 payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4062 ) -> Result<(), fidl::Error>;
4063 fn r#set_sae_password(
4064 &self,
4065 payload: &SupplicantStaNetworkSetSaePasswordRequest,
4066 ) -> Result<(), fidl::Error>;
4067 fn r#set_wep_key(
4068 &self,
4069 payload: &SupplicantStaNetworkSetWepKeyRequest,
4070 ) -> Result<(), fidl::Error>;
4071 fn r#set_wep_tx_key_idx(
4072 &self,
4073 payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4074 ) -> Result<(), fidl::Error>;
4075 type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
4076 + Send;
4077 fn r#select(&self) -> Self::SelectResponseFut;
4078}
4079#[derive(Debug)]
4080#[cfg(target_os = "fuchsia")]
4081pub struct SupplicantStaNetworkSynchronousProxy {
4082 client: fidl::client::sync::Client,
4083}
4084
4085#[cfg(target_os = "fuchsia")]
4086impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
4087 type Proxy = SupplicantStaNetworkProxy;
4088 type Protocol = SupplicantStaNetworkMarker;
4089
4090 fn from_channel(inner: fidl::Channel) -> Self {
4091 Self::new(inner)
4092 }
4093
4094 fn into_channel(self) -> fidl::Channel {
4095 self.client.into_channel()
4096 }
4097
4098 fn as_channel(&self) -> &fidl::Channel {
4099 self.client.as_channel()
4100 }
4101}
4102
4103#[cfg(target_os = "fuchsia")]
4104impl SupplicantStaNetworkSynchronousProxy {
4105 pub fn new(channel: fidl::Channel) -> Self {
4106 Self { client: fidl::client::sync::Client::new(channel) }
4107 }
4108
4109 pub fn into_channel(self) -> fidl::Channel {
4110 self.client.into_channel()
4111 }
4112
4113 pub fn wait_for_event(
4116 &self,
4117 deadline: zx::MonotonicInstant,
4118 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4119 SupplicantStaNetworkEvent::decode(
4120 self.client.wait_for_event::<SupplicantStaNetworkMarker>(deadline)?,
4121 )
4122 }
4123
4124 pub fn r#set_bssid(
4125 &self,
4126 mut payload: &SupplicantStaNetworkSetBssidRequest,
4127 ) -> Result<(), fidl::Error> {
4128 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4129 payload,
4130 0x10a91d044ee6374d,
4131 fidl::encoding::DynamicFlags::FLEXIBLE,
4132 )
4133 }
4134
4135 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4136 self.client.send::<fidl::encoding::EmptyPayload>(
4137 (),
4138 0xbc7ad82f541b267,
4139 fidl::encoding::DynamicFlags::FLEXIBLE,
4140 )
4141 }
4142
4143 pub fn r#set_ssid(
4144 &self,
4145 mut payload: &SupplicantStaNetworkSetSsidRequest,
4146 ) -> Result<(), fidl::Error> {
4147 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4148 payload,
4149 0x6b598a7a802e3083,
4150 fidl::encoding::DynamicFlags::FLEXIBLE,
4151 )
4152 }
4153
4154 pub fn r#set_key_mgmt(
4155 &self,
4156 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4157 ) -> Result<(), fidl::Error> {
4158 self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4159 payload,
4160 0xc67082685b75a5c,
4161 fidl::encoding::DynamicFlags::FLEXIBLE,
4162 )
4163 }
4164
4165 pub fn r#set_psk_passphrase(
4166 &self,
4167 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4168 ) -> Result<(), fidl::Error> {
4169 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4170 payload,
4171 0xf6d438225979307,
4172 fidl::encoding::DynamicFlags::FLEXIBLE,
4173 )
4174 }
4175
4176 pub fn r#set_sae_password(
4177 &self,
4178 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4179 ) -> Result<(), fidl::Error> {
4180 self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4181 payload,
4182 0x2982737e196747b8,
4183 fidl::encoding::DynamicFlags::FLEXIBLE,
4184 )
4185 }
4186
4187 pub fn r#set_wep_key(
4188 &self,
4189 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4190 ) -> Result<(), fidl::Error> {
4191 self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4192 payload,
4193 0x22a7e25ec81f2dee,
4194 fidl::encoding::DynamicFlags::FLEXIBLE,
4195 )
4196 }
4197
4198 pub fn r#set_wep_tx_key_idx(
4201 &self,
4202 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4203 ) -> Result<(), fidl::Error> {
4204 self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4205 payload,
4206 0x4f25576c21fcb8cb,
4207 fidl::encoding::DynamicFlags::FLEXIBLE,
4208 )
4209 }
4210
4211 pub fn r#select(
4212 &self,
4213 ___deadline: zx::MonotonicInstant,
4214 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4215 let _response = self.client.send_query::<
4216 fidl::encoding::EmptyPayload,
4217 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4218 SupplicantStaNetworkMarker,
4219 >(
4220 (),
4221 0x354bc361a0c77b45,
4222 fidl::encoding::DynamicFlags::FLEXIBLE,
4223 ___deadline,
4224 )?
4225 .into_result::<SupplicantStaNetworkMarker>("select")?;
4226 Ok(_response.map(|x| x))
4227 }
4228}
4229
4230#[cfg(target_os = "fuchsia")]
4231impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4232 fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4233 value.into_channel().into()
4234 }
4235}
4236
4237#[cfg(target_os = "fuchsia")]
4238impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4239 fn from(value: fidl::Channel) -> Self {
4240 Self::new(value)
4241 }
4242}
4243
4244#[cfg(target_os = "fuchsia")]
4245impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4246 type Protocol = SupplicantStaNetworkMarker;
4247
4248 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4249 Self::new(value.into_channel())
4250 }
4251}
4252
4253#[derive(Debug, Clone)]
4254pub struct SupplicantStaNetworkProxy {
4255 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4256}
4257
4258impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4259 type Protocol = SupplicantStaNetworkMarker;
4260
4261 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4262 Self::new(inner)
4263 }
4264
4265 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4266 self.client.into_channel().map_err(|client| Self { client })
4267 }
4268
4269 fn as_channel(&self) -> &::fidl::AsyncChannel {
4270 self.client.as_channel()
4271 }
4272}
4273
4274impl SupplicantStaNetworkProxy {
4275 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4277 let protocol_name =
4278 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4279 Self { client: fidl::client::Client::new(channel, protocol_name) }
4280 }
4281
4282 pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4288 SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4289 }
4290
4291 pub fn r#set_bssid(
4292 &self,
4293 mut payload: &SupplicantStaNetworkSetBssidRequest,
4294 ) -> Result<(), fidl::Error> {
4295 SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4296 }
4297
4298 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4299 SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4300 }
4301
4302 pub fn r#set_ssid(
4303 &self,
4304 mut payload: &SupplicantStaNetworkSetSsidRequest,
4305 ) -> Result<(), fidl::Error> {
4306 SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4307 }
4308
4309 pub fn r#set_key_mgmt(
4310 &self,
4311 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4312 ) -> Result<(), fidl::Error> {
4313 SupplicantStaNetworkProxyInterface::r#set_key_mgmt(self, payload)
4314 }
4315
4316 pub fn r#set_psk_passphrase(
4317 &self,
4318 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4319 ) -> Result<(), fidl::Error> {
4320 SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4321 }
4322
4323 pub fn r#set_sae_password(
4324 &self,
4325 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4326 ) -> Result<(), fidl::Error> {
4327 SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4328 }
4329
4330 pub fn r#set_wep_key(
4331 &self,
4332 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4333 ) -> Result<(), fidl::Error> {
4334 SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4335 }
4336
4337 pub fn r#set_wep_tx_key_idx(
4340 &self,
4341 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4342 ) -> Result<(), fidl::Error> {
4343 SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4344 }
4345
4346 pub fn r#select(
4347 &self,
4348 ) -> fidl::client::QueryResponseFut<
4349 SupplicantStaNetworkSelectResult,
4350 fidl::encoding::DefaultFuchsiaResourceDialect,
4351 > {
4352 SupplicantStaNetworkProxyInterface::r#select(self)
4353 }
4354}
4355
4356impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4357 fn r#set_bssid(
4358 &self,
4359 mut payload: &SupplicantStaNetworkSetBssidRequest,
4360 ) -> Result<(), fidl::Error> {
4361 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4362 payload,
4363 0x10a91d044ee6374d,
4364 fidl::encoding::DynamicFlags::FLEXIBLE,
4365 )
4366 }
4367
4368 fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4369 self.client.send::<fidl::encoding::EmptyPayload>(
4370 (),
4371 0xbc7ad82f541b267,
4372 fidl::encoding::DynamicFlags::FLEXIBLE,
4373 )
4374 }
4375
4376 fn r#set_ssid(
4377 &self,
4378 mut payload: &SupplicantStaNetworkSetSsidRequest,
4379 ) -> Result<(), fidl::Error> {
4380 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4381 payload,
4382 0x6b598a7a802e3083,
4383 fidl::encoding::DynamicFlags::FLEXIBLE,
4384 )
4385 }
4386
4387 fn r#set_key_mgmt(
4388 &self,
4389 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4390 ) -> Result<(), fidl::Error> {
4391 self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4392 payload,
4393 0xc67082685b75a5c,
4394 fidl::encoding::DynamicFlags::FLEXIBLE,
4395 )
4396 }
4397
4398 fn r#set_psk_passphrase(
4399 &self,
4400 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4401 ) -> Result<(), fidl::Error> {
4402 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4403 payload,
4404 0xf6d438225979307,
4405 fidl::encoding::DynamicFlags::FLEXIBLE,
4406 )
4407 }
4408
4409 fn r#set_sae_password(
4410 &self,
4411 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4412 ) -> Result<(), fidl::Error> {
4413 self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4414 payload,
4415 0x2982737e196747b8,
4416 fidl::encoding::DynamicFlags::FLEXIBLE,
4417 )
4418 }
4419
4420 fn r#set_wep_key(
4421 &self,
4422 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4423 ) -> Result<(), fidl::Error> {
4424 self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4425 payload,
4426 0x22a7e25ec81f2dee,
4427 fidl::encoding::DynamicFlags::FLEXIBLE,
4428 )
4429 }
4430
4431 fn r#set_wep_tx_key_idx(
4432 &self,
4433 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4434 ) -> Result<(), fidl::Error> {
4435 self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4436 payload,
4437 0x4f25576c21fcb8cb,
4438 fidl::encoding::DynamicFlags::FLEXIBLE,
4439 )
4440 }
4441
4442 type SelectResponseFut = fidl::client::QueryResponseFut<
4443 SupplicantStaNetworkSelectResult,
4444 fidl::encoding::DefaultFuchsiaResourceDialect,
4445 >;
4446 fn r#select(&self) -> Self::SelectResponseFut {
4447 fn _decode(
4448 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4449 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4450 let _response = fidl::client::decode_transaction_body::<
4451 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4452 fidl::encoding::DefaultFuchsiaResourceDialect,
4453 0x354bc361a0c77b45,
4454 >(_buf?)?
4455 .into_result::<SupplicantStaNetworkMarker>("select")?;
4456 Ok(_response.map(|x| x))
4457 }
4458 self.client.send_query_and_decode::<
4459 fidl::encoding::EmptyPayload,
4460 SupplicantStaNetworkSelectResult,
4461 >(
4462 (),
4463 0x354bc361a0c77b45,
4464 fidl::encoding::DynamicFlags::FLEXIBLE,
4465 _decode,
4466 )
4467 }
4468}
4469
4470pub struct SupplicantStaNetworkEventStream {
4471 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4472}
4473
4474impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4475
4476impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4477 fn is_terminated(&self) -> bool {
4478 self.event_receiver.is_terminated()
4479 }
4480}
4481
4482impl futures::Stream for SupplicantStaNetworkEventStream {
4483 type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4484
4485 fn poll_next(
4486 mut self: std::pin::Pin<&mut Self>,
4487 cx: &mut std::task::Context<'_>,
4488 ) -> std::task::Poll<Option<Self::Item>> {
4489 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4490 &mut self.event_receiver,
4491 cx
4492 )?) {
4493 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4494 None => std::task::Poll::Ready(None),
4495 }
4496 }
4497}
4498
4499#[derive(Debug)]
4500pub enum SupplicantStaNetworkEvent {
4501 #[non_exhaustive]
4502 _UnknownEvent {
4503 ordinal: u64,
4505 },
4506}
4507
4508impl SupplicantStaNetworkEvent {
4509 fn decode(
4511 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4512 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4513 let (bytes, _handles) = buf.split_mut();
4514 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4515 debug_assert_eq!(tx_header.tx_id, 0);
4516 match tx_header.ordinal {
4517 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4518 Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4519 }
4520 _ => Err(fidl::Error::UnknownOrdinal {
4521 ordinal: tx_header.ordinal,
4522 protocol_name:
4523 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4524 }),
4525 }
4526 }
4527}
4528
4529pub struct SupplicantStaNetworkRequestStream {
4531 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4532 is_terminated: bool,
4533}
4534
4535impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4536
4537impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4538 fn is_terminated(&self) -> bool {
4539 self.is_terminated
4540 }
4541}
4542
4543impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4544 type Protocol = SupplicantStaNetworkMarker;
4545 type ControlHandle = SupplicantStaNetworkControlHandle;
4546
4547 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4548 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4549 }
4550
4551 fn control_handle(&self) -> Self::ControlHandle {
4552 SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4553 }
4554
4555 fn into_inner(
4556 self,
4557 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4558 {
4559 (self.inner, self.is_terminated)
4560 }
4561
4562 fn from_inner(
4563 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4564 is_terminated: bool,
4565 ) -> Self {
4566 Self { inner, is_terminated }
4567 }
4568}
4569
4570impl futures::Stream for SupplicantStaNetworkRequestStream {
4571 type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4572
4573 fn poll_next(
4574 mut self: std::pin::Pin<&mut Self>,
4575 cx: &mut std::task::Context<'_>,
4576 ) -> std::task::Poll<Option<Self::Item>> {
4577 let this = &mut *self;
4578 if this.inner.check_shutdown(cx) {
4579 this.is_terminated = true;
4580 return std::task::Poll::Ready(None);
4581 }
4582 if this.is_terminated {
4583 panic!("polled SupplicantStaNetworkRequestStream after completion");
4584 }
4585 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4586 |bytes, handles| {
4587 match this.inner.channel().read_etc(cx, bytes, handles) {
4588 std::task::Poll::Ready(Ok(())) => {}
4589 std::task::Poll::Pending => return std::task::Poll::Pending,
4590 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4591 this.is_terminated = true;
4592 return std::task::Poll::Ready(None);
4593 }
4594 std::task::Poll::Ready(Err(e)) => {
4595 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4596 e.into(),
4597 ))));
4598 }
4599 }
4600
4601 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4603
4604 std::task::Poll::Ready(Some(match header.ordinal {
4605 0x10a91d044ee6374d => {
4606 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4607 let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4608 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4609 let control_handle = SupplicantStaNetworkControlHandle {
4610 inner: this.inner.clone(),
4611 };
4612 Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4613 control_handle,
4614 })
4615 }
4616 0xbc7ad82f541b267 => {
4617 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4618 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4619 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4620 let control_handle = SupplicantStaNetworkControlHandle {
4621 inner: this.inner.clone(),
4622 };
4623 Ok(SupplicantStaNetworkRequest::ClearBssid {
4624 control_handle,
4625 })
4626 }
4627 0x6b598a7a802e3083 => {
4628 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4629 let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4630 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4631 let control_handle = SupplicantStaNetworkControlHandle {
4632 inner: this.inner.clone(),
4633 };
4634 Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4635 control_handle,
4636 })
4637 }
4638 0xc67082685b75a5c => {
4639 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4640 let mut req = fidl::new_empty!(SupplicantStaNetworkSetKeyMgmtRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4641 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetKeyMgmtRequest>(&header, _body_bytes, handles, &mut req)?;
4642 let control_handle = SupplicantStaNetworkControlHandle {
4643 inner: this.inner.clone(),
4644 };
4645 Ok(SupplicantStaNetworkRequest::SetKeyMgmt {payload: req,
4646 control_handle,
4647 })
4648 }
4649 0xf6d438225979307 => {
4650 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4651 let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4652 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4653 let control_handle = SupplicantStaNetworkControlHandle {
4654 inner: this.inner.clone(),
4655 };
4656 Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4657 control_handle,
4658 })
4659 }
4660 0x2982737e196747b8 => {
4661 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4662 let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4663 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4664 let control_handle = SupplicantStaNetworkControlHandle {
4665 inner: this.inner.clone(),
4666 };
4667 Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4668 control_handle,
4669 })
4670 }
4671 0x22a7e25ec81f2dee => {
4672 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4673 let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4674 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4675 let control_handle = SupplicantStaNetworkControlHandle {
4676 inner: this.inner.clone(),
4677 };
4678 Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4679 control_handle,
4680 })
4681 }
4682 0x4f25576c21fcb8cb => {
4683 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4684 let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4685 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4686 let control_handle = SupplicantStaNetworkControlHandle {
4687 inner: this.inner.clone(),
4688 };
4689 Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4690 control_handle,
4691 })
4692 }
4693 0x354bc361a0c77b45 => {
4694 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4695 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4696 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4697 let control_handle = SupplicantStaNetworkControlHandle {
4698 inner: this.inner.clone(),
4699 };
4700 Ok(SupplicantStaNetworkRequest::Select {
4701 responder: SupplicantStaNetworkSelectResponder {
4702 control_handle: std::mem::ManuallyDrop::new(control_handle),
4703 tx_id: header.tx_id,
4704 },
4705 })
4706 }
4707 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4708 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4709 ordinal: header.ordinal,
4710 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4711 method_type: fidl::MethodType::OneWay,
4712 })
4713 }
4714 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4715 this.inner.send_framework_err(
4716 fidl::encoding::FrameworkErr::UnknownMethod,
4717 header.tx_id,
4718 header.ordinal,
4719 header.dynamic_flags(),
4720 (bytes, handles),
4721 )?;
4722 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4723 ordinal: header.ordinal,
4724 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4725 method_type: fidl::MethodType::TwoWay,
4726 })
4727 }
4728 _ => Err(fidl::Error::UnknownOrdinal {
4729 ordinal: header.ordinal,
4730 protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4731 }),
4732 }))
4733 },
4734 )
4735 }
4736}
4737
4738#[derive(Debug)]
4739pub enum SupplicantStaNetworkRequest {
4740 SetBssid {
4741 payload: SupplicantStaNetworkSetBssidRequest,
4742 control_handle: SupplicantStaNetworkControlHandle,
4743 },
4744 ClearBssid {
4745 control_handle: SupplicantStaNetworkControlHandle,
4746 },
4747 SetSsid {
4748 payload: SupplicantStaNetworkSetSsidRequest,
4749 control_handle: SupplicantStaNetworkControlHandle,
4750 },
4751 SetKeyMgmt {
4752 payload: SupplicantStaNetworkSetKeyMgmtRequest,
4753 control_handle: SupplicantStaNetworkControlHandle,
4754 },
4755 SetPskPassphrase {
4756 payload: SupplicantStaNetworkSetPskPassphraseRequest,
4757 control_handle: SupplicantStaNetworkControlHandle,
4758 },
4759 SetSaePassword {
4760 payload: SupplicantStaNetworkSetSaePasswordRequest,
4761 control_handle: SupplicantStaNetworkControlHandle,
4762 },
4763 SetWepKey {
4764 payload: SupplicantStaNetworkSetWepKeyRequest,
4765 control_handle: SupplicantStaNetworkControlHandle,
4766 },
4767 SetWepTxKeyIdx {
4770 payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4771 control_handle: SupplicantStaNetworkControlHandle,
4772 },
4773 Select {
4774 responder: SupplicantStaNetworkSelectResponder,
4775 },
4776 #[non_exhaustive]
4778 _UnknownMethod {
4779 ordinal: u64,
4781 control_handle: SupplicantStaNetworkControlHandle,
4782 method_type: fidl::MethodType,
4783 },
4784}
4785
4786impl SupplicantStaNetworkRequest {
4787 #[allow(irrefutable_let_patterns)]
4788 pub fn into_set_bssid(
4789 self,
4790 ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4791 if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4792 Some((payload, control_handle))
4793 } else {
4794 None
4795 }
4796 }
4797
4798 #[allow(irrefutable_let_patterns)]
4799 pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4800 if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4801 Some((control_handle))
4802 } else {
4803 None
4804 }
4805 }
4806
4807 #[allow(irrefutable_let_patterns)]
4808 pub fn into_set_ssid(
4809 self,
4810 ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4811 if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4812 Some((payload, control_handle))
4813 } else {
4814 None
4815 }
4816 }
4817
4818 #[allow(irrefutable_let_patterns)]
4819 pub fn into_set_key_mgmt(
4820 self,
4821 ) -> Option<(SupplicantStaNetworkSetKeyMgmtRequest, SupplicantStaNetworkControlHandle)> {
4822 if let SupplicantStaNetworkRequest::SetKeyMgmt { payload, control_handle } = self {
4823 Some((payload, control_handle))
4824 } else {
4825 None
4826 }
4827 }
4828
4829 #[allow(irrefutable_let_patterns)]
4830 pub fn into_set_psk_passphrase(
4831 self,
4832 ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
4833 {
4834 if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
4835 Some((payload, control_handle))
4836 } else {
4837 None
4838 }
4839 }
4840
4841 #[allow(irrefutable_let_patterns)]
4842 pub fn into_set_sae_password(
4843 self,
4844 ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
4845 {
4846 if let SupplicantStaNetworkRequest::SetSaePassword { payload, control_handle } = self {
4847 Some((payload, control_handle))
4848 } else {
4849 None
4850 }
4851 }
4852
4853 #[allow(irrefutable_let_patterns)]
4854 pub fn into_set_wep_key(
4855 self,
4856 ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
4857 if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
4858 Some((payload, control_handle))
4859 } else {
4860 None
4861 }
4862 }
4863
4864 #[allow(irrefutable_let_patterns)]
4865 pub fn into_set_wep_tx_key_idx(
4866 self,
4867 ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
4868 {
4869 if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
4870 Some((payload, control_handle))
4871 } else {
4872 None
4873 }
4874 }
4875
4876 #[allow(irrefutable_let_patterns)]
4877 pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
4878 if let SupplicantStaNetworkRequest::Select { responder } = self {
4879 Some((responder))
4880 } else {
4881 None
4882 }
4883 }
4884
4885 pub fn method_name(&self) -> &'static str {
4887 match *self {
4888 SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
4889 SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
4890 SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
4891 SupplicantStaNetworkRequest::SetKeyMgmt { .. } => "set_key_mgmt",
4892 SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
4893 SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
4894 SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
4895 SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
4896 SupplicantStaNetworkRequest::Select { .. } => "select",
4897 SupplicantStaNetworkRequest::_UnknownMethod {
4898 method_type: fidl::MethodType::OneWay,
4899 ..
4900 } => "unknown one-way method",
4901 SupplicantStaNetworkRequest::_UnknownMethod {
4902 method_type: fidl::MethodType::TwoWay,
4903 ..
4904 } => "unknown two-way method",
4905 }
4906 }
4907}
4908
4909#[derive(Debug, Clone)]
4910pub struct SupplicantStaNetworkControlHandle {
4911 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4912}
4913
4914impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
4915 fn shutdown(&self) {
4916 self.inner.shutdown()
4917 }
4918
4919 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4920 self.inner.shutdown_with_epitaph(status)
4921 }
4922
4923 fn is_closed(&self) -> bool {
4924 self.inner.channel().is_closed()
4925 }
4926 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4927 self.inner.channel().on_closed()
4928 }
4929
4930 #[cfg(target_os = "fuchsia")]
4931 fn signal_peer(
4932 &self,
4933 clear_mask: zx::Signals,
4934 set_mask: zx::Signals,
4935 ) -> Result<(), zx_status::Status> {
4936 use fidl::Peered;
4937 self.inner.channel().signal_peer(clear_mask, set_mask)
4938 }
4939}
4940
4941impl SupplicantStaNetworkControlHandle {}
4942
4943#[must_use = "FIDL methods require a response to be sent"]
4944#[derive(Debug)]
4945pub struct SupplicantStaNetworkSelectResponder {
4946 control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
4947 tx_id: u32,
4948}
4949
4950impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
4954 fn drop(&mut self) {
4955 self.control_handle.shutdown();
4956 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4958 }
4959}
4960
4961impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
4962 type ControlHandle = SupplicantStaNetworkControlHandle;
4963
4964 fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
4965 &self.control_handle
4966 }
4967
4968 fn drop_without_shutdown(mut self) {
4969 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4971 std::mem::forget(self);
4973 }
4974}
4975
4976impl SupplicantStaNetworkSelectResponder {
4977 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4981 let _result = self.send_raw(result);
4982 if _result.is_err() {
4983 self.control_handle.shutdown();
4984 }
4985 self.drop_without_shutdown();
4986 _result
4987 }
4988
4989 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4991 let _result = self.send_raw(result);
4992 self.drop_without_shutdown();
4993 _result
4994 }
4995
4996 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4997 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4998 fidl::encoding::EmptyStruct,
4999 i32,
5000 >>(
5001 fidl::encoding::FlexibleResult::new(result),
5002 self.tx_id,
5003 0x354bc361a0c77b45,
5004 fidl::encoding::DynamicFlags::FLEXIBLE,
5005 )
5006 }
5007}
5008
5009#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5010pub struct WifiMarker;
5011
5012impl fidl::endpoints::ProtocolMarker for WifiMarker {
5013 type Proxy = WifiProxy;
5014 type RequestStream = WifiRequestStream;
5015 #[cfg(target_os = "fuchsia")]
5016 type SynchronousProxy = WifiSynchronousProxy;
5017
5018 const DEBUG_NAME: &'static str = "(anonymous) Wifi";
5019}
5020pub type WifiStartResult = Result<(), i32>;
5021pub type WifiStopResult = Result<(), i32>;
5022pub type WifiGetChipResult = Result<(), i32>;
5023
5024pub trait WifiProxyInterface: Send + Sync {
5025 fn r#register_event_callback(
5026 &self,
5027 payload: WifiRegisterEventCallbackRequest,
5028 ) -> Result<(), fidl::Error>;
5029 type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
5030 fn r#start(&self) -> Self::StartResponseFut;
5031 type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
5032 fn r#stop(&self) -> Self::StopResponseFut;
5033 type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
5034 + Send;
5035 fn r#get_state(&self) -> Self::GetStateResponseFut;
5036 type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
5037 + Send;
5038 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
5039 type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
5040 + Send;
5041 fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
5042}
5043#[derive(Debug)]
5044#[cfg(target_os = "fuchsia")]
5045pub struct WifiSynchronousProxy {
5046 client: fidl::client::sync::Client,
5047}
5048
5049#[cfg(target_os = "fuchsia")]
5050impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
5051 type Proxy = WifiProxy;
5052 type Protocol = WifiMarker;
5053
5054 fn from_channel(inner: fidl::Channel) -> Self {
5055 Self::new(inner)
5056 }
5057
5058 fn into_channel(self) -> fidl::Channel {
5059 self.client.into_channel()
5060 }
5061
5062 fn as_channel(&self) -> &fidl::Channel {
5063 self.client.as_channel()
5064 }
5065}
5066
5067#[cfg(target_os = "fuchsia")]
5068impl WifiSynchronousProxy {
5069 pub fn new(channel: fidl::Channel) -> Self {
5070 Self { client: fidl::client::sync::Client::new(channel) }
5071 }
5072
5073 pub fn into_channel(self) -> fidl::Channel {
5074 self.client.into_channel()
5075 }
5076
5077 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
5080 WifiEvent::decode(self.client.wait_for_event::<WifiMarker>(deadline)?)
5081 }
5082
5083 pub fn r#register_event_callback(
5086 &self,
5087 mut payload: WifiRegisterEventCallbackRequest,
5088 ) -> Result<(), fidl::Error> {
5089 self.client.send::<WifiRegisterEventCallbackRequest>(
5090 &mut payload,
5091 0x12abbdea948dd67b,
5092 fidl::encoding::DynamicFlags::FLEXIBLE,
5093 )
5094 }
5095
5096 pub fn r#start(
5100 &self,
5101 ___deadline: zx::MonotonicInstant,
5102 ) -> Result<WifiStartResult, fidl::Error> {
5103 let _response = self.client.send_query::<
5104 fidl::encoding::EmptyPayload,
5105 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5106 WifiMarker,
5107 >(
5108 (),
5109 0x427030e4dc6ec07a,
5110 fidl::encoding::DynamicFlags::FLEXIBLE,
5111 ___deadline,
5112 )?
5113 .into_result::<WifiMarker>("start")?;
5114 Ok(_response.map(|x| x))
5115 }
5116
5117 pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
5121 let _response = self.client.send_query::<
5122 fidl::encoding::EmptyPayload,
5123 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5124 WifiMarker,
5125 >(
5126 (),
5127 0x67c9bdf61b2888d,
5128 fidl::encoding::DynamicFlags::FLEXIBLE,
5129 ___deadline,
5130 )?
5131 .into_result::<WifiMarker>("stop")?;
5132 Ok(_response.map(|x| x))
5133 }
5134
5135 pub fn r#get_state(
5137 &self,
5138 ___deadline: zx::MonotonicInstant,
5139 ) -> Result<WifiGetStateResponse, fidl::Error> {
5140 let _response = self.client.send_query::<
5141 fidl::encoding::EmptyPayload,
5142 fidl::encoding::FlexibleType<WifiGetStateResponse>,
5143 WifiMarker,
5144 >(
5145 (),
5146 0x4616114a937d1fb0,
5147 fidl::encoding::DynamicFlags::FLEXIBLE,
5148 ___deadline,
5149 )?
5150 .into_result::<WifiMarker>("get_state")?;
5151 Ok(_response)
5152 }
5153
5154 pub fn r#get_chip_ids(
5156 &self,
5157 ___deadline: zx::MonotonicInstant,
5158 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5159 let _response = self.client.send_query::<
5160 fidl::encoding::EmptyPayload,
5161 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5162 WifiMarker,
5163 >(
5164 (),
5165 0x2fb4f92351d802b5,
5166 fidl::encoding::DynamicFlags::FLEXIBLE,
5167 ___deadline,
5168 )?
5169 .into_result::<WifiMarker>("get_chip_ids")?;
5170 Ok(_response)
5171 }
5172
5173 pub fn r#get_chip(
5176 &self,
5177 mut payload: WifiGetChipRequest,
5178 ___deadline: zx::MonotonicInstant,
5179 ) -> Result<WifiGetChipResult, fidl::Error> {
5180 let _response = self.client.send_query::<
5181 WifiGetChipRequest,
5182 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5183 WifiMarker,
5184 >(
5185 &mut payload,
5186 0xef95d8246612540,
5187 fidl::encoding::DynamicFlags::FLEXIBLE,
5188 ___deadline,
5189 )?
5190 .into_result::<WifiMarker>("get_chip")?;
5191 Ok(_response.map(|x| x))
5192 }
5193}
5194
5195#[cfg(target_os = "fuchsia")]
5196impl From<WifiSynchronousProxy> for zx::NullableHandle {
5197 fn from(value: WifiSynchronousProxy) -> Self {
5198 value.into_channel().into()
5199 }
5200}
5201
5202#[cfg(target_os = "fuchsia")]
5203impl From<fidl::Channel> for WifiSynchronousProxy {
5204 fn from(value: fidl::Channel) -> Self {
5205 Self::new(value)
5206 }
5207}
5208
5209#[cfg(target_os = "fuchsia")]
5210impl fidl::endpoints::FromClient for WifiSynchronousProxy {
5211 type Protocol = WifiMarker;
5212
5213 fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
5214 Self::new(value.into_channel())
5215 }
5216}
5217
5218#[derive(Debug, Clone)]
5219pub struct WifiProxy {
5220 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5221}
5222
5223impl fidl::endpoints::Proxy for WifiProxy {
5224 type Protocol = WifiMarker;
5225
5226 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5227 Self::new(inner)
5228 }
5229
5230 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5231 self.client.into_channel().map_err(|client| Self { client })
5232 }
5233
5234 fn as_channel(&self) -> &::fidl::AsyncChannel {
5235 self.client.as_channel()
5236 }
5237}
5238
5239impl WifiProxy {
5240 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5242 let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5243 Self { client: fidl::client::Client::new(channel, protocol_name) }
5244 }
5245
5246 pub fn take_event_stream(&self) -> WifiEventStream {
5252 WifiEventStream { event_receiver: self.client.take_event_receiver() }
5253 }
5254
5255 pub fn r#register_event_callback(
5258 &self,
5259 mut payload: WifiRegisterEventCallbackRequest,
5260 ) -> Result<(), fidl::Error> {
5261 WifiProxyInterface::r#register_event_callback(self, payload)
5262 }
5263
5264 pub fn r#start(
5268 &self,
5269 ) -> fidl::client::QueryResponseFut<
5270 WifiStartResult,
5271 fidl::encoding::DefaultFuchsiaResourceDialect,
5272 > {
5273 WifiProxyInterface::r#start(self)
5274 }
5275
5276 pub fn r#stop(
5280 &self,
5281 ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5282 {
5283 WifiProxyInterface::r#stop(self)
5284 }
5285
5286 pub fn r#get_state(
5288 &self,
5289 ) -> fidl::client::QueryResponseFut<
5290 WifiGetStateResponse,
5291 fidl::encoding::DefaultFuchsiaResourceDialect,
5292 > {
5293 WifiProxyInterface::r#get_state(self)
5294 }
5295
5296 pub fn r#get_chip_ids(
5298 &self,
5299 ) -> fidl::client::QueryResponseFut<
5300 WifiGetChipIdsResponse,
5301 fidl::encoding::DefaultFuchsiaResourceDialect,
5302 > {
5303 WifiProxyInterface::r#get_chip_ids(self)
5304 }
5305
5306 pub fn r#get_chip(
5309 &self,
5310 mut payload: WifiGetChipRequest,
5311 ) -> fidl::client::QueryResponseFut<
5312 WifiGetChipResult,
5313 fidl::encoding::DefaultFuchsiaResourceDialect,
5314 > {
5315 WifiProxyInterface::r#get_chip(self, payload)
5316 }
5317}
5318
5319impl WifiProxyInterface for WifiProxy {
5320 fn r#register_event_callback(
5321 &self,
5322 mut payload: WifiRegisterEventCallbackRequest,
5323 ) -> Result<(), fidl::Error> {
5324 self.client.send::<WifiRegisterEventCallbackRequest>(
5325 &mut payload,
5326 0x12abbdea948dd67b,
5327 fidl::encoding::DynamicFlags::FLEXIBLE,
5328 )
5329 }
5330
5331 type StartResponseFut = fidl::client::QueryResponseFut<
5332 WifiStartResult,
5333 fidl::encoding::DefaultFuchsiaResourceDialect,
5334 >;
5335 fn r#start(&self) -> Self::StartResponseFut {
5336 fn _decode(
5337 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5338 ) -> Result<WifiStartResult, fidl::Error> {
5339 let _response = fidl::client::decode_transaction_body::<
5340 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5341 fidl::encoding::DefaultFuchsiaResourceDialect,
5342 0x427030e4dc6ec07a,
5343 >(_buf?)?
5344 .into_result::<WifiMarker>("start")?;
5345 Ok(_response.map(|x| x))
5346 }
5347 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5348 (),
5349 0x427030e4dc6ec07a,
5350 fidl::encoding::DynamicFlags::FLEXIBLE,
5351 _decode,
5352 )
5353 }
5354
5355 type StopResponseFut = fidl::client::QueryResponseFut<
5356 WifiStopResult,
5357 fidl::encoding::DefaultFuchsiaResourceDialect,
5358 >;
5359 fn r#stop(&self) -> Self::StopResponseFut {
5360 fn _decode(
5361 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5362 ) -> Result<WifiStopResult, fidl::Error> {
5363 let _response = fidl::client::decode_transaction_body::<
5364 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5365 fidl::encoding::DefaultFuchsiaResourceDialect,
5366 0x67c9bdf61b2888d,
5367 >(_buf?)?
5368 .into_result::<WifiMarker>("stop")?;
5369 Ok(_response.map(|x| x))
5370 }
5371 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5372 (),
5373 0x67c9bdf61b2888d,
5374 fidl::encoding::DynamicFlags::FLEXIBLE,
5375 _decode,
5376 )
5377 }
5378
5379 type GetStateResponseFut = fidl::client::QueryResponseFut<
5380 WifiGetStateResponse,
5381 fidl::encoding::DefaultFuchsiaResourceDialect,
5382 >;
5383 fn r#get_state(&self) -> Self::GetStateResponseFut {
5384 fn _decode(
5385 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5386 ) -> Result<WifiGetStateResponse, fidl::Error> {
5387 let _response = fidl::client::decode_transaction_body::<
5388 fidl::encoding::FlexibleType<WifiGetStateResponse>,
5389 fidl::encoding::DefaultFuchsiaResourceDialect,
5390 0x4616114a937d1fb0,
5391 >(_buf?)?
5392 .into_result::<WifiMarker>("get_state")?;
5393 Ok(_response)
5394 }
5395 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5396 (),
5397 0x4616114a937d1fb0,
5398 fidl::encoding::DynamicFlags::FLEXIBLE,
5399 _decode,
5400 )
5401 }
5402
5403 type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5404 WifiGetChipIdsResponse,
5405 fidl::encoding::DefaultFuchsiaResourceDialect,
5406 >;
5407 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5408 fn _decode(
5409 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5410 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5411 let _response = fidl::client::decode_transaction_body::<
5412 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5413 fidl::encoding::DefaultFuchsiaResourceDialect,
5414 0x2fb4f92351d802b5,
5415 >(_buf?)?
5416 .into_result::<WifiMarker>("get_chip_ids")?;
5417 Ok(_response)
5418 }
5419 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5420 (),
5421 0x2fb4f92351d802b5,
5422 fidl::encoding::DynamicFlags::FLEXIBLE,
5423 _decode,
5424 )
5425 }
5426
5427 type GetChipResponseFut = fidl::client::QueryResponseFut<
5428 WifiGetChipResult,
5429 fidl::encoding::DefaultFuchsiaResourceDialect,
5430 >;
5431 fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5432 fn _decode(
5433 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5434 ) -> Result<WifiGetChipResult, fidl::Error> {
5435 let _response = fidl::client::decode_transaction_body::<
5436 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5437 fidl::encoding::DefaultFuchsiaResourceDialect,
5438 0xef95d8246612540,
5439 >(_buf?)?
5440 .into_result::<WifiMarker>("get_chip")?;
5441 Ok(_response.map(|x| x))
5442 }
5443 self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5444 &mut payload,
5445 0xef95d8246612540,
5446 fidl::encoding::DynamicFlags::FLEXIBLE,
5447 _decode,
5448 )
5449 }
5450}
5451
5452pub struct WifiEventStream {
5453 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5454}
5455
5456impl std::marker::Unpin for WifiEventStream {}
5457
5458impl futures::stream::FusedStream for WifiEventStream {
5459 fn is_terminated(&self) -> bool {
5460 self.event_receiver.is_terminated()
5461 }
5462}
5463
5464impl futures::Stream for WifiEventStream {
5465 type Item = Result<WifiEvent, fidl::Error>;
5466
5467 fn poll_next(
5468 mut self: std::pin::Pin<&mut Self>,
5469 cx: &mut std::task::Context<'_>,
5470 ) -> std::task::Poll<Option<Self::Item>> {
5471 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5472 &mut self.event_receiver,
5473 cx
5474 )?) {
5475 Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5476 None => std::task::Poll::Ready(None),
5477 }
5478 }
5479}
5480
5481#[derive(Debug)]
5482pub enum WifiEvent {
5483 #[non_exhaustive]
5484 _UnknownEvent {
5485 ordinal: u64,
5487 },
5488}
5489
5490impl WifiEvent {
5491 fn decode(
5493 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5494 ) -> Result<WifiEvent, fidl::Error> {
5495 let (bytes, _handles) = buf.split_mut();
5496 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5497 debug_assert_eq!(tx_header.tx_id, 0);
5498 match tx_header.ordinal {
5499 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5500 Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5501 }
5502 _ => Err(fidl::Error::UnknownOrdinal {
5503 ordinal: tx_header.ordinal,
5504 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5505 }),
5506 }
5507 }
5508}
5509
5510pub struct WifiRequestStream {
5512 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5513 is_terminated: bool,
5514}
5515
5516impl std::marker::Unpin for WifiRequestStream {}
5517
5518impl futures::stream::FusedStream for WifiRequestStream {
5519 fn is_terminated(&self) -> bool {
5520 self.is_terminated
5521 }
5522}
5523
5524impl fidl::endpoints::RequestStream for WifiRequestStream {
5525 type Protocol = WifiMarker;
5526 type ControlHandle = WifiControlHandle;
5527
5528 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5529 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5530 }
5531
5532 fn control_handle(&self) -> Self::ControlHandle {
5533 WifiControlHandle { inner: self.inner.clone() }
5534 }
5535
5536 fn into_inner(
5537 self,
5538 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5539 {
5540 (self.inner, self.is_terminated)
5541 }
5542
5543 fn from_inner(
5544 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5545 is_terminated: bool,
5546 ) -> Self {
5547 Self { inner, is_terminated }
5548 }
5549}
5550
5551impl futures::Stream for WifiRequestStream {
5552 type Item = Result<WifiRequest, fidl::Error>;
5553
5554 fn poll_next(
5555 mut self: std::pin::Pin<&mut Self>,
5556 cx: &mut std::task::Context<'_>,
5557 ) -> std::task::Poll<Option<Self::Item>> {
5558 let this = &mut *self;
5559 if this.inner.check_shutdown(cx) {
5560 this.is_terminated = true;
5561 return std::task::Poll::Ready(None);
5562 }
5563 if this.is_terminated {
5564 panic!("polled WifiRequestStream after completion");
5565 }
5566 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5567 |bytes, handles| {
5568 match this.inner.channel().read_etc(cx, bytes, handles) {
5569 std::task::Poll::Ready(Ok(())) => {}
5570 std::task::Poll::Pending => return std::task::Poll::Pending,
5571 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5572 this.is_terminated = true;
5573 return std::task::Poll::Ready(None);
5574 }
5575 std::task::Poll::Ready(Err(e)) => {
5576 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5577 e.into(),
5578 ))));
5579 }
5580 }
5581
5582 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5584
5585 std::task::Poll::Ready(Some(match header.ordinal {
5586 0x12abbdea948dd67b => {
5587 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5588 let mut req = fidl::new_empty!(
5589 WifiRegisterEventCallbackRequest,
5590 fidl::encoding::DefaultFuchsiaResourceDialect
5591 );
5592 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5593 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5594 Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5595 }
5596 0x427030e4dc6ec07a => {
5597 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5598 let mut req = fidl::new_empty!(
5599 fidl::encoding::EmptyPayload,
5600 fidl::encoding::DefaultFuchsiaResourceDialect
5601 );
5602 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5603 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5604 Ok(WifiRequest::Start {
5605 responder: WifiStartResponder {
5606 control_handle: std::mem::ManuallyDrop::new(control_handle),
5607 tx_id: header.tx_id,
5608 },
5609 })
5610 }
5611 0x67c9bdf61b2888d => {
5612 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5613 let mut req = fidl::new_empty!(
5614 fidl::encoding::EmptyPayload,
5615 fidl::encoding::DefaultFuchsiaResourceDialect
5616 );
5617 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5618 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5619 Ok(WifiRequest::Stop {
5620 responder: WifiStopResponder {
5621 control_handle: std::mem::ManuallyDrop::new(control_handle),
5622 tx_id: header.tx_id,
5623 },
5624 })
5625 }
5626 0x4616114a937d1fb0 => {
5627 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5628 let mut req = fidl::new_empty!(
5629 fidl::encoding::EmptyPayload,
5630 fidl::encoding::DefaultFuchsiaResourceDialect
5631 );
5632 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5633 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5634 Ok(WifiRequest::GetState {
5635 responder: WifiGetStateResponder {
5636 control_handle: std::mem::ManuallyDrop::new(control_handle),
5637 tx_id: header.tx_id,
5638 },
5639 })
5640 }
5641 0x2fb4f92351d802b5 => {
5642 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5643 let mut req = fidl::new_empty!(
5644 fidl::encoding::EmptyPayload,
5645 fidl::encoding::DefaultFuchsiaResourceDialect
5646 );
5647 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5648 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5649 Ok(WifiRequest::GetChipIds {
5650 responder: WifiGetChipIdsResponder {
5651 control_handle: std::mem::ManuallyDrop::new(control_handle),
5652 tx_id: header.tx_id,
5653 },
5654 })
5655 }
5656 0xef95d8246612540 => {
5657 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5658 let mut req = fidl::new_empty!(
5659 WifiGetChipRequest,
5660 fidl::encoding::DefaultFuchsiaResourceDialect
5661 );
5662 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5663 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5664 Ok(WifiRequest::GetChip {
5665 payload: req,
5666 responder: WifiGetChipResponder {
5667 control_handle: std::mem::ManuallyDrop::new(control_handle),
5668 tx_id: header.tx_id,
5669 },
5670 })
5671 }
5672 _ if header.tx_id == 0
5673 && header
5674 .dynamic_flags()
5675 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5676 {
5677 Ok(WifiRequest::_UnknownMethod {
5678 ordinal: header.ordinal,
5679 control_handle: WifiControlHandle { inner: this.inner.clone() },
5680 method_type: fidl::MethodType::OneWay,
5681 })
5682 }
5683 _ if header
5684 .dynamic_flags()
5685 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5686 {
5687 this.inner.send_framework_err(
5688 fidl::encoding::FrameworkErr::UnknownMethod,
5689 header.tx_id,
5690 header.ordinal,
5691 header.dynamic_flags(),
5692 (bytes, handles),
5693 )?;
5694 Ok(WifiRequest::_UnknownMethod {
5695 ordinal: header.ordinal,
5696 control_handle: WifiControlHandle { inner: this.inner.clone() },
5697 method_type: fidl::MethodType::TwoWay,
5698 })
5699 }
5700 _ => Err(fidl::Error::UnknownOrdinal {
5701 ordinal: header.ordinal,
5702 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5703 }),
5704 }))
5705 },
5706 )
5707 }
5708}
5709
5710#[derive(Debug)]
5711pub enum WifiRequest {
5712 RegisterEventCallback {
5715 payload: WifiRegisterEventCallbackRequest,
5716 control_handle: WifiControlHandle,
5717 },
5718 Start { responder: WifiStartResponder },
5722 Stop { responder: WifiStopResponder },
5726 GetState { responder: WifiGetStateResponder },
5728 GetChipIds { responder: WifiGetChipIdsResponder },
5730 GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5733 #[non_exhaustive]
5735 _UnknownMethod {
5736 ordinal: u64,
5738 control_handle: WifiControlHandle,
5739 method_type: fidl::MethodType,
5740 },
5741}
5742
5743impl WifiRequest {
5744 #[allow(irrefutable_let_patterns)]
5745 pub fn into_register_event_callback(
5746 self,
5747 ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5748 if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5749 Some((payload, control_handle))
5750 } else {
5751 None
5752 }
5753 }
5754
5755 #[allow(irrefutable_let_patterns)]
5756 pub fn into_start(self) -> Option<(WifiStartResponder)> {
5757 if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5758 }
5759
5760 #[allow(irrefutable_let_patterns)]
5761 pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5762 if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5763 }
5764
5765 #[allow(irrefutable_let_patterns)]
5766 pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5767 if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5768 }
5769
5770 #[allow(irrefutable_let_patterns)]
5771 pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5772 if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5773 }
5774
5775 #[allow(irrefutable_let_patterns)]
5776 pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5777 if let WifiRequest::GetChip { payload, responder } = self {
5778 Some((payload, responder))
5779 } else {
5780 None
5781 }
5782 }
5783
5784 pub fn method_name(&self) -> &'static str {
5786 match *self {
5787 WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5788 WifiRequest::Start { .. } => "start",
5789 WifiRequest::Stop { .. } => "stop",
5790 WifiRequest::GetState { .. } => "get_state",
5791 WifiRequest::GetChipIds { .. } => "get_chip_ids",
5792 WifiRequest::GetChip { .. } => "get_chip",
5793 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5794 "unknown one-way method"
5795 }
5796 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5797 "unknown two-way method"
5798 }
5799 }
5800 }
5801}
5802
5803#[derive(Debug, Clone)]
5804pub struct WifiControlHandle {
5805 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5806}
5807
5808impl fidl::endpoints::ControlHandle for WifiControlHandle {
5809 fn shutdown(&self) {
5810 self.inner.shutdown()
5811 }
5812
5813 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5814 self.inner.shutdown_with_epitaph(status)
5815 }
5816
5817 fn is_closed(&self) -> bool {
5818 self.inner.channel().is_closed()
5819 }
5820 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5821 self.inner.channel().on_closed()
5822 }
5823
5824 #[cfg(target_os = "fuchsia")]
5825 fn signal_peer(
5826 &self,
5827 clear_mask: zx::Signals,
5828 set_mask: zx::Signals,
5829 ) -> Result<(), zx_status::Status> {
5830 use fidl::Peered;
5831 self.inner.channel().signal_peer(clear_mask, set_mask)
5832 }
5833}
5834
5835impl WifiControlHandle {}
5836
5837#[must_use = "FIDL methods require a response to be sent"]
5838#[derive(Debug)]
5839pub struct WifiStartResponder {
5840 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5841 tx_id: u32,
5842}
5843
5844impl std::ops::Drop for WifiStartResponder {
5848 fn drop(&mut self) {
5849 self.control_handle.shutdown();
5850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5852 }
5853}
5854
5855impl fidl::endpoints::Responder for WifiStartResponder {
5856 type ControlHandle = WifiControlHandle;
5857
5858 fn control_handle(&self) -> &WifiControlHandle {
5859 &self.control_handle
5860 }
5861
5862 fn drop_without_shutdown(mut self) {
5863 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5865 std::mem::forget(self);
5867 }
5868}
5869
5870impl WifiStartResponder {
5871 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5875 let _result = self.send_raw(result);
5876 if _result.is_err() {
5877 self.control_handle.shutdown();
5878 }
5879 self.drop_without_shutdown();
5880 _result
5881 }
5882
5883 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5885 let _result = self.send_raw(result);
5886 self.drop_without_shutdown();
5887 _result
5888 }
5889
5890 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5891 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5892 fidl::encoding::EmptyStruct,
5893 i32,
5894 >>(
5895 fidl::encoding::FlexibleResult::new(result),
5896 self.tx_id,
5897 0x427030e4dc6ec07a,
5898 fidl::encoding::DynamicFlags::FLEXIBLE,
5899 )
5900 }
5901}
5902
5903#[must_use = "FIDL methods require a response to be sent"]
5904#[derive(Debug)]
5905pub struct WifiStopResponder {
5906 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5907 tx_id: u32,
5908}
5909
5910impl std::ops::Drop for WifiStopResponder {
5914 fn drop(&mut self) {
5915 self.control_handle.shutdown();
5916 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5918 }
5919}
5920
5921impl fidl::endpoints::Responder for WifiStopResponder {
5922 type ControlHandle = WifiControlHandle;
5923
5924 fn control_handle(&self) -> &WifiControlHandle {
5925 &self.control_handle
5926 }
5927
5928 fn drop_without_shutdown(mut self) {
5929 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5931 std::mem::forget(self);
5933 }
5934}
5935
5936impl WifiStopResponder {
5937 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5941 let _result = self.send_raw(result);
5942 if _result.is_err() {
5943 self.control_handle.shutdown();
5944 }
5945 self.drop_without_shutdown();
5946 _result
5947 }
5948
5949 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5951 let _result = self.send_raw(result);
5952 self.drop_without_shutdown();
5953 _result
5954 }
5955
5956 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5957 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5958 fidl::encoding::EmptyStruct,
5959 i32,
5960 >>(
5961 fidl::encoding::FlexibleResult::new(result),
5962 self.tx_id,
5963 0x67c9bdf61b2888d,
5964 fidl::encoding::DynamicFlags::FLEXIBLE,
5965 )
5966 }
5967}
5968
5969#[must_use = "FIDL methods require a response to be sent"]
5970#[derive(Debug)]
5971pub struct WifiGetStateResponder {
5972 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5973 tx_id: u32,
5974}
5975
5976impl std::ops::Drop for WifiGetStateResponder {
5980 fn drop(&mut self) {
5981 self.control_handle.shutdown();
5982 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5984 }
5985}
5986
5987impl fidl::endpoints::Responder for WifiGetStateResponder {
5988 type ControlHandle = WifiControlHandle;
5989
5990 fn control_handle(&self) -> &WifiControlHandle {
5991 &self.control_handle
5992 }
5993
5994 fn drop_without_shutdown(mut self) {
5995 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5997 std::mem::forget(self);
5999 }
6000}
6001
6002impl WifiGetStateResponder {
6003 pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6007 let _result = self.send_raw(payload);
6008 if _result.is_err() {
6009 self.control_handle.shutdown();
6010 }
6011 self.drop_without_shutdown();
6012 _result
6013 }
6014
6015 pub fn send_no_shutdown_on_err(
6017 self,
6018 mut payload: &WifiGetStateResponse,
6019 ) -> Result<(), fidl::Error> {
6020 let _result = self.send_raw(payload);
6021 self.drop_without_shutdown();
6022 _result
6023 }
6024
6025 fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6026 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
6027 fidl::encoding::Flexible::new(payload),
6028 self.tx_id,
6029 0x4616114a937d1fb0,
6030 fidl::encoding::DynamicFlags::FLEXIBLE,
6031 )
6032 }
6033}
6034
6035#[must_use = "FIDL methods require a response to be sent"]
6036#[derive(Debug)]
6037pub struct WifiGetChipIdsResponder {
6038 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6039 tx_id: u32,
6040}
6041
6042impl std::ops::Drop for WifiGetChipIdsResponder {
6046 fn drop(&mut self) {
6047 self.control_handle.shutdown();
6048 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6050 }
6051}
6052
6053impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
6054 type ControlHandle = WifiControlHandle;
6055
6056 fn control_handle(&self) -> &WifiControlHandle {
6057 &self.control_handle
6058 }
6059
6060 fn drop_without_shutdown(mut self) {
6061 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6063 std::mem::forget(self);
6065 }
6066}
6067
6068impl WifiGetChipIdsResponder {
6069 pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6073 let _result = self.send_raw(payload);
6074 if _result.is_err() {
6075 self.control_handle.shutdown();
6076 }
6077 self.drop_without_shutdown();
6078 _result
6079 }
6080
6081 pub fn send_no_shutdown_on_err(
6083 self,
6084 mut payload: &WifiGetChipIdsResponse,
6085 ) -> Result<(), fidl::Error> {
6086 let _result = self.send_raw(payload);
6087 self.drop_without_shutdown();
6088 _result
6089 }
6090
6091 fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6092 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
6093 fidl::encoding::Flexible::new(payload),
6094 self.tx_id,
6095 0x2fb4f92351d802b5,
6096 fidl::encoding::DynamicFlags::FLEXIBLE,
6097 )
6098 }
6099}
6100
6101#[must_use = "FIDL methods require a response to be sent"]
6102#[derive(Debug)]
6103pub struct WifiGetChipResponder {
6104 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6105 tx_id: u32,
6106}
6107
6108impl std::ops::Drop for WifiGetChipResponder {
6112 fn drop(&mut self) {
6113 self.control_handle.shutdown();
6114 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6116 }
6117}
6118
6119impl fidl::endpoints::Responder for WifiGetChipResponder {
6120 type ControlHandle = WifiControlHandle;
6121
6122 fn control_handle(&self) -> &WifiControlHandle {
6123 &self.control_handle
6124 }
6125
6126 fn drop_without_shutdown(mut self) {
6127 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6129 std::mem::forget(self);
6131 }
6132}
6133
6134impl WifiGetChipResponder {
6135 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6139 let _result = self.send_raw(result);
6140 if _result.is_err() {
6141 self.control_handle.shutdown();
6142 }
6143 self.drop_without_shutdown();
6144 _result
6145 }
6146
6147 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6149 let _result = self.send_raw(result);
6150 self.drop_without_shutdown();
6151 _result
6152 }
6153
6154 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6155 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6156 fidl::encoding::EmptyStruct,
6157 i32,
6158 >>(
6159 fidl::encoding::FlexibleResult::new(result),
6160 self.tx_id,
6161 0xef95d8246612540,
6162 fidl::encoding::DynamicFlags::FLEXIBLE,
6163 )
6164 }
6165}
6166
6167#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6168pub struct WifiChipMarker;
6169
6170impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
6171 type Proxy = WifiChipProxy;
6172 type RequestStream = WifiChipRequestStream;
6173 #[cfg(target_os = "fuchsia")]
6174 type SynchronousProxy = WifiChipSynchronousProxy;
6175
6176 const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
6177}
6178pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
6179pub type WifiChipGetStaIfaceResult = Result<(), i32>;
6180pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
6181pub type WifiChipSetCountryCodeResult = Result<(), i32>;
6182pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
6183
6184pub trait WifiChipProxyInterface: Send + Sync {
6185 type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
6186 + Send;
6187 fn r#create_sta_iface(
6188 &self,
6189 payload: WifiChipCreateStaIfaceRequest,
6190 ) -> Self::CreateStaIfaceResponseFut;
6191 type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
6192 + Send;
6193 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
6194 type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
6195 + Send;
6196 fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
6197 type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
6198 + Send;
6199 fn r#remove_sta_iface(
6200 &self,
6201 payload: WifiChipRemoveStaIfaceRequest,
6202 ) -> Self::RemoveStaIfaceResponseFut;
6203 type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
6204 + Send;
6205 fn r#set_country_code(
6206 &self,
6207 payload: WifiChipSetCountryCodeRequest,
6208 ) -> Self::SetCountryCodeResponseFut;
6209 type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
6210 + Send;
6211 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
6212 type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
6213 + Send;
6214 fn r#get_id(&self) -> Self::GetIdResponseFut;
6215 type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
6216 + Send;
6217 fn r#get_mode(&self) -> Self::GetModeResponseFut;
6218 type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
6219 + Send;
6220 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
6221 type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
6222 + Send;
6223 fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
6224 type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6225 + Send;
6226 fn r#select_tx_power_scenario(
6227 &self,
6228 scenario: WifiChipTxPowerScenario,
6229 ) -> Self::SelectTxPowerScenarioResponseFut;
6230 type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6231 + Send;
6232 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
6233}
6234#[derive(Debug)]
6235#[cfg(target_os = "fuchsia")]
6236pub struct WifiChipSynchronousProxy {
6237 client: fidl::client::sync::Client,
6238}
6239
6240#[cfg(target_os = "fuchsia")]
6241impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6242 type Proxy = WifiChipProxy;
6243 type Protocol = WifiChipMarker;
6244
6245 fn from_channel(inner: fidl::Channel) -> Self {
6246 Self::new(inner)
6247 }
6248
6249 fn into_channel(self) -> fidl::Channel {
6250 self.client.into_channel()
6251 }
6252
6253 fn as_channel(&self) -> &fidl::Channel {
6254 self.client.as_channel()
6255 }
6256}
6257
6258#[cfg(target_os = "fuchsia")]
6259impl WifiChipSynchronousProxy {
6260 pub fn new(channel: fidl::Channel) -> Self {
6261 Self { client: fidl::client::sync::Client::new(channel) }
6262 }
6263
6264 pub fn into_channel(self) -> fidl::Channel {
6265 self.client.into_channel()
6266 }
6267
6268 pub fn wait_for_event(
6271 &self,
6272 deadline: zx::MonotonicInstant,
6273 ) -> Result<WifiChipEvent, fidl::Error> {
6274 WifiChipEvent::decode(self.client.wait_for_event::<WifiChipMarker>(deadline)?)
6275 }
6276
6277 pub fn r#create_sta_iface(
6279 &self,
6280 mut payload: WifiChipCreateStaIfaceRequest,
6281 ___deadline: zx::MonotonicInstant,
6282 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6283 let _response = self.client.send_query::<
6284 WifiChipCreateStaIfaceRequest,
6285 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6286 WifiChipMarker,
6287 >(
6288 &mut payload,
6289 0x6fb2d5892face7af,
6290 fidl::encoding::DynamicFlags::FLEXIBLE,
6291 ___deadline,
6292 )?
6293 .into_result::<WifiChipMarker>("create_sta_iface")?;
6294 Ok(_response.map(|x| x))
6295 }
6296
6297 pub fn r#get_sta_iface_names(
6299 &self,
6300 ___deadline: zx::MonotonicInstant,
6301 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6302 let _response = self.client.send_query::<
6303 fidl::encoding::EmptyPayload,
6304 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6305 WifiChipMarker,
6306 >(
6307 (),
6308 0x349257482df6a000,
6309 fidl::encoding::DynamicFlags::FLEXIBLE,
6310 ___deadline,
6311 )?
6312 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6313 Ok(_response)
6314 }
6315
6316 pub fn r#get_sta_iface(
6318 &self,
6319 mut payload: WifiChipGetStaIfaceRequest,
6320 ___deadline: zx::MonotonicInstant,
6321 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6322 let _response = self.client.send_query::<
6323 WifiChipGetStaIfaceRequest,
6324 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6325 WifiChipMarker,
6326 >(
6327 &mut payload,
6328 0x6d9704eeb36f28a2,
6329 fidl::encoding::DynamicFlags::FLEXIBLE,
6330 ___deadline,
6331 )?
6332 .into_result::<WifiChipMarker>("get_sta_iface")?;
6333 Ok(_response.map(|x| x))
6334 }
6335
6336 pub fn r#remove_sta_iface(
6338 &self,
6339 mut payload: WifiChipRemoveStaIfaceRequest,
6340 ___deadline: zx::MonotonicInstant,
6341 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6342 let _response = self.client.send_query::<
6343 WifiChipRemoveStaIfaceRequest,
6344 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6345 WifiChipMarker,
6346 >(
6347 &mut payload,
6348 0x4cd8eee466f8b04c,
6349 fidl::encoding::DynamicFlags::FLEXIBLE,
6350 ___deadline,
6351 )?
6352 .into_result::<WifiChipMarker>("remove_sta_iface")?;
6353 Ok(_response.map(|x| x))
6354 }
6355
6356 pub fn r#set_country_code(
6357 &self,
6358 mut payload: WifiChipSetCountryCodeRequest,
6359 ___deadline: zx::MonotonicInstant,
6360 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6361 let _response = self.client.send_query::<
6362 WifiChipSetCountryCodeRequest,
6363 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6364 WifiChipMarker,
6365 >(
6366 &mut payload,
6367 0x1dfe372d1d61a490,
6368 fidl::encoding::DynamicFlags::FLEXIBLE,
6369 ___deadline,
6370 )?
6371 .into_result::<WifiChipMarker>("set_country_code")?;
6372 Ok(_response.map(|x| x))
6373 }
6374
6375 pub fn r#get_available_modes(
6379 &self,
6380 ___deadline: zx::MonotonicInstant,
6381 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6382 let _response = self.client.send_query::<
6383 fidl::encoding::EmptyPayload,
6384 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6385 WifiChipMarker,
6386 >(
6387 (),
6388 0x1701095b452a3acd,
6389 fidl::encoding::DynamicFlags::FLEXIBLE,
6390 ___deadline,
6391 )?
6392 .into_result::<WifiChipMarker>("get_available_modes")?;
6393 Ok(_response)
6394 }
6395
6396 pub fn r#get_id(
6398 &self,
6399 ___deadline: zx::MonotonicInstant,
6400 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6401 let _response = self.client.send_query::<
6402 fidl::encoding::EmptyPayload,
6403 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6404 WifiChipMarker,
6405 >(
6406 (),
6407 0x37d5197325bb3370,
6408 fidl::encoding::DynamicFlags::FLEXIBLE,
6409 ___deadline,
6410 )?
6411 .into_result::<WifiChipMarker>("get_id")?;
6412 Ok(_response)
6413 }
6414
6415 pub fn r#get_mode(
6417 &self,
6418 ___deadline: zx::MonotonicInstant,
6419 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6420 let _response = self.client.send_query::<
6421 fidl::encoding::EmptyPayload,
6422 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6423 WifiChipMarker,
6424 >(
6425 (),
6426 0x4d209e0f3ac84d6f,
6427 fidl::encoding::DynamicFlags::FLEXIBLE,
6428 ___deadline,
6429 )?
6430 .into_result::<WifiChipMarker>("get_mode")?;
6431 Ok(_response)
6432 }
6433
6434 pub fn r#get_capabilities(
6436 &self,
6437 ___deadline: zx::MonotonicInstant,
6438 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6439 let _response = self.client.send_query::<
6440 fidl::encoding::EmptyPayload,
6441 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6442 WifiChipMarker,
6443 >(
6444 (),
6445 0x1b253f396dcaa2e0,
6446 fidl::encoding::DynamicFlags::FLEXIBLE,
6447 ___deadline,
6448 )?
6449 .into_result::<WifiChipMarker>("get_capabilities")?;
6450 Ok(_response)
6451 }
6452
6453 pub fn r#trigger_subsystem_restart(
6456 &self,
6457 ___deadline: zx::MonotonicInstant,
6458 ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6459 let _response = self.client.send_query::<
6460 fidl::encoding::EmptyPayload,
6461 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6462 WifiChipMarker,
6463 >(
6464 (),
6465 0x42ffcae5aad196f9,
6466 fidl::encoding::DynamicFlags::FLEXIBLE,
6467 ___deadline,
6468 )?
6469 .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6470 Ok(_response.map(|x| x))
6471 }
6472
6473 pub fn r#select_tx_power_scenario(
6475 &self,
6476 mut scenario: WifiChipTxPowerScenario,
6477 ___deadline: zx::MonotonicInstant,
6478 ) -> Result<(), fidl::Error> {
6479 let _response = self.client.send_query::<
6480 WifiChipSelectTxPowerScenarioRequest,
6481 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6482 WifiChipMarker,
6483 >(
6484 (scenario,),
6485 0x19287ab52ea72281,
6486 fidl::encoding::DynamicFlags::FLEXIBLE,
6487 ___deadline,
6488 )?
6489 .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6490 Ok(_response)
6491 }
6492
6493 pub fn r#reset_tx_power_scenario(
6495 &self,
6496 ___deadline: zx::MonotonicInstant,
6497 ) -> Result<(), fidl::Error> {
6498 let _response = self.client.send_query::<
6499 fidl::encoding::EmptyPayload,
6500 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6501 WifiChipMarker,
6502 >(
6503 (),
6504 0x46408a2fb1eb9d09,
6505 fidl::encoding::DynamicFlags::FLEXIBLE,
6506 ___deadline,
6507 )?
6508 .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6509 Ok(_response)
6510 }
6511}
6512
6513#[cfg(target_os = "fuchsia")]
6514impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6515 fn from(value: WifiChipSynchronousProxy) -> Self {
6516 value.into_channel().into()
6517 }
6518}
6519
6520#[cfg(target_os = "fuchsia")]
6521impl From<fidl::Channel> for WifiChipSynchronousProxy {
6522 fn from(value: fidl::Channel) -> Self {
6523 Self::new(value)
6524 }
6525}
6526
6527#[cfg(target_os = "fuchsia")]
6528impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6529 type Protocol = WifiChipMarker;
6530
6531 fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6532 Self::new(value.into_channel())
6533 }
6534}
6535
6536#[derive(Debug, Clone)]
6537pub struct WifiChipProxy {
6538 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6539}
6540
6541impl fidl::endpoints::Proxy for WifiChipProxy {
6542 type Protocol = WifiChipMarker;
6543
6544 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6545 Self::new(inner)
6546 }
6547
6548 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6549 self.client.into_channel().map_err(|client| Self { client })
6550 }
6551
6552 fn as_channel(&self) -> &::fidl::AsyncChannel {
6553 self.client.as_channel()
6554 }
6555}
6556
6557impl WifiChipProxy {
6558 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6560 let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6561 Self { client: fidl::client::Client::new(channel, protocol_name) }
6562 }
6563
6564 pub fn take_event_stream(&self) -> WifiChipEventStream {
6570 WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6571 }
6572
6573 pub fn r#create_sta_iface(
6575 &self,
6576 mut payload: WifiChipCreateStaIfaceRequest,
6577 ) -> fidl::client::QueryResponseFut<
6578 WifiChipCreateStaIfaceResult,
6579 fidl::encoding::DefaultFuchsiaResourceDialect,
6580 > {
6581 WifiChipProxyInterface::r#create_sta_iface(self, payload)
6582 }
6583
6584 pub fn r#get_sta_iface_names(
6586 &self,
6587 ) -> fidl::client::QueryResponseFut<
6588 WifiChipGetStaIfaceNamesResponse,
6589 fidl::encoding::DefaultFuchsiaResourceDialect,
6590 > {
6591 WifiChipProxyInterface::r#get_sta_iface_names(self)
6592 }
6593
6594 pub fn r#get_sta_iface(
6596 &self,
6597 mut payload: WifiChipGetStaIfaceRequest,
6598 ) -> fidl::client::QueryResponseFut<
6599 WifiChipGetStaIfaceResult,
6600 fidl::encoding::DefaultFuchsiaResourceDialect,
6601 > {
6602 WifiChipProxyInterface::r#get_sta_iface(self, payload)
6603 }
6604
6605 pub fn r#remove_sta_iface(
6607 &self,
6608 mut payload: WifiChipRemoveStaIfaceRequest,
6609 ) -> fidl::client::QueryResponseFut<
6610 WifiChipRemoveStaIfaceResult,
6611 fidl::encoding::DefaultFuchsiaResourceDialect,
6612 > {
6613 WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6614 }
6615
6616 pub fn r#set_country_code(
6617 &self,
6618 mut payload: WifiChipSetCountryCodeRequest,
6619 ) -> fidl::client::QueryResponseFut<
6620 WifiChipSetCountryCodeResult,
6621 fidl::encoding::DefaultFuchsiaResourceDialect,
6622 > {
6623 WifiChipProxyInterface::r#set_country_code(self, payload)
6624 }
6625
6626 pub fn r#get_available_modes(
6630 &self,
6631 ) -> fidl::client::QueryResponseFut<
6632 WifiChipGetAvailableModesResponse,
6633 fidl::encoding::DefaultFuchsiaResourceDialect,
6634 > {
6635 WifiChipProxyInterface::r#get_available_modes(self)
6636 }
6637
6638 pub fn r#get_id(
6640 &self,
6641 ) -> fidl::client::QueryResponseFut<
6642 WifiChipGetIdResponse,
6643 fidl::encoding::DefaultFuchsiaResourceDialect,
6644 > {
6645 WifiChipProxyInterface::r#get_id(self)
6646 }
6647
6648 pub fn r#get_mode(
6650 &self,
6651 ) -> fidl::client::QueryResponseFut<
6652 WifiChipGetModeResponse,
6653 fidl::encoding::DefaultFuchsiaResourceDialect,
6654 > {
6655 WifiChipProxyInterface::r#get_mode(self)
6656 }
6657
6658 pub fn r#get_capabilities(
6660 &self,
6661 ) -> fidl::client::QueryResponseFut<
6662 WifiChipGetCapabilitiesResponse,
6663 fidl::encoding::DefaultFuchsiaResourceDialect,
6664 > {
6665 WifiChipProxyInterface::r#get_capabilities(self)
6666 }
6667
6668 pub fn r#trigger_subsystem_restart(
6671 &self,
6672 ) -> fidl::client::QueryResponseFut<
6673 WifiChipTriggerSubsystemRestartResult,
6674 fidl::encoding::DefaultFuchsiaResourceDialect,
6675 > {
6676 WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6677 }
6678
6679 pub fn r#select_tx_power_scenario(
6681 &self,
6682 mut scenario: WifiChipTxPowerScenario,
6683 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6684 WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6685 }
6686
6687 pub fn r#reset_tx_power_scenario(
6689 &self,
6690 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6691 WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6692 }
6693}
6694
6695impl WifiChipProxyInterface for WifiChipProxy {
6696 type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6697 WifiChipCreateStaIfaceResult,
6698 fidl::encoding::DefaultFuchsiaResourceDialect,
6699 >;
6700 fn r#create_sta_iface(
6701 &self,
6702 mut payload: WifiChipCreateStaIfaceRequest,
6703 ) -> Self::CreateStaIfaceResponseFut {
6704 fn _decode(
6705 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6706 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6707 let _response = fidl::client::decode_transaction_body::<
6708 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6709 fidl::encoding::DefaultFuchsiaResourceDialect,
6710 0x6fb2d5892face7af,
6711 >(_buf?)?
6712 .into_result::<WifiChipMarker>("create_sta_iface")?;
6713 Ok(_response.map(|x| x))
6714 }
6715 self.client
6716 .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6717 &mut payload,
6718 0x6fb2d5892face7af,
6719 fidl::encoding::DynamicFlags::FLEXIBLE,
6720 _decode,
6721 )
6722 }
6723
6724 type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6725 WifiChipGetStaIfaceNamesResponse,
6726 fidl::encoding::DefaultFuchsiaResourceDialect,
6727 >;
6728 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6729 fn _decode(
6730 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6731 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6732 let _response = fidl::client::decode_transaction_body::<
6733 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6734 fidl::encoding::DefaultFuchsiaResourceDialect,
6735 0x349257482df6a000,
6736 >(_buf?)?
6737 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6738 Ok(_response)
6739 }
6740 self.client.send_query_and_decode::<
6741 fidl::encoding::EmptyPayload,
6742 WifiChipGetStaIfaceNamesResponse,
6743 >(
6744 (),
6745 0x349257482df6a000,
6746 fidl::encoding::DynamicFlags::FLEXIBLE,
6747 _decode,
6748 )
6749 }
6750
6751 type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6752 WifiChipGetStaIfaceResult,
6753 fidl::encoding::DefaultFuchsiaResourceDialect,
6754 >;
6755 fn r#get_sta_iface(
6756 &self,
6757 mut payload: WifiChipGetStaIfaceRequest,
6758 ) -> Self::GetStaIfaceResponseFut {
6759 fn _decode(
6760 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6761 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6762 let _response = fidl::client::decode_transaction_body::<
6763 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6764 fidl::encoding::DefaultFuchsiaResourceDialect,
6765 0x6d9704eeb36f28a2,
6766 >(_buf?)?
6767 .into_result::<WifiChipMarker>("get_sta_iface")?;
6768 Ok(_response.map(|x| x))
6769 }
6770 self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6771 &mut payload,
6772 0x6d9704eeb36f28a2,
6773 fidl::encoding::DynamicFlags::FLEXIBLE,
6774 _decode,
6775 )
6776 }
6777
6778 type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6779 WifiChipRemoveStaIfaceResult,
6780 fidl::encoding::DefaultFuchsiaResourceDialect,
6781 >;
6782 fn r#remove_sta_iface(
6783 &self,
6784 mut payload: WifiChipRemoveStaIfaceRequest,
6785 ) -> Self::RemoveStaIfaceResponseFut {
6786 fn _decode(
6787 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6788 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6789 let _response = fidl::client::decode_transaction_body::<
6790 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6791 fidl::encoding::DefaultFuchsiaResourceDialect,
6792 0x4cd8eee466f8b04c,
6793 >(_buf?)?
6794 .into_result::<WifiChipMarker>("remove_sta_iface")?;
6795 Ok(_response.map(|x| x))
6796 }
6797 self.client
6798 .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6799 &mut payload,
6800 0x4cd8eee466f8b04c,
6801 fidl::encoding::DynamicFlags::FLEXIBLE,
6802 _decode,
6803 )
6804 }
6805
6806 type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6807 WifiChipSetCountryCodeResult,
6808 fidl::encoding::DefaultFuchsiaResourceDialect,
6809 >;
6810 fn r#set_country_code(
6811 &self,
6812 mut payload: WifiChipSetCountryCodeRequest,
6813 ) -> Self::SetCountryCodeResponseFut {
6814 fn _decode(
6815 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6816 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6817 let _response = fidl::client::decode_transaction_body::<
6818 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6819 fidl::encoding::DefaultFuchsiaResourceDialect,
6820 0x1dfe372d1d61a490,
6821 >(_buf?)?
6822 .into_result::<WifiChipMarker>("set_country_code")?;
6823 Ok(_response.map(|x| x))
6824 }
6825 self.client
6826 .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6827 &mut payload,
6828 0x1dfe372d1d61a490,
6829 fidl::encoding::DynamicFlags::FLEXIBLE,
6830 _decode,
6831 )
6832 }
6833
6834 type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
6835 WifiChipGetAvailableModesResponse,
6836 fidl::encoding::DefaultFuchsiaResourceDialect,
6837 >;
6838 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
6839 fn _decode(
6840 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6841 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6842 let _response = fidl::client::decode_transaction_body::<
6843 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6844 fidl::encoding::DefaultFuchsiaResourceDialect,
6845 0x1701095b452a3acd,
6846 >(_buf?)?
6847 .into_result::<WifiChipMarker>("get_available_modes")?;
6848 Ok(_response)
6849 }
6850 self.client.send_query_and_decode::<
6851 fidl::encoding::EmptyPayload,
6852 WifiChipGetAvailableModesResponse,
6853 >(
6854 (),
6855 0x1701095b452a3acd,
6856 fidl::encoding::DynamicFlags::FLEXIBLE,
6857 _decode,
6858 )
6859 }
6860
6861 type GetIdResponseFut = fidl::client::QueryResponseFut<
6862 WifiChipGetIdResponse,
6863 fidl::encoding::DefaultFuchsiaResourceDialect,
6864 >;
6865 fn r#get_id(&self) -> Self::GetIdResponseFut {
6866 fn _decode(
6867 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6868 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6869 let _response = fidl::client::decode_transaction_body::<
6870 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6871 fidl::encoding::DefaultFuchsiaResourceDialect,
6872 0x37d5197325bb3370,
6873 >(_buf?)?
6874 .into_result::<WifiChipMarker>("get_id")?;
6875 Ok(_response)
6876 }
6877 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
6878 (),
6879 0x37d5197325bb3370,
6880 fidl::encoding::DynamicFlags::FLEXIBLE,
6881 _decode,
6882 )
6883 }
6884
6885 type GetModeResponseFut = fidl::client::QueryResponseFut<
6886 WifiChipGetModeResponse,
6887 fidl::encoding::DefaultFuchsiaResourceDialect,
6888 >;
6889 fn r#get_mode(&self) -> Self::GetModeResponseFut {
6890 fn _decode(
6891 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6892 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6893 let _response = fidl::client::decode_transaction_body::<
6894 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6895 fidl::encoding::DefaultFuchsiaResourceDialect,
6896 0x4d209e0f3ac84d6f,
6897 >(_buf?)?
6898 .into_result::<WifiChipMarker>("get_mode")?;
6899 Ok(_response)
6900 }
6901 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
6902 (),
6903 0x4d209e0f3ac84d6f,
6904 fidl::encoding::DynamicFlags::FLEXIBLE,
6905 _decode,
6906 )
6907 }
6908
6909 type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
6910 WifiChipGetCapabilitiesResponse,
6911 fidl::encoding::DefaultFuchsiaResourceDialect,
6912 >;
6913 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
6914 fn _decode(
6915 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6916 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6917 let _response = fidl::client::decode_transaction_body::<
6918 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6919 fidl::encoding::DefaultFuchsiaResourceDialect,
6920 0x1b253f396dcaa2e0,
6921 >(_buf?)?
6922 .into_result::<WifiChipMarker>("get_capabilities")?;
6923 Ok(_response)
6924 }
6925 self.client
6926 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
6927 (),
6928 0x1b253f396dcaa2e0,
6929 fidl::encoding::DynamicFlags::FLEXIBLE,
6930 _decode,
6931 )
6932 }
6933
6934 type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
6935 WifiChipTriggerSubsystemRestartResult,
6936 fidl::encoding::DefaultFuchsiaResourceDialect,
6937 >;
6938 fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
6939 fn _decode(
6940 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6941 ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6942 let _response = fidl::client::decode_transaction_body::<
6943 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6944 fidl::encoding::DefaultFuchsiaResourceDialect,
6945 0x42ffcae5aad196f9,
6946 >(_buf?)?
6947 .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6948 Ok(_response.map(|x| x))
6949 }
6950 self.client.send_query_and_decode::<
6951 fidl::encoding::EmptyPayload,
6952 WifiChipTriggerSubsystemRestartResult,
6953 >(
6954 (),
6955 0x42ffcae5aad196f9,
6956 fidl::encoding::DynamicFlags::FLEXIBLE,
6957 _decode,
6958 )
6959 }
6960
6961 type SelectTxPowerScenarioResponseFut =
6962 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6963 fn r#select_tx_power_scenario(
6964 &self,
6965 mut scenario: WifiChipTxPowerScenario,
6966 ) -> Self::SelectTxPowerScenarioResponseFut {
6967 fn _decode(
6968 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6969 ) -> Result<(), fidl::Error> {
6970 let _response = fidl::client::decode_transaction_body::<
6971 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6972 fidl::encoding::DefaultFuchsiaResourceDialect,
6973 0x19287ab52ea72281,
6974 >(_buf?)?
6975 .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6976 Ok(_response)
6977 }
6978 self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
6979 (scenario,),
6980 0x19287ab52ea72281,
6981 fidl::encoding::DynamicFlags::FLEXIBLE,
6982 _decode,
6983 )
6984 }
6985
6986 type ResetTxPowerScenarioResponseFut =
6987 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6988 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
6989 fn _decode(
6990 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6991 ) -> Result<(), fidl::Error> {
6992 let _response = fidl::client::decode_transaction_body::<
6993 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6994 fidl::encoding::DefaultFuchsiaResourceDialect,
6995 0x46408a2fb1eb9d09,
6996 >(_buf?)?
6997 .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6998 Ok(_response)
6999 }
7000 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7001 (),
7002 0x46408a2fb1eb9d09,
7003 fidl::encoding::DynamicFlags::FLEXIBLE,
7004 _decode,
7005 )
7006 }
7007}
7008
7009pub struct WifiChipEventStream {
7010 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7011}
7012
7013impl std::marker::Unpin for WifiChipEventStream {}
7014
7015impl futures::stream::FusedStream for WifiChipEventStream {
7016 fn is_terminated(&self) -> bool {
7017 self.event_receiver.is_terminated()
7018 }
7019}
7020
7021impl futures::Stream for WifiChipEventStream {
7022 type Item = Result<WifiChipEvent, fidl::Error>;
7023
7024 fn poll_next(
7025 mut self: std::pin::Pin<&mut Self>,
7026 cx: &mut std::task::Context<'_>,
7027 ) -> std::task::Poll<Option<Self::Item>> {
7028 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7029 &mut self.event_receiver,
7030 cx
7031 )?) {
7032 Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
7033 None => std::task::Poll::Ready(None),
7034 }
7035 }
7036}
7037
7038#[derive(Debug)]
7039pub enum WifiChipEvent {
7040 #[non_exhaustive]
7041 _UnknownEvent {
7042 ordinal: u64,
7044 },
7045}
7046
7047impl WifiChipEvent {
7048 fn decode(
7050 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7051 ) -> Result<WifiChipEvent, fidl::Error> {
7052 let (bytes, _handles) = buf.split_mut();
7053 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7054 debug_assert_eq!(tx_header.tx_id, 0);
7055 match tx_header.ordinal {
7056 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7057 Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7058 }
7059 _ => Err(fidl::Error::UnknownOrdinal {
7060 ordinal: tx_header.ordinal,
7061 protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7062 }),
7063 }
7064 }
7065}
7066
7067pub struct WifiChipRequestStream {
7069 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7070 is_terminated: bool,
7071}
7072
7073impl std::marker::Unpin for WifiChipRequestStream {}
7074
7075impl futures::stream::FusedStream for WifiChipRequestStream {
7076 fn is_terminated(&self) -> bool {
7077 self.is_terminated
7078 }
7079}
7080
7081impl fidl::endpoints::RequestStream for WifiChipRequestStream {
7082 type Protocol = WifiChipMarker;
7083 type ControlHandle = WifiChipControlHandle;
7084
7085 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7086 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7087 }
7088
7089 fn control_handle(&self) -> Self::ControlHandle {
7090 WifiChipControlHandle { inner: self.inner.clone() }
7091 }
7092
7093 fn into_inner(
7094 self,
7095 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7096 {
7097 (self.inner, self.is_terminated)
7098 }
7099
7100 fn from_inner(
7101 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7102 is_terminated: bool,
7103 ) -> Self {
7104 Self { inner, is_terminated }
7105 }
7106}
7107
7108impl futures::Stream for WifiChipRequestStream {
7109 type Item = Result<WifiChipRequest, fidl::Error>;
7110
7111 fn poll_next(
7112 mut self: std::pin::Pin<&mut Self>,
7113 cx: &mut std::task::Context<'_>,
7114 ) -> std::task::Poll<Option<Self::Item>> {
7115 let this = &mut *self;
7116 if this.inner.check_shutdown(cx) {
7117 this.is_terminated = true;
7118 return std::task::Poll::Ready(None);
7119 }
7120 if this.is_terminated {
7121 panic!("polled WifiChipRequestStream after completion");
7122 }
7123 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7124 |bytes, handles| {
7125 match this.inner.channel().read_etc(cx, bytes, handles) {
7126 std::task::Poll::Ready(Ok(())) => {}
7127 std::task::Poll::Pending => return std::task::Poll::Pending,
7128 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7129 this.is_terminated = true;
7130 return std::task::Poll::Ready(None);
7131 }
7132 std::task::Poll::Ready(Err(e)) => {
7133 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7134 e.into(),
7135 ))));
7136 }
7137 }
7138
7139 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7141
7142 std::task::Poll::Ready(Some(match header.ordinal {
7143 0x6fb2d5892face7af => {
7144 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7145 let mut req = fidl::new_empty!(
7146 WifiChipCreateStaIfaceRequest,
7147 fidl::encoding::DefaultFuchsiaResourceDialect
7148 );
7149 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7150 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7151 Ok(WifiChipRequest::CreateStaIface {
7152 payload: req,
7153 responder: WifiChipCreateStaIfaceResponder {
7154 control_handle: std::mem::ManuallyDrop::new(control_handle),
7155 tx_id: header.tx_id,
7156 },
7157 })
7158 }
7159 0x349257482df6a000 => {
7160 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7161 let mut req = fidl::new_empty!(
7162 fidl::encoding::EmptyPayload,
7163 fidl::encoding::DefaultFuchsiaResourceDialect
7164 );
7165 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7166 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7167 Ok(WifiChipRequest::GetStaIfaceNames {
7168 responder: WifiChipGetStaIfaceNamesResponder {
7169 control_handle: std::mem::ManuallyDrop::new(control_handle),
7170 tx_id: header.tx_id,
7171 },
7172 })
7173 }
7174 0x6d9704eeb36f28a2 => {
7175 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7176 let mut req = fidl::new_empty!(
7177 WifiChipGetStaIfaceRequest,
7178 fidl::encoding::DefaultFuchsiaResourceDialect
7179 );
7180 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7181 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7182 Ok(WifiChipRequest::GetStaIface {
7183 payload: req,
7184 responder: WifiChipGetStaIfaceResponder {
7185 control_handle: std::mem::ManuallyDrop::new(control_handle),
7186 tx_id: header.tx_id,
7187 },
7188 })
7189 }
7190 0x4cd8eee466f8b04c => {
7191 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7192 let mut req = fidl::new_empty!(
7193 WifiChipRemoveStaIfaceRequest,
7194 fidl::encoding::DefaultFuchsiaResourceDialect
7195 );
7196 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7197 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7198 Ok(WifiChipRequest::RemoveStaIface {
7199 payload: req,
7200 responder: WifiChipRemoveStaIfaceResponder {
7201 control_handle: std::mem::ManuallyDrop::new(control_handle),
7202 tx_id: header.tx_id,
7203 },
7204 })
7205 }
7206 0x1dfe372d1d61a490 => {
7207 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7208 let mut req = fidl::new_empty!(
7209 WifiChipSetCountryCodeRequest,
7210 fidl::encoding::DefaultFuchsiaResourceDialect
7211 );
7212 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
7213 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7214 Ok(WifiChipRequest::SetCountryCode {
7215 payload: req,
7216 responder: WifiChipSetCountryCodeResponder {
7217 control_handle: std::mem::ManuallyDrop::new(control_handle),
7218 tx_id: header.tx_id,
7219 },
7220 })
7221 }
7222 0x1701095b452a3acd => {
7223 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7224 let mut req = fidl::new_empty!(
7225 fidl::encoding::EmptyPayload,
7226 fidl::encoding::DefaultFuchsiaResourceDialect
7227 );
7228 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7229 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7230 Ok(WifiChipRequest::GetAvailableModes {
7231 responder: WifiChipGetAvailableModesResponder {
7232 control_handle: std::mem::ManuallyDrop::new(control_handle),
7233 tx_id: header.tx_id,
7234 },
7235 })
7236 }
7237 0x37d5197325bb3370 => {
7238 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7239 let mut req = fidl::new_empty!(
7240 fidl::encoding::EmptyPayload,
7241 fidl::encoding::DefaultFuchsiaResourceDialect
7242 );
7243 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7244 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7245 Ok(WifiChipRequest::GetId {
7246 responder: WifiChipGetIdResponder {
7247 control_handle: std::mem::ManuallyDrop::new(control_handle),
7248 tx_id: header.tx_id,
7249 },
7250 })
7251 }
7252 0x4d209e0f3ac84d6f => {
7253 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7254 let mut req = fidl::new_empty!(
7255 fidl::encoding::EmptyPayload,
7256 fidl::encoding::DefaultFuchsiaResourceDialect
7257 );
7258 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7259 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7260 Ok(WifiChipRequest::GetMode {
7261 responder: WifiChipGetModeResponder {
7262 control_handle: std::mem::ManuallyDrop::new(control_handle),
7263 tx_id: header.tx_id,
7264 },
7265 })
7266 }
7267 0x1b253f396dcaa2e0 => {
7268 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7269 let mut req = fidl::new_empty!(
7270 fidl::encoding::EmptyPayload,
7271 fidl::encoding::DefaultFuchsiaResourceDialect
7272 );
7273 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7274 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7275 Ok(WifiChipRequest::GetCapabilities {
7276 responder: WifiChipGetCapabilitiesResponder {
7277 control_handle: std::mem::ManuallyDrop::new(control_handle),
7278 tx_id: header.tx_id,
7279 },
7280 })
7281 }
7282 0x42ffcae5aad196f9 => {
7283 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7284 let mut req = fidl::new_empty!(
7285 fidl::encoding::EmptyPayload,
7286 fidl::encoding::DefaultFuchsiaResourceDialect
7287 );
7288 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7289 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7290 Ok(WifiChipRequest::TriggerSubsystemRestart {
7291 responder: WifiChipTriggerSubsystemRestartResponder {
7292 control_handle: std::mem::ManuallyDrop::new(control_handle),
7293 tx_id: header.tx_id,
7294 },
7295 })
7296 }
7297 0x19287ab52ea72281 => {
7298 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7299 let mut req = fidl::new_empty!(
7300 WifiChipSelectTxPowerScenarioRequest,
7301 fidl::encoding::DefaultFuchsiaResourceDialect
7302 );
7303 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7304 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7305 Ok(WifiChipRequest::SelectTxPowerScenario {
7306 scenario: req.scenario,
7307
7308 responder: WifiChipSelectTxPowerScenarioResponder {
7309 control_handle: std::mem::ManuallyDrop::new(control_handle),
7310 tx_id: header.tx_id,
7311 },
7312 })
7313 }
7314 0x46408a2fb1eb9d09 => {
7315 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7316 let mut req = fidl::new_empty!(
7317 fidl::encoding::EmptyPayload,
7318 fidl::encoding::DefaultFuchsiaResourceDialect
7319 );
7320 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7321 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7322 Ok(WifiChipRequest::ResetTxPowerScenario {
7323 responder: WifiChipResetTxPowerScenarioResponder {
7324 control_handle: std::mem::ManuallyDrop::new(control_handle),
7325 tx_id: header.tx_id,
7326 },
7327 })
7328 }
7329 _ if header.tx_id == 0
7330 && header
7331 .dynamic_flags()
7332 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7333 {
7334 Ok(WifiChipRequest::_UnknownMethod {
7335 ordinal: header.ordinal,
7336 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7337 method_type: fidl::MethodType::OneWay,
7338 })
7339 }
7340 _ if header
7341 .dynamic_flags()
7342 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7343 {
7344 this.inner.send_framework_err(
7345 fidl::encoding::FrameworkErr::UnknownMethod,
7346 header.tx_id,
7347 header.ordinal,
7348 header.dynamic_flags(),
7349 (bytes, handles),
7350 )?;
7351 Ok(WifiChipRequest::_UnknownMethod {
7352 ordinal: header.ordinal,
7353 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7354 method_type: fidl::MethodType::TwoWay,
7355 })
7356 }
7357 _ => Err(fidl::Error::UnknownOrdinal {
7358 ordinal: header.ordinal,
7359 protocol_name:
7360 <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7361 }),
7362 }))
7363 },
7364 )
7365 }
7366}
7367
7368#[derive(Debug)]
7369pub enum WifiChipRequest {
7370 CreateStaIface {
7372 payload: WifiChipCreateStaIfaceRequest,
7373 responder: WifiChipCreateStaIfaceResponder,
7374 },
7375 GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7377 GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7379 RemoveStaIface {
7381 payload: WifiChipRemoveStaIfaceRequest,
7382 responder: WifiChipRemoveStaIfaceResponder,
7383 },
7384 SetCountryCode {
7385 payload: WifiChipSetCountryCodeRequest,
7386 responder: WifiChipSetCountryCodeResponder,
7387 },
7388 GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7392 GetId { responder: WifiChipGetIdResponder },
7394 GetMode { responder: WifiChipGetModeResponder },
7396 GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7398 TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7401 SelectTxPowerScenario {
7403 scenario: WifiChipTxPowerScenario,
7404 responder: WifiChipSelectTxPowerScenarioResponder,
7405 },
7406 ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7408 #[non_exhaustive]
7410 _UnknownMethod {
7411 ordinal: u64,
7413 control_handle: WifiChipControlHandle,
7414 method_type: fidl::MethodType,
7415 },
7416}
7417
7418impl WifiChipRequest {
7419 #[allow(irrefutable_let_patterns)]
7420 pub fn into_create_sta_iface(
7421 self,
7422 ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7423 if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7424 Some((payload, responder))
7425 } else {
7426 None
7427 }
7428 }
7429
7430 #[allow(irrefutable_let_patterns)]
7431 pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7432 if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7433 Some((responder))
7434 } else {
7435 None
7436 }
7437 }
7438
7439 #[allow(irrefutable_let_patterns)]
7440 pub fn into_get_sta_iface(
7441 self,
7442 ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7443 if let WifiChipRequest::GetStaIface { payload, responder } = self {
7444 Some((payload, responder))
7445 } else {
7446 None
7447 }
7448 }
7449
7450 #[allow(irrefutable_let_patterns)]
7451 pub fn into_remove_sta_iface(
7452 self,
7453 ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7454 if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7455 Some((payload, responder))
7456 } else {
7457 None
7458 }
7459 }
7460
7461 #[allow(irrefutable_let_patterns)]
7462 pub fn into_set_country_code(
7463 self,
7464 ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7465 if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7466 Some((payload, responder))
7467 } else {
7468 None
7469 }
7470 }
7471
7472 #[allow(irrefutable_let_patterns)]
7473 pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7474 if let WifiChipRequest::GetAvailableModes { responder } = self {
7475 Some((responder))
7476 } else {
7477 None
7478 }
7479 }
7480
7481 #[allow(irrefutable_let_patterns)]
7482 pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7483 if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7484 }
7485
7486 #[allow(irrefutable_let_patterns)]
7487 pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7488 if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7489 }
7490
7491 #[allow(irrefutable_let_patterns)]
7492 pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7493 if let WifiChipRequest::GetCapabilities { responder } = self {
7494 Some((responder))
7495 } else {
7496 None
7497 }
7498 }
7499
7500 #[allow(irrefutable_let_patterns)]
7501 pub fn into_trigger_subsystem_restart(
7502 self,
7503 ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7504 if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7505 Some((responder))
7506 } else {
7507 None
7508 }
7509 }
7510
7511 #[allow(irrefutable_let_patterns)]
7512 pub fn into_select_tx_power_scenario(
7513 self,
7514 ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7515 if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7516 Some((scenario, responder))
7517 } else {
7518 None
7519 }
7520 }
7521
7522 #[allow(irrefutable_let_patterns)]
7523 pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7524 if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7525 Some((responder))
7526 } else {
7527 None
7528 }
7529 }
7530
7531 pub fn method_name(&self) -> &'static str {
7533 match *self {
7534 WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7535 WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7536 WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7537 WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7538 WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7539 WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7540 WifiChipRequest::GetId { .. } => "get_id",
7541 WifiChipRequest::GetMode { .. } => "get_mode",
7542 WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7543 WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7544 WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7545 WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7546 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7547 "unknown one-way method"
7548 }
7549 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7550 "unknown two-way method"
7551 }
7552 }
7553 }
7554}
7555
7556#[derive(Debug, Clone)]
7557pub struct WifiChipControlHandle {
7558 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7559}
7560
7561impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7562 fn shutdown(&self) {
7563 self.inner.shutdown()
7564 }
7565
7566 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7567 self.inner.shutdown_with_epitaph(status)
7568 }
7569
7570 fn is_closed(&self) -> bool {
7571 self.inner.channel().is_closed()
7572 }
7573 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7574 self.inner.channel().on_closed()
7575 }
7576
7577 #[cfg(target_os = "fuchsia")]
7578 fn signal_peer(
7579 &self,
7580 clear_mask: zx::Signals,
7581 set_mask: zx::Signals,
7582 ) -> Result<(), zx_status::Status> {
7583 use fidl::Peered;
7584 self.inner.channel().signal_peer(clear_mask, set_mask)
7585 }
7586}
7587
7588impl WifiChipControlHandle {}
7589
7590#[must_use = "FIDL methods require a response to be sent"]
7591#[derive(Debug)]
7592pub struct WifiChipCreateStaIfaceResponder {
7593 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7594 tx_id: u32,
7595}
7596
7597impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7601 fn drop(&mut self) {
7602 self.control_handle.shutdown();
7603 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7605 }
7606}
7607
7608impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7609 type ControlHandle = WifiChipControlHandle;
7610
7611 fn control_handle(&self) -> &WifiChipControlHandle {
7612 &self.control_handle
7613 }
7614
7615 fn drop_without_shutdown(mut self) {
7616 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7618 std::mem::forget(self);
7620 }
7621}
7622
7623impl WifiChipCreateStaIfaceResponder {
7624 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7628 let _result = self.send_raw(result);
7629 if _result.is_err() {
7630 self.control_handle.shutdown();
7631 }
7632 self.drop_without_shutdown();
7633 _result
7634 }
7635
7636 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7638 let _result = self.send_raw(result);
7639 self.drop_without_shutdown();
7640 _result
7641 }
7642
7643 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7644 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7645 fidl::encoding::EmptyStruct,
7646 i32,
7647 >>(
7648 fidl::encoding::FlexibleResult::new(result),
7649 self.tx_id,
7650 0x6fb2d5892face7af,
7651 fidl::encoding::DynamicFlags::FLEXIBLE,
7652 )
7653 }
7654}
7655
7656#[must_use = "FIDL methods require a response to be sent"]
7657#[derive(Debug)]
7658pub struct WifiChipGetStaIfaceNamesResponder {
7659 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7660 tx_id: u32,
7661}
7662
7663impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7667 fn drop(&mut self) {
7668 self.control_handle.shutdown();
7669 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7671 }
7672}
7673
7674impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7675 type ControlHandle = WifiChipControlHandle;
7676
7677 fn control_handle(&self) -> &WifiChipControlHandle {
7678 &self.control_handle
7679 }
7680
7681 fn drop_without_shutdown(mut self) {
7682 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7684 std::mem::forget(self);
7686 }
7687}
7688
7689impl WifiChipGetStaIfaceNamesResponder {
7690 pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7694 let _result = self.send_raw(payload);
7695 if _result.is_err() {
7696 self.control_handle.shutdown();
7697 }
7698 self.drop_without_shutdown();
7699 _result
7700 }
7701
7702 pub fn send_no_shutdown_on_err(
7704 self,
7705 mut payload: &WifiChipGetStaIfaceNamesResponse,
7706 ) -> Result<(), fidl::Error> {
7707 let _result = self.send_raw(payload);
7708 self.drop_without_shutdown();
7709 _result
7710 }
7711
7712 fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7713 self.control_handle
7714 .inner
7715 .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7716 fidl::encoding::Flexible::new(payload),
7717 self.tx_id,
7718 0x349257482df6a000,
7719 fidl::encoding::DynamicFlags::FLEXIBLE,
7720 )
7721 }
7722}
7723
7724#[must_use = "FIDL methods require a response to be sent"]
7725#[derive(Debug)]
7726pub struct WifiChipGetStaIfaceResponder {
7727 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7728 tx_id: u32,
7729}
7730
7731impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7735 fn drop(&mut self) {
7736 self.control_handle.shutdown();
7737 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7739 }
7740}
7741
7742impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7743 type ControlHandle = WifiChipControlHandle;
7744
7745 fn control_handle(&self) -> &WifiChipControlHandle {
7746 &self.control_handle
7747 }
7748
7749 fn drop_without_shutdown(mut self) {
7750 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7752 std::mem::forget(self);
7754 }
7755}
7756
7757impl WifiChipGetStaIfaceResponder {
7758 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7762 let _result = self.send_raw(result);
7763 if _result.is_err() {
7764 self.control_handle.shutdown();
7765 }
7766 self.drop_without_shutdown();
7767 _result
7768 }
7769
7770 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7772 let _result = self.send_raw(result);
7773 self.drop_without_shutdown();
7774 _result
7775 }
7776
7777 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7778 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7779 fidl::encoding::EmptyStruct,
7780 i32,
7781 >>(
7782 fidl::encoding::FlexibleResult::new(result),
7783 self.tx_id,
7784 0x6d9704eeb36f28a2,
7785 fidl::encoding::DynamicFlags::FLEXIBLE,
7786 )
7787 }
7788}
7789
7790#[must_use = "FIDL methods require a response to be sent"]
7791#[derive(Debug)]
7792pub struct WifiChipRemoveStaIfaceResponder {
7793 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7794 tx_id: u32,
7795}
7796
7797impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
7801 fn drop(&mut self) {
7802 self.control_handle.shutdown();
7803 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7805 }
7806}
7807
7808impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
7809 type ControlHandle = WifiChipControlHandle;
7810
7811 fn control_handle(&self) -> &WifiChipControlHandle {
7812 &self.control_handle
7813 }
7814
7815 fn drop_without_shutdown(mut self) {
7816 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7818 std::mem::forget(self);
7820 }
7821}
7822
7823impl WifiChipRemoveStaIfaceResponder {
7824 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7828 let _result = self.send_raw(result);
7829 if _result.is_err() {
7830 self.control_handle.shutdown();
7831 }
7832 self.drop_without_shutdown();
7833 _result
7834 }
7835
7836 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7838 let _result = self.send_raw(result);
7839 self.drop_without_shutdown();
7840 _result
7841 }
7842
7843 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7844 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7845 fidl::encoding::EmptyStruct,
7846 i32,
7847 >>(
7848 fidl::encoding::FlexibleResult::new(result),
7849 self.tx_id,
7850 0x4cd8eee466f8b04c,
7851 fidl::encoding::DynamicFlags::FLEXIBLE,
7852 )
7853 }
7854}
7855
7856#[must_use = "FIDL methods require a response to be sent"]
7857#[derive(Debug)]
7858pub struct WifiChipSetCountryCodeResponder {
7859 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7860 tx_id: u32,
7861}
7862
7863impl std::ops::Drop for WifiChipSetCountryCodeResponder {
7867 fn drop(&mut self) {
7868 self.control_handle.shutdown();
7869 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7871 }
7872}
7873
7874impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
7875 type ControlHandle = WifiChipControlHandle;
7876
7877 fn control_handle(&self) -> &WifiChipControlHandle {
7878 &self.control_handle
7879 }
7880
7881 fn drop_without_shutdown(mut self) {
7882 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7884 std::mem::forget(self);
7886 }
7887}
7888
7889impl WifiChipSetCountryCodeResponder {
7890 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7894 let _result = self.send_raw(result);
7895 if _result.is_err() {
7896 self.control_handle.shutdown();
7897 }
7898 self.drop_without_shutdown();
7899 _result
7900 }
7901
7902 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7904 let _result = self.send_raw(result);
7905 self.drop_without_shutdown();
7906 _result
7907 }
7908
7909 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7910 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7911 fidl::encoding::EmptyStruct,
7912 i32,
7913 >>(
7914 fidl::encoding::FlexibleResult::new(result),
7915 self.tx_id,
7916 0x1dfe372d1d61a490,
7917 fidl::encoding::DynamicFlags::FLEXIBLE,
7918 )
7919 }
7920}
7921
7922#[must_use = "FIDL methods require a response to be sent"]
7923#[derive(Debug)]
7924pub struct WifiChipGetAvailableModesResponder {
7925 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7926 tx_id: u32,
7927}
7928
7929impl std::ops::Drop for WifiChipGetAvailableModesResponder {
7933 fn drop(&mut self) {
7934 self.control_handle.shutdown();
7935 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7937 }
7938}
7939
7940impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
7941 type ControlHandle = WifiChipControlHandle;
7942
7943 fn control_handle(&self) -> &WifiChipControlHandle {
7944 &self.control_handle
7945 }
7946
7947 fn drop_without_shutdown(mut self) {
7948 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7950 std::mem::forget(self);
7952 }
7953}
7954
7955impl WifiChipGetAvailableModesResponder {
7956 pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7960 let _result = self.send_raw(payload);
7961 if _result.is_err() {
7962 self.control_handle.shutdown();
7963 }
7964 self.drop_without_shutdown();
7965 _result
7966 }
7967
7968 pub fn send_no_shutdown_on_err(
7970 self,
7971 mut payload: &WifiChipGetAvailableModesResponse,
7972 ) -> Result<(), fidl::Error> {
7973 let _result = self.send_raw(payload);
7974 self.drop_without_shutdown();
7975 _result
7976 }
7977
7978 fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7979 self.control_handle
7980 .inner
7981 .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
7982 fidl::encoding::Flexible::new(payload),
7983 self.tx_id,
7984 0x1701095b452a3acd,
7985 fidl::encoding::DynamicFlags::FLEXIBLE,
7986 )
7987 }
7988}
7989
7990#[must_use = "FIDL methods require a response to be sent"]
7991#[derive(Debug)]
7992pub struct WifiChipGetIdResponder {
7993 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7994 tx_id: u32,
7995}
7996
7997impl std::ops::Drop for WifiChipGetIdResponder {
8001 fn drop(&mut self) {
8002 self.control_handle.shutdown();
8003 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8005 }
8006}
8007
8008impl fidl::endpoints::Responder for WifiChipGetIdResponder {
8009 type ControlHandle = WifiChipControlHandle;
8010
8011 fn control_handle(&self) -> &WifiChipControlHandle {
8012 &self.control_handle
8013 }
8014
8015 fn drop_without_shutdown(mut self) {
8016 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8018 std::mem::forget(self);
8020 }
8021}
8022
8023impl WifiChipGetIdResponder {
8024 pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8028 let _result = self.send_raw(payload);
8029 if _result.is_err() {
8030 self.control_handle.shutdown();
8031 }
8032 self.drop_without_shutdown();
8033 _result
8034 }
8035
8036 pub fn send_no_shutdown_on_err(
8038 self,
8039 mut payload: &WifiChipGetIdResponse,
8040 ) -> Result<(), fidl::Error> {
8041 let _result = self.send_raw(payload);
8042 self.drop_without_shutdown();
8043 _result
8044 }
8045
8046 fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8047 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
8048 fidl::encoding::Flexible::new(payload),
8049 self.tx_id,
8050 0x37d5197325bb3370,
8051 fidl::encoding::DynamicFlags::FLEXIBLE,
8052 )
8053 }
8054}
8055
8056#[must_use = "FIDL methods require a response to be sent"]
8057#[derive(Debug)]
8058pub struct WifiChipGetModeResponder {
8059 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8060 tx_id: u32,
8061}
8062
8063impl std::ops::Drop for WifiChipGetModeResponder {
8067 fn drop(&mut self) {
8068 self.control_handle.shutdown();
8069 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8071 }
8072}
8073
8074impl fidl::endpoints::Responder for WifiChipGetModeResponder {
8075 type ControlHandle = WifiChipControlHandle;
8076
8077 fn control_handle(&self) -> &WifiChipControlHandle {
8078 &self.control_handle
8079 }
8080
8081 fn drop_without_shutdown(mut self) {
8082 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8084 std::mem::forget(self);
8086 }
8087}
8088
8089impl WifiChipGetModeResponder {
8090 pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8094 let _result = self.send_raw(payload);
8095 if _result.is_err() {
8096 self.control_handle.shutdown();
8097 }
8098 self.drop_without_shutdown();
8099 _result
8100 }
8101
8102 pub fn send_no_shutdown_on_err(
8104 self,
8105 mut payload: &WifiChipGetModeResponse,
8106 ) -> Result<(), fidl::Error> {
8107 let _result = self.send_raw(payload);
8108 self.drop_without_shutdown();
8109 _result
8110 }
8111
8112 fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8113 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
8114 fidl::encoding::Flexible::new(payload),
8115 self.tx_id,
8116 0x4d209e0f3ac84d6f,
8117 fidl::encoding::DynamicFlags::FLEXIBLE,
8118 )
8119 }
8120}
8121
8122#[must_use = "FIDL methods require a response to be sent"]
8123#[derive(Debug)]
8124pub struct WifiChipGetCapabilitiesResponder {
8125 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8126 tx_id: u32,
8127}
8128
8129impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
8133 fn drop(&mut self) {
8134 self.control_handle.shutdown();
8135 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8137 }
8138}
8139
8140impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
8141 type ControlHandle = WifiChipControlHandle;
8142
8143 fn control_handle(&self) -> &WifiChipControlHandle {
8144 &self.control_handle
8145 }
8146
8147 fn drop_without_shutdown(mut self) {
8148 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8150 std::mem::forget(self);
8152 }
8153}
8154
8155impl WifiChipGetCapabilitiesResponder {
8156 pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8160 let _result = self.send_raw(payload);
8161 if _result.is_err() {
8162 self.control_handle.shutdown();
8163 }
8164 self.drop_without_shutdown();
8165 _result
8166 }
8167
8168 pub fn send_no_shutdown_on_err(
8170 self,
8171 mut payload: &WifiChipGetCapabilitiesResponse,
8172 ) -> Result<(), fidl::Error> {
8173 let _result = self.send_raw(payload);
8174 self.drop_without_shutdown();
8175 _result
8176 }
8177
8178 fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8179 self.control_handle
8180 .inner
8181 .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
8182 fidl::encoding::Flexible::new(payload),
8183 self.tx_id,
8184 0x1b253f396dcaa2e0,
8185 fidl::encoding::DynamicFlags::FLEXIBLE,
8186 )
8187 }
8188}
8189
8190#[must_use = "FIDL methods require a response to be sent"]
8191#[derive(Debug)]
8192pub struct WifiChipTriggerSubsystemRestartResponder {
8193 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8194 tx_id: u32,
8195}
8196
8197impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
8201 fn drop(&mut self) {
8202 self.control_handle.shutdown();
8203 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8205 }
8206}
8207
8208impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
8209 type ControlHandle = WifiChipControlHandle;
8210
8211 fn control_handle(&self) -> &WifiChipControlHandle {
8212 &self.control_handle
8213 }
8214
8215 fn drop_without_shutdown(mut self) {
8216 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8218 std::mem::forget(self);
8220 }
8221}
8222
8223impl WifiChipTriggerSubsystemRestartResponder {
8224 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8228 let _result = self.send_raw(result);
8229 if _result.is_err() {
8230 self.control_handle.shutdown();
8231 }
8232 self.drop_without_shutdown();
8233 _result
8234 }
8235
8236 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8238 let _result = self.send_raw(result);
8239 self.drop_without_shutdown();
8240 _result
8241 }
8242
8243 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8244 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8245 fidl::encoding::EmptyStruct,
8246 i32,
8247 >>(
8248 fidl::encoding::FlexibleResult::new(result),
8249 self.tx_id,
8250 0x42ffcae5aad196f9,
8251 fidl::encoding::DynamicFlags::FLEXIBLE,
8252 )
8253 }
8254}
8255
8256#[must_use = "FIDL methods require a response to be sent"]
8257#[derive(Debug)]
8258pub struct WifiChipSelectTxPowerScenarioResponder {
8259 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8260 tx_id: u32,
8261}
8262
8263impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8267 fn drop(&mut self) {
8268 self.control_handle.shutdown();
8269 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8271 }
8272}
8273
8274impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8275 type ControlHandle = WifiChipControlHandle;
8276
8277 fn control_handle(&self) -> &WifiChipControlHandle {
8278 &self.control_handle
8279 }
8280
8281 fn drop_without_shutdown(mut self) {
8282 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8284 std::mem::forget(self);
8286 }
8287}
8288
8289impl WifiChipSelectTxPowerScenarioResponder {
8290 pub fn send(self) -> Result<(), fidl::Error> {
8294 let _result = self.send_raw();
8295 if _result.is_err() {
8296 self.control_handle.shutdown();
8297 }
8298 self.drop_without_shutdown();
8299 _result
8300 }
8301
8302 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8304 let _result = self.send_raw();
8305 self.drop_without_shutdown();
8306 _result
8307 }
8308
8309 fn send_raw(&self) -> Result<(), fidl::Error> {
8310 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8311 fidl::encoding::Flexible::new(()),
8312 self.tx_id,
8313 0x19287ab52ea72281,
8314 fidl::encoding::DynamicFlags::FLEXIBLE,
8315 )
8316 }
8317}
8318
8319#[must_use = "FIDL methods require a response to be sent"]
8320#[derive(Debug)]
8321pub struct WifiChipResetTxPowerScenarioResponder {
8322 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8323 tx_id: u32,
8324}
8325
8326impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8330 fn drop(&mut self) {
8331 self.control_handle.shutdown();
8332 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8334 }
8335}
8336
8337impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8338 type ControlHandle = WifiChipControlHandle;
8339
8340 fn control_handle(&self) -> &WifiChipControlHandle {
8341 &self.control_handle
8342 }
8343
8344 fn drop_without_shutdown(mut self) {
8345 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8347 std::mem::forget(self);
8349 }
8350}
8351
8352impl WifiChipResetTxPowerScenarioResponder {
8353 pub fn send(self) -> Result<(), fidl::Error> {
8357 let _result = self.send_raw();
8358 if _result.is_err() {
8359 self.control_handle.shutdown();
8360 }
8361 self.drop_without_shutdown();
8362 _result
8363 }
8364
8365 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8367 let _result = self.send_raw();
8368 self.drop_without_shutdown();
8369 _result
8370 }
8371
8372 fn send_raw(&self) -> Result<(), fidl::Error> {
8373 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8374 fidl::encoding::Flexible::new(()),
8375 self.tx_id,
8376 0x46408a2fb1eb9d09,
8377 fidl::encoding::DynamicFlags::FLEXIBLE,
8378 )
8379 }
8380}
8381
8382#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8383pub struct WifiEventCallbackMarker;
8384
8385impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8386 type Proxy = WifiEventCallbackProxy;
8387 type RequestStream = WifiEventCallbackRequestStream;
8388 #[cfg(target_os = "fuchsia")]
8389 type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8390
8391 const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8392}
8393
8394pub trait WifiEventCallbackProxyInterface: Send + Sync {
8395 fn r#on_start(&self) -> Result<(), fidl::Error>;
8396 fn r#on_stop(&self) -> Result<(), fidl::Error>;
8397 fn r#on_subsystem_restart(
8398 &self,
8399 payload: WifiEventCallbackOnSubsystemRestartRequest,
8400 ) -> Result<(), fidl::Error>;
8401}
8402#[derive(Debug)]
8403#[cfg(target_os = "fuchsia")]
8404pub struct WifiEventCallbackSynchronousProxy {
8405 client: fidl::client::sync::Client,
8406}
8407
8408#[cfg(target_os = "fuchsia")]
8409impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8410 type Proxy = WifiEventCallbackProxy;
8411 type Protocol = WifiEventCallbackMarker;
8412
8413 fn from_channel(inner: fidl::Channel) -> Self {
8414 Self::new(inner)
8415 }
8416
8417 fn into_channel(self) -> fidl::Channel {
8418 self.client.into_channel()
8419 }
8420
8421 fn as_channel(&self) -> &fidl::Channel {
8422 self.client.as_channel()
8423 }
8424}
8425
8426#[cfg(target_os = "fuchsia")]
8427impl WifiEventCallbackSynchronousProxy {
8428 pub fn new(channel: fidl::Channel) -> Self {
8429 Self { client: fidl::client::sync::Client::new(channel) }
8430 }
8431
8432 pub fn into_channel(self) -> fidl::Channel {
8433 self.client.into_channel()
8434 }
8435
8436 pub fn wait_for_event(
8439 &self,
8440 deadline: zx::MonotonicInstant,
8441 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8442 WifiEventCallbackEvent::decode(
8443 self.client.wait_for_event::<WifiEventCallbackMarker>(deadline)?,
8444 )
8445 }
8446
8447 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8448 self.client.send::<fidl::encoding::EmptyPayload>(
8449 (),
8450 0x61189ff44f9d35f3,
8451 fidl::encoding::DynamicFlags::FLEXIBLE,
8452 )
8453 }
8454
8455 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8456 self.client.send::<fidl::encoding::EmptyPayload>(
8457 (),
8458 0x58b697bcd475e0f9,
8459 fidl::encoding::DynamicFlags::FLEXIBLE,
8460 )
8461 }
8462
8463 pub fn r#on_subsystem_restart(
8464 &self,
8465 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8466 ) -> Result<(), fidl::Error> {
8467 self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8468 &mut payload,
8469 0x69dfee4d3475db21,
8470 fidl::encoding::DynamicFlags::FLEXIBLE,
8471 )
8472 }
8473}
8474
8475#[cfg(target_os = "fuchsia")]
8476impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8477 fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8478 value.into_channel().into()
8479 }
8480}
8481
8482#[cfg(target_os = "fuchsia")]
8483impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8484 fn from(value: fidl::Channel) -> Self {
8485 Self::new(value)
8486 }
8487}
8488
8489#[cfg(target_os = "fuchsia")]
8490impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8491 type Protocol = WifiEventCallbackMarker;
8492
8493 fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8494 Self::new(value.into_channel())
8495 }
8496}
8497
8498#[derive(Debug, Clone)]
8499pub struct WifiEventCallbackProxy {
8500 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8501}
8502
8503impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8504 type Protocol = WifiEventCallbackMarker;
8505
8506 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8507 Self::new(inner)
8508 }
8509
8510 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8511 self.client.into_channel().map_err(|client| Self { client })
8512 }
8513
8514 fn as_channel(&self) -> &::fidl::AsyncChannel {
8515 self.client.as_channel()
8516 }
8517}
8518
8519impl WifiEventCallbackProxy {
8520 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8522 let protocol_name =
8523 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8524 Self { client: fidl::client::Client::new(channel, protocol_name) }
8525 }
8526
8527 pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8533 WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8534 }
8535
8536 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8537 WifiEventCallbackProxyInterface::r#on_start(self)
8538 }
8539
8540 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8541 WifiEventCallbackProxyInterface::r#on_stop(self)
8542 }
8543
8544 pub fn r#on_subsystem_restart(
8545 &self,
8546 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8547 ) -> Result<(), fidl::Error> {
8548 WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8549 }
8550}
8551
8552impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8553 fn r#on_start(&self) -> Result<(), fidl::Error> {
8554 self.client.send::<fidl::encoding::EmptyPayload>(
8555 (),
8556 0x61189ff44f9d35f3,
8557 fidl::encoding::DynamicFlags::FLEXIBLE,
8558 )
8559 }
8560
8561 fn r#on_stop(&self) -> Result<(), fidl::Error> {
8562 self.client.send::<fidl::encoding::EmptyPayload>(
8563 (),
8564 0x58b697bcd475e0f9,
8565 fidl::encoding::DynamicFlags::FLEXIBLE,
8566 )
8567 }
8568
8569 fn r#on_subsystem_restart(
8570 &self,
8571 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8572 ) -> Result<(), fidl::Error> {
8573 self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8574 &mut payload,
8575 0x69dfee4d3475db21,
8576 fidl::encoding::DynamicFlags::FLEXIBLE,
8577 )
8578 }
8579}
8580
8581pub struct WifiEventCallbackEventStream {
8582 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8583}
8584
8585impl std::marker::Unpin for WifiEventCallbackEventStream {}
8586
8587impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8588 fn is_terminated(&self) -> bool {
8589 self.event_receiver.is_terminated()
8590 }
8591}
8592
8593impl futures::Stream for WifiEventCallbackEventStream {
8594 type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8595
8596 fn poll_next(
8597 mut self: std::pin::Pin<&mut Self>,
8598 cx: &mut std::task::Context<'_>,
8599 ) -> std::task::Poll<Option<Self::Item>> {
8600 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8601 &mut self.event_receiver,
8602 cx
8603 )?) {
8604 Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8605 None => std::task::Poll::Ready(None),
8606 }
8607 }
8608}
8609
8610#[derive(Debug)]
8611pub enum WifiEventCallbackEvent {
8612 #[non_exhaustive]
8613 _UnknownEvent {
8614 ordinal: u64,
8616 },
8617}
8618
8619impl WifiEventCallbackEvent {
8620 fn decode(
8622 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8623 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8624 let (bytes, _handles) = buf.split_mut();
8625 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8626 debug_assert_eq!(tx_header.tx_id, 0);
8627 match tx_header.ordinal {
8628 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8629 Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8630 }
8631 _ => Err(fidl::Error::UnknownOrdinal {
8632 ordinal: tx_header.ordinal,
8633 protocol_name:
8634 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8635 }),
8636 }
8637 }
8638}
8639
8640pub struct WifiEventCallbackRequestStream {
8642 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8643 is_terminated: bool,
8644}
8645
8646impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8647
8648impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8649 fn is_terminated(&self) -> bool {
8650 self.is_terminated
8651 }
8652}
8653
8654impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8655 type Protocol = WifiEventCallbackMarker;
8656 type ControlHandle = WifiEventCallbackControlHandle;
8657
8658 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8659 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8660 }
8661
8662 fn control_handle(&self) -> Self::ControlHandle {
8663 WifiEventCallbackControlHandle { inner: self.inner.clone() }
8664 }
8665
8666 fn into_inner(
8667 self,
8668 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8669 {
8670 (self.inner, self.is_terminated)
8671 }
8672
8673 fn from_inner(
8674 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8675 is_terminated: bool,
8676 ) -> Self {
8677 Self { inner, is_terminated }
8678 }
8679}
8680
8681impl futures::Stream for WifiEventCallbackRequestStream {
8682 type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8683
8684 fn poll_next(
8685 mut self: std::pin::Pin<&mut Self>,
8686 cx: &mut std::task::Context<'_>,
8687 ) -> std::task::Poll<Option<Self::Item>> {
8688 let this = &mut *self;
8689 if this.inner.check_shutdown(cx) {
8690 this.is_terminated = true;
8691 return std::task::Poll::Ready(None);
8692 }
8693 if this.is_terminated {
8694 panic!("polled WifiEventCallbackRequestStream after completion");
8695 }
8696 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8697 |bytes, handles| {
8698 match this.inner.channel().read_etc(cx, bytes, handles) {
8699 std::task::Poll::Ready(Ok(())) => {}
8700 std::task::Poll::Pending => return std::task::Poll::Pending,
8701 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8702 this.is_terminated = true;
8703 return std::task::Poll::Ready(None);
8704 }
8705 std::task::Poll::Ready(Err(e)) => {
8706 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8707 e.into(),
8708 ))));
8709 }
8710 }
8711
8712 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8714
8715 std::task::Poll::Ready(Some(match header.ordinal {
8716 0x61189ff44f9d35f3 => {
8717 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8718 let mut req = fidl::new_empty!(
8719 fidl::encoding::EmptyPayload,
8720 fidl::encoding::DefaultFuchsiaResourceDialect
8721 );
8722 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8723 let control_handle =
8724 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8725 Ok(WifiEventCallbackRequest::OnStart { control_handle })
8726 }
8727 0x58b697bcd475e0f9 => {
8728 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8729 let mut req = fidl::new_empty!(
8730 fidl::encoding::EmptyPayload,
8731 fidl::encoding::DefaultFuchsiaResourceDialect
8732 );
8733 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8734 let control_handle =
8735 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8736 Ok(WifiEventCallbackRequest::OnStop { control_handle })
8737 }
8738 0x69dfee4d3475db21 => {
8739 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8740 let mut req = fidl::new_empty!(
8741 WifiEventCallbackOnSubsystemRestartRequest,
8742 fidl::encoding::DefaultFuchsiaResourceDialect
8743 );
8744 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8745 let control_handle =
8746 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8747 Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8748 payload: req,
8749 control_handle,
8750 })
8751 }
8752 _ if header.tx_id == 0
8753 && header
8754 .dynamic_flags()
8755 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8756 {
8757 Ok(WifiEventCallbackRequest::_UnknownMethod {
8758 ordinal: header.ordinal,
8759 control_handle: WifiEventCallbackControlHandle {
8760 inner: this.inner.clone(),
8761 },
8762 method_type: fidl::MethodType::OneWay,
8763 })
8764 }
8765 _ if header
8766 .dynamic_flags()
8767 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8768 {
8769 this.inner.send_framework_err(
8770 fidl::encoding::FrameworkErr::UnknownMethod,
8771 header.tx_id,
8772 header.ordinal,
8773 header.dynamic_flags(),
8774 (bytes, handles),
8775 )?;
8776 Ok(WifiEventCallbackRequest::_UnknownMethod {
8777 ordinal: header.ordinal,
8778 control_handle: WifiEventCallbackControlHandle {
8779 inner: this.inner.clone(),
8780 },
8781 method_type: fidl::MethodType::TwoWay,
8782 })
8783 }
8784 _ => Err(fidl::Error::UnknownOrdinal {
8785 ordinal: header.ordinal,
8786 protocol_name:
8787 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8788 }),
8789 }))
8790 },
8791 )
8792 }
8793}
8794
8795#[derive(Debug)]
8796pub enum WifiEventCallbackRequest {
8797 OnStart {
8798 control_handle: WifiEventCallbackControlHandle,
8799 },
8800 OnStop {
8801 control_handle: WifiEventCallbackControlHandle,
8802 },
8803 OnSubsystemRestart {
8804 payload: WifiEventCallbackOnSubsystemRestartRequest,
8805 control_handle: WifiEventCallbackControlHandle,
8806 },
8807 #[non_exhaustive]
8809 _UnknownMethod {
8810 ordinal: u64,
8812 control_handle: WifiEventCallbackControlHandle,
8813 method_type: fidl::MethodType,
8814 },
8815}
8816
8817impl WifiEventCallbackRequest {
8818 #[allow(irrefutable_let_patterns)]
8819 pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
8820 if let WifiEventCallbackRequest::OnStart { control_handle } = self {
8821 Some((control_handle))
8822 } else {
8823 None
8824 }
8825 }
8826
8827 #[allow(irrefutable_let_patterns)]
8828 pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
8829 if let WifiEventCallbackRequest::OnStop { control_handle } = self {
8830 Some((control_handle))
8831 } else {
8832 None
8833 }
8834 }
8835
8836 #[allow(irrefutable_let_patterns)]
8837 pub fn into_on_subsystem_restart(
8838 self,
8839 ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
8840 if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
8841 Some((payload, control_handle))
8842 } else {
8843 None
8844 }
8845 }
8846
8847 pub fn method_name(&self) -> &'static str {
8849 match *self {
8850 WifiEventCallbackRequest::OnStart { .. } => "on_start",
8851 WifiEventCallbackRequest::OnStop { .. } => "on_stop",
8852 WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
8853 WifiEventCallbackRequest::_UnknownMethod {
8854 method_type: fidl::MethodType::OneWay,
8855 ..
8856 } => "unknown one-way method",
8857 WifiEventCallbackRequest::_UnknownMethod {
8858 method_type: fidl::MethodType::TwoWay,
8859 ..
8860 } => "unknown two-way method",
8861 }
8862 }
8863}
8864
8865#[derive(Debug, Clone)]
8866pub struct WifiEventCallbackControlHandle {
8867 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8868}
8869
8870impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
8871 fn shutdown(&self) {
8872 self.inner.shutdown()
8873 }
8874
8875 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8876 self.inner.shutdown_with_epitaph(status)
8877 }
8878
8879 fn is_closed(&self) -> bool {
8880 self.inner.channel().is_closed()
8881 }
8882 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8883 self.inner.channel().on_closed()
8884 }
8885
8886 #[cfg(target_os = "fuchsia")]
8887 fn signal_peer(
8888 &self,
8889 clear_mask: zx::Signals,
8890 set_mask: zx::Signals,
8891 ) -> Result<(), zx_status::Status> {
8892 use fidl::Peered;
8893 self.inner.channel().signal_peer(clear_mask, set_mask)
8894 }
8895}
8896
8897impl WifiEventCallbackControlHandle {}
8898
8899#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8900pub struct WifiLegacyHalMarker;
8901
8902impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
8903 type Proxy = WifiLegacyHalProxy;
8904 type RequestStream = WifiLegacyHalRequestStream;
8905 #[cfg(target_os = "fuchsia")]
8906 type SynchronousProxy = WifiLegacyHalSynchronousProxy;
8907
8908 const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
8909}
8910pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8911pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8912
8913pub trait WifiLegacyHalProxyInterface: Send + Sync {
8914 type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
8915 + Send;
8916 fn r#select_tx_power_scenario(
8917 &self,
8918 payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8919 ) -> Self::SelectTxPowerScenarioResponseFut;
8920 type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
8921 + Send;
8922 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
8923}
8924#[derive(Debug)]
8925#[cfg(target_os = "fuchsia")]
8926pub struct WifiLegacyHalSynchronousProxy {
8927 client: fidl::client::sync::Client,
8928}
8929
8930#[cfg(target_os = "fuchsia")]
8931impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
8932 type Proxy = WifiLegacyHalProxy;
8933 type Protocol = WifiLegacyHalMarker;
8934
8935 fn from_channel(inner: fidl::Channel) -> Self {
8936 Self::new(inner)
8937 }
8938
8939 fn into_channel(self) -> fidl::Channel {
8940 self.client.into_channel()
8941 }
8942
8943 fn as_channel(&self) -> &fidl::Channel {
8944 self.client.as_channel()
8945 }
8946}
8947
8948#[cfg(target_os = "fuchsia")]
8949impl WifiLegacyHalSynchronousProxy {
8950 pub fn new(channel: fidl::Channel) -> Self {
8951 Self { client: fidl::client::sync::Client::new(channel) }
8952 }
8953
8954 pub fn into_channel(self) -> fidl::Channel {
8955 self.client.into_channel()
8956 }
8957
8958 pub fn wait_for_event(
8961 &self,
8962 deadline: zx::MonotonicInstant,
8963 ) -> Result<WifiLegacyHalEvent, fidl::Error> {
8964 WifiLegacyHalEvent::decode(self.client.wait_for_event::<WifiLegacyHalMarker>(deadline)?)
8965 }
8966
8967 pub fn r#select_tx_power_scenario(
8969 &self,
8970 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8971 ___deadline: zx::MonotonicInstant,
8972 ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
8973 let _response = self.client.send_query::<
8974 WifiLegacyHalSelectTxPowerScenarioRequest,
8975 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
8976 WifiLegacyHalMarker,
8977 >(
8978 &mut payload,
8979 0x49f42620e0a3caf9,
8980 fidl::encoding::DynamicFlags::FLEXIBLE,
8981 ___deadline,
8982 )?
8983 .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
8984 Ok(_response.map(|x| x))
8985 }
8986
8987 pub fn r#reset_tx_power_scenario(
8989 &self,
8990 ___deadline: zx::MonotonicInstant,
8991 ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
8992 let _response =
8993 self.client
8994 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
8995 fidl::encoding::EmptyStruct,
8996 WifiLegacyHalStatus,
8997 >, WifiLegacyHalMarker>(
8998 (),
8999 0x6c0f8e9203167d8e,
9000 fidl::encoding::DynamicFlags::FLEXIBLE,
9001 ___deadline,
9002 )?
9003 .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9004 Ok(_response.map(|x| x))
9005 }
9006}
9007
9008#[cfg(target_os = "fuchsia")]
9009impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
9010 fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
9011 value.into_channel().into()
9012 }
9013}
9014
9015#[cfg(target_os = "fuchsia")]
9016impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
9017 fn from(value: fidl::Channel) -> Self {
9018 Self::new(value)
9019 }
9020}
9021
9022#[cfg(target_os = "fuchsia")]
9023impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
9024 type Protocol = WifiLegacyHalMarker;
9025
9026 fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
9027 Self::new(value.into_channel())
9028 }
9029}
9030
9031#[derive(Debug, Clone)]
9032pub struct WifiLegacyHalProxy {
9033 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9034}
9035
9036impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
9037 type Protocol = WifiLegacyHalMarker;
9038
9039 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9040 Self::new(inner)
9041 }
9042
9043 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9044 self.client.into_channel().map_err(|client| Self { client })
9045 }
9046
9047 fn as_channel(&self) -> &::fidl::AsyncChannel {
9048 self.client.as_channel()
9049 }
9050}
9051
9052impl WifiLegacyHalProxy {
9053 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9055 let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9056 Self { client: fidl::client::Client::new(channel, protocol_name) }
9057 }
9058
9059 pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
9065 WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
9066 }
9067
9068 pub fn r#select_tx_power_scenario(
9070 &self,
9071 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9072 ) -> fidl::client::QueryResponseFut<
9073 WifiLegacyHalSelectTxPowerScenarioResult,
9074 fidl::encoding::DefaultFuchsiaResourceDialect,
9075 > {
9076 WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
9077 }
9078
9079 pub fn r#reset_tx_power_scenario(
9081 &self,
9082 ) -> fidl::client::QueryResponseFut<
9083 WifiLegacyHalResetTxPowerScenarioResult,
9084 fidl::encoding::DefaultFuchsiaResourceDialect,
9085 > {
9086 WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
9087 }
9088}
9089
9090impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
9091 type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9092 WifiLegacyHalSelectTxPowerScenarioResult,
9093 fidl::encoding::DefaultFuchsiaResourceDialect,
9094 >;
9095 fn r#select_tx_power_scenario(
9096 &self,
9097 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9098 ) -> Self::SelectTxPowerScenarioResponseFut {
9099 fn _decode(
9100 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9101 ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9102 let _response = fidl::client::decode_transaction_body::<
9103 fidl::encoding::FlexibleResultType<
9104 fidl::encoding::EmptyStruct,
9105 WifiLegacyHalStatus,
9106 >,
9107 fidl::encoding::DefaultFuchsiaResourceDialect,
9108 0x49f42620e0a3caf9,
9109 >(_buf?)?
9110 .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9111 Ok(_response.map(|x| x))
9112 }
9113 self.client.send_query_and_decode::<
9114 WifiLegacyHalSelectTxPowerScenarioRequest,
9115 WifiLegacyHalSelectTxPowerScenarioResult,
9116 >(
9117 &mut payload,
9118 0x49f42620e0a3caf9,
9119 fidl::encoding::DynamicFlags::FLEXIBLE,
9120 _decode,
9121 )
9122 }
9123
9124 type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9125 WifiLegacyHalResetTxPowerScenarioResult,
9126 fidl::encoding::DefaultFuchsiaResourceDialect,
9127 >;
9128 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
9129 fn _decode(
9130 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9131 ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9132 let _response = fidl::client::decode_transaction_body::<
9133 fidl::encoding::FlexibleResultType<
9134 fidl::encoding::EmptyStruct,
9135 WifiLegacyHalStatus,
9136 >,
9137 fidl::encoding::DefaultFuchsiaResourceDialect,
9138 0x6c0f8e9203167d8e,
9139 >(_buf?)?
9140 .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9141 Ok(_response.map(|x| x))
9142 }
9143 self.client.send_query_and_decode::<
9144 fidl::encoding::EmptyPayload,
9145 WifiLegacyHalResetTxPowerScenarioResult,
9146 >(
9147 (),
9148 0x6c0f8e9203167d8e,
9149 fidl::encoding::DynamicFlags::FLEXIBLE,
9150 _decode,
9151 )
9152 }
9153}
9154
9155pub struct WifiLegacyHalEventStream {
9156 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9157}
9158
9159impl std::marker::Unpin for WifiLegacyHalEventStream {}
9160
9161impl futures::stream::FusedStream for WifiLegacyHalEventStream {
9162 fn is_terminated(&self) -> bool {
9163 self.event_receiver.is_terminated()
9164 }
9165}
9166
9167impl futures::Stream for WifiLegacyHalEventStream {
9168 type Item = Result<WifiLegacyHalEvent, fidl::Error>;
9169
9170 fn poll_next(
9171 mut self: std::pin::Pin<&mut Self>,
9172 cx: &mut std::task::Context<'_>,
9173 ) -> std::task::Poll<Option<Self::Item>> {
9174 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9175 &mut self.event_receiver,
9176 cx
9177 )?) {
9178 Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
9179 None => std::task::Poll::Ready(None),
9180 }
9181 }
9182}
9183
9184#[derive(Debug)]
9185pub enum WifiLegacyHalEvent {
9186 #[non_exhaustive]
9187 _UnknownEvent {
9188 ordinal: u64,
9190 },
9191}
9192
9193impl WifiLegacyHalEvent {
9194 fn decode(
9196 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9197 ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9198 let (bytes, _handles) = buf.split_mut();
9199 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9200 debug_assert_eq!(tx_header.tx_id, 0);
9201 match tx_header.ordinal {
9202 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9203 Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9204 }
9205 _ => Err(fidl::Error::UnknownOrdinal {
9206 ordinal: tx_header.ordinal,
9207 protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9208 }),
9209 }
9210 }
9211}
9212
9213pub struct WifiLegacyHalRequestStream {
9215 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9216 is_terminated: bool,
9217}
9218
9219impl std::marker::Unpin for WifiLegacyHalRequestStream {}
9220
9221impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
9222 fn is_terminated(&self) -> bool {
9223 self.is_terminated
9224 }
9225}
9226
9227impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
9228 type Protocol = WifiLegacyHalMarker;
9229 type ControlHandle = WifiLegacyHalControlHandle;
9230
9231 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9232 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9233 }
9234
9235 fn control_handle(&self) -> Self::ControlHandle {
9236 WifiLegacyHalControlHandle { inner: self.inner.clone() }
9237 }
9238
9239 fn into_inner(
9240 self,
9241 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9242 {
9243 (self.inner, self.is_terminated)
9244 }
9245
9246 fn from_inner(
9247 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9248 is_terminated: bool,
9249 ) -> Self {
9250 Self { inner, is_terminated }
9251 }
9252}
9253
9254impl futures::Stream for WifiLegacyHalRequestStream {
9255 type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9256
9257 fn poll_next(
9258 mut self: std::pin::Pin<&mut Self>,
9259 cx: &mut std::task::Context<'_>,
9260 ) -> std::task::Poll<Option<Self::Item>> {
9261 let this = &mut *self;
9262 if this.inner.check_shutdown(cx) {
9263 this.is_terminated = true;
9264 return std::task::Poll::Ready(None);
9265 }
9266 if this.is_terminated {
9267 panic!("polled WifiLegacyHalRequestStream after completion");
9268 }
9269 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9270 |bytes, handles| {
9271 match this.inner.channel().read_etc(cx, bytes, handles) {
9272 std::task::Poll::Ready(Ok(())) => {}
9273 std::task::Poll::Pending => return std::task::Poll::Pending,
9274 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9275 this.is_terminated = true;
9276 return std::task::Poll::Ready(None);
9277 }
9278 std::task::Poll::Ready(Err(e)) => {
9279 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9280 e.into(),
9281 ))));
9282 }
9283 }
9284
9285 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9287
9288 std::task::Poll::Ready(Some(match header.ordinal {
9289 0x49f42620e0a3caf9 => {
9290 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9291 let mut req = fidl::new_empty!(
9292 WifiLegacyHalSelectTxPowerScenarioRequest,
9293 fidl::encoding::DefaultFuchsiaResourceDialect
9294 );
9295 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9296 let control_handle =
9297 WifiLegacyHalControlHandle { inner: this.inner.clone() };
9298 Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9299 payload: req,
9300 responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9301 control_handle: std::mem::ManuallyDrop::new(control_handle),
9302 tx_id: header.tx_id,
9303 },
9304 })
9305 }
9306 0x6c0f8e9203167d8e => {
9307 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9308 let mut req = fidl::new_empty!(
9309 fidl::encoding::EmptyPayload,
9310 fidl::encoding::DefaultFuchsiaResourceDialect
9311 );
9312 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9313 let control_handle =
9314 WifiLegacyHalControlHandle { inner: this.inner.clone() };
9315 Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9316 responder: WifiLegacyHalResetTxPowerScenarioResponder {
9317 control_handle: std::mem::ManuallyDrop::new(control_handle),
9318 tx_id: header.tx_id,
9319 },
9320 })
9321 }
9322 _ if header.tx_id == 0
9323 && header
9324 .dynamic_flags()
9325 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9326 {
9327 Ok(WifiLegacyHalRequest::_UnknownMethod {
9328 ordinal: header.ordinal,
9329 control_handle: WifiLegacyHalControlHandle {
9330 inner: this.inner.clone(),
9331 },
9332 method_type: fidl::MethodType::OneWay,
9333 })
9334 }
9335 _ if header
9336 .dynamic_flags()
9337 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9338 {
9339 this.inner.send_framework_err(
9340 fidl::encoding::FrameworkErr::UnknownMethod,
9341 header.tx_id,
9342 header.ordinal,
9343 header.dynamic_flags(),
9344 (bytes, handles),
9345 )?;
9346 Ok(WifiLegacyHalRequest::_UnknownMethod {
9347 ordinal: header.ordinal,
9348 control_handle: WifiLegacyHalControlHandle {
9349 inner: this.inner.clone(),
9350 },
9351 method_type: fidl::MethodType::TwoWay,
9352 })
9353 }
9354 _ => Err(fidl::Error::UnknownOrdinal {
9355 ordinal: header.ordinal,
9356 protocol_name:
9357 <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9358 }),
9359 }))
9360 },
9361 )
9362 }
9363}
9364
9365#[derive(Debug)]
9366pub enum WifiLegacyHalRequest {
9367 SelectTxPowerScenario {
9369 payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9370 responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9371 },
9372 ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9374 #[non_exhaustive]
9376 _UnknownMethod {
9377 ordinal: u64,
9379 control_handle: WifiLegacyHalControlHandle,
9380 method_type: fidl::MethodType,
9381 },
9382}
9383
9384impl WifiLegacyHalRequest {
9385 #[allow(irrefutable_let_patterns)]
9386 pub fn into_select_tx_power_scenario(
9387 self,
9388 ) -> Option<(
9389 WifiLegacyHalSelectTxPowerScenarioRequest,
9390 WifiLegacyHalSelectTxPowerScenarioResponder,
9391 )> {
9392 if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9393 Some((payload, responder))
9394 } else {
9395 None
9396 }
9397 }
9398
9399 #[allow(irrefutable_let_patterns)]
9400 pub fn into_reset_tx_power_scenario(
9401 self,
9402 ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9403 if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9404 Some((responder))
9405 } else {
9406 None
9407 }
9408 }
9409
9410 pub fn method_name(&self) -> &'static str {
9412 match *self {
9413 WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9414 WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9415 WifiLegacyHalRequest::_UnknownMethod {
9416 method_type: fidl::MethodType::OneWay, ..
9417 } => "unknown one-way method",
9418 WifiLegacyHalRequest::_UnknownMethod {
9419 method_type: fidl::MethodType::TwoWay, ..
9420 } => "unknown two-way method",
9421 }
9422 }
9423}
9424
9425#[derive(Debug, Clone)]
9426pub struct WifiLegacyHalControlHandle {
9427 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9428}
9429
9430impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9431 fn shutdown(&self) {
9432 self.inner.shutdown()
9433 }
9434
9435 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9436 self.inner.shutdown_with_epitaph(status)
9437 }
9438
9439 fn is_closed(&self) -> bool {
9440 self.inner.channel().is_closed()
9441 }
9442 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9443 self.inner.channel().on_closed()
9444 }
9445
9446 #[cfg(target_os = "fuchsia")]
9447 fn signal_peer(
9448 &self,
9449 clear_mask: zx::Signals,
9450 set_mask: zx::Signals,
9451 ) -> Result<(), zx_status::Status> {
9452 use fidl::Peered;
9453 self.inner.channel().signal_peer(clear_mask, set_mask)
9454 }
9455}
9456
9457impl WifiLegacyHalControlHandle {}
9458
9459#[must_use = "FIDL methods require a response to be sent"]
9460#[derive(Debug)]
9461pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9462 control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9463 tx_id: u32,
9464}
9465
9466impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9470 fn drop(&mut self) {
9471 self.control_handle.shutdown();
9472 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9474 }
9475}
9476
9477impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9478 type ControlHandle = WifiLegacyHalControlHandle;
9479
9480 fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9481 &self.control_handle
9482 }
9483
9484 fn drop_without_shutdown(mut self) {
9485 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9487 std::mem::forget(self);
9489 }
9490}
9491
9492impl WifiLegacyHalSelectTxPowerScenarioResponder {
9493 pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9497 let _result = self.send_raw(result);
9498 if _result.is_err() {
9499 self.control_handle.shutdown();
9500 }
9501 self.drop_without_shutdown();
9502 _result
9503 }
9504
9505 pub fn send_no_shutdown_on_err(
9507 self,
9508 mut result: Result<(), WifiLegacyHalStatus>,
9509 ) -> Result<(), fidl::Error> {
9510 let _result = self.send_raw(result);
9511 self.drop_without_shutdown();
9512 _result
9513 }
9514
9515 fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9516 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9517 fidl::encoding::EmptyStruct,
9518 WifiLegacyHalStatus,
9519 >>(
9520 fidl::encoding::FlexibleResult::new(result),
9521 self.tx_id,
9522 0x49f42620e0a3caf9,
9523 fidl::encoding::DynamicFlags::FLEXIBLE,
9524 )
9525 }
9526}
9527
9528#[must_use = "FIDL methods require a response to be sent"]
9529#[derive(Debug)]
9530pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9531 control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9532 tx_id: u32,
9533}
9534
9535impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9539 fn drop(&mut self) {
9540 self.control_handle.shutdown();
9541 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9543 }
9544}
9545
9546impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9547 type ControlHandle = WifiLegacyHalControlHandle;
9548
9549 fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9550 &self.control_handle
9551 }
9552
9553 fn drop_without_shutdown(mut self) {
9554 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9556 std::mem::forget(self);
9558 }
9559}
9560
9561impl WifiLegacyHalResetTxPowerScenarioResponder {
9562 pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9566 let _result = self.send_raw(result);
9567 if _result.is_err() {
9568 self.control_handle.shutdown();
9569 }
9570 self.drop_without_shutdown();
9571 _result
9572 }
9573
9574 pub fn send_no_shutdown_on_err(
9576 self,
9577 mut result: Result<(), WifiLegacyHalStatus>,
9578 ) -> Result<(), fidl::Error> {
9579 let _result = self.send_raw(result);
9580 self.drop_without_shutdown();
9581 _result
9582 }
9583
9584 fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9585 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9586 fidl::encoding::EmptyStruct,
9587 WifiLegacyHalStatus,
9588 >>(
9589 fidl::encoding::FlexibleResult::new(result),
9590 self.tx_id,
9591 0x6c0f8e9203167d8e,
9592 fidl::encoding::DynamicFlags::FLEXIBLE,
9593 )
9594 }
9595}
9596
9597#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9598pub struct WifiStaIfaceMarker;
9599
9600impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9601 type Proxy = WifiStaIfaceProxy;
9602 type RequestStream = WifiStaIfaceRequestStream;
9603 #[cfg(target_os = "fuchsia")]
9604 type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9605
9606 const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9607}
9608pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9609pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9610pub type WifiStaIfaceGetApfPacketFilterSupportResult =
9611 Result<WifiStaIfaceGetApfPacketFilterSupportResponse, i32>;
9612pub type WifiStaIfaceInstallApfPacketFilterResult = Result<(), i32>;
9613pub type WifiStaIfaceReadApfPacketFilterDataResult =
9614 Result<WifiStaIfaceReadApfPacketFilterDataResponse, i32>;
9615
9616pub trait WifiStaIfaceProxyInterface: Send + Sync {
9617 type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9618 + Send;
9619 fn r#get_name(&self) -> Self::GetNameResponseFut;
9620 type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9621 + Send;
9622 fn r#set_scan_only_mode(
9623 &self,
9624 payload: WifiStaIfaceSetScanOnlyModeRequest,
9625 ) -> Self::SetScanOnlyModeResponseFut;
9626 type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9627 + Send;
9628 fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9629 type GetApfPacketFilterSupportResponseFut: std::future::Future<
9630 Output = Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error>,
9631 > + Send;
9632 fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut;
9633 type InstallApfPacketFilterResponseFut: std::future::Future<Output = Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error>>
9634 + Send;
9635 fn r#install_apf_packet_filter(
9636 &self,
9637 payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9638 ) -> Self::InstallApfPacketFilterResponseFut;
9639 type ReadApfPacketFilterDataResponseFut: std::future::Future<Output = Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error>>
9640 + Send;
9641 fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut;
9642}
9643#[derive(Debug)]
9644#[cfg(target_os = "fuchsia")]
9645pub struct WifiStaIfaceSynchronousProxy {
9646 client: fidl::client::sync::Client,
9647}
9648
9649#[cfg(target_os = "fuchsia")]
9650impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9651 type Proxy = WifiStaIfaceProxy;
9652 type Protocol = WifiStaIfaceMarker;
9653
9654 fn from_channel(inner: fidl::Channel) -> Self {
9655 Self::new(inner)
9656 }
9657
9658 fn into_channel(self) -> fidl::Channel {
9659 self.client.into_channel()
9660 }
9661
9662 fn as_channel(&self) -> &fidl::Channel {
9663 self.client.as_channel()
9664 }
9665}
9666
9667#[cfg(target_os = "fuchsia")]
9668impl WifiStaIfaceSynchronousProxy {
9669 pub fn new(channel: fidl::Channel) -> Self {
9670 Self { client: fidl::client::sync::Client::new(channel) }
9671 }
9672
9673 pub fn into_channel(self) -> fidl::Channel {
9674 self.client.into_channel()
9675 }
9676
9677 pub fn wait_for_event(
9680 &self,
9681 deadline: zx::MonotonicInstant,
9682 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9683 WifiStaIfaceEvent::decode(self.client.wait_for_event::<WifiStaIfaceMarker>(deadline)?)
9684 }
9685
9686 pub fn r#get_name(
9688 &self,
9689 ___deadline: zx::MonotonicInstant,
9690 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9691 let _response = self.client.send_query::<
9692 fidl::encoding::EmptyPayload,
9693 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9694 WifiStaIfaceMarker,
9695 >(
9696 (),
9697 0x5c150b91c80c5789,
9698 fidl::encoding::DynamicFlags::FLEXIBLE,
9699 ___deadline,
9700 )?
9701 .into_result::<WifiStaIfaceMarker>("get_name")?;
9702 Ok(_response)
9703 }
9704
9705 pub fn r#set_scan_only_mode(
9706 &self,
9707 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9708 ___deadline: zx::MonotonicInstant,
9709 ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9710 let _response = self.client.send_query::<
9711 WifiStaIfaceSetScanOnlyModeRequest,
9712 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9713 WifiStaIfaceMarker,
9714 >(
9715 &mut payload,
9716 0x22550328583bf0e3,
9717 fidl::encoding::DynamicFlags::FLEXIBLE,
9718 ___deadline,
9719 )?
9720 .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9721 Ok(_response.map(|x| x))
9722 }
9723
9724 pub fn r#set_mac_address(
9728 &self,
9729 mut mac_addr: &[u8; 6],
9730 ___deadline: zx::MonotonicInstant,
9731 ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9732 let _response = self.client.send_query::<
9733 WifiStaIfaceSetMacAddressRequest,
9734 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9735 WifiStaIfaceMarker,
9736 >(
9737 (mac_addr,),
9738 0x39c4f355079421b9,
9739 fidl::encoding::DynamicFlags::FLEXIBLE,
9740 ___deadline,
9741 )?
9742 .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9743 Ok(_response.map(|x| x))
9744 }
9745
9746 pub fn r#get_apf_packet_filter_support(
9747 &self,
9748 ___deadline: zx::MonotonicInstant,
9749 ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
9750 let _response =
9751 self.client
9752 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9753 WifiStaIfaceGetApfPacketFilterSupportResponse,
9754 i32,
9755 >, WifiStaIfaceMarker>(
9756 (),
9757 0x205c538d31d76c8c,
9758 fidl::encoding::DynamicFlags::FLEXIBLE,
9759 ___deadline,
9760 )?
9761 .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
9762 Ok(_response.map(|x| x))
9763 }
9764
9765 pub fn r#install_apf_packet_filter(
9769 &self,
9770 mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9771 ___deadline: zx::MonotonicInstant,
9772 ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
9773 let _response = self.client.send_query::<
9774 WifiStaIfaceInstallApfPacketFilterRequest,
9775 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9776 WifiStaIfaceMarker,
9777 >(
9778 payload,
9779 0x6306fbfdb65631ba,
9780 fidl::encoding::DynamicFlags::FLEXIBLE,
9781 ___deadline,
9782 )?
9783 .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
9784 Ok(_response.map(|x| x))
9785 }
9786
9787 pub fn r#read_apf_packet_filter_data(
9796 &self,
9797 ___deadline: zx::MonotonicInstant,
9798 ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
9799 let _response =
9800 self.client
9801 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9802 WifiStaIfaceReadApfPacketFilterDataResponse,
9803 i32,
9804 >, WifiStaIfaceMarker>(
9805 (),
9806 0x4f39e558ddbca39,
9807 fidl::encoding::DynamicFlags::FLEXIBLE,
9808 ___deadline,
9809 )?
9810 .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
9811 Ok(_response.map(|x| x))
9812 }
9813}
9814
9815#[cfg(target_os = "fuchsia")]
9816impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
9817 fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
9818 value.into_channel().into()
9819 }
9820}
9821
9822#[cfg(target_os = "fuchsia")]
9823impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
9824 fn from(value: fidl::Channel) -> Self {
9825 Self::new(value)
9826 }
9827}
9828
9829#[cfg(target_os = "fuchsia")]
9830impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
9831 type Protocol = WifiStaIfaceMarker;
9832
9833 fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
9834 Self::new(value.into_channel())
9835 }
9836}
9837
9838#[derive(Debug, Clone)]
9839pub struct WifiStaIfaceProxy {
9840 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9841}
9842
9843impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
9844 type Protocol = WifiStaIfaceMarker;
9845
9846 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9847 Self::new(inner)
9848 }
9849
9850 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9851 self.client.into_channel().map_err(|client| Self { client })
9852 }
9853
9854 fn as_channel(&self) -> &::fidl::AsyncChannel {
9855 self.client.as_channel()
9856 }
9857}
9858
9859impl WifiStaIfaceProxy {
9860 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9862 let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9863 Self { client: fidl::client::Client::new(channel, protocol_name) }
9864 }
9865
9866 pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
9872 WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
9873 }
9874
9875 pub fn r#get_name(
9877 &self,
9878 ) -> fidl::client::QueryResponseFut<
9879 WifiStaIfaceGetNameResponse,
9880 fidl::encoding::DefaultFuchsiaResourceDialect,
9881 > {
9882 WifiStaIfaceProxyInterface::r#get_name(self)
9883 }
9884
9885 pub fn r#set_scan_only_mode(
9886 &self,
9887 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9888 ) -> fidl::client::QueryResponseFut<
9889 WifiStaIfaceSetScanOnlyModeResult,
9890 fidl::encoding::DefaultFuchsiaResourceDialect,
9891 > {
9892 WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
9893 }
9894
9895 pub fn r#set_mac_address(
9899 &self,
9900 mut mac_addr: &[u8; 6],
9901 ) -> fidl::client::QueryResponseFut<
9902 WifiStaIfaceSetMacAddressResult,
9903 fidl::encoding::DefaultFuchsiaResourceDialect,
9904 > {
9905 WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
9906 }
9907
9908 pub fn r#get_apf_packet_filter_support(
9909 &self,
9910 ) -> fidl::client::QueryResponseFut<
9911 WifiStaIfaceGetApfPacketFilterSupportResult,
9912 fidl::encoding::DefaultFuchsiaResourceDialect,
9913 > {
9914 WifiStaIfaceProxyInterface::r#get_apf_packet_filter_support(self)
9915 }
9916
9917 pub fn r#install_apf_packet_filter(
9921 &self,
9922 mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9923 ) -> fidl::client::QueryResponseFut<
9924 WifiStaIfaceInstallApfPacketFilterResult,
9925 fidl::encoding::DefaultFuchsiaResourceDialect,
9926 > {
9927 WifiStaIfaceProxyInterface::r#install_apf_packet_filter(self, payload)
9928 }
9929
9930 pub fn r#read_apf_packet_filter_data(
9939 &self,
9940 ) -> fidl::client::QueryResponseFut<
9941 WifiStaIfaceReadApfPacketFilterDataResult,
9942 fidl::encoding::DefaultFuchsiaResourceDialect,
9943 > {
9944 WifiStaIfaceProxyInterface::r#read_apf_packet_filter_data(self)
9945 }
9946}
9947
9948impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
9949 type GetNameResponseFut = fidl::client::QueryResponseFut<
9950 WifiStaIfaceGetNameResponse,
9951 fidl::encoding::DefaultFuchsiaResourceDialect,
9952 >;
9953 fn r#get_name(&self) -> Self::GetNameResponseFut {
9954 fn _decode(
9955 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9956 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9957 let _response = fidl::client::decode_transaction_body::<
9958 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9959 fidl::encoding::DefaultFuchsiaResourceDialect,
9960 0x5c150b91c80c5789,
9961 >(_buf?)?
9962 .into_result::<WifiStaIfaceMarker>("get_name")?;
9963 Ok(_response)
9964 }
9965 self.client
9966 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
9967 (),
9968 0x5c150b91c80c5789,
9969 fidl::encoding::DynamicFlags::FLEXIBLE,
9970 _decode,
9971 )
9972 }
9973
9974 type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
9975 WifiStaIfaceSetScanOnlyModeResult,
9976 fidl::encoding::DefaultFuchsiaResourceDialect,
9977 >;
9978 fn r#set_scan_only_mode(
9979 &self,
9980 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9981 ) -> Self::SetScanOnlyModeResponseFut {
9982 fn _decode(
9983 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9984 ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9985 let _response = fidl::client::decode_transaction_body::<
9986 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9987 fidl::encoding::DefaultFuchsiaResourceDialect,
9988 0x22550328583bf0e3,
9989 >(_buf?)?
9990 .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9991 Ok(_response.map(|x| x))
9992 }
9993 self.client.send_query_and_decode::<
9994 WifiStaIfaceSetScanOnlyModeRequest,
9995 WifiStaIfaceSetScanOnlyModeResult,
9996 >(
9997 &mut payload,
9998 0x22550328583bf0e3,
9999 fidl::encoding::DynamicFlags::FLEXIBLE,
10000 _decode,
10001 )
10002 }
10003
10004 type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
10005 WifiStaIfaceSetMacAddressResult,
10006 fidl::encoding::DefaultFuchsiaResourceDialect,
10007 >;
10008 fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
10009 fn _decode(
10010 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10011 ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
10012 let _response = fidl::client::decode_transaction_body::<
10013 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10014 fidl::encoding::DefaultFuchsiaResourceDialect,
10015 0x39c4f355079421b9,
10016 >(_buf?)?
10017 .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
10018 Ok(_response.map(|x| x))
10019 }
10020 self.client.send_query_and_decode::<
10021 WifiStaIfaceSetMacAddressRequest,
10022 WifiStaIfaceSetMacAddressResult,
10023 >(
10024 (mac_addr,),
10025 0x39c4f355079421b9,
10026 fidl::encoding::DynamicFlags::FLEXIBLE,
10027 _decode,
10028 )
10029 }
10030
10031 type GetApfPacketFilterSupportResponseFut = fidl::client::QueryResponseFut<
10032 WifiStaIfaceGetApfPacketFilterSupportResult,
10033 fidl::encoding::DefaultFuchsiaResourceDialect,
10034 >;
10035 fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut {
10036 fn _decode(
10037 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10038 ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
10039 let _response = fidl::client::decode_transaction_body::<
10040 fidl::encoding::FlexibleResultType<
10041 WifiStaIfaceGetApfPacketFilterSupportResponse,
10042 i32,
10043 >,
10044 fidl::encoding::DefaultFuchsiaResourceDialect,
10045 0x205c538d31d76c8c,
10046 >(_buf?)?
10047 .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
10048 Ok(_response.map(|x| x))
10049 }
10050 self.client.send_query_and_decode::<
10051 fidl::encoding::EmptyPayload,
10052 WifiStaIfaceGetApfPacketFilterSupportResult,
10053 >(
10054 (),
10055 0x205c538d31d76c8c,
10056 fidl::encoding::DynamicFlags::FLEXIBLE,
10057 _decode,
10058 )
10059 }
10060
10061 type InstallApfPacketFilterResponseFut = fidl::client::QueryResponseFut<
10062 WifiStaIfaceInstallApfPacketFilterResult,
10063 fidl::encoding::DefaultFuchsiaResourceDialect,
10064 >;
10065 fn r#install_apf_packet_filter(
10066 &self,
10067 mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10068 ) -> Self::InstallApfPacketFilterResponseFut {
10069 fn _decode(
10070 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10071 ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10072 let _response = fidl::client::decode_transaction_body::<
10073 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10074 fidl::encoding::DefaultFuchsiaResourceDialect,
10075 0x6306fbfdb65631ba,
10076 >(_buf?)?
10077 .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10078 Ok(_response.map(|x| x))
10079 }
10080 self.client.send_query_and_decode::<
10081 WifiStaIfaceInstallApfPacketFilterRequest,
10082 WifiStaIfaceInstallApfPacketFilterResult,
10083 >(
10084 payload,
10085 0x6306fbfdb65631ba,
10086 fidl::encoding::DynamicFlags::FLEXIBLE,
10087 _decode,
10088 )
10089 }
10090
10091 type ReadApfPacketFilterDataResponseFut = fidl::client::QueryResponseFut<
10092 WifiStaIfaceReadApfPacketFilterDataResult,
10093 fidl::encoding::DefaultFuchsiaResourceDialect,
10094 >;
10095 fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut {
10096 fn _decode(
10097 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10098 ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10099 let _response = fidl::client::decode_transaction_body::<
10100 fidl::encoding::FlexibleResultType<
10101 WifiStaIfaceReadApfPacketFilterDataResponse,
10102 i32,
10103 >,
10104 fidl::encoding::DefaultFuchsiaResourceDialect,
10105 0x4f39e558ddbca39,
10106 >(_buf?)?
10107 .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10108 Ok(_response.map(|x| x))
10109 }
10110 self.client.send_query_and_decode::<
10111 fidl::encoding::EmptyPayload,
10112 WifiStaIfaceReadApfPacketFilterDataResult,
10113 >(
10114 (),
10115 0x4f39e558ddbca39,
10116 fidl::encoding::DynamicFlags::FLEXIBLE,
10117 _decode,
10118 )
10119 }
10120}
10121
10122pub struct WifiStaIfaceEventStream {
10123 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10124}
10125
10126impl std::marker::Unpin for WifiStaIfaceEventStream {}
10127
10128impl futures::stream::FusedStream for WifiStaIfaceEventStream {
10129 fn is_terminated(&self) -> bool {
10130 self.event_receiver.is_terminated()
10131 }
10132}
10133
10134impl futures::Stream for WifiStaIfaceEventStream {
10135 type Item = Result<WifiStaIfaceEvent, fidl::Error>;
10136
10137 fn poll_next(
10138 mut self: std::pin::Pin<&mut Self>,
10139 cx: &mut std::task::Context<'_>,
10140 ) -> std::task::Poll<Option<Self::Item>> {
10141 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10142 &mut self.event_receiver,
10143 cx
10144 )?) {
10145 Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
10146 None => std::task::Poll::Ready(None),
10147 }
10148 }
10149}
10150
10151#[derive(Debug)]
10152pub enum WifiStaIfaceEvent {
10153 #[non_exhaustive]
10154 _UnknownEvent {
10155 ordinal: u64,
10157 },
10158}
10159
10160impl WifiStaIfaceEvent {
10161 fn decode(
10163 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10164 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
10165 let (bytes, _handles) = buf.split_mut();
10166 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10167 debug_assert_eq!(tx_header.tx_id, 0);
10168 match tx_header.ordinal {
10169 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10170 Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10171 }
10172 _ => Err(fidl::Error::UnknownOrdinal {
10173 ordinal: tx_header.ordinal,
10174 protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10175 }),
10176 }
10177 }
10178}
10179
10180pub struct WifiStaIfaceRequestStream {
10182 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10183 is_terminated: bool,
10184}
10185
10186impl std::marker::Unpin for WifiStaIfaceRequestStream {}
10187
10188impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
10189 fn is_terminated(&self) -> bool {
10190 self.is_terminated
10191 }
10192}
10193
10194impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
10195 type Protocol = WifiStaIfaceMarker;
10196 type ControlHandle = WifiStaIfaceControlHandle;
10197
10198 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10199 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10200 }
10201
10202 fn control_handle(&self) -> Self::ControlHandle {
10203 WifiStaIfaceControlHandle { inner: self.inner.clone() }
10204 }
10205
10206 fn into_inner(
10207 self,
10208 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10209 {
10210 (self.inner, self.is_terminated)
10211 }
10212
10213 fn from_inner(
10214 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10215 is_terminated: bool,
10216 ) -> Self {
10217 Self { inner, is_terminated }
10218 }
10219}
10220
10221impl futures::Stream for WifiStaIfaceRequestStream {
10222 type Item = Result<WifiStaIfaceRequest, fidl::Error>;
10223
10224 fn poll_next(
10225 mut self: std::pin::Pin<&mut Self>,
10226 cx: &mut std::task::Context<'_>,
10227 ) -> std::task::Poll<Option<Self::Item>> {
10228 let this = &mut *self;
10229 if this.inner.check_shutdown(cx) {
10230 this.is_terminated = true;
10231 return std::task::Poll::Ready(None);
10232 }
10233 if this.is_terminated {
10234 panic!("polled WifiStaIfaceRequestStream after completion");
10235 }
10236 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10237 |bytes, handles| {
10238 match this.inner.channel().read_etc(cx, bytes, handles) {
10239 std::task::Poll::Ready(Ok(())) => {}
10240 std::task::Poll::Pending => return std::task::Poll::Pending,
10241 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10242 this.is_terminated = true;
10243 return std::task::Poll::Ready(None);
10244 }
10245 std::task::Poll::Ready(Err(e)) => {
10246 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10247 e.into(),
10248 ))));
10249 }
10250 }
10251
10252 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10254
10255 std::task::Poll::Ready(Some(match header.ordinal {
10256 0x5c150b91c80c5789 => {
10257 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10258 let mut req = fidl::new_empty!(
10259 fidl::encoding::EmptyPayload,
10260 fidl::encoding::DefaultFuchsiaResourceDialect
10261 );
10262 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10263 let control_handle =
10264 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10265 Ok(WifiStaIfaceRequest::GetName {
10266 responder: WifiStaIfaceGetNameResponder {
10267 control_handle: std::mem::ManuallyDrop::new(control_handle),
10268 tx_id: header.tx_id,
10269 },
10270 })
10271 }
10272 0x22550328583bf0e3 => {
10273 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10274 let mut req = fidl::new_empty!(
10275 WifiStaIfaceSetScanOnlyModeRequest,
10276 fidl::encoding::DefaultFuchsiaResourceDialect
10277 );
10278 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
10279 let control_handle =
10280 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10281 Ok(WifiStaIfaceRequest::SetScanOnlyMode {
10282 payload: req,
10283 responder: WifiStaIfaceSetScanOnlyModeResponder {
10284 control_handle: std::mem::ManuallyDrop::new(control_handle),
10285 tx_id: header.tx_id,
10286 },
10287 })
10288 }
10289 0x39c4f355079421b9 => {
10290 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10291 let mut req = fidl::new_empty!(
10292 WifiStaIfaceSetMacAddressRequest,
10293 fidl::encoding::DefaultFuchsiaResourceDialect
10294 );
10295 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
10296 let control_handle =
10297 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10298 Ok(WifiStaIfaceRequest::SetMacAddress {
10299 mac_addr: req.mac_addr,
10300
10301 responder: WifiStaIfaceSetMacAddressResponder {
10302 control_handle: std::mem::ManuallyDrop::new(control_handle),
10303 tx_id: header.tx_id,
10304 },
10305 })
10306 }
10307 0x205c538d31d76c8c => {
10308 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10309 let mut req = fidl::new_empty!(
10310 fidl::encoding::EmptyPayload,
10311 fidl::encoding::DefaultFuchsiaResourceDialect
10312 );
10313 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10314 let control_handle =
10315 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10316 Ok(WifiStaIfaceRequest::GetApfPacketFilterSupport {
10317 responder: WifiStaIfaceGetApfPacketFilterSupportResponder {
10318 control_handle: std::mem::ManuallyDrop::new(control_handle),
10319 tx_id: header.tx_id,
10320 },
10321 })
10322 }
10323 0x6306fbfdb65631ba => {
10324 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10325 let mut req = fidl::new_empty!(
10326 WifiStaIfaceInstallApfPacketFilterRequest,
10327 fidl::encoding::DefaultFuchsiaResourceDialect
10328 );
10329 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceInstallApfPacketFilterRequest>(&header, _body_bytes, handles, &mut req)?;
10330 let control_handle =
10331 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10332 Ok(WifiStaIfaceRequest::InstallApfPacketFilter {
10333 payload: req,
10334 responder: WifiStaIfaceInstallApfPacketFilterResponder {
10335 control_handle: std::mem::ManuallyDrop::new(control_handle),
10336 tx_id: header.tx_id,
10337 },
10338 })
10339 }
10340 0x4f39e558ddbca39 => {
10341 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10342 let mut req = fidl::new_empty!(
10343 fidl::encoding::EmptyPayload,
10344 fidl::encoding::DefaultFuchsiaResourceDialect
10345 );
10346 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10347 let control_handle =
10348 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10349 Ok(WifiStaIfaceRequest::ReadApfPacketFilterData {
10350 responder: WifiStaIfaceReadApfPacketFilterDataResponder {
10351 control_handle: std::mem::ManuallyDrop::new(control_handle),
10352 tx_id: header.tx_id,
10353 },
10354 })
10355 }
10356 _ if header.tx_id == 0
10357 && header
10358 .dynamic_flags()
10359 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10360 {
10361 Ok(WifiStaIfaceRequest::_UnknownMethod {
10362 ordinal: header.ordinal,
10363 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10364 method_type: fidl::MethodType::OneWay,
10365 })
10366 }
10367 _ if header
10368 .dynamic_flags()
10369 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10370 {
10371 this.inner.send_framework_err(
10372 fidl::encoding::FrameworkErr::UnknownMethod,
10373 header.tx_id,
10374 header.ordinal,
10375 header.dynamic_flags(),
10376 (bytes, handles),
10377 )?;
10378 Ok(WifiStaIfaceRequest::_UnknownMethod {
10379 ordinal: header.ordinal,
10380 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10381 method_type: fidl::MethodType::TwoWay,
10382 })
10383 }
10384 _ => Err(fidl::Error::UnknownOrdinal {
10385 ordinal: header.ordinal,
10386 protocol_name:
10387 <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10388 }),
10389 }))
10390 },
10391 )
10392 }
10393}
10394
10395#[derive(Debug)]
10396pub enum WifiStaIfaceRequest {
10397 GetName {
10399 responder: WifiStaIfaceGetNameResponder,
10400 },
10401 SetScanOnlyMode {
10402 payload: WifiStaIfaceSetScanOnlyModeRequest,
10403 responder: WifiStaIfaceSetScanOnlyModeResponder,
10404 },
10405 SetMacAddress {
10409 mac_addr: [u8; 6],
10410 responder: WifiStaIfaceSetMacAddressResponder,
10411 },
10412 GetApfPacketFilterSupport {
10413 responder: WifiStaIfaceGetApfPacketFilterSupportResponder,
10414 },
10415 InstallApfPacketFilter {
10419 payload: WifiStaIfaceInstallApfPacketFilterRequest,
10420 responder: WifiStaIfaceInstallApfPacketFilterResponder,
10421 },
10422 ReadApfPacketFilterData {
10431 responder: WifiStaIfaceReadApfPacketFilterDataResponder,
10432 },
10433 #[non_exhaustive]
10435 _UnknownMethod {
10436 ordinal: u64,
10438 control_handle: WifiStaIfaceControlHandle,
10439 method_type: fidl::MethodType,
10440 },
10441}
10442
10443impl WifiStaIfaceRequest {
10444 #[allow(irrefutable_let_patterns)]
10445 pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
10446 if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
10447 }
10448
10449 #[allow(irrefutable_let_patterns)]
10450 pub fn into_set_scan_only_mode(
10451 self,
10452 ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
10453 if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
10454 Some((payload, responder))
10455 } else {
10456 None
10457 }
10458 }
10459
10460 #[allow(irrefutable_let_patterns)]
10461 pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
10462 if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
10463 Some((mac_addr, responder))
10464 } else {
10465 None
10466 }
10467 }
10468
10469 #[allow(irrefutable_let_patterns)]
10470 pub fn into_get_apf_packet_filter_support(
10471 self,
10472 ) -> Option<(WifiStaIfaceGetApfPacketFilterSupportResponder)> {
10473 if let WifiStaIfaceRequest::GetApfPacketFilterSupport { responder } = self {
10474 Some((responder))
10475 } else {
10476 None
10477 }
10478 }
10479
10480 #[allow(irrefutable_let_patterns)]
10481 pub fn into_install_apf_packet_filter(
10482 self,
10483 ) -> Option<(
10484 WifiStaIfaceInstallApfPacketFilterRequest,
10485 WifiStaIfaceInstallApfPacketFilterResponder,
10486 )> {
10487 if let WifiStaIfaceRequest::InstallApfPacketFilter { payload, responder } = self {
10488 Some((payload, responder))
10489 } else {
10490 None
10491 }
10492 }
10493
10494 #[allow(irrefutable_let_patterns)]
10495 pub fn into_read_apf_packet_filter_data(
10496 self,
10497 ) -> Option<(WifiStaIfaceReadApfPacketFilterDataResponder)> {
10498 if let WifiStaIfaceRequest::ReadApfPacketFilterData { responder } = self {
10499 Some((responder))
10500 } else {
10501 None
10502 }
10503 }
10504
10505 pub fn method_name(&self) -> &'static str {
10507 match *self {
10508 WifiStaIfaceRequest::GetName { .. } => "get_name",
10509 WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
10510 WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
10511 WifiStaIfaceRequest::GetApfPacketFilterSupport { .. } => {
10512 "get_apf_packet_filter_support"
10513 }
10514 WifiStaIfaceRequest::InstallApfPacketFilter { .. } => "install_apf_packet_filter",
10515 WifiStaIfaceRequest::ReadApfPacketFilterData { .. } => "read_apf_packet_filter_data",
10516 WifiStaIfaceRequest::_UnknownMethod {
10517 method_type: fidl::MethodType::OneWay, ..
10518 } => "unknown one-way method",
10519 WifiStaIfaceRequest::_UnknownMethod {
10520 method_type: fidl::MethodType::TwoWay, ..
10521 } => "unknown two-way method",
10522 }
10523 }
10524}
10525
10526#[derive(Debug, Clone)]
10527pub struct WifiStaIfaceControlHandle {
10528 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10529}
10530
10531impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
10532 fn shutdown(&self) {
10533 self.inner.shutdown()
10534 }
10535
10536 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10537 self.inner.shutdown_with_epitaph(status)
10538 }
10539
10540 fn is_closed(&self) -> bool {
10541 self.inner.channel().is_closed()
10542 }
10543 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10544 self.inner.channel().on_closed()
10545 }
10546
10547 #[cfg(target_os = "fuchsia")]
10548 fn signal_peer(
10549 &self,
10550 clear_mask: zx::Signals,
10551 set_mask: zx::Signals,
10552 ) -> Result<(), zx_status::Status> {
10553 use fidl::Peered;
10554 self.inner.channel().signal_peer(clear_mask, set_mask)
10555 }
10556}
10557
10558impl WifiStaIfaceControlHandle {}
10559
10560#[must_use = "FIDL methods require a response to be sent"]
10561#[derive(Debug)]
10562pub struct WifiStaIfaceGetNameResponder {
10563 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10564 tx_id: u32,
10565}
10566
10567impl std::ops::Drop for WifiStaIfaceGetNameResponder {
10571 fn drop(&mut self) {
10572 self.control_handle.shutdown();
10573 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10575 }
10576}
10577
10578impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
10579 type ControlHandle = WifiStaIfaceControlHandle;
10580
10581 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10582 &self.control_handle
10583 }
10584
10585 fn drop_without_shutdown(mut self) {
10586 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10588 std::mem::forget(self);
10590 }
10591}
10592
10593impl WifiStaIfaceGetNameResponder {
10594 pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10598 let _result = self.send_raw(payload);
10599 if _result.is_err() {
10600 self.control_handle.shutdown();
10601 }
10602 self.drop_without_shutdown();
10603 _result
10604 }
10605
10606 pub fn send_no_shutdown_on_err(
10608 self,
10609 mut payload: &WifiStaIfaceGetNameResponse,
10610 ) -> Result<(), fidl::Error> {
10611 let _result = self.send_raw(payload);
10612 self.drop_without_shutdown();
10613 _result
10614 }
10615
10616 fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10617 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10618 fidl::encoding::Flexible::new(payload),
10619 self.tx_id,
10620 0x5c150b91c80c5789,
10621 fidl::encoding::DynamicFlags::FLEXIBLE,
10622 )
10623 }
10624}
10625
10626#[must_use = "FIDL methods require a response to be sent"]
10627#[derive(Debug)]
10628pub struct WifiStaIfaceSetScanOnlyModeResponder {
10629 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10630 tx_id: u32,
10631}
10632
10633impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10637 fn drop(&mut self) {
10638 self.control_handle.shutdown();
10639 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10641 }
10642}
10643
10644impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10645 type ControlHandle = WifiStaIfaceControlHandle;
10646
10647 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10648 &self.control_handle
10649 }
10650
10651 fn drop_without_shutdown(mut self) {
10652 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10654 std::mem::forget(self);
10656 }
10657}
10658
10659impl WifiStaIfaceSetScanOnlyModeResponder {
10660 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10664 let _result = self.send_raw(result);
10665 if _result.is_err() {
10666 self.control_handle.shutdown();
10667 }
10668 self.drop_without_shutdown();
10669 _result
10670 }
10671
10672 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10674 let _result = self.send_raw(result);
10675 self.drop_without_shutdown();
10676 _result
10677 }
10678
10679 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10680 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10681 fidl::encoding::EmptyStruct,
10682 i32,
10683 >>(
10684 fidl::encoding::FlexibleResult::new(result),
10685 self.tx_id,
10686 0x22550328583bf0e3,
10687 fidl::encoding::DynamicFlags::FLEXIBLE,
10688 )
10689 }
10690}
10691
10692#[must_use = "FIDL methods require a response to be sent"]
10693#[derive(Debug)]
10694pub struct WifiStaIfaceSetMacAddressResponder {
10695 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10696 tx_id: u32,
10697}
10698
10699impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
10703 fn drop(&mut self) {
10704 self.control_handle.shutdown();
10705 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10707 }
10708}
10709
10710impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
10711 type ControlHandle = WifiStaIfaceControlHandle;
10712
10713 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10714 &self.control_handle
10715 }
10716
10717 fn drop_without_shutdown(mut self) {
10718 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10720 std::mem::forget(self);
10722 }
10723}
10724
10725impl WifiStaIfaceSetMacAddressResponder {
10726 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10730 let _result = self.send_raw(result);
10731 if _result.is_err() {
10732 self.control_handle.shutdown();
10733 }
10734 self.drop_without_shutdown();
10735 _result
10736 }
10737
10738 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10740 let _result = self.send_raw(result);
10741 self.drop_without_shutdown();
10742 _result
10743 }
10744
10745 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10746 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10747 fidl::encoding::EmptyStruct,
10748 i32,
10749 >>(
10750 fidl::encoding::FlexibleResult::new(result),
10751 self.tx_id,
10752 0x39c4f355079421b9,
10753 fidl::encoding::DynamicFlags::FLEXIBLE,
10754 )
10755 }
10756}
10757
10758#[must_use = "FIDL methods require a response to be sent"]
10759#[derive(Debug)]
10760pub struct WifiStaIfaceGetApfPacketFilterSupportResponder {
10761 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10762 tx_id: u32,
10763}
10764
10765impl std::ops::Drop for WifiStaIfaceGetApfPacketFilterSupportResponder {
10769 fn drop(&mut self) {
10770 self.control_handle.shutdown();
10771 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10773 }
10774}
10775
10776impl fidl::endpoints::Responder for WifiStaIfaceGetApfPacketFilterSupportResponder {
10777 type ControlHandle = WifiStaIfaceControlHandle;
10778
10779 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10780 &self.control_handle
10781 }
10782
10783 fn drop_without_shutdown(mut self) {
10784 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10786 std::mem::forget(self);
10788 }
10789}
10790
10791impl WifiStaIfaceGetApfPacketFilterSupportResponder {
10792 pub fn send(
10796 self,
10797 mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10798 ) -> Result<(), fidl::Error> {
10799 let _result = self.send_raw(result);
10800 if _result.is_err() {
10801 self.control_handle.shutdown();
10802 }
10803 self.drop_without_shutdown();
10804 _result
10805 }
10806
10807 pub fn send_no_shutdown_on_err(
10809 self,
10810 mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10811 ) -> Result<(), fidl::Error> {
10812 let _result = self.send_raw(result);
10813 self.drop_without_shutdown();
10814 _result
10815 }
10816
10817 fn send_raw(
10818 &self,
10819 mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10820 ) -> Result<(), fidl::Error> {
10821 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10822 WifiStaIfaceGetApfPacketFilterSupportResponse,
10823 i32,
10824 >>(
10825 fidl::encoding::FlexibleResult::new(result),
10826 self.tx_id,
10827 0x205c538d31d76c8c,
10828 fidl::encoding::DynamicFlags::FLEXIBLE,
10829 )
10830 }
10831}
10832
10833#[must_use = "FIDL methods require a response to be sent"]
10834#[derive(Debug)]
10835pub struct WifiStaIfaceInstallApfPacketFilterResponder {
10836 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10837 tx_id: u32,
10838}
10839
10840impl std::ops::Drop for WifiStaIfaceInstallApfPacketFilterResponder {
10844 fn drop(&mut self) {
10845 self.control_handle.shutdown();
10846 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10848 }
10849}
10850
10851impl fidl::endpoints::Responder for WifiStaIfaceInstallApfPacketFilterResponder {
10852 type ControlHandle = WifiStaIfaceControlHandle;
10853
10854 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10855 &self.control_handle
10856 }
10857
10858 fn drop_without_shutdown(mut self) {
10859 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10861 std::mem::forget(self);
10863 }
10864}
10865
10866impl WifiStaIfaceInstallApfPacketFilterResponder {
10867 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10871 let _result = self.send_raw(result);
10872 if _result.is_err() {
10873 self.control_handle.shutdown();
10874 }
10875 self.drop_without_shutdown();
10876 _result
10877 }
10878
10879 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10881 let _result = self.send_raw(result);
10882 self.drop_without_shutdown();
10883 _result
10884 }
10885
10886 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10887 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10888 fidl::encoding::EmptyStruct,
10889 i32,
10890 >>(
10891 fidl::encoding::FlexibleResult::new(result),
10892 self.tx_id,
10893 0x6306fbfdb65631ba,
10894 fidl::encoding::DynamicFlags::FLEXIBLE,
10895 )
10896 }
10897}
10898
10899#[must_use = "FIDL methods require a response to be sent"]
10900#[derive(Debug)]
10901pub struct WifiStaIfaceReadApfPacketFilterDataResponder {
10902 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10903 tx_id: u32,
10904}
10905
10906impl std::ops::Drop for WifiStaIfaceReadApfPacketFilterDataResponder {
10910 fn drop(&mut self) {
10911 self.control_handle.shutdown();
10912 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10914 }
10915}
10916
10917impl fidl::endpoints::Responder for WifiStaIfaceReadApfPacketFilterDataResponder {
10918 type ControlHandle = WifiStaIfaceControlHandle;
10919
10920 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10921 &self.control_handle
10922 }
10923
10924 fn drop_without_shutdown(mut self) {
10925 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10927 std::mem::forget(self);
10929 }
10930}
10931
10932impl WifiStaIfaceReadApfPacketFilterDataResponder {
10933 pub fn send(
10937 self,
10938 mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
10939 ) -> Result<(), fidl::Error> {
10940 let _result = self.send_raw(result);
10941 if _result.is_err() {
10942 self.control_handle.shutdown();
10943 }
10944 self.drop_without_shutdown();
10945 _result
10946 }
10947
10948 pub fn send_no_shutdown_on_err(
10950 self,
10951 mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
10952 ) -> Result<(), fidl::Error> {
10953 let _result = self.send_raw(result);
10954 self.drop_without_shutdown();
10955 _result
10956 }
10957
10958 fn send_raw(
10959 &self,
10960 mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
10961 ) -> Result<(), fidl::Error> {
10962 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10963 WifiStaIfaceReadApfPacketFilterDataResponse,
10964 i32,
10965 >>(
10966 fidl::encoding::FlexibleResult::new(result),
10967 self.tx_id,
10968 0x4f39e558ddbca39,
10969 fidl::encoding::DynamicFlags::FLEXIBLE,
10970 )
10971 }
10972}
10973
10974#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10975pub struct WlanixMarker;
10976
10977impl fidl::endpoints::ProtocolMarker for WlanixMarker {
10978 type Proxy = WlanixProxy;
10979 type RequestStream = WlanixRequestStream;
10980 #[cfg(target_os = "fuchsia")]
10981 type SynchronousProxy = WlanixSynchronousProxy;
10982
10983 const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
10984}
10985impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
10986
10987pub trait WlanixProxyInterface: Send + Sync {
10988 fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
10989 fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
10990 fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
10991 fn r#get_wifi_legacy_hal(
10992 &self,
10993 payload: WlanixGetWifiLegacyHalRequest,
10994 ) -> Result<(), fidl::Error>;
10995}
10996#[derive(Debug)]
10997#[cfg(target_os = "fuchsia")]
10998pub struct WlanixSynchronousProxy {
10999 client: fidl::client::sync::Client,
11000}
11001
11002#[cfg(target_os = "fuchsia")]
11003impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
11004 type Proxy = WlanixProxy;
11005 type Protocol = WlanixMarker;
11006
11007 fn from_channel(inner: fidl::Channel) -> Self {
11008 Self::new(inner)
11009 }
11010
11011 fn into_channel(self) -> fidl::Channel {
11012 self.client.into_channel()
11013 }
11014
11015 fn as_channel(&self) -> &fidl::Channel {
11016 self.client.as_channel()
11017 }
11018}
11019
11020#[cfg(target_os = "fuchsia")]
11021impl WlanixSynchronousProxy {
11022 pub fn new(channel: fidl::Channel) -> Self {
11023 Self { client: fidl::client::sync::Client::new(channel) }
11024 }
11025
11026 pub fn into_channel(self) -> fidl::Channel {
11027 self.client.into_channel()
11028 }
11029
11030 pub fn wait_for_event(
11033 &self,
11034 deadline: zx::MonotonicInstant,
11035 ) -> Result<WlanixEvent, fidl::Error> {
11036 WlanixEvent::decode(self.client.wait_for_event::<WlanixMarker>(deadline)?)
11037 }
11038
11039 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11041 self.client.send::<WlanixGetWifiRequest>(
11042 &mut payload,
11043 0x142511f44b2c338c,
11044 fidl::encoding::DynamicFlags::FLEXIBLE,
11045 )
11046 }
11047
11048 pub fn r#get_supplicant(
11049 &self,
11050 mut payload: WlanixGetSupplicantRequest,
11051 ) -> Result<(), fidl::Error> {
11052 self.client.send::<WlanixGetSupplicantRequest>(
11053 &mut payload,
11054 0x55554b37c4021d3d,
11055 fidl::encoding::DynamicFlags::FLEXIBLE,
11056 )
11057 }
11058
11059 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11060 self.client.send::<WlanixGetNl80211Request>(
11061 &mut payload,
11062 0x48028a25bd855ef9,
11063 fidl::encoding::DynamicFlags::FLEXIBLE,
11064 )
11065 }
11066
11067 pub fn r#get_wifi_legacy_hal(
11068 &self,
11069 mut payload: WlanixGetWifiLegacyHalRequest,
11070 ) -> Result<(), fidl::Error> {
11071 self.client.send::<WlanixGetWifiLegacyHalRequest>(
11072 &mut payload,
11073 0x7302d9bb3b8d1edc,
11074 fidl::encoding::DynamicFlags::FLEXIBLE,
11075 )
11076 }
11077}
11078
11079#[cfg(target_os = "fuchsia")]
11080impl From<WlanixSynchronousProxy> for zx::NullableHandle {
11081 fn from(value: WlanixSynchronousProxy) -> Self {
11082 value.into_channel().into()
11083 }
11084}
11085
11086#[cfg(target_os = "fuchsia")]
11087impl From<fidl::Channel> for WlanixSynchronousProxy {
11088 fn from(value: fidl::Channel) -> Self {
11089 Self::new(value)
11090 }
11091}
11092
11093#[cfg(target_os = "fuchsia")]
11094impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
11095 type Protocol = WlanixMarker;
11096
11097 fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
11098 Self::new(value.into_channel())
11099 }
11100}
11101
11102#[derive(Debug, Clone)]
11103pub struct WlanixProxy {
11104 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
11105}
11106
11107impl fidl::endpoints::Proxy for WlanixProxy {
11108 type Protocol = WlanixMarker;
11109
11110 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
11111 Self::new(inner)
11112 }
11113
11114 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
11115 self.client.into_channel().map_err(|client| Self { client })
11116 }
11117
11118 fn as_channel(&self) -> &::fidl::AsyncChannel {
11119 self.client.as_channel()
11120 }
11121}
11122
11123impl WlanixProxy {
11124 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
11126 let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11127 Self { client: fidl::client::Client::new(channel, protocol_name) }
11128 }
11129
11130 pub fn take_event_stream(&self) -> WlanixEventStream {
11136 WlanixEventStream { event_receiver: self.client.take_event_receiver() }
11137 }
11138
11139 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11141 WlanixProxyInterface::r#get_wifi(self, payload)
11142 }
11143
11144 pub fn r#get_supplicant(
11145 &self,
11146 mut payload: WlanixGetSupplicantRequest,
11147 ) -> Result<(), fidl::Error> {
11148 WlanixProxyInterface::r#get_supplicant(self, payload)
11149 }
11150
11151 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11152 WlanixProxyInterface::r#get_nl80211(self, payload)
11153 }
11154
11155 pub fn r#get_wifi_legacy_hal(
11156 &self,
11157 mut payload: WlanixGetWifiLegacyHalRequest,
11158 ) -> Result<(), fidl::Error> {
11159 WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
11160 }
11161}
11162
11163impl WlanixProxyInterface for WlanixProxy {
11164 fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11165 self.client.send::<WlanixGetWifiRequest>(
11166 &mut payload,
11167 0x142511f44b2c338c,
11168 fidl::encoding::DynamicFlags::FLEXIBLE,
11169 )
11170 }
11171
11172 fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
11173 self.client.send::<WlanixGetSupplicantRequest>(
11174 &mut payload,
11175 0x55554b37c4021d3d,
11176 fidl::encoding::DynamicFlags::FLEXIBLE,
11177 )
11178 }
11179
11180 fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11181 self.client.send::<WlanixGetNl80211Request>(
11182 &mut payload,
11183 0x48028a25bd855ef9,
11184 fidl::encoding::DynamicFlags::FLEXIBLE,
11185 )
11186 }
11187
11188 fn r#get_wifi_legacy_hal(
11189 &self,
11190 mut payload: WlanixGetWifiLegacyHalRequest,
11191 ) -> Result<(), fidl::Error> {
11192 self.client.send::<WlanixGetWifiLegacyHalRequest>(
11193 &mut payload,
11194 0x7302d9bb3b8d1edc,
11195 fidl::encoding::DynamicFlags::FLEXIBLE,
11196 )
11197 }
11198}
11199
11200pub struct WlanixEventStream {
11201 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
11202}
11203
11204impl std::marker::Unpin for WlanixEventStream {}
11205
11206impl futures::stream::FusedStream for WlanixEventStream {
11207 fn is_terminated(&self) -> bool {
11208 self.event_receiver.is_terminated()
11209 }
11210}
11211
11212impl futures::Stream for WlanixEventStream {
11213 type Item = Result<WlanixEvent, fidl::Error>;
11214
11215 fn poll_next(
11216 mut self: std::pin::Pin<&mut Self>,
11217 cx: &mut std::task::Context<'_>,
11218 ) -> std::task::Poll<Option<Self::Item>> {
11219 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11220 &mut self.event_receiver,
11221 cx
11222 )?) {
11223 Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
11224 None => std::task::Poll::Ready(None),
11225 }
11226 }
11227}
11228
11229#[derive(Debug)]
11230pub enum WlanixEvent {
11231 #[non_exhaustive]
11232 _UnknownEvent {
11233 ordinal: u64,
11235 },
11236}
11237
11238impl WlanixEvent {
11239 fn decode(
11241 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11242 ) -> Result<WlanixEvent, fidl::Error> {
11243 let (bytes, _handles) = buf.split_mut();
11244 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11245 debug_assert_eq!(tx_header.tx_id, 0);
11246 match tx_header.ordinal {
11247 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11248 Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11249 }
11250 _ => Err(fidl::Error::UnknownOrdinal {
11251 ordinal: tx_header.ordinal,
11252 protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11253 }),
11254 }
11255 }
11256}
11257
11258pub struct WlanixRequestStream {
11260 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11261 is_terminated: bool,
11262}
11263
11264impl std::marker::Unpin for WlanixRequestStream {}
11265
11266impl futures::stream::FusedStream for WlanixRequestStream {
11267 fn is_terminated(&self) -> bool {
11268 self.is_terminated
11269 }
11270}
11271
11272impl fidl::endpoints::RequestStream for WlanixRequestStream {
11273 type Protocol = WlanixMarker;
11274 type ControlHandle = WlanixControlHandle;
11275
11276 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
11277 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11278 }
11279
11280 fn control_handle(&self) -> Self::ControlHandle {
11281 WlanixControlHandle { inner: self.inner.clone() }
11282 }
11283
11284 fn into_inner(
11285 self,
11286 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
11287 {
11288 (self.inner, self.is_terminated)
11289 }
11290
11291 fn from_inner(
11292 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11293 is_terminated: bool,
11294 ) -> Self {
11295 Self { inner, is_terminated }
11296 }
11297}
11298
11299impl futures::Stream for WlanixRequestStream {
11300 type Item = Result<WlanixRequest, fidl::Error>;
11301
11302 fn poll_next(
11303 mut self: std::pin::Pin<&mut Self>,
11304 cx: &mut std::task::Context<'_>,
11305 ) -> std::task::Poll<Option<Self::Item>> {
11306 let this = &mut *self;
11307 if this.inner.check_shutdown(cx) {
11308 this.is_terminated = true;
11309 return std::task::Poll::Ready(None);
11310 }
11311 if this.is_terminated {
11312 panic!("polled WlanixRequestStream after completion");
11313 }
11314 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
11315 |bytes, handles| {
11316 match this.inner.channel().read_etc(cx, bytes, handles) {
11317 std::task::Poll::Ready(Ok(())) => {}
11318 std::task::Poll::Pending => return std::task::Poll::Pending,
11319 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
11320 this.is_terminated = true;
11321 return std::task::Poll::Ready(None);
11322 }
11323 std::task::Poll::Ready(Err(e)) => {
11324 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11325 e.into(),
11326 ))));
11327 }
11328 }
11329
11330 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11332
11333 std::task::Poll::Ready(Some(match header.ordinal {
11334 0x142511f44b2c338c => {
11335 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11336 let mut req = fidl::new_empty!(
11337 WlanixGetWifiRequest,
11338 fidl::encoding::DefaultFuchsiaResourceDialect
11339 );
11340 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
11341 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11342 Ok(WlanixRequest::GetWifi { payload: req, control_handle })
11343 }
11344 0x55554b37c4021d3d => {
11345 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11346 let mut req = fidl::new_empty!(
11347 WlanixGetSupplicantRequest,
11348 fidl::encoding::DefaultFuchsiaResourceDialect
11349 );
11350 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
11351 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11352 Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
11353 }
11354 0x48028a25bd855ef9 => {
11355 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11356 let mut req = fidl::new_empty!(
11357 WlanixGetNl80211Request,
11358 fidl::encoding::DefaultFuchsiaResourceDialect
11359 );
11360 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
11361 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11362 Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
11363 }
11364 0x7302d9bb3b8d1edc => {
11365 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11366 let mut req = fidl::new_empty!(
11367 WlanixGetWifiLegacyHalRequest,
11368 fidl::encoding::DefaultFuchsiaResourceDialect
11369 );
11370 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
11371 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11372 Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
11373 }
11374 _ if header.tx_id == 0
11375 && header
11376 .dynamic_flags()
11377 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11378 {
11379 Ok(WlanixRequest::_UnknownMethod {
11380 ordinal: header.ordinal,
11381 control_handle: WlanixControlHandle { inner: this.inner.clone() },
11382 method_type: fidl::MethodType::OneWay,
11383 })
11384 }
11385 _ if header
11386 .dynamic_flags()
11387 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11388 {
11389 this.inner.send_framework_err(
11390 fidl::encoding::FrameworkErr::UnknownMethod,
11391 header.tx_id,
11392 header.ordinal,
11393 header.dynamic_flags(),
11394 (bytes, handles),
11395 )?;
11396 Ok(WlanixRequest::_UnknownMethod {
11397 ordinal: header.ordinal,
11398 control_handle: WlanixControlHandle { inner: this.inner.clone() },
11399 method_type: fidl::MethodType::TwoWay,
11400 })
11401 }
11402 _ => Err(fidl::Error::UnknownOrdinal {
11403 ordinal: header.ordinal,
11404 protocol_name:
11405 <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11406 }),
11407 }))
11408 },
11409 )
11410 }
11411}
11412
11413#[derive(Debug)]
11415pub enum WlanixRequest {
11416 GetWifi {
11418 payload: WlanixGetWifiRequest,
11419 control_handle: WlanixControlHandle,
11420 },
11421 GetSupplicant {
11422 payload: WlanixGetSupplicantRequest,
11423 control_handle: WlanixControlHandle,
11424 },
11425 GetNl80211 {
11426 payload: WlanixGetNl80211Request,
11427 control_handle: WlanixControlHandle,
11428 },
11429 GetWifiLegacyHal {
11430 payload: WlanixGetWifiLegacyHalRequest,
11431 control_handle: WlanixControlHandle,
11432 },
11433 #[non_exhaustive]
11435 _UnknownMethod {
11436 ordinal: u64,
11438 control_handle: WlanixControlHandle,
11439 method_type: fidl::MethodType,
11440 },
11441}
11442
11443impl WlanixRequest {
11444 #[allow(irrefutable_let_patterns)]
11445 pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
11446 if let WlanixRequest::GetWifi { payload, control_handle } = self {
11447 Some((payload, control_handle))
11448 } else {
11449 None
11450 }
11451 }
11452
11453 #[allow(irrefutable_let_patterns)]
11454 pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
11455 if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
11456 Some((payload, control_handle))
11457 } else {
11458 None
11459 }
11460 }
11461
11462 #[allow(irrefutable_let_patterns)]
11463 pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
11464 if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
11465 Some((payload, control_handle))
11466 } else {
11467 None
11468 }
11469 }
11470
11471 #[allow(irrefutable_let_patterns)]
11472 pub fn into_get_wifi_legacy_hal(
11473 self,
11474 ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
11475 if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
11476 Some((payload, control_handle))
11477 } else {
11478 None
11479 }
11480 }
11481
11482 pub fn method_name(&self) -> &'static str {
11484 match *self {
11485 WlanixRequest::GetWifi { .. } => "get_wifi",
11486 WlanixRequest::GetSupplicant { .. } => "get_supplicant",
11487 WlanixRequest::GetNl80211 { .. } => "get_nl80211",
11488 WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
11489 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
11490 "unknown one-way method"
11491 }
11492 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
11493 "unknown two-way method"
11494 }
11495 }
11496 }
11497}
11498
11499#[derive(Debug, Clone)]
11500pub struct WlanixControlHandle {
11501 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11502}
11503
11504impl fidl::endpoints::ControlHandle for WlanixControlHandle {
11505 fn shutdown(&self) {
11506 self.inner.shutdown()
11507 }
11508
11509 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
11510 self.inner.shutdown_with_epitaph(status)
11511 }
11512
11513 fn is_closed(&self) -> bool {
11514 self.inner.channel().is_closed()
11515 }
11516 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11517 self.inner.channel().on_closed()
11518 }
11519
11520 #[cfg(target_os = "fuchsia")]
11521 fn signal_peer(
11522 &self,
11523 clear_mask: zx::Signals,
11524 set_mask: zx::Signals,
11525 ) -> Result<(), zx_status::Status> {
11526 use fidl::Peered;
11527 self.inner.channel().signal_peer(clear_mask, set_mask)
11528 }
11529}
11530
11531impl WlanixControlHandle {}
11532
11533mod internal {
11534 use super::*;
11535
11536 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
11537 type Borrowed<'a> = &'a mut Self;
11538 fn take_or_borrow<'a>(
11539 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11540 ) -> Self::Borrowed<'a> {
11541 value
11542 }
11543 }
11544
11545 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
11546 type Owned = Self;
11547
11548 #[inline(always)]
11549 fn inline_align(_context: fidl::encoding::Context) -> usize {
11550 8
11551 }
11552
11553 #[inline(always)]
11554 fn inline_size(_context: fidl::encoding::Context) -> usize {
11555 16
11556 }
11557 }
11558
11559 unsafe impl
11560 fidl::encoding::Encode<
11561 Nl80211MessageV2Request,
11562 fidl::encoding::DefaultFuchsiaResourceDialect,
11563 > for &mut Nl80211MessageV2Request
11564 {
11565 #[inline]
11566 unsafe fn encode(
11567 self,
11568 encoder: &mut fidl::encoding::Encoder<
11569 '_,
11570 fidl::encoding::DefaultFuchsiaResourceDialect,
11571 >,
11572 offset: usize,
11573 _depth: fidl::encoding::Depth,
11574 ) -> fidl::Result<()> {
11575 encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11576 fidl::encoding::Encode::<
11578 Nl80211MessageV2Request,
11579 fidl::encoding::DefaultFuchsiaResourceDialect,
11580 >::encode(
11581 (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
11582 encoder,
11583 offset,
11584 _depth,
11585 )
11586 }
11587 }
11588 unsafe impl<
11589 T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
11590 >
11591 fidl::encoding::Encode<
11592 Nl80211MessageV2Request,
11593 fidl::encoding::DefaultFuchsiaResourceDialect,
11594 > for (T0,)
11595 {
11596 #[inline]
11597 unsafe fn encode(
11598 self,
11599 encoder: &mut fidl::encoding::Encoder<
11600 '_,
11601 fidl::encoding::DefaultFuchsiaResourceDialect,
11602 >,
11603 offset: usize,
11604 depth: fidl::encoding::Depth,
11605 ) -> fidl::Result<()> {
11606 encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11607 self.0.encode(encoder, offset + 0, depth)?;
11611 Ok(())
11612 }
11613 }
11614
11615 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11616 for Nl80211MessageV2Request
11617 {
11618 #[inline(always)]
11619 fn new_empty() -> Self {
11620 Self {
11621 message: fidl::new_empty!(
11622 Nl80211Message,
11623 fidl::encoding::DefaultFuchsiaResourceDialect
11624 ),
11625 }
11626 }
11627
11628 #[inline]
11629 unsafe fn decode(
11630 &mut self,
11631 decoder: &mut fidl::encoding::Decoder<
11632 '_,
11633 fidl::encoding::DefaultFuchsiaResourceDialect,
11634 >,
11635 offset: usize,
11636 _depth: fidl::encoding::Depth,
11637 ) -> fidl::Result<()> {
11638 decoder.debug_check_bounds::<Self>(offset);
11639 fidl::decode!(
11641 Nl80211Message,
11642 fidl::encoding::DefaultFuchsiaResourceDialect,
11643 &mut self.message,
11644 decoder,
11645 offset + 0,
11646 _depth
11647 )?;
11648 Ok(())
11649 }
11650 }
11651
11652 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
11653 type Borrowed<'a> = &'a mut Self;
11654 fn take_or_borrow<'a>(
11655 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11656 ) -> Self::Borrowed<'a> {
11657 value
11658 }
11659 }
11660
11661 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
11662 type Owned = Self;
11663
11664 #[inline(always)]
11665 fn inline_align(_context: fidl::encoding::Context) -> usize {
11666 4
11667 }
11668
11669 #[inline(always)]
11670 fn inline_size(_context: fidl::encoding::Context) -> usize {
11671 4
11672 }
11673 }
11674
11675 unsafe impl
11676 fidl::encoding::Encode<
11677 Nl80211MessageV2Response,
11678 fidl::encoding::DefaultFuchsiaResourceDialect,
11679 > for &mut Nl80211MessageV2Response
11680 {
11681 #[inline]
11682 unsafe fn encode(
11683 self,
11684 encoder: &mut fidl::encoding::Encoder<
11685 '_,
11686 fidl::encoding::DefaultFuchsiaResourceDialect,
11687 >,
11688 offset: usize,
11689 _depth: fidl::encoding::Depth,
11690 ) -> fidl::Result<()> {
11691 encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11692 fidl::encoding::Encode::<
11694 Nl80211MessageV2Response,
11695 fidl::encoding::DefaultFuchsiaResourceDialect,
11696 >::encode(
11697 (<fidl::encoding::HandleType<
11698 fidl::Vmo,
11699 { fidl::ObjectType::VMO.into_raw() },
11700 2147483648,
11701 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11702 &mut self.response
11703 ),),
11704 encoder,
11705 offset,
11706 _depth,
11707 )
11708 }
11709 }
11710 unsafe impl<
11711 T0: fidl::encoding::Encode<
11712 fidl::encoding::HandleType<
11713 fidl::Vmo,
11714 { fidl::ObjectType::VMO.into_raw() },
11715 2147483648,
11716 >,
11717 fidl::encoding::DefaultFuchsiaResourceDialect,
11718 >,
11719 >
11720 fidl::encoding::Encode<
11721 Nl80211MessageV2Response,
11722 fidl::encoding::DefaultFuchsiaResourceDialect,
11723 > for (T0,)
11724 {
11725 #[inline]
11726 unsafe fn encode(
11727 self,
11728 encoder: &mut fidl::encoding::Encoder<
11729 '_,
11730 fidl::encoding::DefaultFuchsiaResourceDialect,
11731 >,
11732 offset: usize,
11733 depth: fidl::encoding::Depth,
11734 ) -> fidl::Result<()> {
11735 encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11736 self.0.encode(encoder, offset + 0, depth)?;
11740 Ok(())
11741 }
11742 }
11743
11744 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11745 for Nl80211MessageV2Response
11746 {
11747 #[inline(always)]
11748 fn new_empty() -> Self {
11749 Self {
11750 response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11751 }
11752 }
11753
11754 #[inline]
11755 unsafe fn decode(
11756 &mut self,
11757 decoder: &mut fidl::encoding::Decoder<
11758 '_,
11759 fidl::encoding::DefaultFuchsiaResourceDialect,
11760 >,
11761 offset: usize,
11762 _depth: fidl::encoding::Depth,
11763 ) -> fidl::Result<()> {
11764 decoder.debug_check_bounds::<Self>(offset);
11765 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
11767 Ok(())
11768 }
11769 }
11770
11771 impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
11772 type Borrowed<'a> = &'a mut Self;
11773 fn take_or_borrow<'a>(
11774 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11775 ) -> Self::Borrowed<'a> {
11776 value
11777 }
11778 }
11779
11780 unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
11781 type Owned = Self;
11782
11783 #[inline(always)]
11784 fn inline_align(_context: fidl::encoding::Context) -> usize {
11785 1
11786 }
11787
11788 #[inline(always)]
11789 fn inline_size(_context: fidl::encoding::Context) -> usize {
11790 6
11791 }
11792 #[inline(always)]
11793 fn encode_is_copy() -> bool {
11794 true
11795 }
11796
11797 #[inline(always)]
11798 fn decode_is_copy() -> bool {
11799 true
11800 }
11801 }
11802
11803 unsafe impl
11804 fidl::encoding::Encode<
11805 WifiStaIfaceSetMacAddressRequest,
11806 fidl::encoding::DefaultFuchsiaResourceDialect,
11807 > for &mut WifiStaIfaceSetMacAddressRequest
11808 {
11809 #[inline]
11810 unsafe fn encode(
11811 self,
11812 encoder: &mut fidl::encoding::Encoder<
11813 '_,
11814 fidl::encoding::DefaultFuchsiaResourceDialect,
11815 >,
11816 offset: usize,
11817 _depth: fidl::encoding::Depth,
11818 ) -> fidl::Result<()> {
11819 encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11820 unsafe {
11821 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11823 (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
11824 .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
11825 }
11828 Ok(())
11829 }
11830 }
11831 unsafe impl<
11832 T0: fidl::encoding::Encode<
11833 fidl::encoding::Array<u8, 6>,
11834 fidl::encoding::DefaultFuchsiaResourceDialect,
11835 >,
11836 >
11837 fidl::encoding::Encode<
11838 WifiStaIfaceSetMacAddressRequest,
11839 fidl::encoding::DefaultFuchsiaResourceDialect,
11840 > for (T0,)
11841 {
11842 #[inline]
11843 unsafe fn encode(
11844 self,
11845 encoder: &mut fidl::encoding::Encoder<
11846 '_,
11847 fidl::encoding::DefaultFuchsiaResourceDialect,
11848 >,
11849 offset: usize,
11850 depth: fidl::encoding::Depth,
11851 ) -> fidl::Result<()> {
11852 encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11853 self.0.encode(encoder, offset + 0, depth)?;
11857 Ok(())
11858 }
11859 }
11860
11861 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11862 for WifiStaIfaceSetMacAddressRequest
11863 {
11864 #[inline(always)]
11865 fn new_empty() -> Self {
11866 Self {
11867 mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
11868 }
11869 }
11870
11871 #[inline]
11872 unsafe fn decode(
11873 &mut self,
11874 decoder: &mut fidl::encoding::Decoder<
11875 '_,
11876 fidl::encoding::DefaultFuchsiaResourceDialect,
11877 >,
11878 offset: usize,
11879 _depth: fidl::encoding::Depth,
11880 ) -> fidl::Result<()> {
11881 decoder.debug_check_bounds::<Self>(offset);
11882 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11883 unsafe {
11886 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
11887 }
11888 Ok(())
11889 }
11890 }
11891
11892 impl Nl80211GetMulticastRequest {
11893 #[inline(always)]
11894 fn max_ordinal_present(&self) -> u64 {
11895 if let Some(_) = self.multicast {
11896 return 2;
11897 }
11898 if let Some(_) = self.group {
11899 return 1;
11900 }
11901 0
11902 }
11903 }
11904
11905 impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
11906 type Borrowed<'a> = &'a mut Self;
11907 fn take_or_borrow<'a>(
11908 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11909 ) -> Self::Borrowed<'a> {
11910 value
11911 }
11912 }
11913
11914 unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
11915 type Owned = Self;
11916
11917 #[inline(always)]
11918 fn inline_align(_context: fidl::encoding::Context) -> usize {
11919 8
11920 }
11921
11922 #[inline(always)]
11923 fn inline_size(_context: fidl::encoding::Context) -> usize {
11924 16
11925 }
11926 }
11927
11928 unsafe impl
11929 fidl::encoding::Encode<
11930 Nl80211GetMulticastRequest,
11931 fidl::encoding::DefaultFuchsiaResourceDialect,
11932 > for &mut Nl80211GetMulticastRequest
11933 {
11934 unsafe fn encode(
11935 self,
11936 encoder: &mut fidl::encoding::Encoder<
11937 '_,
11938 fidl::encoding::DefaultFuchsiaResourceDialect,
11939 >,
11940 offset: usize,
11941 mut depth: fidl::encoding::Depth,
11942 ) -> fidl::Result<()> {
11943 encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
11944 let max_ordinal: u64 = self.max_ordinal_present();
11946 encoder.write_num(max_ordinal, offset);
11947 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11948 if max_ordinal == 0 {
11950 return Ok(());
11951 }
11952 depth.increment()?;
11953 let envelope_size = 8;
11954 let bytes_len = max_ordinal as usize * envelope_size;
11955 #[allow(unused_variables)]
11956 let offset = encoder.out_of_line_offset(bytes_len);
11957 let mut _prev_end_offset: usize = 0;
11958 if 1 > max_ordinal {
11959 return Ok(());
11960 }
11961
11962 let cur_offset: usize = (1 - 1) * envelope_size;
11965
11966 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11968
11969 fidl::encoding::encode_in_envelope_optional::<
11974 fidl::encoding::BoundedString<32>,
11975 fidl::encoding::DefaultFuchsiaResourceDialect,
11976 >(
11977 self.group.as_ref().map(
11978 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
11979 ),
11980 encoder,
11981 offset + cur_offset,
11982 depth,
11983 )?;
11984
11985 _prev_end_offset = cur_offset + envelope_size;
11986 if 2 > max_ordinal {
11987 return Ok(());
11988 }
11989
11990 let cur_offset: usize = (2 - 1) * envelope_size;
11993
11994 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11996
11997 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12002 self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12003 encoder, offset + cur_offset, depth
12004 )?;
12005
12006 _prev_end_offset = cur_offset + envelope_size;
12007
12008 Ok(())
12009 }
12010 }
12011
12012 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12013 for Nl80211GetMulticastRequest
12014 {
12015 #[inline(always)]
12016 fn new_empty() -> Self {
12017 Self::default()
12018 }
12019
12020 unsafe fn decode(
12021 &mut self,
12022 decoder: &mut fidl::encoding::Decoder<
12023 '_,
12024 fidl::encoding::DefaultFuchsiaResourceDialect,
12025 >,
12026 offset: usize,
12027 mut depth: fidl::encoding::Depth,
12028 ) -> fidl::Result<()> {
12029 decoder.debug_check_bounds::<Self>(offset);
12030 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12031 None => return Err(fidl::Error::NotNullable),
12032 Some(len) => len,
12033 };
12034 if len == 0 {
12036 return Ok(());
12037 };
12038 depth.increment()?;
12039 let envelope_size = 8;
12040 let bytes_len = len * envelope_size;
12041 let offset = decoder.out_of_line_offset(bytes_len)?;
12042 let mut _next_ordinal_to_read = 0;
12044 let mut next_offset = offset;
12045 let end_offset = offset + bytes_len;
12046 _next_ordinal_to_read += 1;
12047 if next_offset >= end_offset {
12048 return Ok(());
12049 }
12050
12051 while _next_ordinal_to_read < 1 {
12053 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12054 _next_ordinal_to_read += 1;
12055 next_offset += envelope_size;
12056 }
12057
12058 let next_out_of_line = decoder.next_out_of_line();
12059 let handles_before = decoder.remaining_handles();
12060 if let Some((inlined, num_bytes, num_handles)) =
12061 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12062 {
12063 let member_inline_size =
12064 <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
12065 decoder.context,
12066 );
12067 if inlined != (member_inline_size <= 4) {
12068 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12069 }
12070 let inner_offset;
12071 let mut inner_depth = depth.clone();
12072 if inlined {
12073 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12074 inner_offset = next_offset;
12075 } else {
12076 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12077 inner_depth.increment()?;
12078 }
12079 let val_ref = self.group.get_or_insert_with(|| {
12080 fidl::new_empty!(
12081 fidl::encoding::BoundedString<32>,
12082 fidl::encoding::DefaultFuchsiaResourceDialect
12083 )
12084 });
12085 fidl::decode!(
12086 fidl::encoding::BoundedString<32>,
12087 fidl::encoding::DefaultFuchsiaResourceDialect,
12088 val_ref,
12089 decoder,
12090 inner_offset,
12091 inner_depth
12092 )?;
12093 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12094 {
12095 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12096 }
12097 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12098 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12099 }
12100 }
12101
12102 next_offset += envelope_size;
12103 _next_ordinal_to_read += 1;
12104 if next_offset >= end_offset {
12105 return Ok(());
12106 }
12107
12108 while _next_ordinal_to_read < 2 {
12110 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12111 _next_ordinal_to_read += 1;
12112 next_offset += envelope_size;
12113 }
12114
12115 let next_out_of_line = decoder.next_out_of_line();
12116 let handles_before = decoder.remaining_handles();
12117 if let Some((inlined, num_bytes, num_handles)) =
12118 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12119 {
12120 let member_inline_size = <fidl::encoding::Endpoint<
12121 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12122 > as fidl::encoding::TypeMarker>::inline_size(
12123 decoder.context
12124 );
12125 if inlined != (member_inline_size <= 4) {
12126 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12127 }
12128 let inner_offset;
12129 let mut inner_depth = depth.clone();
12130 if inlined {
12131 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12132 inner_offset = next_offset;
12133 } else {
12134 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12135 inner_depth.increment()?;
12136 }
12137 let val_ref = self.multicast.get_or_insert_with(|| {
12138 fidl::new_empty!(
12139 fidl::encoding::Endpoint<
12140 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12141 >,
12142 fidl::encoding::DefaultFuchsiaResourceDialect
12143 )
12144 });
12145 fidl::decode!(
12146 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
12147 fidl::encoding::DefaultFuchsiaResourceDialect,
12148 val_ref,
12149 decoder,
12150 inner_offset,
12151 inner_depth
12152 )?;
12153 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12154 {
12155 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12156 }
12157 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12158 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12159 }
12160 }
12161
12162 next_offset += envelope_size;
12163
12164 while next_offset < end_offset {
12166 _next_ordinal_to_read += 1;
12167 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12168 next_offset += envelope_size;
12169 }
12170
12171 Ok(())
12172 }
12173 }
12174
12175 impl Nl80211MessageRequest {
12176 #[inline(always)]
12177 fn max_ordinal_present(&self) -> u64 {
12178 if let Some(_) = self.message {
12179 return 1;
12180 }
12181 0
12182 }
12183 }
12184
12185 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
12186 type Borrowed<'a> = &'a mut Self;
12187 fn take_or_borrow<'a>(
12188 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12189 ) -> Self::Borrowed<'a> {
12190 value
12191 }
12192 }
12193
12194 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
12195 type Owned = Self;
12196
12197 #[inline(always)]
12198 fn inline_align(_context: fidl::encoding::Context) -> usize {
12199 8
12200 }
12201
12202 #[inline(always)]
12203 fn inline_size(_context: fidl::encoding::Context) -> usize {
12204 16
12205 }
12206 }
12207
12208 unsafe impl
12209 fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12210 for &mut Nl80211MessageRequest
12211 {
12212 unsafe fn encode(
12213 self,
12214 encoder: &mut fidl::encoding::Encoder<
12215 '_,
12216 fidl::encoding::DefaultFuchsiaResourceDialect,
12217 >,
12218 offset: usize,
12219 mut depth: fidl::encoding::Depth,
12220 ) -> fidl::Result<()> {
12221 encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
12222 let max_ordinal: u64 = self.max_ordinal_present();
12224 encoder.write_num(max_ordinal, offset);
12225 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12226 if max_ordinal == 0 {
12228 return Ok(());
12229 }
12230 depth.increment()?;
12231 let envelope_size = 8;
12232 let bytes_len = max_ordinal as usize * envelope_size;
12233 #[allow(unused_variables)]
12234 let offset = encoder.out_of_line_offset(bytes_len);
12235 let mut _prev_end_offset: usize = 0;
12236 if 1 > max_ordinal {
12237 return Ok(());
12238 }
12239
12240 let cur_offset: usize = (1 - 1) * envelope_size;
12243
12244 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12246
12247 fidl::encoding::encode_in_envelope_optional::<
12252 Nl80211Message,
12253 fidl::encoding::DefaultFuchsiaResourceDialect,
12254 >(
12255 self.message
12256 .as_ref()
12257 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12258 encoder,
12259 offset + cur_offset,
12260 depth,
12261 )?;
12262
12263 _prev_end_offset = cur_offset + envelope_size;
12264
12265 Ok(())
12266 }
12267 }
12268
12269 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12270 for Nl80211MessageRequest
12271 {
12272 #[inline(always)]
12273 fn new_empty() -> Self {
12274 Self::default()
12275 }
12276
12277 unsafe fn decode(
12278 &mut self,
12279 decoder: &mut fidl::encoding::Decoder<
12280 '_,
12281 fidl::encoding::DefaultFuchsiaResourceDialect,
12282 >,
12283 offset: usize,
12284 mut depth: fidl::encoding::Depth,
12285 ) -> fidl::Result<()> {
12286 decoder.debug_check_bounds::<Self>(offset);
12287 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12288 None => return Err(fidl::Error::NotNullable),
12289 Some(len) => len,
12290 };
12291 if len == 0 {
12293 return Ok(());
12294 };
12295 depth.increment()?;
12296 let envelope_size = 8;
12297 let bytes_len = len * envelope_size;
12298 let offset = decoder.out_of_line_offset(bytes_len)?;
12299 let mut _next_ordinal_to_read = 0;
12301 let mut next_offset = offset;
12302 let end_offset = offset + bytes_len;
12303 _next_ordinal_to_read += 1;
12304 if next_offset >= end_offset {
12305 return Ok(());
12306 }
12307
12308 while _next_ordinal_to_read < 1 {
12310 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12311 _next_ordinal_to_read += 1;
12312 next_offset += envelope_size;
12313 }
12314
12315 let next_out_of_line = decoder.next_out_of_line();
12316 let handles_before = decoder.remaining_handles();
12317 if let Some((inlined, num_bytes, num_handles)) =
12318 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12319 {
12320 let member_inline_size =
12321 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12322 if inlined != (member_inline_size <= 4) {
12323 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12324 }
12325 let inner_offset;
12326 let mut inner_depth = depth.clone();
12327 if inlined {
12328 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12329 inner_offset = next_offset;
12330 } else {
12331 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12332 inner_depth.increment()?;
12333 }
12334 let val_ref = self.message.get_or_insert_with(|| {
12335 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12336 });
12337 fidl::decode!(
12338 Nl80211Message,
12339 fidl::encoding::DefaultFuchsiaResourceDialect,
12340 val_ref,
12341 decoder,
12342 inner_offset,
12343 inner_depth
12344 )?;
12345 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12346 {
12347 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12348 }
12349 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12350 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12351 }
12352 }
12353
12354 next_offset += envelope_size;
12355
12356 while next_offset < end_offset {
12358 _next_ordinal_to_read += 1;
12359 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12360 next_offset += envelope_size;
12361 }
12362
12363 Ok(())
12364 }
12365 }
12366
12367 impl Nl80211MulticastMessageRequest {
12368 #[inline(always)]
12369 fn max_ordinal_present(&self) -> u64 {
12370 if let Some(_) = self.message {
12371 return 1;
12372 }
12373 0
12374 }
12375 }
12376
12377 impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
12378 type Borrowed<'a> = &'a mut Self;
12379 fn take_or_borrow<'a>(
12380 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12381 ) -> Self::Borrowed<'a> {
12382 value
12383 }
12384 }
12385
12386 unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
12387 type Owned = Self;
12388
12389 #[inline(always)]
12390 fn inline_align(_context: fidl::encoding::Context) -> usize {
12391 8
12392 }
12393
12394 #[inline(always)]
12395 fn inline_size(_context: fidl::encoding::Context) -> usize {
12396 16
12397 }
12398 }
12399
12400 unsafe impl
12401 fidl::encoding::Encode<
12402 Nl80211MulticastMessageRequest,
12403 fidl::encoding::DefaultFuchsiaResourceDialect,
12404 > for &mut Nl80211MulticastMessageRequest
12405 {
12406 unsafe fn encode(
12407 self,
12408 encoder: &mut fidl::encoding::Encoder<
12409 '_,
12410 fidl::encoding::DefaultFuchsiaResourceDialect,
12411 >,
12412 offset: usize,
12413 mut depth: fidl::encoding::Depth,
12414 ) -> fidl::Result<()> {
12415 encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
12416 let max_ordinal: u64 = self.max_ordinal_present();
12418 encoder.write_num(max_ordinal, offset);
12419 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12420 if max_ordinal == 0 {
12422 return Ok(());
12423 }
12424 depth.increment()?;
12425 let envelope_size = 8;
12426 let bytes_len = max_ordinal as usize * envelope_size;
12427 #[allow(unused_variables)]
12428 let offset = encoder.out_of_line_offset(bytes_len);
12429 let mut _prev_end_offset: usize = 0;
12430 if 1 > max_ordinal {
12431 return Ok(());
12432 }
12433
12434 let cur_offset: usize = (1 - 1) * envelope_size;
12437
12438 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12440
12441 fidl::encoding::encode_in_envelope_optional::<
12446 Nl80211Message,
12447 fidl::encoding::DefaultFuchsiaResourceDialect,
12448 >(
12449 self.message
12450 .as_ref()
12451 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12452 encoder,
12453 offset + cur_offset,
12454 depth,
12455 )?;
12456
12457 _prev_end_offset = cur_offset + envelope_size;
12458
12459 Ok(())
12460 }
12461 }
12462
12463 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12464 for Nl80211MulticastMessageRequest
12465 {
12466 #[inline(always)]
12467 fn new_empty() -> Self {
12468 Self::default()
12469 }
12470
12471 unsafe fn decode(
12472 &mut self,
12473 decoder: &mut fidl::encoding::Decoder<
12474 '_,
12475 fidl::encoding::DefaultFuchsiaResourceDialect,
12476 >,
12477 offset: usize,
12478 mut depth: fidl::encoding::Depth,
12479 ) -> fidl::Result<()> {
12480 decoder.debug_check_bounds::<Self>(offset);
12481 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12482 None => return Err(fidl::Error::NotNullable),
12483 Some(len) => len,
12484 };
12485 if len == 0 {
12487 return Ok(());
12488 };
12489 depth.increment()?;
12490 let envelope_size = 8;
12491 let bytes_len = len * envelope_size;
12492 let offset = decoder.out_of_line_offset(bytes_len)?;
12493 let mut _next_ordinal_to_read = 0;
12495 let mut next_offset = offset;
12496 let end_offset = offset + bytes_len;
12497 _next_ordinal_to_read += 1;
12498 if next_offset >= end_offset {
12499 return Ok(());
12500 }
12501
12502 while _next_ordinal_to_read < 1 {
12504 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12505 _next_ordinal_to_read += 1;
12506 next_offset += envelope_size;
12507 }
12508
12509 let next_out_of_line = decoder.next_out_of_line();
12510 let handles_before = decoder.remaining_handles();
12511 if let Some((inlined, num_bytes, num_handles)) =
12512 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12513 {
12514 let member_inline_size =
12515 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12516 if inlined != (member_inline_size <= 4) {
12517 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12518 }
12519 let inner_offset;
12520 let mut inner_depth = depth.clone();
12521 if inlined {
12522 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12523 inner_offset = next_offset;
12524 } else {
12525 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12526 inner_depth.increment()?;
12527 }
12528 let val_ref = self.message.get_or_insert_with(|| {
12529 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12530 });
12531 fidl::decode!(
12532 Nl80211Message,
12533 fidl::encoding::DefaultFuchsiaResourceDialect,
12534 val_ref,
12535 decoder,
12536 inner_offset,
12537 inner_depth
12538 )?;
12539 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12540 {
12541 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12542 }
12543 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12544 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12545 }
12546 }
12547
12548 next_offset += envelope_size;
12549
12550 while next_offset < end_offset {
12552 _next_ordinal_to_read += 1;
12553 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12554 next_offset += envelope_size;
12555 }
12556
12557 Ok(())
12558 }
12559 }
12560
12561 impl Nl80211MessageResponse {
12562 #[inline(always)]
12563 fn max_ordinal_present(&self) -> u64 {
12564 if let Some(_) = self.responses {
12565 return 1;
12566 }
12567 0
12568 }
12569 }
12570
12571 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
12572 type Borrowed<'a> = &'a mut Self;
12573 fn take_or_borrow<'a>(
12574 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12575 ) -> Self::Borrowed<'a> {
12576 value
12577 }
12578 }
12579
12580 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
12581 type Owned = Self;
12582
12583 #[inline(always)]
12584 fn inline_align(_context: fidl::encoding::Context) -> usize {
12585 8
12586 }
12587
12588 #[inline(always)]
12589 fn inline_size(_context: fidl::encoding::Context) -> usize {
12590 16
12591 }
12592 }
12593
12594 unsafe impl
12595 fidl::encoding::Encode<
12596 Nl80211MessageResponse,
12597 fidl::encoding::DefaultFuchsiaResourceDialect,
12598 > for &mut Nl80211MessageResponse
12599 {
12600 unsafe fn encode(
12601 self,
12602 encoder: &mut fidl::encoding::Encoder<
12603 '_,
12604 fidl::encoding::DefaultFuchsiaResourceDialect,
12605 >,
12606 offset: usize,
12607 mut depth: fidl::encoding::Depth,
12608 ) -> fidl::Result<()> {
12609 encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
12610 let max_ordinal: u64 = self.max_ordinal_present();
12612 encoder.write_num(max_ordinal, offset);
12613 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12614 if max_ordinal == 0 {
12616 return Ok(());
12617 }
12618 depth.increment()?;
12619 let envelope_size = 8;
12620 let bytes_len = max_ordinal as usize * envelope_size;
12621 #[allow(unused_variables)]
12622 let offset = encoder.out_of_line_offset(bytes_len);
12623 let mut _prev_end_offset: usize = 0;
12624 if 1 > max_ordinal {
12625 return Ok(());
12626 }
12627
12628 let cur_offset: usize = (1 - 1) * envelope_size;
12631
12632 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12634
12635 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12640 self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
12641 encoder, offset + cur_offset, depth
12642 )?;
12643
12644 _prev_end_offset = cur_offset + envelope_size;
12645
12646 Ok(())
12647 }
12648 }
12649
12650 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12651 for Nl80211MessageResponse
12652 {
12653 #[inline(always)]
12654 fn new_empty() -> Self {
12655 Self::default()
12656 }
12657
12658 unsafe fn decode(
12659 &mut self,
12660 decoder: &mut fidl::encoding::Decoder<
12661 '_,
12662 fidl::encoding::DefaultFuchsiaResourceDialect,
12663 >,
12664 offset: usize,
12665 mut depth: fidl::encoding::Depth,
12666 ) -> fidl::Result<()> {
12667 decoder.debug_check_bounds::<Self>(offset);
12668 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12669 None => return Err(fidl::Error::NotNullable),
12670 Some(len) => len,
12671 };
12672 if len == 0 {
12674 return Ok(());
12675 };
12676 depth.increment()?;
12677 let envelope_size = 8;
12678 let bytes_len = len * envelope_size;
12679 let offset = decoder.out_of_line_offset(bytes_len)?;
12680 let mut _next_ordinal_to_read = 0;
12682 let mut next_offset = offset;
12683 let end_offset = offset + bytes_len;
12684 _next_ordinal_to_read += 1;
12685 if next_offset >= end_offset {
12686 return Ok(());
12687 }
12688
12689 while _next_ordinal_to_read < 1 {
12691 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12692 _next_ordinal_to_read += 1;
12693 next_offset += envelope_size;
12694 }
12695
12696 let next_out_of_line = decoder.next_out_of_line();
12697 let handles_before = decoder.remaining_handles();
12698 if let Some((inlined, num_bytes, num_handles)) =
12699 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12700 {
12701 let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12702 if inlined != (member_inline_size <= 4) {
12703 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12704 }
12705 let inner_offset;
12706 let mut inner_depth = depth.clone();
12707 if inlined {
12708 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12709 inner_offset = next_offset;
12710 } else {
12711 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12712 inner_depth.increment()?;
12713 }
12714 let val_ref = self.responses.get_or_insert_with(|| {
12715 fidl::new_empty!(
12716 fidl::encoding::UnboundedVector<Nl80211Message>,
12717 fidl::encoding::DefaultFuchsiaResourceDialect
12718 )
12719 });
12720 fidl::decode!(
12721 fidl::encoding::UnboundedVector<Nl80211Message>,
12722 fidl::encoding::DefaultFuchsiaResourceDialect,
12723 val_ref,
12724 decoder,
12725 inner_offset,
12726 inner_depth
12727 )?;
12728 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12729 {
12730 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12731 }
12732 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12733 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12734 }
12735 }
12736
12737 next_offset += envelope_size;
12738
12739 while next_offset < end_offset {
12741 _next_ordinal_to_read += 1;
12742 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12743 next_offset += envelope_size;
12744 }
12745
12746 Ok(())
12747 }
12748 }
12749
12750 impl SupplicantAddStaInterfaceRequest {
12751 #[inline(always)]
12752 fn max_ordinal_present(&self) -> u64 {
12753 if let Some(_) = self.iface_name {
12754 return 2;
12755 }
12756 if let Some(_) = self.iface {
12757 return 1;
12758 }
12759 0
12760 }
12761 }
12762
12763 impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
12764 type Borrowed<'a> = &'a mut Self;
12765 fn take_or_borrow<'a>(
12766 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12767 ) -> Self::Borrowed<'a> {
12768 value
12769 }
12770 }
12771
12772 unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
12773 type Owned = Self;
12774
12775 #[inline(always)]
12776 fn inline_align(_context: fidl::encoding::Context) -> usize {
12777 8
12778 }
12779
12780 #[inline(always)]
12781 fn inline_size(_context: fidl::encoding::Context) -> usize {
12782 16
12783 }
12784 }
12785
12786 unsafe impl
12787 fidl::encoding::Encode<
12788 SupplicantAddStaInterfaceRequest,
12789 fidl::encoding::DefaultFuchsiaResourceDialect,
12790 > for &mut SupplicantAddStaInterfaceRequest
12791 {
12792 unsafe fn encode(
12793 self,
12794 encoder: &mut fidl::encoding::Encoder<
12795 '_,
12796 fidl::encoding::DefaultFuchsiaResourceDialect,
12797 >,
12798 offset: usize,
12799 mut depth: fidl::encoding::Depth,
12800 ) -> fidl::Result<()> {
12801 encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
12802 let max_ordinal: u64 = self.max_ordinal_present();
12804 encoder.write_num(max_ordinal, offset);
12805 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12806 if max_ordinal == 0 {
12808 return Ok(());
12809 }
12810 depth.increment()?;
12811 let envelope_size = 8;
12812 let bytes_len = max_ordinal as usize * envelope_size;
12813 #[allow(unused_variables)]
12814 let offset = encoder.out_of_line_offset(bytes_len);
12815 let mut _prev_end_offset: usize = 0;
12816 if 1 > max_ordinal {
12817 return Ok(());
12818 }
12819
12820 let cur_offset: usize = (1 - 1) * envelope_size;
12823
12824 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12826
12827 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12832 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12833 encoder, offset + cur_offset, depth
12834 )?;
12835
12836 _prev_end_offset = cur_offset + envelope_size;
12837 if 2 > max_ordinal {
12838 return Ok(());
12839 }
12840
12841 let cur_offset: usize = (2 - 1) * envelope_size;
12844
12845 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12847
12848 fidl::encoding::encode_in_envelope_optional::<
12853 fidl::encoding::BoundedString<16>,
12854 fidl::encoding::DefaultFuchsiaResourceDialect,
12855 >(
12856 self.iface_name.as_ref().map(
12857 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12858 ),
12859 encoder,
12860 offset + cur_offset,
12861 depth,
12862 )?;
12863
12864 _prev_end_offset = cur_offset + envelope_size;
12865
12866 Ok(())
12867 }
12868 }
12869
12870 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12871 for SupplicantAddStaInterfaceRequest
12872 {
12873 #[inline(always)]
12874 fn new_empty() -> Self {
12875 Self::default()
12876 }
12877
12878 unsafe fn decode(
12879 &mut self,
12880 decoder: &mut fidl::encoding::Decoder<
12881 '_,
12882 fidl::encoding::DefaultFuchsiaResourceDialect,
12883 >,
12884 offset: usize,
12885 mut depth: fidl::encoding::Depth,
12886 ) -> fidl::Result<()> {
12887 decoder.debug_check_bounds::<Self>(offset);
12888 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12889 None => return Err(fidl::Error::NotNullable),
12890 Some(len) => len,
12891 };
12892 if len == 0 {
12894 return Ok(());
12895 };
12896 depth.increment()?;
12897 let envelope_size = 8;
12898 let bytes_len = len * envelope_size;
12899 let offset = decoder.out_of_line_offset(bytes_len)?;
12900 let mut _next_ordinal_to_read = 0;
12902 let mut next_offset = offset;
12903 let end_offset = offset + bytes_len;
12904 _next_ordinal_to_read += 1;
12905 if next_offset >= end_offset {
12906 return Ok(());
12907 }
12908
12909 while _next_ordinal_to_read < 1 {
12911 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12912 _next_ordinal_to_read += 1;
12913 next_offset += envelope_size;
12914 }
12915
12916 let next_out_of_line = decoder.next_out_of_line();
12917 let handles_before = decoder.remaining_handles();
12918 if let Some((inlined, num_bytes, num_handles)) =
12919 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12920 {
12921 let member_inline_size = <fidl::encoding::Endpoint<
12922 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12923 > as fidl::encoding::TypeMarker>::inline_size(
12924 decoder.context
12925 );
12926 if inlined != (member_inline_size <= 4) {
12927 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12928 }
12929 let inner_offset;
12930 let mut inner_depth = depth.clone();
12931 if inlined {
12932 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12933 inner_offset = next_offset;
12934 } else {
12935 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12936 inner_depth.increment()?;
12937 }
12938 let val_ref = self.iface.get_or_insert_with(|| {
12939 fidl::new_empty!(
12940 fidl::encoding::Endpoint<
12941 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12942 >,
12943 fidl::encoding::DefaultFuchsiaResourceDialect
12944 )
12945 });
12946 fidl::decode!(
12947 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
12948 fidl::encoding::DefaultFuchsiaResourceDialect,
12949 val_ref,
12950 decoder,
12951 inner_offset,
12952 inner_depth
12953 )?;
12954 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12955 {
12956 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12957 }
12958 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12959 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12960 }
12961 }
12962
12963 next_offset += envelope_size;
12964 _next_ordinal_to_read += 1;
12965 if next_offset >= end_offset {
12966 return Ok(());
12967 }
12968
12969 while _next_ordinal_to_read < 2 {
12971 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12972 _next_ordinal_to_read += 1;
12973 next_offset += envelope_size;
12974 }
12975
12976 let next_out_of_line = decoder.next_out_of_line();
12977 let handles_before = decoder.remaining_handles();
12978 if let Some((inlined, num_bytes, num_handles)) =
12979 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12980 {
12981 let member_inline_size =
12982 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12983 decoder.context,
12984 );
12985 if inlined != (member_inline_size <= 4) {
12986 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12987 }
12988 let inner_offset;
12989 let mut inner_depth = depth.clone();
12990 if inlined {
12991 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12992 inner_offset = next_offset;
12993 } else {
12994 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12995 inner_depth.increment()?;
12996 }
12997 let val_ref = self.iface_name.get_or_insert_with(|| {
12998 fidl::new_empty!(
12999 fidl::encoding::BoundedString<16>,
13000 fidl::encoding::DefaultFuchsiaResourceDialect
13001 )
13002 });
13003 fidl::decode!(
13004 fidl::encoding::BoundedString<16>,
13005 fidl::encoding::DefaultFuchsiaResourceDialect,
13006 val_ref,
13007 decoder,
13008 inner_offset,
13009 inner_depth
13010 )?;
13011 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13012 {
13013 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13014 }
13015 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13016 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13017 }
13018 }
13019
13020 next_offset += envelope_size;
13021
13022 while next_offset < end_offset {
13024 _next_ordinal_to_read += 1;
13025 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13026 next_offset += envelope_size;
13027 }
13028
13029 Ok(())
13030 }
13031 }
13032
13033 impl SupplicantRemoveInterfaceRequest {
13034 #[inline(always)]
13035 fn max_ordinal_present(&self) -> u64 {
13036 if let Some(_) = self.iface_name {
13037 return 1;
13038 }
13039 0
13040 }
13041 }
13042
13043 impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
13044 type Borrowed<'a> = &'a mut Self;
13045 fn take_or_borrow<'a>(
13046 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13047 ) -> Self::Borrowed<'a> {
13048 value
13049 }
13050 }
13051
13052 unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
13053 type Owned = Self;
13054
13055 #[inline(always)]
13056 fn inline_align(_context: fidl::encoding::Context) -> usize {
13057 8
13058 }
13059
13060 #[inline(always)]
13061 fn inline_size(_context: fidl::encoding::Context) -> usize {
13062 16
13063 }
13064 }
13065
13066 unsafe impl
13067 fidl::encoding::Encode<
13068 SupplicantRemoveInterfaceRequest,
13069 fidl::encoding::DefaultFuchsiaResourceDialect,
13070 > for &mut SupplicantRemoveInterfaceRequest
13071 {
13072 unsafe fn encode(
13073 self,
13074 encoder: &mut fidl::encoding::Encoder<
13075 '_,
13076 fidl::encoding::DefaultFuchsiaResourceDialect,
13077 >,
13078 offset: usize,
13079 mut depth: fidl::encoding::Depth,
13080 ) -> fidl::Result<()> {
13081 encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
13082 let max_ordinal: u64 = self.max_ordinal_present();
13084 encoder.write_num(max_ordinal, offset);
13085 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13086 if max_ordinal == 0 {
13088 return Ok(());
13089 }
13090 depth.increment()?;
13091 let envelope_size = 8;
13092 let bytes_len = max_ordinal as usize * envelope_size;
13093 #[allow(unused_variables)]
13094 let offset = encoder.out_of_line_offset(bytes_len);
13095 let mut _prev_end_offset: usize = 0;
13096 if 1 > max_ordinal {
13097 return Ok(());
13098 }
13099
13100 let cur_offset: usize = (1 - 1) * envelope_size;
13103
13104 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13106
13107 fidl::encoding::encode_in_envelope_optional::<
13112 fidl::encoding::BoundedString<16>,
13113 fidl::encoding::DefaultFuchsiaResourceDialect,
13114 >(
13115 self.iface_name.as_ref().map(
13116 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13117 ),
13118 encoder,
13119 offset + cur_offset,
13120 depth,
13121 )?;
13122
13123 _prev_end_offset = cur_offset + envelope_size;
13124
13125 Ok(())
13126 }
13127 }
13128
13129 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13130 for SupplicantRemoveInterfaceRequest
13131 {
13132 #[inline(always)]
13133 fn new_empty() -> Self {
13134 Self::default()
13135 }
13136
13137 unsafe fn decode(
13138 &mut self,
13139 decoder: &mut fidl::encoding::Decoder<
13140 '_,
13141 fidl::encoding::DefaultFuchsiaResourceDialect,
13142 >,
13143 offset: usize,
13144 mut depth: fidl::encoding::Depth,
13145 ) -> fidl::Result<()> {
13146 decoder.debug_check_bounds::<Self>(offset);
13147 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13148 None => return Err(fidl::Error::NotNullable),
13149 Some(len) => len,
13150 };
13151 if len == 0 {
13153 return Ok(());
13154 };
13155 depth.increment()?;
13156 let envelope_size = 8;
13157 let bytes_len = len * envelope_size;
13158 let offset = decoder.out_of_line_offset(bytes_len)?;
13159 let mut _next_ordinal_to_read = 0;
13161 let mut next_offset = offset;
13162 let end_offset = offset + bytes_len;
13163 _next_ordinal_to_read += 1;
13164 if next_offset >= end_offset {
13165 return Ok(());
13166 }
13167
13168 while _next_ordinal_to_read < 1 {
13170 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13171 _next_ordinal_to_read += 1;
13172 next_offset += envelope_size;
13173 }
13174
13175 let next_out_of_line = decoder.next_out_of_line();
13176 let handles_before = decoder.remaining_handles();
13177 if let Some((inlined, num_bytes, num_handles)) =
13178 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13179 {
13180 let member_inline_size =
13181 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13182 decoder.context,
13183 );
13184 if inlined != (member_inline_size <= 4) {
13185 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13186 }
13187 let inner_offset;
13188 let mut inner_depth = depth.clone();
13189 if inlined {
13190 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13191 inner_offset = next_offset;
13192 } else {
13193 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13194 inner_depth.increment()?;
13195 }
13196 let val_ref = self.iface_name.get_or_insert_with(|| {
13197 fidl::new_empty!(
13198 fidl::encoding::BoundedString<16>,
13199 fidl::encoding::DefaultFuchsiaResourceDialect
13200 )
13201 });
13202 fidl::decode!(
13203 fidl::encoding::BoundedString<16>,
13204 fidl::encoding::DefaultFuchsiaResourceDialect,
13205 val_ref,
13206 decoder,
13207 inner_offset,
13208 inner_depth
13209 )?;
13210 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13211 {
13212 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13213 }
13214 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13215 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13216 }
13217 }
13218
13219 next_offset += envelope_size;
13220
13221 while next_offset < end_offset {
13223 _next_ordinal_to_read += 1;
13224 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13225 next_offset += envelope_size;
13226 }
13227
13228 Ok(())
13229 }
13230 }
13231
13232 impl SupplicantStaIfaceAddNetworkRequest {
13233 #[inline(always)]
13234 fn max_ordinal_present(&self) -> u64 {
13235 if let Some(_) = self.network {
13236 return 1;
13237 }
13238 0
13239 }
13240 }
13241
13242 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
13243 type Borrowed<'a> = &'a mut Self;
13244 fn take_or_borrow<'a>(
13245 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13246 ) -> Self::Borrowed<'a> {
13247 value
13248 }
13249 }
13250
13251 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
13252 type Owned = Self;
13253
13254 #[inline(always)]
13255 fn inline_align(_context: fidl::encoding::Context) -> usize {
13256 8
13257 }
13258
13259 #[inline(always)]
13260 fn inline_size(_context: fidl::encoding::Context) -> usize {
13261 16
13262 }
13263 }
13264
13265 unsafe impl
13266 fidl::encoding::Encode<
13267 SupplicantStaIfaceAddNetworkRequest,
13268 fidl::encoding::DefaultFuchsiaResourceDialect,
13269 > for &mut SupplicantStaIfaceAddNetworkRequest
13270 {
13271 unsafe fn encode(
13272 self,
13273 encoder: &mut fidl::encoding::Encoder<
13274 '_,
13275 fidl::encoding::DefaultFuchsiaResourceDialect,
13276 >,
13277 offset: usize,
13278 mut depth: fidl::encoding::Depth,
13279 ) -> fidl::Result<()> {
13280 encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
13281 let max_ordinal: u64 = self.max_ordinal_present();
13283 encoder.write_num(max_ordinal, offset);
13284 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13285 if max_ordinal == 0 {
13287 return Ok(());
13288 }
13289 depth.increment()?;
13290 let envelope_size = 8;
13291 let bytes_len = max_ordinal as usize * envelope_size;
13292 #[allow(unused_variables)]
13293 let offset = encoder.out_of_line_offset(bytes_len);
13294 let mut _prev_end_offset: usize = 0;
13295 if 1 > max_ordinal {
13296 return Ok(());
13297 }
13298
13299 let cur_offset: usize = (1 - 1) * envelope_size;
13302
13303 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13305
13306 fidl::encoding::encode_in_envelope_optional::<
13311 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
13312 fidl::encoding::DefaultFuchsiaResourceDialect,
13313 >(
13314 self.network.as_mut().map(
13315 <fidl::encoding::Endpoint<
13316 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13317 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13318 ),
13319 encoder,
13320 offset + cur_offset,
13321 depth,
13322 )?;
13323
13324 _prev_end_offset = cur_offset + envelope_size;
13325
13326 Ok(())
13327 }
13328 }
13329
13330 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13331 for SupplicantStaIfaceAddNetworkRequest
13332 {
13333 #[inline(always)]
13334 fn new_empty() -> Self {
13335 Self::default()
13336 }
13337
13338 unsafe fn decode(
13339 &mut self,
13340 decoder: &mut fidl::encoding::Decoder<
13341 '_,
13342 fidl::encoding::DefaultFuchsiaResourceDialect,
13343 >,
13344 offset: usize,
13345 mut depth: fidl::encoding::Depth,
13346 ) -> fidl::Result<()> {
13347 decoder.debug_check_bounds::<Self>(offset);
13348 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13349 None => return Err(fidl::Error::NotNullable),
13350 Some(len) => len,
13351 };
13352 if len == 0 {
13354 return Ok(());
13355 };
13356 depth.increment()?;
13357 let envelope_size = 8;
13358 let bytes_len = len * envelope_size;
13359 let offset = decoder.out_of_line_offset(bytes_len)?;
13360 let mut _next_ordinal_to_read = 0;
13362 let mut next_offset = offset;
13363 let end_offset = offset + bytes_len;
13364 _next_ordinal_to_read += 1;
13365 if next_offset >= end_offset {
13366 return Ok(());
13367 }
13368
13369 while _next_ordinal_to_read < 1 {
13371 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13372 _next_ordinal_to_read += 1;
13373 next_offset += envelope_size;
13374 }
13375
13376 let next_out_of_line = decoder.next_out_of_line();
13377 let handles_before = decoder.remaining_handles();
13378 if let Some((inlined, num_bytes, num_handles)) =
13379 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13380 {
13381 let member_inline_size = <fidl::encoding::Endpoint<
13382 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13383 > as fidl::encoding::TypeMarker>::inline_size(
13384 decoder.context
13385 );
13386 if inlined != (member_inline_size <= 4) {
13387 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13388 }
13389 let inner_offset;
13390 let mut inner_depth = depth.clone();
13391 if inlined {
13392 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13393 inner_offset = next_offset;
13394 } else {
13395 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13396 inner_depth.increment()?;
13397 }
13398 let val_ref = self.network.get_or_insert_with(|| {
13399 fidl::new_empty!(
13400 fidl::encoding::Endpoint<
13401 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13402 >,
13403 fidl::encoding::DefaultFuchsiaResourceDialect
13404 )
13405 });
13406 fidl::decode!(
13407 fidl::encoding::Endpoint<
13408 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13409 >,
13410 fidl::encoding::DefaultFuchsiaResourceDialect,
13411 val_ref,
13412 decoder,
13413 inner_offset,
13414 inner_depth
13415 )?;
13416 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13417 {
13418 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13419 }
13420 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13421 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13422 }
13423 }
13424
13425 next_offset += envelope_size;
13426
13427 while next_offset < end_offset {
13429 _next_ordinal_to_read += 1;
13430 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13431 next_offset += envelope_size;
13432 }
13433
13434 Ok(())
13435 }
13436 }
13437
13438 impl SupplicantStaIfaceRegisterCallbackRequest {
13439 #[inline(always)]
13440 fn max_ordinal_present(&self) -> u64 {
13441 if let Some(_) = self.callback {
13442 return 1;
13443 }
13444 0
13445 }
13446 }
13447
13448 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13449 type Borrowed<'a> = &'a mut Self;
13450 fn take_or_borrow<'a>(
13451 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13452 ) -> Self::Borrowed<'a> {
13453 value
13454 }
13455 }
13456
13457 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13458 type Owned = Self;
13459
13460 #[inline(always)]
13461 fn inline_align(_context: fidl::encoding::Context) -> usize {
13462 8
13463 }
13464
13465 #[inline(always)]
13466 fn inline_size(_context: fidl::encoding::Context) -> usize {
13467 16
13468 }
13469 }
13470
13471 unsafe impl
13472 fidl::encoding::Encode<
13473 SupplicantStaIfaceRegisterCallbackRequest,
13474 fidl::encoding::DefaultFuchsiaResourceDialect,
13475 > for &mut SupplicantStaIfaceRegisterCallbackRequest
13476 {
13477 unsafe fn encode(
13478 self,
13479 encoder: &mut fidl::encoding::Encoder<
13480 '_,
13481 fidl::encoding::DefaultFuchsiaResourceDialect,
13482 >,
13483 offset: usize,
13484 mut depth: fidl::encoding::Depth,
13485 ) -> fidl::Result<()> {
13486 encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
13487 let max_ordinal: u64 = self.max_ordinal_present();
13489 encoder.write_num(max_ordinal, offset);
13490 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13491 if max_ordinal == 0 {
13493 return Ok(());
13494 }
13495 depth.increment()?;
13496 let envelope_size = 8;
13497 let bytes_len = max_ordinal as usize * envelope_size;
13498 #[allow(unused_variables)]
13499 let offset = encoder.out_of_line_offset(bytes_len);
13500 let mut _prev_end_offset: usize = 0;
13501 if 1 > max_ordinal {
13502 return Ok(());
13503 }
13504
13505 let cur_offset: usize = (1 - 1) * envelope_size;
13508
13509 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13511
13512 fidl::encoding::encode_in_envelope_optional::<
13517 fidl::encoding::Endpoint<
13518 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13519 >,
13520 fidl::encoding::DefaultFuchsiaResourceDialect,
13521 >(
13522 self.callback.as_mut().map(
13523 <fidl::encoding::Endpoint<
13524 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13525 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13526 ),
13527 encoder,
13528 offset + cur_offset,
13529 depth,
13530 )?;
13531
13532 _prev_end_offset = cur_offset + envelope_size;
13533
13534 Ok(())
13535 }
13536 }
13537
13538 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13539 for SupplicantStaIfaceRegisterCallbackRequest
13540 {
13541 #[inline(always)]
13542 fn new_empty() -> Self {
13543 Self::default()
13544 }
13545
13546 unsafe fn decode(
13547 &mut self,
13548 decoder: &mut fidl::encoding::Decoder<
13549 '_,
13550 fidl::encoding::DefaultFuchsiaResourceDialect,
13551 >,
13552 offset: usize,
13553 mut depth: fidl::encoding::Depth,
13554 ) -> fidl::Result<()> {
13555 decoder.debug_check_bounds::<Self>(offset);
13556 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13557 None => return Err(fidl::Error::NotNullable),
13558 Some(len) => len,
13559 };
13560 if len == 0 {
13562 return Ok(());
13563 };
13564 depth.increment()?;
13565 let envelope_size = 8;
13566 let bytes_len = len * envelope_size;
13567 let offset = decoder.out_of_line_offset(bytes_len)?;
13568 let mut _next_ordinal_to_read = 0;
13570 let mut next_offset = offset;
13571 let end_offset = offset + bytes_len;
13572 _next_ordinal_to_read += 1;
13573 if next_offset >= end_offset {
13574 return Ok(());
13575 }
13576
13577 while _next_ordinal_to_read < 1 {
13579 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13580 _next_ordinal_to_read += 1;
13581 next_offset += envelope_size;
13582 }
13583
13584 let next_out_of_line = decoder.next_out_of_line();
13585 let handles_before = decoder.remaining_handles();
13586 if let Some((inlined, num_bytes, num_handles)) =
13587 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13588 {
13589 let member_inline_size = <fidl::encoding::Endpoint<
13590 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13591 > as fidl::encoding::TypeMarker>::inline_size(
13592 decoder.context
13593 );
13594 if inlined != (member_inline_size <= 4) {
13595 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13596 }
13597 let inner_offset;
13598 let mut inner_depth = depth.clone();
13599 if inlined {
13600 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13601 inner_offset = next_offset;
13602 } else {
13603 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13604 inner_depth.increment()?;
13605 }
13606 let val_ref = self.callback.get_or_insert_with(|| {
13607 fidl::new_empty!(
13608 fidl::encoding::Endpoint<
13609 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13610 >,
13611 fidl::encoding::DefaultFuchsiaResourceDialect
13612 )
13613 });
13614 fidl::decode!(
13615 fidl::encoding::Endpoint<
13616 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13617 >,
13618 fidl::encoding::DefaultFuchsiaResourceDialect,
13619 val_ref,
13620 decoder,
13621 inner_offset,
13622 inner_depth
13623 )?;
13624 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13625 {
13626 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13627 }
13628 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13629 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13630 }
13631 }
13632
13633 next_offset += envelope_size;
13634
13635 while next_offset < end_offset {
13637 _next_ordinal_to_read += 1;
13638 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13639 next_offset += envelope_size;
13640 }
13641
13642 Ok(())
13643 }
13644 }
13645
13646 impl SupplicantStaIfaceSetPowerSaveRequest {
13647 #[inline(always)]
13648 fn max_ordinal_present(&self) -> u64 {
13649 if let Some(_) = self.enable {
13650 return 1;
13651 }
13652 0
13653 }
13654 }
13655
13656 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13657 type Borrowed<'a> = &'a mut Self;
13658 fn take_or_borrow<'a>(
13659 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13660 ) -> Self::Borrowed<'a> {
13661 value
13662 }
13663 }
13664
13665 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13666 type Owned = Self;
13667
13668 #[inline(always)]
13669 fn inline_align(_context: fidl::encoding::Context) -> usize {
13670 8
13671 }
13672
13673 #[inline(always)]
13674 fn inline_size(_context: fidl::encoding::Context) -> usize {
13675 16
13676 }
13677 }
13678
13679 unsafe impl
13680 fidl::encoding::Encode<
13681 SupplicantStaIfaceSetPowerSaveRequest,
13682 fidl::encoding::DefaultFuchsiaResourceDialect,
13683 > for &mut SupplicantStaIfaceSetPowerSaveRequest
13684 {
13685 unsafe fn encode(
13686 self,
13687 encoder: &mut fidl::encoding::Encoder<
13688 '_,
13689 fidl::encoding::DefaultFuchsiaResourceDialect,
13690 >,
13691 offset: usize,
13692 mut depth: fidl::encoding::Depth,
13693 ) -> fidl::Result<()> {
13694 encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
13695 let max_ordinal: u64 = self.max_ordinal_present();
13697 encoder.write_num(max_ordinal, offset);
13698 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13699 if max_ordinal == 0 {
13701 return Ok(());
13702 }
13703 depth.increment()?;
13704 let envelope_size = 8;
13705 let bytes_len = max_ordinal as usize * envelope_size;
13706 #[allow(unused_variables)]
13707 let offset = encoder.out_of_line_offset(bytes_len);
13708 let mut _prev_end_offset: usize = 0;
13709 if 1 > max_ordinal {
13710 return Ok(());
13711 }
13712
13713 let cur_offset: usize = (1 - 1) * envelope_size;
13716
13717 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13719
13720 fidl::encoding::encode_in_envelope_optional::<
13725 bool,
13726 fidl::encoding::DefaultFuchsiaResourceDialect,
13727 >(
13728 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13729 encoder,
13730 offset + cur_offset,
13731 depth,
13732 )?;
13733
13734 _prev_end_offset = cur_offset + envelope_size;
13735
13736 Ok(())
13737 }
13738 }
13739
13740 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13741 for SupplicantStaIfaceSetPowerSaveRequest
13742 {
13743 #[inline(always)]
13744 fn new_empty() -> Self {
13745 Self::default()
13746 }
13747
13748 unsafe fn decode(
13749 &mut self,
13750 decoder: &mut fidl::encoding::Decoder<
13751 '_,
13752 fidl::encoding::DefaultFuchsiaResourceDialect,
13753 >,
13754 offset: usize,
13755 mut depth: fidl::encoding::Depth,
13756 ) -> fidl::Result<()> {
13757 decoder.debug_check_bounds::<Self>(offset);
13758 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13759 None => return Err(fidl::Error::NotNullable),
13760 Some(len) => len,
13761 };
13762 if len == 0 {
13764 return Ok(());
13765 };
13766 depth.increment()?;
13767 let envelope_size = 8;
13768 let bytes_len = len * envelope_size;
13769 let offset = decoder.out_of_line_offset(bytes_len)?;
13770 let mut _next_ordinal_to_read = 0;
13772 let mut next_offset = offset;
13773 let end_offset = offset + bytes_len;
13774 _next_ordinal_to_read += 1;
13775 if next_offset >= end_offset {
13776 return Ok(());
13777 }
13778
13779 while _next_ordinal_to_read < 1 {
13781 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13782 _next_ordinal_to_read += 1;
13783 next_offset += envelope_size;
13784 }
13785
13786 let next_out_of_line = decoder.next_out_of_line();
13787 let handles_before = decoder.remaining_handles();
13788 if let Some((inlined, num_bytes, num_handles)) =
13789 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13790 {
13791 let member_inline_size =
13792 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13793 if inlined != (member_inline_size <= 4) {
13794 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13795 }
13796 let inner_offset;
13797 let mut inner_depth = depth.clone();
13798 if inlined {
13799 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13800 inner_offset = next_offset;
13801 } else {
13802 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13803 inner_depth.increment()?;
13804 }
13805 let val_ref = self.enable.get_or_insert_with(|| {
13806 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13807 });
13808 fidl::decode!(
13809 bool,
13810 fidl::encoding::DefaultFuchsiaResourceDialect,
13811 val_ref,
13812 decoder,
13813 inner_offset,
13814 inner_depth
13815 )?;
13816 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13817 {
13818 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13819 }
13820 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13821 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13822 }
13823 }
13824
13825 next_offset += envelope_size;
13826
13827 while next_offset < end_offset {
13829 _next_ordinal_to_read += 1;
13830 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13831 next_offset += envelope_size;
13832 }
13833
13834 Ok(())
13835 }
13836 }
13837
13838 impl SupplicantStaIfaceSetStaCountryCodeRequest {
13839 #[inline(always)]
13840 fn max_ordinal_present(&self) -> u64 {
13841 if let Some(_) = self.code {
13842 return 1;
13843 }
13844 0
13845 }
13846 }
13847
13848 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13849 type Borrowed<'a> = &'a mut Self;
13850 fn take_or_borrow<'a>(
13851 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13852 ) -> Self::Borrowed<'a> {
13853 value
13854 }
13855 }
13856
13857 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13858 type Owned = Self;
13859
13860 #[inline(always)]
13861 fn inline_align(_context: fidl::encoding::Context) -> usize {
13862 8
13863 }
13864
13865 #[inline(always)]
13866 fn inline_size(_context: fidl::encoding::Context) -> usize {
13867 16
13868 }
13869 }
13870
13871 unsafe impl
13872 fidl::encoding::Encode<
13873 SupplicantStaIfaceSetStaCountryCodeRequest,
13874 fidl::encoding::DefaultFuchsiaResourceDialect,
13875 > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
13876 {
13877 unsafe fn encode(
13878 self,
13879 encoder: &mut fidl::encoding::Encoder<
13880 '_,
13881 fidl::encoding::DefaultFuchsiaResourceDialect,
13882 >,
13883 offset: usize,
13884 mut depth: fidl::encoding::Depth,
13885 ) -> fidl::Result<()> {
13886 encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
13887 let max_ordinal: u64 = self.max_ordinal_present();
13889 encoder.write_num(max_ordinal, offset);
13890 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13891 if max_ordinal == 0 {
13893 return Ok(());
13894 }
13895 depth.increment()?;
13896 let envelope_size = 8;
13897 let bytes_len = max_ordinal as usize * envelope_size;
13898 #[allow(unused_variables)]
13899 let offset = encoder.out_of_line_offset(bytes_len);
13900 let mut _prev_end_offset: usize = 0;
13901 if 1 > max_ordinal {
13902 return Ok(());
13903 }
13904
13905 let cur_offset: usize = (1 - 1) * envelope_size;
13908
13909 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13911
13912 fidl::encoding::encode_in_envelope_optional::<
13917 fidl::encoding::Array<u8, 2>,
13918 fidl::encoding::DefaultFuchsiaResourceDialect,
13919 >(
13920 self.code
13921 .as_ref()
13922 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
13923 encoder,
13924 offset + cur_offset,
13925 depth,
13926 )?;
13927
13928 _prev_end_offset = cur_offset + envelope_size;
13929
13930 Ok(())
13931 }
13932 }
13933
13934 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13935 for SupplicantStaIfaceSetStaCountryCodeRequest
13936 {
13937 #[inline(always)]
13938 fn new_empty() -> Self {
13939 Self::default()
13940 }
13941
13942 unsafe fn decode(
13943 &mut self,
13944 decoder: &mut fidl::encoding::Decoder<
13945 '_,
13946 fidl::encoding::DefaultFuchsiaResourceDialect,
13947 >,
13948 offset: usize,
13949 mut depth: fidl::encoding::Depth,
13950 ) -> fidl::Result<()> {
13951 decoder.debug_check_bounds::<Self>(offset);
13952 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13953 None => return Err(fidl::Error::NotNullable),
13954 Some(len) => len,
13955 };
13956 if len == 0 {
13958 return Ok(());
13959 };
13960 depth.increment()?;
13961 let envelope_size = 8;
13962 let bytes_len = len * envelope_size;
13963 let offset = decoder.out_of_line_offset(bytes_len)?;
13964 let mut _next_ordinal_to_read = 0;
13966 let mut next_offset = offset;
13967 let end_offset = offset + bytes_len;
13968 _next_ordinal_to_read += 1;
13969 if next_offset >= end_offset {
13970 return Ok(());
13971 }
13972
13973 while _next_ordinal_to_read < 1 {
13975 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13976 _next_ordinal_to_read += 1;
13977 next_offset += envelope_size;
13978 }
13979
13980 let next_out_of_line = decoder.next_out_of_line();
13981 let handles_before = decoder.remaining_handles();
13982 if let Some((inlined, num_bytes, num_handles)) =
13983 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13984 {
13985 let member_inline_size =
13986 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
13987 decoder.context,
13988 );
13989 if inlined != (member_inline_size <= 4) {
13990 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13991 }
13992 let inner_offset;
13993 let mut inner_depth = depth.clone();
13994 if inlined {
13995 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13996 inner_offset = next_offset;
13997 } else {
13998 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13999 inner_depth.increment()?;
14000 }
14001 let val_ref =
14002 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
14003 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14004 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14005 {
14006 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14007 }
14008 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14009 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14010 }
14011 }
14012
14013 next_offset += envelope_size;
14014
14015 while next_offset < end_offset {
14017 _next_ordinal_to_read += 1;
14018 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14019 next_offset += envelope_size;
14020 }
14021
14022 Ok(())
14023 }
14024 }
14025
14026 impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
14027 #[inline(always)]
14028 fn max_ordinal_present(&self) -> u64 {
14029 if let Some(_) = self.enable {
14030 return 1;
14031 }
14032 0
14033 }
14034 }
14035
14036 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14037 type Borrowed<'a> = &'a mut Self;
14038 fn take_or_borrow<'a>(
14039 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14040 ) -> Self::Borrowed<'a> {
14041 value
14042 }
14043 }
14044
14045 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14046 type Owned = Self;
14047
14048 #[inline(always)]
14049 fn inline_align(_context: fidl::encoding::Context) -> usize {
14050 8
14051 }
14052
14053 #[inline(always)]
14054 fn inline_size(_context: fidl::encoding::Context) -> usize {
14055 16
14056 }
14057 }
14058
14059 unsafe impl
14060 fidl::encoding::Encode<
14061 SupplicantStaIfaceSetSuspendModeEnabledRequest,
14062 fidl::encoding::DefaultFuchsiaResourceDialect,
14063 > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
14064 {
14065 unsafe fn encode(
14066 self,
14067 encoder: &mut fidl::encoding::Encoder<
14068 '_,
14069 fidl::encoding::DefaultFuchsiaResourceDialect,
14070 >,
14071 offset: usize,
14072 mut depth: fidl::encoding::Depth,
14073 ) -> fidl::Result<()> {
14074 encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
14075 let max_ordinal: u64 = self.max_ordinal_present();
14077 encoder.write_num(max_ordinal, offset);
14078 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14079 if max_ordinal == 0 {
14081 return Ok(());
14082 }
14083 depth.increment()?;
14084 let envelope_size = 8;
14085 let bytes_len = max_ordinal as usize * envelope_size;
14086 #[allow(unused_variables)]
14087 let offset = encoder.out_of_line_offset(bytes_len);
14088 let mut _prev_end_offset: usize = 0;
14089 if 1 > max_ordinal {
14090 return Ok(());
14091 }
14092
14093 let cur_offset: usize = (1 - 1) * envelope_size;
14096
14097 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14099
14100 fidl::encoding::encode_in_envelope_optional::<
14105 bool,
14106 fidl::encoding::DefaultFuchsiaResourceDialect,
14107 >(
14108 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
14109 encoder,
14110 offset + cur_offset,
14111 depth,
14112 )?;
14113
14114 _prev_end_offset = cur_offset + envelope_size;
14115
14116 Ok(())
14117 }
14118 }
14119
14120 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14121 for SupplicantStaIfaceSetSuspendModeEnabledRequest
14122 {
14123 #[inline(always)]
14124 fn new_empty() -> Self {
14125 Self::default()
14126 }
14127
14128 unsafe fn decode(
14129 &mut self,
14130 decoder: &mut fidl::encoding::Decoder<
14131 '_,
14132 fidl::encoding::DefaultFuchsiaResourceDialect,
14133 >,
14134 offset: usize,
14135 mut depth: fidl::encoding::Depth,
14136 ) -> fidl::Result<()> {
14137 decoder.debug_check_bounds::<Self>(offset);
14138 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14139 None => return Err(fidl::Error::NotNullable),
14140 Some(len) => len,
14141 };
14142 if len == 0 {
14144 return Ok(());
14145 };
14146 depth.increment()?;
14147 let envelope_size = 8;
14148 let bytes_len = len * envelope_size;
14149 let offset = decoder.out_of_line_offset(bytes_len)?;
14150 let mut _next_ordinal_to_read = 0;
14152 let mut next_offset = offset;
14153 let end_offset = offset + bytes_len;
14154 _next_ordinal_to_read += 1;
14155 if next_offset >= end_offset {
14156 return Ok(());
14157 }
14158
14159 while _next_ordinal_to_read < 1 {
14161 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14162 _next_ordinal_to_read += 1;
14163 next_offset += envelope_size;
14164 }
14165
14166 let next_out_of_line = decoder.next_out_of_line();
14167 let handles_before = decoder.remaining_handles();
14168 if let Some((inlined, num_bytes, num_handles)) =
14169 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14170 {
14171 let member_inline_size =
14172 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14173 if inlined != (member_inline_size <= 4) {
14174 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14175 }
14176 let inner_offset;
14177 let mut inner_depth = depth.clone();
14178 if inlined {
14179 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14180 inner_offset = next_offset;
14181 } else {
14182 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14183 inner_depth.increment()?;
14184 }
14185 let val_ref = self.enable.get_or_insert_with(|| {
14186 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
14187 });
14188 fidl::decode!(
14189 bool,
14190 fidl::encoding::DefaultFuchsiaResourceDialect,
14191 val_ref,
14192 decoder,
14193 inner_offset,
14194 inner_depth
14195 )?;
14196 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14197 {
14198 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14199 }
14200 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14201 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14202 }
14203 }
14204
14205 next_offset += envelope_size;
14206
14207 while next_offset < end_offset {
14209 _next_ordinal_to_read += 1;
14210 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14211 next_offset += envelope_size;
14212 }
14213
14214 Ok(())
14215 }
14216 }
14217
14218 impl WifiChipCreateStaIfaceRequest {
14219 #[inline(always)]
14220 fn max_ordinal_present(&self) -> u64 {
14221 if let Some(_) = self.iface {
14222 return 1;
14223 }
14224 0
14225 }
14226 }
14227
14228 impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
14229 type Borrowed<'a> = &'a mut Self;
14230 fn take_or_borrow<'a>(
14231 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14232 ) -> Self::Borrowed<'a> {
14233 value
14234 }
14235 }
14236
14237 unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
14238 type Owned = Self;
14239
14240 #[inline(always)]
14241 fn inline_align(_context: fidl::encoding::Context) -> usize {
14242 8
14243 }
14244
14245 #[inline(always)]
14246 fn inline_size(_context: fidl::encoding::Context) -> usize {
14247 16
14248 }
14249 }
14250
14251 unsafe impl
14252 fidl::encoding::Encode<
14253 WifiChipCreateStaIfaceRequest,
14254 fidl::encoding::DefaultFuchsiaResourceDialect,
14255 > for &mut WifiChipCreateStaIfaceRequest
14256 {
14257 unsafe fn encode(
14258 self,
14259 encoder: &mut fidl::encoding::Encoder<
14260 '_,
14261 fidl::encoding::DefaultFuchsiaResourceDialect,
14262 >,
14263 offset: usize,
14264 mut depth: fidl::encoding::Depth,
14265 ) -> fidl::Result<()> {
14266 encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
14267 let max_ordinal: u64 = self.max_ordinal_present();
14269 encoder.write_num(max_ordinal, offset);
14270 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14271 if max_ordinal == 0 {
14273 return Ok(());
14274 }
14275 depth.increment()?;
14276 let envelope_size = 8;
14277 let bytes_len = max_ordinal as usize * envelope_size;
14278 #[allow(unused_variables)]
14279 let offset = encoder.out_of_line_offset(bytes_len);
14280 let mut _prev_end_offset: usize = 0;
14281 if 1 > max_ordinal {
14282 return Ok(());
14283 }
14284
14285 let cur_offset: usize = (1 - 1) * envelope_size;
14288
14289 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14291
14292 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14297 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14298 encoder, offset + cur_offset, depth
14299 )?;
14300
14301 _prev_end_offset = cur_offset + envelope_size;
14302
14303 Ok(())
14304 }
14305 }
14306
14307 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14308 for WifiChipCreateStaIfaceRequest
14309 {
14310 #[inline(always)]
14311 fn new_empty() -> Self {
14312 Self::default()
14313 }
14314
14315 unsafe fn decode(
14316 &mut self,
14317 decoder: &mut fidl::encoding::Decoder<
14318 '_,
14319 fidl::encoding::DefaultFuchsiaResourceDialect,
14320 >,
14321 offset: usize,
14322 mut depth: fidl::encoding::Depth,
14323 ) -> fidl::Result<()> {
14324 decoder.debug_check_bounds::<Self>(offset);
14325 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14326 None => return Err(fidl::Error::NotNullable),
14327 Some(len) => len,
14328 };
14329 if len == 0 {
14331 return Ok(());
14332 };
14333 depth.increment()?;
14334 let envelope_size = 8;
14335 let bytes_len = len * envelope_size;
14336 let offset = decoder.out_of_line_offset(bytes_len)?;
14337 let mut _next_ordinal_to_read = 0;
14339 let mut next_offset = offset;
14340 let end_offset = offset + bytes_len;
14341 _next_ordinal_to_read += 1;
14342 if next_offset >= end_offset {
14343 return Ok(());
14344 }
14345
14346 while _next_ordinal_to_read < 1 {
14348 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14349 _next_ordinal_to_read += 1;
14350 next_offset += envelope_size;
14351 }
14352
14353 let next_out_of_line = decoder.next_out_of_line();
14354 let handles_before = decoder.remaining_handles();
14355 if let Some((inlined, num_bytes, num_handles)) =
14356 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14357 {
14358 let member_inline_size = <fidl::encoding::Endpoint<
14359 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14360 > as fidl::encoding::TypeMarker>::inline_size(
14361 decoder.context
14362 );
14363 if inlined != (member_inline_size <= 4) {
14364 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14365 }
14366 let inner_offset;
14367 let mut inner_depth = depth.clone();
14368 if inlined {
14369 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14370 inner_offset = next_offset;
14371 } else {
14372 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14373 inner_depth.increment()?;
14374 }
14375 let val_ref = self.iface.get_or_insert_with(|| {
14376 fidl::new_empty!(
14377 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14378 fidl::encoding::DefaultFuchsiaResourceDialect
14379 )
14380 });
14381 fidl::decode!(
14382 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14383 fidl::encoding::DefaultFuchsiaResourceDialect,
14384 val_ref,
14385 decoder,
14386 inner_offset,
14387 inner_depth
14388 )?;
14389 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14390 {
14391 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14392 }
14393 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14394 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14395 }
14396 }
14397
14398 next_offset += envelope_size;
14399
14400 while next_offset < end_offset {
14402 _next_ordinal_to_read += 1;
14403 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14404 next_offset += envelope_size;
14405 }
14406
14407 Ok(())
14408 }
14409 }
14410
14411 impl WifiChipGetStaIfaceRequest {
14412 #[inline(always)]
14413 fn max_ordinal_present(&self) -> u64 {
14414 if let Some(_) = self.iface {
14415 return 2;
14416 }
14417 if let Some(_) = self.iface_name {
14418 return 1;
14419 }
14420 0
14421 }
14422 }
14423
14424 impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
14425 type Borrowed<'a> = &'a mut Self;
14426 fn take_or_borrow<'a>(
14427 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14428 ) -> Self::Borrowed<'a> {
14429 value
14430 }
14431 }
14432
14433 unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
14434 type Owned = Self;
14435
14436 #[inline(always)]
14437 fn inline_align(_context: fidl::encoding::Context) -> usize {
14438 8
14439 }
14440
14441 #[inline(always)]
14442 fn inline_size(_context: fidl::encoding::Context) -> usize {
14443 16
14444 }
14445 }
14446
14447 unsafe impl
14448 fidl::encoding::Encode<
14449 WifiChipGetStaIfaceRequest,
14450 fidl::encoding::DefaultFuchsiaResourceDialect,
14451 > for &mut WifiChipGetStaIfaceRequest
14452 {
14453 unsafe fn encode(
14454 self,
14455 encoder: &mut fidl::encoding::Encoder<
14456 '_,
14457 fidl::encoding::DefaultFuchsiaResourceDialect,
14458 >,
14459 offset: usize,
14460 mut depth: fidl::encoding::Depth,
14461 ) -> fidl::Result<()> {
14462 encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
14463 let max_ordinal: u64 = self.max_ordinal_present();
14465 encoder.write_num(max_ordinal, offset);
14466 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14467 if max_ordinal == 0 {
14469 return Ok(());
14470 }
14471 depth.increment()?;
14472 let envelope_size = 8;
14473 let bytes_len = max_ordinal as usize * envelope_size;
14474 #[allow(unused_variables)]
14475 let offset = encoder.out_of_line_offset(bytes_len);
14476 let mut _prev_end_offset: usize = 0;
14477 if 1 > max_ordinal {
14478 return Ok(());
14479 }
14480
14481 let cur_offset: usize = (1 - 1) * envelope_size;
14484
14485 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14487
14488 fidl::encoding::encode_in_envelope_optional::<
14493 fidl::encoding::BoundedString<16>,
14494 fidl::encoding::DefaultFuchsiaResourceDialect,
14495 >(
14496 self.iface_name.as_ref().map(
14497 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14498 ),
14499 encoder,
14500 offset + cur_offset,
14501 depth,
14502 )?;
14503
14504 _prev_end_offset = cur_offset + envelope_size;
14505 if 2 > max_ordinal {
14506 return Ok(());
14507 }
14508
14509 let cur_offset: usize = (2 - 1) * envelope_size;
14512
14513 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14515
14516 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14521 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14522 encoder, offset + cur_offset, depth
14523 )?;
14524
14525 _prev_end_offset = cur_offset + envelope_size;
14526
14527 Ok(())
14528 }
14529 }
14530
14531 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14532 for WifiChipGetStaIfaceRequest
14533 {
14534 #[inline(always)]
14535 fn new_empty() -> Self {
14536 Self::default()
14537 }
14538
14539 unsafe fn decode(
14540 &mut self,
14541 decoder: &mut fidl::encoding::Decoder<
14542 '_,
14543 fidl::encoding::DefaultFuchsiaResourceDialect,
14544 >,
14545 offset: usize,
14546 mut depth: fidl::encoding::Depth,
14547 ) -> fidl::Result<()> {
14548 decoder.debug_check_bounds::<Self>(offset);
14549 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14550 None => return Err(fidl::Error::NotNullable),
14551 Some(len) => len,
14552 };
14553 if len == 0 {
14555 return Ok(());
14556 };
14557 depth.increment()?;
14558 let envelope_size = 8;
14559 let bytes_len = len * envelope_size;
14560 let offset = decoder.out_of_line_offset(bytes_len)?;
14561 let mut _next_ordinal_to_read = 0;
14563 let mut next_offset = offset;
14564 let end_offset = offset + bytes_len;
14565 _next_ordinal_to_read += 1;
14566 if next_offset >= end_offset {
14567 return Ok(());
14568 }
14569
14570 while _next_ordinal_to_read < 1 {
14572 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14573 _next_ordinal_to_read += 1;
14574 next_offset += envelope_size;
14575 }
14576
14577 let next_out_of_line = decoder.next_out_of_line();
14578 let handles_before = decoder.remaining_handles();
14579 if let Some((inlined, num_bytes, num_handles)) =
14580 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14581 {
14582 let member_inline_size =
14583 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14584 decoder.context,
14585 );
14586 if inlined != (member_inline_size <= 4) {
14587 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14588 }
14589 let inner_offset;
14590 let mut inner_depth = depth.clone();
14591 if inlined {
14592 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14593 inner_offset = next_offset;
14594 } else {
14595 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14596 inner_depth.increment()?;
14597 }
14598 let val_ref = self.iface_name.get_or_insert_with(|| {
14599 fidl::new_empty!(
14600 fidl::encoding::BoundedString<16>,
14601 fidl::encoding::DefaultFuchsiaResourceDialect
14602 )
14603 });
14604 fidl::decode!(
14605 fidl::encoding::BoundedString<16>,
14606 fidl::encoding::DefaultFuchsiaResourceDialect,
14607 val_ref,
14608 decoder,
14609 inner_offset,
14610 inner_depth
14611 )?;
14612 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14613 {
14614 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14615 }
14616 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14617 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14618 }
14619 }
14620
14621 next_offset += envelope_size;
14622 _next_ordinal_to_read += 1;
14623 if next_offset >= end_offset {
14624 return Ok(());
14625 }
14626
14627 while _next_ordinal_to_read < 2 {
14629 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14630 _next_ordinal_to_read += 1;
14631 next_offset += envelope_size;
14632 }
14633
14634 let next_out_of_line = decoder.next_out_of_line();
14635 let handles_before = decoder.remaining_handles();
14636 if let Some((inlined, num_bytes, num_handles)) =
14637 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14638 {
14639 let member_inline_size = <fidl::encoding::Endpoint<
14640 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14641 > as fidl::encoding::TypeMarker>::inline_size(
14642 decoder.context
14643 );
14644 if inlined != (member_inline_size <= 4) {
14645 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14646 }
14647 let inner_offset;
14648 let mut inner_depth = depth.clone();
14649 if inlined {
14650 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14651 inner_offset = next_offset;
14652 } else {
14653 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14654 inner_depth.increment()?;
14655 }
14656 let val_ref = self.iface.get_or_insert_with(|| {
14657 fidl::new_empty!(
14658 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14659 fidl::encoding::DefaultFuchsiaResourceDialect
14660 )
14661 });
14662 fidl::decode!(
14663 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14664 fidl::encoding::DefaultFuchsiaResourceDialect,
14665 val_ref,
14666 decoder,
14667 inner_offset,
14668 inner_depth
14669 )?;
14670 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14671 {
14672 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14673 }
14674 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14675 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14676 }
14677 }
14678
14679 next_offset += envelope_size;
14680
14681 while next_offset < end_offset {
14683 _next_ordinal_to_read += 1;
14684 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14685 next_offset += envelope_size;
14686 }
14687
14688 Ok(())
14689 }
14690 }
14691
14692 impl WifiChipRemoveStaIfaceRequest {
14693 #[inline(always)]
14694 fn max_ordinal_present(&self) -> u64 {
14695 if let Some(_) = self.iface_name {
14696 return 1;
14697 }
14698 0
14699 }
14700 }
14701
14702 impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
14703 type Borrowed<'a> = &'a mut Self;
14704 fn take_or_borrow<'a>(
14705 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14706 ) -> Self::Borrowed<'a> {
14707 value
14708 }
14709 }
14710
14711 unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
14712 type Owned = Self;
14713
14714 #[inline(always)]
14715 fn inline_align(_context: fidl::encoding::Context) -> usize {
14716 8
14717 }
14718
14719 #[inline(always)]
14720 fn inline_size(_context: fidl::encoding::Context) -> usize {
14721 16
14722 }
14723 }
14724
14725 unsafe impl
14726 fidl::encoding::Encode<
14727 WifiChipRemoveStaIfaceRequest,
14728 fidl::encoding::DefaultFuchsiaResourceDialect,
14729 > for &mut WifiChipRemoveStaIfaceRequest
14730 {
14731 unsafe fn encode(
14732 self,
14733 encoder: &mut fidl::encoding::Encoder<
14734 '_,
14735 fidl::encoding::DefaultFuchsiaResourceDialect,
14736 >,
14737 offset: usize,
14738 mut depth: fidl::encoding::Depth,
14739 ) -> fidl::Result<()> {
14740 encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
14741 let max_ordinal: u64 = self.max_ordinal_present();
14743 encoder.write_num(max_ordinal, offset);
14744 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14745 if max_ordinal == 0 {
14747 return Ok(());
14748 }
14749 depth.increment()?;
14750 let envelope_size = 8;
14751 let bytes_len = max_ordinal as usize * envelope_size;
14752 #[allow(unused_variables)]
14753 let offset = encoder.out_of_line_offset(bytes_len);
14754 let mut _prev_end_offset: usize = 0;
14755 if 1 > max_ordinal {
14756 return Ok(());
14757 }
14758
14759 let cur_offset: usize = (1 - 1) * envelope_size;
14762
14763 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14765
14766 fidl::encoding::encode_in_envelope_optional::<
14771 fidl::encoding::BoundedString<16>,
14772 fidl::encoding::DefaultFuchsiaResourceDialect,
14773 >(
14774 self.iface_name.as_ref().map(
14775 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14776 ),
14777 encoder,
14778 offset + cur_offset,
14779 depth,
14780 )?;
14781
14782 _prev_end_offset = cur_offset + envelope_size;
14783
14784 Ok(())
14785 }
14786 }
14787
14788 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14789 for WifiChipRemoveStaIfaceRequest
14790 {
14791 #[inline(always)]
14792 fn new_empty() -> Self {
14793 Self::default()
14794 }
14795
14796 unsafe fn decode(
14797 &mut self,
14798 decoder: &mut fidl::encoding::Decoder<
14799 '_,
14800 fidl::encoding::DefaultFuchsiaResourceDialect,
14801 >,
14802 offset: usize,
14803 mut depth: fidl::encoding::Depth,
14804 ) -> fidl::Result<()> {
14805 decoder.debug_check_bounds::<Self>(offset);
14806 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14807 None => return Err(fidl::Error::NotNullable),
14808 Some(len) => len,
14809 };
14810 if len == 0 {
14812 return Ok(());
14813 };
14814 depth.increment()?;
14815 let envelope_size = 8;
14816 let bytes_len = len * envelope_size;
14817 let offset = decoder.out_of_line_offset(bytes_len)?;
14818 let mut _next_ordinal_to_read = 0;
14820 let mut next_offset = offset;
14821 let end_offset = offset + bytes_len;
14822 _next_ordinal_to_read += 1;
14823 if next_offset >= end_offset {
14824 return Ok(());
14825 }
14826
14827 while _next_ordinal_to_read < 1 {
14829 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14830 _next_ordinal_to_read += 1;
14831 next_offset += envelope_size;
14832 }
14833
14834 let next_out_of_line = decoder.next_out_of_line();
14835 let handles_before = decoder.remaining_handles();
14836 if let Some((inlined, num_bytes, num_handles)) =
14837 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14838 {
14839 let member_inline_size =
14840 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14841 decoder.context,
14842 );
14843 if inlined != (member_inline_size <= 4) {
14844 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14845 }
14846 let inner_offset;
14847 let mut inner_depth = depth.clone();
14848 if inlined {
14849 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14850 inner_offset = next_offset;
14851 } else {
14852 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14853 inner_depth.increment()?;
14854 }
14855 let val_ref = self.iface_name.get_or_insert_with(|| {
14856 fidl::new_empty!(
14857 fidl::encoding::BoundedString<16>,
14858 fidl::encoding::DefaultFuchsiaResourceDialect
14859 )
14860 });
14861 fidl::decode!(
14862 fidl::encoding::BoundedString<16>,
14863 fidl::encoding::DefaultFuchsiaResourceDialect,
14864 val_ref,
14865 decoder,
14866 inner_offset,
14867 inner_depth
14868 )?;
14869 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14870 {
14871 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14872 }
14873 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14874 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14875 }
14876 }
14877
14878 next_offset += envelope_size;
14879
14880 while next_offset < end_offset {
14882 _next_ordinal_to_read += 1;
14883 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14884 next_offset += envelope_size;
14885 }
14886
14887 Ok(())
14888 }
14889 }
14890
14891 impl WifiChipSetCountryCodeRequest {
14892 #[inline(always)]
14893 fn max_ordinal_present(&self) -> u64 {
14894 if let Some(_) = self.code {
14895 return 1;
14896 }
14897 0
14898 }
14899 }
14900
14901 impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
14902 type Borrowed<'a> = &'a mut Self;
14903 fn take_or_borrow<'a>(
14904 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14905 ) -> Self::Borrowed<'a> {
14906 value
14907 }
14908 }
14909
14910 unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
14911 type Owned = Self;
14912
14913 #[inline(always)]
14914 fn inline_align(_context: fidl::encoding::Context) -> usize {
14915 8
14916 }
14917
14918 #[inline(always)]
14919 fn inline_size(_context: fidl::encoding::Context) -> usize {
14920 16
14921 }
14922 }
14923
14924 unsafe impl
14925 fidl::encoding::Encode<
14926 WifiChipSetCountryCodeRequest,
14927 fidl::encoding::DefaultFuchsiaResourceDialect,
14928 > for &mut WifiChipSetCountryCodeRequest
14929 {
14930 unsafe fn encode(
14931 self,
14932 encoder: &mut fidl::encoding::Encoder<
14933 '_,
14934 fidl::encoding::DefaultFuchsiaResourceDialect,
14935 >,
14936 offset: usize,
14937 mut depth: fidl::encoding::Depth,
14938 ) -> fidl::Result<()> {
14939 encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
14940 let max_ordinal: u64 = self.max_ordinal_present();
14942 encoder.write_num(max_ordinal, offset);
14943 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14944 if max_ordinal == 0 {
14946 return Ok(());
14947 }
14948 depth.increment()?;
14949 let envelope_size = 8;
14950 let bytes_len = max_ordinal as usize * envelope_size;
14951 #[allow(unused_variables)]
14952 let offset = encoder.out_of_line_offset(bytes_len);
14953 let mut _prev_end_offset: usize = 0;
14954 if 1 > max_ordinal {
14955 return Ok(());
14956 }
14957
14958 let cur_offset: usize = (1 - 1) * envelope_size;
14961
14962 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14964
14965 fidl::encoding::encode_in_envelope_optional::<
14970 fidl::encoding::Array<u8, 2>,
14971 fidl::encoding::DefaultFuchsiaResourceDialect,
14972 >(
14973 self.code
14974 .as_ref()
14975 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14976 encoder,
14977 offset + cur_offset,
14978 depth,
14979 )?;
14980
14981 _prev_end_offset = cur_offset + envelope_size;
14982
14983 Ok(())
14984 }
14985 }
14986
14987 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14988 for WifiChipSetCountryCodeRequest
14989 {
14990 #[inline(always)]
14991 fn new_empty() -> Self {
14992 Self::default()
14993 }
14994
14995 unsafe fn decode(
14996 &mut self,
14997 decoder: &mut fidl::encoding::Decoder<
14998 '_,
14999 fidl::encoding::DefaultFuchsiaResourceDialect,
15000 >,
15001 offset: usize,
15002 mut depth: fidl::encoding::Depth,
15003 ) -> fidl::Result<()> {
15004 decoder.debug_check_bounds::<Self>(offset);
15005 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15006 None => return Err(fidl::Error::NotNullable),
15007 Some(len) => len,
15008 };
15009 if len == 0 {
15011 return Ok(());
15012 };
15013 depth.increment()?;
15014 let envelope_size = 8;
15015 let bytes_len = len * envelope_size;
15016 let offset = decoder.out_of_line_offset(bytes_len)?;
15017 let mut _next_ordinal_to_read = 0;
15019 let mut next_offset = offset;
15020 let end_offset = offset + bytes_len;
15021 _next_ordinal_to_read += 1;
15022 if next_offset >= end_offset {
15023 return Ok(());
15024 }
15025
15026 while _next_ordinal_to_read < 1 {
15028 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15029 _next_ordinal_to_read += 1;
15030 next_offset += envelope_size;
15031 }
15032
15033 let next_out_of_line = decoder.next_out_of_line();
15034 let handles_before = decoder.remaining_handles();
15035 if let Some((inlined, num_bytes, num_handles)) =
15036 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15037 {
15038 let member_inline_size =
15039 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
15040 decoder.context,
15041 );
15042 if inlined != (member_inline_size <= 4) {
15043 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15044 }
15045 let inner_offset;
15046 let mut inner_depth = depth.clone();
15047 if inlined {
15048 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15049 inner_offset = next_offset;
15050 } else {
15051 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15052 inner_depth.increment()?;
15053 }
15054 let val_ref =
15055 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
15056 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15057 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15058 {
15059 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15060 }
15061 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15062 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15063 }
15064 }
15065
15066 next_offset += envelope_size;
15067
15068 while next_offset < end_offset {
15070 _next_ordinal_to_read += 1;
15071 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15072 next_offset += envelope_size;
15073 }
15074
15075 Ok(())
15076 }
15077 }
15078
15079 impl WifiEventCallbackOnSubsystemRestartRequest {
15080 #[inline(always)]
15081 fn max_ordinal_present(&self) -> u64 {
15082 if let Some(_) = self.status {
15083 return 1;
15084 }
15085 0
15086 }
15087 }
15088
15089 impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15090 type Borrowed<'a> = &'a mut Self;
15091 fn take_or_borrow<'a>(
15092 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15093 ) -> Self::Borrowed<'a> {
15094 value
15095 }
15096 }
15097
15098 unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15099 type Owned = Self;
15100
15101 #[inline(always)]
15102 fn inline_align(_context: fidl::encoding::Context) -> usize {
15103 8
15104 }
15105
15106 #[inline(always)]
15107 fn inline_size(_context: fidl::encoding::Context) -> usize {
15108 16
15109 }
15110 }
15111
15112 unsafe impl
15113 fidl::encoding::Encode<
15114 WifiEventCallbackOnSubsystemRestartRequest,
15115 fidl::encoding::DefaultFuchsiaResourceDialect,
15116 > for &mut WifiEventCallbackOnSubsystemRestartRequest
15117 {
15118 unsafe fn encode(
15119 self,
15120 encoder: &mut fidl::encoding::Encoder<
15121 '_,
15122 fidl::encoding::DefaultFuchsiaResourceDialect,
15123 >,
15124 offset: usize,
15125 mut depth: fidl::encoding::Depth,
15126 ) -> fidl::Result<()> {
15127 encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
15128 let max_ordinal: u64 = self.max_ordinal_present();
15130 encoder.write_num(max_ordinal, offset);
15131 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15132 if max_ordinal == 0 {
15134 return Ok(());
15135 }
15136 depth.increment()?;
15137 let envelope_size = 8;
15138 let bytes_len = max_ordinal as usize * envelope_size;
15139 #[allow(unused_variables)]
15140 let offset = encoder.out_of_line_offset(bytes_len);
15141 let mut _prev_end_offset: usize = 0;
15142 if 1 > max_ordinal {
15143 return Ok(());
15144 }
15145
15146 let cur_offset: usize = (1 - 1) * envelope_size;
15149
15150 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15152
15153 fidl::encoding::encode_in_envelope_optional::<
15158 i32,
15159 fidl::encoding::DefaultFuchsiaResourceDialect,
15160 >(
15161 self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
15162 encoder,
15163 offset + cur_offset,
15164 depth,
15165 )?;
15166
15167 _prev_end_offset = cur_offset + envelope_size;
15168
15169 Ok(())
15170 }
15171 }
15172
15173 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15174 for WifiEventCallbackOnSubsystemRestartRequest
15175 {
15176 #[inline(always)]
15177 fn new_empty() -> Self {
15178 Self::default()
15179 }
15180
15181 unsafe fn decode(
15182 &mut self,
15183 decoder: &mut fidl::encoding::Decoder<
15184 '_,
15185 fidl::encoding::DefaultFuchsiaResourceDialect,
15186 >,
15187 offset: usize,
15188 mut depth: fidl::encoding::Depth,
15189 ) -> fidl::Result<()> {
15190 decoder.debug_check_bounds::<Self>(offset);
15191 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15192 None => return Err(fidl::Error::NotNullable),
15193 Some(len) => len,
15194 };
15195 if len == 0 {
15197 return Ok(());
15198 };
15199 depth.increment()?;
15200 let envelope_size = 8;
15201 let bytes_len = len * envelope_size;
15202 let offset = decoder.out_of_line_offset(bytes_len)?;
15203 let mut _next_ordinal_to_read = 0;
15205 let mut next_offset = offset;
15206 let end_offset = offset + bytes_len;
15207 _next_ordinal_to_read += 1;
15208 if next_offset >= end_offset {
15209 return Ok(());
15210 }
15211
15212 while _next_ordinal_to_read < 1 {
15214 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15215 _next_ordinal_to_read += 1;
15216 next_offset += envelope_size;
15217 }
15218
15219 let next_out_of_line = decoder.next_out_of_line();
15220 let handles_before = decoder.remaining_handles();
15221 if let Some((inlined, num_bytes, num_handles)) =
15222 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15223 {
15224 let member_inline_size =
15225 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15226 if inlined != (member_inline_size <= 4) {
15227 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15228 }
15229 let inner_offset;
15230 let mut inner_depth = depth.clone();
15231 if inlined {
15232 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15233 inner_offset = next_offset;
15234 } else {
15235 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15236 inner_depth.increment()?;
15237 }
15238 let val_ref = self.status.get_or_insert_with(|| {
15239 fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
15240 });
15241 fidl::decode!(
15242 i32,
15243 fidl::encoding::DefaultFuchsiaResourceDialect,
15244 val_ref,
15245 decoder,
15246 inner_offset,
15247 inner_depth
15248 )?;
15249 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15250 {
15251 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15252 }
15253 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15254 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15255 }
15256 }
15257
15258 next_offset += envelope_size;
15259
15260 while next_offset < end_offset {
15262 _next_ordinal_to_read += 1;
15263 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15264 next_offset += envelope_size;
15265 }
15266
15267 Ok(())
15268 }
15269 }
15270
15271 impl WifiGetChipRequest {
15272 #[inline(always)]
15273 fn max_ordinal_present(&self) -> u64 {
15274 if let Some(_) = self.chip {
15275 return 2;
15276 }
15277 if let Some(_) = self.chip_id {
15278 return 1;
15279 }
15280 0
15281 }
15282 }
15283
15284 impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
15285 type Borrowed<'a> = &'a mut Self;
15286 fn take_or_borrow<'a>(
15287 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15288 ) -> Self::Borrowed<'a> {
15289 value
15290 }
15291 }
15292
15293 unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
15294 type Owned = Self;
15295
15296 #[inline(always)]
15297 fn inline_align(_context: fidl::encoding::Context) -> usize {
15298 8
15299 }
15300
15301 #[inline(always)]
15302 fn inline_size(_context: fidl::encoding::Context) -> usize {
15303 16
15304 }
15305 }
15306
15307 unsafe impl
15308 fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
15309 for &mut WifiGetChipRequest
15310 {
15311 unsafe fn encode(
15312 self,
15313 encoder: &mut fidl::encoding::Encoder<
15314 '_,
15315 fidl::encoding::DefaultFuchsiaResourceDialect,
15316 >,
15317 offset: usize,
15318 mut depth: fidl::encoding::Depth,
15319 ) -> fidl::Result<()> {
15320 encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
15321 let max_ordinal: u64 = self.max_ordinal_present();
15323 encoder.write_num(max_ordinal, offset);
15324 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15325 if max_ordinal == 0 {
15327 return Ok(());
15328 }
15329 depth.increment()?;
15330 let envelope_size = 8;
15331 let bytes_len = max_ordinal as usize * envelope_size;
15332 #[allow(unused_variables)]
15333 let offset = encoder.out_of_line_offset(bytes_len);
15334 let mut _prev_end_offset: usize = 0;
15335 if 1 > max_ordinal {
15336 return Ok(());
15337 }
15338
15339 let cur_offset: usize = (1 - 1) * envelope_size;
15342
15343 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15345
15346 fidl::encoding::encode_in_envelope_optional::<
15351 u32,
15352 fidl::encoding::DefaultFuchsiaResourceDialect,
15353 >(
15354 self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
15355 encoder,
15356 offset + cur_offset,
15357 depth,
15358 )?;
15359
15360 _prev_end_offset = cur_offset + envelope_size;
15361 if 2 > max_ordinal {
15362 return Ok(());
15363 }
15364
15365 let cur_offset: usize = (2 - 1) * envelope_size;
15368
15369 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15371
15372 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15377 self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15378 encoder, offset + cur_offset, depth
15379 )?;
15380
15381 _prev_end_offset = cur_offset + envelope_size;
15382
15383 Ok(())
15384 }
15385 }
15386
15387 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15388 for WifiGetChipRequest
15389 {
15390 #[inline(always)]
15391 fn new_empty() -> Self {
15392 Self::default()
15393 }
15394
15395 unsafe fn decode(
15396 &mut self,
15397 decoder: &mut fidl::encoding::Decoder<
15398 '_,
15399 fidl::encoding::DefaultFuchsiaResourceDialect,
15400 >,
15401 offset: usize,
15402 mut depth: fidl::encoding::Depth,
15403 ) -> fidl::Result<()> {
15404 decoder.debug_check_bounds::<Self>(offset);
15405 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15406 None => return Err(fidl::Error::NotNullable),
15407 Some(len) => len,
15408 };
15409 if len == 0 {
15411 return Ok(());
15412 };
15413 depth.increment()?;
15414 let envelope_size = 8;
15415 let bytes_len = len * envelope_size;
15416 let offset = decoder.out_of_line_offset(bytes_len)?;
15417 let mut _next_ordinal_to_read = 0;
15419 let mut next_offset = offset;
15420 let end_offset = offset + bytes_len;
15421 _next_ordinal_to_read += 1;
15422 if next_offset >= end_offset {
15423 return Ok(());
15424 }
15425
15426 while _next_ordinal_to_read < 1 {
15428 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15429 _next_ordinal_to_read += 1;
15430 next_offset += envelope_size;
15431 }
15432
15433 let next_out_of_line = decoder.next_out_of_line();
15434 let handles_before = decoder.remaining_handles();
15435 if let Some((inlined, num_bytes, num_handles)) =
15436 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15437 {
15438 let member_inline_size =
15439 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15440 if inlined != (member_inline_size <= 4) {
15441 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15442 }
15443 let inner_offset;
15444 let mut inner_depth = depth.clone();
15445 if inlined {
15446 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15447 inner_offset = next_offset;
15448 } else {
15449 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15450 inner_depth.increment()?;
15451 }
15452 let val_ref = self.chip_id.get_or_insert_with(|| {
15453 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
15454 });
15455 fidl::decode!(
15456 u32,
15457 fidl::encoding::DefaultFuchsiaResourceDialect,
15458 val_ref,
15459 decoder,
15460 inner_offset,
15461 inner_depth
15462 )?;
15463 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15464 {
15465 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15466 }
15467 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15468 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15469 }
15470 }
15471
15472 next_offset += envelope_size;
15473 _next_ordinal_to_read += 1;
15474 if next_offset >= end_offset {
15475 return Ok(());
15476 }
15477
15478 while _next_ordinal_to_read < 2 {
15480 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15481 _next_ordinal_to_read += 1;
15482 next_offset += envelope_size;
15483 }
15484
15485 let next_out_of_line = decoder.next_out_of_line();
15486 let handles_before = decoder.remaining_handles();
15487 if let Some((inlined, num_bytes, num_handles)) =
15488 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15489 {
15490 let member_inline_size = <fidl::encoding::Endpoint<
15491 fidl::endpoints::ServerEnd<WifiChipMarker>,
15492 > as fidl::encoding::TypeMarker>::inline_size(
15493 decoder.context
15494 );
15495 if inlined != (member_inline_size <= 4) {
15496 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15497 }
15498 let inner_offset;
15499 let mut inner_depth = depth.clone();
15500 if inlined {
15501 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15502 inner_offset = next_offset;
15503 } else {
15504 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15505 inner_depth.increment()?;
15506 }
15507 let val_ref = self.chip.get_or_insert_with(|| {
15508 fidl::new_empty!(
15509 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15510 fidl::encoding::DefaultFuchsiaResourceDialect
15511 )
15512 });
15513 fidl::decode!(
15514 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15515 fidl::encoding::DefaultFuchsiaResourceDialect,
15516 val_ref,
15517 decoder,
15518 inner_offset,
15519 inner_depth
15520 )?;
15521 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15522 {
15523 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15524 }
15525 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15526 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15527 }
15528 }
15529
15530 next_offset += envelope_size;
15531
15532 while next_offset < end_offset {
15534 _next_ordinal_to_read += 1;
15535 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15536 next_offset += envelope_size;
15537 }
15538
15539 Ok(())
15540 }
15541 }
15542
15543 impl WifiLegacyHalSelectTxPowerScenarioRequest {
15544 #[inline(always)]
15545 fn max_ordinal_present(&self) -> u64 {
15546 if let Some(_) = self.scenario {
15547 return 1;
15548 }
15549 0
15550 }
15551 }
15552
15553 impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15554 type Borrowed<'a> = &'a mut Self;
15555 fn take_or_borrow<'a>(
15556 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15557 ) -> Self::Borrowed<'a> {
15558 value
15559 }
15560 }
15561
15562 unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15563 type Owned = Self;
15564
15565 #[inline(always)]
15566 fn inline_align(_context: fidl::encoding::Context) -> usize {
15567 8
15568 }
15569
15570 #[inline(always)]
15571 fn inline_size(_context: fidl::encoding::Context) -> usize {
15572 16
15573 }
15574 }
15575
15576 unsafe impl
15577 fidl::encoding::Encode<
15578 WifiLegacyHalSelectTxPowerScenarioRequest,
15579 fidl::encoding::DefaultFuchsiaResourceDialect,
15580 > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
15581 {
15582 unsafe fn encode(
15583 self,
15584 encoder: &mut fidl::encoding::Encoder<
15585 '_,
15586 fidl::encoding::DefaultFuchsiaResourceDialect,
15587 >,
15588 offset: usize,
15589 mut depth: fidl::encoding::Depth,
15590 ) -> fidl::Result<()> {
15591 encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
15592 let max_ordinal: u64 = self.max_ordinal_present();
15594 encoder.write_num(max_ordinal, offset);
15595 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15596 if max_ordinal == 0 {
15598 return Ok(());
15599 }
15600 depth.increment()?;
15601 let envelope_size = 8;
15602 let bytes_len = max_ordinal as usize * envelope_size;
15603 #[allow(unused_variables)]
15604 let offset = encoder.out_of_line_offset(bytes_len);
15605 let mut _prev_end_offset: usize = 0;
15606 if 1 > max_ordinal {
15607 return Ok(());
15608 }
15609
15610 let cur_offset: usize = (1 - 1) * envelope_size;
15613
15614 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15616
15617 fidl::encoding::encode_in_envelope_optional::<
15622 WifiLegacyHalTxPowerScenario,
15623 fidl::encoding::DefaultFuchsiaResourceDialect,
15624 >(
15625 self.scenario
15626 .as_ref()
15627 .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
15628 encoder,
15629 offset + cur_offset,
15630 depth,
15631 )?;
15632
15633 _prev_end_offset = cur_offset + envelope_size;
15634
15635 Ok(())
15636 }
15637 }
15638
15639 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15640 for WifiLegacyHalSelectTxPowerScenarioRequest
15641 {
15642 #[inline(always)]
15643 fn new_empty() -> Self {
15644 Self::default()
15645 }
15646
15647 unsafe fn decode(
15648 &mut self,
15649 decoder: &mut fidl::encoding::Decoder<
15650 '_,
15651 fidl::encoding::DefaultFuchsiaResourceDialect,
15652 >,
15653 offset: usize,
15654 mut depth: fidl::encoding::Depth,
15655 ) -> fidl::Result<()> {
15656 decoder.debug_check_bounds::<Self>(offset);
15657 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15658 None => return Err(fidl::Error::NotNullable),
15659 Some(len) => len,
15660 };
15661 if len == 0 {
15663 return Ok(());
15664 };
15665 depth.increment()?;
15666 let envelope_size = 8;
15667 let bytes_len = len * envelope_size;
15668 let offset = decoder.out_of_line_offset(bytes_len)?;
15669 let mut _next_ordinal_to_read = 0;
15671 let mut next_offset = offset;
15672 let end_offset = offset + bytes_len;
15673 _next_ordinal_to_read += 1;
15674 if next_offset >= end_offset {
15675 return Ok(());
15676 }
15677
15678 while _next_ordinal_to_read < 1 {
15680 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15681 _next_ordinal_to_read += 1;
15682 next_offset += envelope_size;
15683 }
15684
15685 let next_out_of_line = decoder.next_out_of_line();
15686 let handles_before = decoder.remaining_handles();
15687 if let Some((inlined, num_bytes, num_handles)) =
15688 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15689 {
15690 let member_inline_size =
15691 <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
15692 decoder.context,
15693 );
15694 if inlined != (member_inline_size <= 4) {
15695 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15696 }
15697 let inner_offset;
15698 let mut inner_depth = depth.clone();
15699 if inlined {
15700 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15701 inner_offset = next_offset;
15702 } else {
15703 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15704 inner_depth.increment()?;
15705 }
15706 let val_ref = self.scenario.get_or_insert_with(|| {
15707 fidl::new_empty!(
15708 WifiLegacyHalTxPowerScenario,
15709 fidl::encoding::DefaultFuchsiaResourceDialect
15710 )
15711 });
15712 fidl::decode!(
15713 WifiLegacyHalTxPowerScenario,
15714 fidl::encoding::DefaultFuchsiaResourceDialect,
15715 val_ref,
15716 decoder,
15717 inner_offset,
15718 inner_depth
15719 )?;
15720 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15721 {
15722 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15723 }
15724 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15725 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15726 }
15727 }
15728
15729 next_offset += envelope_size;
15730
15731 while next_offset < end_offset {
15733 _next_ordinal_to_read += 1;
15734 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15735 next_offset += envelope_size;
15736 }
15737
15738 Ok(())
15739 }
15740 }
15741
15742 impl WifiRegisterEventCallbackRequest {
15743 #[inline(always)]
15744 fn max_ordinal_present(&self) -> u64 {
15745 if let Some(_) = self.callback {
15746 return 1;
15747 }
15748 0
15749 }
15750 }
15751
15752 impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
15753 type Borrowed<'a> = &'a mut Self;
15754 fn take_or_borrow<'a>(
15755 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15756 ) -> Self::Borrowed<'a> {
15757 value
15758 }
15759 }
15760
15761 unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
15762 type Owned = Self;
15763
15764 #[inline(always)]
15765 fn inline_align(_context: fidl::encoding::Context) -> usize {
15766 8
15767 }
15768
15769 #[inline(always)]
15770 fn inline_size(_context: fidl::encoding::Context) -> usize {
15771 16
15772 }
15773 }
15774
15775 unsafe impl
15776 fidl::encoding::Encode<
15777 WifiRegisterEventCallbackRequest,
15778 fidl::encoding::DefaultFuchsiaResourceDialect,
15779 > for &mut WifiRegisterEventCallbackRequest
15780 {
15781 unsafe fn encode(
15782 self,
15783 encoder: &mut fidl::encoding::Encoder<
15784 '_,
15785 fidl::encoding::DefaultFuchsiaResourceDialect,
15786 >,
15787 offset: usize,
15788 mut depth: fidl::encoding::Depth,
15789 ) -> fidl::Result<()> {
15790 encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
15791 let max_ordinal: u64 = self.max_ordinal_present();
15793 encoder.write_num(max_ordinal, offset);
15794 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15795 if max_ordinal == 0 {
15797 return Ok(());
15798 }
15799 depth.increment()?;
15800 let envelope_size = 8;
15801 let bytes_len = max_ordinal as usize * envelope_size;
15802 #[allow(unused_variables)]
15803 let offset = encoder.out_of_line_offset(bytes_len);
15804 let mut _prev_end_offset: usize = 0;
15805 if 1 > max_ordinal {
15806 return Ok(());
15807 }
15808
15809 let cur_offset: usize = (1 - 1) * envelope_size;
15812
15813 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15815
15816 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15821 self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15822 encoder, offset + cur_offset, depth
15823 )?;
15824
15825 _prev_end_offset = cur_offset + envelope_size;
15826
15827 Ok(())
15828 }
15829 }
15830
15831 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15832 for WifiRegisterEventCallbackRequest
15833 {
15834 #[inline(always)]
15835 fn new_empty() -> Self {
15836 Self::default()
15837 }
15838
15839 unsafe fn decode(
15840 &mut self,
15841 decoder: &mut fidl::encoding::Decoder<
15842 '_,
15843 fidl::encoding::DefaultFuchsiaResourceDialect,
15844 >,
15845 offset: usize,
15846 mut depth: fidl::encoding::Depth,
15847 ) -> fidl::Result<()> {
15848 decoder.debug_check_bounds::<Self>(offset);
15849 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15850 None => return Err(fidl::Error::NotNullable),
15851 Some(len) => len,
15852 };
15853 if len == 0 {
15855 return Ok(());
15856 };
15857 depth.increment()?;
15858 let envelope_size = 8;
15859 let bytes_len = len * envelope_size;
15860 let offset = decoder.out_of_line_offset(bytes_len)?;
15861 let mut _next_ordinal_to_read = 0;
15863 let mut next_offset = offset;
15864 let end_offset = offset + bytes_len;
15865 _next_ordinal_to_read += 1;
15866 if next_offset >= end_offset {
15867 return Ok(());
15868 }
15869
15870 while _next_ordinal_to_read < 1 {
15872 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15873 _next_ordinal_to_read += 1;
15874 next_offset += envelope_size;
15875 }
15876
15877 let next_out_of_line = decoder.next_out_of_line();
15878 let handles_before = decoder.remaining_handles();
15879 if let Some((inlined, num_bytes, num_handles)) =
15880 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15881 {
15882 let member_inline_size = <fidl::encoding::Endpoint<
15883 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15884 > as fidl::encoding::TypeMarker>::inline_size(
15885 decoder.context
15886 );
15887 if inlined != (member_inline_size <= 4) {
15888 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15889 }
15890 let inner_offset;
15891 let mut inner_depth = depth.clone();
15892 if inlined {
15893 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15894 inner_offset = next_offset;
15895 } else {
15896 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15897 inner_depth.increment()?;
15898 }
15899 let val_ref = self.callback.get_or_insert_with(|| {
15900 fidl::new_empty!(
15901 fidl::encoding::Endpoint<
15902 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15903 >,
15904 fidl::encoding::DefaultFuchsiaResourceDialect
15905 )
15906 });
15907 fidl::decode!(
15908 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
15909 fidl::encoding::DefaultFuchsiaResourceDialect,
15910 val_ref,
15911 decoder,
15912 inner_offset,
15913 inner_depth
15914 )?;
15915 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15916 {
15917 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15918 }
15919 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15920 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15921 }
15922 }
15923
15924 next_offset += envelope_size;
15925
15926 while next_offset < end_offset {
15928 _next_ordinal_to_read += 1;
15929 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15930 next_offset += envelope_size;
15931 }
15932
15933 Ok(())
15934 }
15935 }
15936
15937 impl WifiStaIfaceSetScanOnlyModeRequest {
15938 #[inline(always)]
15939 fn max_ordinal_present(&self) -> u64 {
15940 if let Some(_) = self.enable {
15941 return 1;
15942 }
15943 0
15944 }
15945 }
15946
15947 impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15948 type Borrowed<'a> = &'a mut Self;
15949 fn take_or_borrow<'a>(
15950 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15951 ) -> Self::Borrowed<'a> {
15952 value
15953 }
15954 }
15955
15956 unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15957 type Owned = Self;
15958
15959 #[inline(always)]
15960 fn inline_align(_context: fidl::encoding::Context) -> usize {
15961 8
15962 }
15963
15964 #[inline(always)]
15965 fn inline_size(_context: fidl::encoding::Context) -> usize {
15966 16
15967 }
15968 }
15969
15970 unsafe impl
15971 fidl::encoding::Encode<
15972 WifiStaIfaceSetScanOnlyModeRequest,
15973 fidl::encoding::DefaultFuchsiaResourceDialect,
15974 > for &mut WifiStaIfaceSetScanOnlyModeRequest
15975 {
15976 unsafe fn encode(
15977 self,
15978 encoder: &mut fidl::encoding::Encoder<
15979 '_,
15980 fidl::encoding::DefaultFuchsiaResourceDialect,
15981 >,
15982 offset: usize,
15983 mut depth: fidl::encoding::Depth,
15984 ) -> fidl::Result<()> {
15985 encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
15986 let max_ordinal: u64 = self.max_ordinal_present();
15988 encoder.write_num(max_ordinal, offset);
15989 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15990 if max_ordinal == 0 {
15992 return Ok(());
15993 }
15994 depth.increment()?;
15995 let envelope_size = 8;
15996 let bytes_len = max_ordinal as usize * envelope_size;
15997 #[allow(unused_variables)]
15998 let offset = encoder.out_of_line_offset(bytes_len);
15999 let mut _prev_end_offset: usize = 0;
16000 if 1 > max_ordinal {
16001 return Ok(());
16002 }
16003
16004 let cur_offset: usize = (1 - 1) * envelope_size;
16007
16008 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16010
16011 fidl::encoding::encode_in_envelope_optional::<
16016 bool,
16017 fidl::encoding::DefaultFuchsiaResourceDialect,
16018 >(
16019 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
16020 encoder,
16021 offset + cur_offset,
16022 depth,
16023 )?;
16024
16025 _prev_end_offset = cur_offset + envelope_size;
16026
16027 Ok(())
16028 }
16029 }
16030
16031 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16032 for WifiStaIfaceSetScanOnlyModeRequest
16033 {
16034 #[inline(always)]
16035 fn new_empty() -> Self {
16036 Self::default()
16037 }
16038
16039 unsafe fn decode(
16040 &mut self,
16041 decoder: &mut fidl::encoding::Decoder<
16042 '_,
16043 fidl::encoding::DefaultFuchsiaResourceDialect,
16044 >,
16045 offset: usize,
16046 mut depth: fidl::encoding::Depth,
16047 ) -> fidl::Result<()> {
16048 decoder.debug_check_bounds::<Self>(offset);
16049 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16050 None => return Err(fidl::Error::NotNullable),
16051 Some(len) => len,
16052 };
16053 if len == 0 {
16055 return Ok(());
16056 };
16057 depth.increment()?;
16058 let envelope_size = 8;
16059 let bytes_len = len * envelope_size;
16060 let offset = decoder.out_of_line_offset(bytes_len)?;
16061 let mut _next_ordinal_to_read = 0;
16063 let mut next_offset = offset;
16064 let end_offset = offset + bytes_len;
16065 _next_ordinal_to_read += 1;
16066 if next_offset >= end_offset {
16067 return Ok(());
16068 }
16069
16070 while _next_ordinal_to_read < 1 {
16072 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16073 _next_ordinal_to_read += 1;
16074 next_offset += envelope_size;
16075 }
16076
16077 let next_out_of_line = decoder.next_out_of_line();
16078 let handles_before = decoder.remaining_handles();
16079 if let Some((inlined, num_bytes, num_handles)) =
16080 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16081 {
16082 let member_inline_size =
16083 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16084 if inlined != (member_inline_size <= 4) {
16085 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16086 }
16087 let inner_offset;
16088 let mut inner_depth = depth.clone();
16089 if inlined {
16090 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16091 inner_offset = next_offset;
16092 } else {
16093 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16094 inner_depth.increment()?;
16095 }
16096 let val_ref = self.enable.get_or_insert_with(|| {
16097 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
16098 });
16099 fidl::decode!(
16100 bool,
16101 fidl::encoding::DefaultFuchsiaResourceDialect,
16102 val_ref,
16103 decoder,
16104 inner_offset,
16105 inner_depth
16106 )?;
16107 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16108 {
16109 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16110 }
16111 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16112 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16113 }
16114 }
16115
16116 next_offset += envelope_size;
16117
16118 while next_offset < end_offset {
16120 _next_ordinal_to_read += 1;
16121 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16122 next_offset += envelope_size;
16123 }
16124
16125 Ok(())
16126 }
16127 }
16128
16129 impl WlanixGetNl80211Request {
16130 #[inline(always)]
16131 fn max_ordinal_present(&self) -> u64 {
16132 if let Some(_) = self.nl80211 {
16133 return 1;
16134 }
16135 0
16136 }
16137 }
16138
16139 impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
16140 type Borrowed<'a> = &'a mut Self;
16141 fn take_or_borrow<'a>(
16142 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16143 ) -> Self::Borrowed<'a> {
16144 value
16145 }
16146 }
16147
16148 unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
16149 type Owned = Self;
16150
16151 #[inline(always)]
16152 fn inline_align(_context: fidl::encoding::Context) -> usize {
16153 8
16154 }
16155
16156 #[inline(always)]
16157 fn inline_size(_context: fidl::encoding::Context) -> usize {
16158 16
16159 }
16160 }
16161
16162 unsafe impl
16163 fidl::encoding::Encode<
16164 WlanixGetNl80211Request,
16165 fidl::encoding::DefaultFuchsiaResourceDialect,
16166 > for &mut WlanixGetNl80211Request
16167 {
16168 unsafe fn encode(
16169 self,
16170 encoder: &mut fidl::encoding::Encoder<
16171 '_,
16172 fidl::encoding::DefaultFuchsiaResourceDialect,
16173 >,
16174 offset: usize,
16175 mut depth: fidl::encoding::Depth,
16176 ) -> fidl::Result<()> {
16177 encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
16178 let max_ordinal: u64 = self.max_ordinal_present();
16180 encoder.write_num(max_ordinal, offset);
16181 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16182 if max_ordinal == 0 {
16184 return Ok(());
16185 }
16186 depth.increment()?;
16187 let envelope_size = 8;
16188 let bytes_len = max_ordinal as usize * envelope_size;
16189 #[allow(unused_variables)]
16190 let offset = encoder.out_of_line_offset(bytes_len);
16191 let mut _prev_end_offset: usize = 0;
16192 if 1 > max_ordinal {
16193 return Ok(());
16194 }
16195
16196 let cur_offset: usize = (1 - 1) * envelope_size;
16199
16200 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16202
16203 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16208 self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16209 encoder, offset + cur_offset, depth
16210 )?;
16211
16212 _prev_end_offset = cur_offset + envelope_size;
16213
16214 Ok(())
16215 }
16216 }
16217
16218 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16219 for WlanixGetNl80211Request
16220 {
16221 #[inline(always)]
16222 fn new_empty() -> Self {
16223 Self::default()
16224 }
16225
16226 unsafe fn decode(
16227 &mut self,
16228 decoder: &mut fidl::encoding::Decoder<
16229 '_,
16230 fidl::encoding::DefaultFuchsiaResourceDialect,
16231 >,
16232 offset: usize,
16233 mut depth: fidl::encoding::Depth,
16234 ) -> fidl::Result<()> {
16235 decoder.debug_check_bounds::<Self>(offset);
16236 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16237 None => return Err(fidl::Error::NotNullable),
16238 Some(len) => len,
16239 };
16240 if len == 0 {
16242 return Ok(());
16243 };
16244 depth.increment()?;
16245 let envelope_size = 8;
16246 let bytes_len = len * envelope_size;
16247 let offset = decoder.out_of_line_offset(bytes_len)?;
16248 let mut _next_ordinal_to_read = 0;
16250 let mut next_offset = offset;
16251 let end_offset = offset + bytes_len;
16252 _next_ordinal_to_read += 1;
16253 if next_offset >= end_offset {
16254 return Ok(());
16255 }
16256
16257 while _next_ordinal_to_read < 1 {
16259 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16260 _next_ordinal_to_read += 1;
16261 next_offset += envelope_size;
16262 }
16263
16264 let next_out_of_line = decoder.next_out_of_line();
16265 let handles_before = decoder.remaining_handles();
16266 if let Some((inlined, num_bytes, num_handles)) =
16267 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16268 {
16269 let member_inline_size = <fidl::encoding::Endpoint<
16270 fidl::endpoints::ServerEnd<Nl80211Marker>,
16271 > as fidl::encoding::TypeMarker>::inline_size(
16272 decoder.context
16273 );
16274 if inlined != (member_inline_size <= 4) {
16275 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16276 }
16277 let inner_offset;
16278 let mut inner_depth = depth.clone();
16279 if inlined {
16280 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16281 inner_offset = next_offset;
16282 } else {
16283 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16284 inner_depth.increment()?;
16285 }
16286 let val_ref = self.nl80211.get_or_insert_with(|| {
16287 fidl::new_empty!(
16288 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16289 fidl::encoding::DefaultFuchsiaResourceDialect
16290 )
16291 });
16292 fidl::decode!(
16293 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16294 fidl::encoding::DefaultFuchsiaResourceDialect,
16295 val_ref,
16296 decoder,
16297 inner_offset,
16298 inner_depth
16299 )?;
16300 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16301 {
16302 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16303 }
16304 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16305 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16306 }
16307 }
16308
16309 next_offset += envelope_size;
16310
16311 while next_offset < end_offset {
16313 _next_ordinal_to_read += 1;
16314 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16315 next_offset += envelope_size;
16316 }
16317
16318 Ok(())
16319 }
16320 }
16321
16322 impl WlanixGetSupplicantRequest {
16323 #[inline(always)]
16324 fn max_ordinal_present(&self) -> u64 {
16325 if let Some(_) = self.supplicant {
16326 return 1;
16327 }
16328 0
16329 }
16330 }
16331
16332 impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
16333 type Borrowed<'a> = &'a mut Self;
16334 fn take_or_borrow<'a>(
16335 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16336 ) -> Self::Borrowed<'a> {
16337 value
16338 }
16339 }
16340
16341 unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
16342 type Owned = Self;
16343
16344 #[inline(always)]
16345 fn inline_align(_context: fidl::encoding::Context) -> usize {
16346 8
16347 }
16348
16349 #[inline(always)]
16350 fn inline_size(_context: fidl::encoding::Context) -> usize {
16351 16
16352 }
16353 }
16354
16355 unsafe impl
16356 fidl::encoding::Encode<
16357 WlanixGetSupplicantRequest,
16358 fidl::encoding::DefaultFuchsiaResourceDialect,
16359 > for &mut WlanixGetSupplicantRequest
16360 {
16361 unsafe fn encode(
16362 self,
16363 encoder: &mut fidl::encoding::Encoder<
16364 '_,
16365 fidl::encoding::DefaultFuchsiaResourceDialect,
16366 >,
16367 offset: usize,
16368 mut depth: fidl::encoding::Depth,
16369 ) -> fidl::Result<()> {
16370 encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
16371 let max_ordinal: u64 = self.max_ordinal_present();
16373 encoder.write_num(max_ordinal, offset);
16374 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16375 if max_ordinal == 0 {
16377 return Ok(());
16378 }
16379 depth.increment()?;
16380 let envelope_size = 8;
16381 let bytes_len = max_ordinal as usize * envelope_size;
16382 #[allow(unused_variables)]
16383 let offset = encoder.out_of_line_offset(bytes_len);
16384 let mut _prev_end_offset: usize = 0;
16385 if 1 > max_ordinal {
16386 return Ok(());
16387 }
16388
16389 let cur_offset: usize = (1 - 1) * envelope_size;
16392
16393 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16395
16396 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16401 self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16402 encoder, offset + cur_offset, depth
16403 )?;
16404
16405 _prev_end_offset = cur_offset + envelope_size;
16406
16407 Ok(())
16408 }
16409 }
16410
16411 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16412 for WlanixGetSupplicantRequest
16413 {
16414 #[inline(always)]
16415 fn new_empty() -> Self {
16416 Self::default()
16417 }
16418
16419 unsafe fn decode(
16420 &mut self,
16421 decoder: &mut fidl::encoding::Decoder<
16422 '_,
16423 fidl::encoding::DefaultFuchsiaResourceDialect,
16424 >,
16425 offset: usize,
16426 mut depth: fidl::encoding::Depth,
16427 ) -> fidl::Result<()> {
16428 decoder.debug_check_bounds::<Self>(offset);
16429 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16430 None => return Err(fidl::Error::NotNullable),
16431 Some(len) => len,
16432 };
16433 if len == 0 {
16435 return Ok(());
16436 };
16437 depth.increment()?;
16438 let envelope_size = 8;
16439 let bytes_len = len * envelope_size;
16440 let offset = decoder.out_of_line_offset(bytes_len)?;
16441 let mut _next_ordinal_to_read = 0;
16443 let mut next_offset = offset;
16444 let end_offset = offset + bytes_len;
16445 _next_ordinal_to_read += 1;
16446 if next_offset >= end_offset {
16447 return Ok(());
16448 }
16449
16450 while _next_ordinal_to_read < 1 {
16452 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16453 _next_ordinal_to_read += 1;
16454 next_offset += envelope_size;
16455 }
16456
16457 let next_out_of_line = decoder.next_out_of_line();
16458 let handles_before = decoder.remaining_handles();
16459 if let Some((inlined, num_bytes, num_handles)) =
16460 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16461 {
16462 let member_inline_size = <fidl::encoding::Endpoint<
16463 fidl::endpoints::ServerEnd<SupplicantMarker>,
16464 > as fidl::encoding::TypeMarker>::inline_size(
16465 decoder.context
16466 );
16467 if inlined != (member_inline_size <= 4) {
16468 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16469 }
16470 let inner_offset;
16471 let mut inner_depth = depth.clone();
16472 if inlined {
16473 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16474 inner_offset = next_offset;
16475 } else {
16476 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16477 inner_depth.increment()?;
16478 }
16479 let val_ref = self.supplicant.get_or_insert_with(|| {
16480 fidl::new_empty!(
16481 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16482 fidl::encoding::DefaultFuchsiaResourceDialect
16483 )
16484 });
16485 fidl::decode!(
16486 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16487 fidl::encoding::DefaultFuchsiaResourceDialect,
16488 val_ref,
16489 decoder,
16490 inner_offset,
16491 inner_depth
16492 )?;
16493 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16494 {
16495 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16496 }
16497 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16498 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16499 }
16500 }
16501
16502 next_offset += envelope_size;
16503
16504 while next_offset < end_offset {
16506 _next_ordinal_to_read += 1;
16507 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16508 next_offset += envelope_size;
16509 }
16510
16511 Ok(())
16512 }
16513 }
16514
16515 impl WlanixGetWifiLegacyHalRequest {
16516 #[inline(always)]
16517 fn max_ordinal_present(&self) -> u64 {
16518 if let Some(_) = self.legacy_hal {
16519 return 1;
16520 }
16521 0
16522 }
16523 }
16524
16525 impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
16526 type Borrowed<'a> = &'a mut Self;
16527 fn take_or_borrow<'a>(
16528 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16529 ) -> Self::Borrowed<'a> {
16530 value
16531 }
16532 }
16533
16534 unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
16535 type Owned = Self;
16536
16537 #[inline(always)]
16538 fn inline_align(_context: fidl::encoding::Context) -> usize {
16539 8
16540 }
16541
16542 #[inline(always)]
16543 fn inline_size(_context: fidl::encoding::Context) -> usize {
16544 16
16545 }
16546 }
16547
16548 unsafe impl
16549 fidl::encoding::Encode<
16550 WlanixGetWifiLegacyHalRequest,
16551 fidl::encoding::DefaultFuchsiaResourceDialect,
16552 > for &mut WlanixGetWifiLegacyHalRequest
16553 {
16554 unsafe fn encode(
16555 self,
16556 encoder: &mut fidl::encoding::Encoder<
16557 '_,
16558 fidl::encoding::DefaultFuchsiaResourceDialect,
16559 >,
16560 offset: usize,
16561 mut depth: fidl::encoding::Depth,
16562 ) -> fidl::Result<()> {
16563 encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
16564 let max_ordinal: u64 = self.max_ordinal_present();
16566 encoder.write_num(max_ordinal, offset);
16567 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16568 if max_ordinal == 0 {
16570 return Ok(());
16571 }
16572 depth.increment()?;
16573 let envelope_size = 8;
16574 let bytes_len = max_ordinal as usize * envelope_size;
16575 #[allow(unused_variables)]
16576 let offset = encoder.out_of_line_offset(bytes_len);
16577 let mut _prev_end_offset: usize = 0;
16578 if 1 > max_ordinal {
16579 return Ok(());
16580 }
16581
16582 let cur_offset: usize = (1 - 1) * envelope_size;
16585
16586 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16588
16589 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16594 self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16595 encoder, offset + cur_offset, depth
16596 )?;
16597
16598 _prev_end_offset = cur_offset + envelope_size;
16599
16600 Ok(())
16601 }
16602 }
16603
16604 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16605 for WlanixGetWifiLegacyHalRequest
16606 {
16607 #[inline(always)]
16608 fn new_empty() -> Self {
16609 Self::default()
16610 }
16611
16612 unsafe fn decode(
16613 &mut self,
16614 decoder: &mut fidl::encoding::Decoder<
16615 '_,
16616 fidl::encoding::DefaultFuchsiaResourceDialect,
16617 >,
16618 offset: usize,
16619 mut depth: fidl::encoding::Depth,
16620 ) -> fidl::Result<()> {
16621 decoder.debug_check_bounds::<Self>(offset);
16622 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16623 None => return Err(fidl::Error::NotNullable),
16624 Some(len) => len,
16625 };
16626 if len == 0 {
16628 return Ok(());
16629 };
16630 depth.increment()?;
16631 let envelope_size = 8;
16632 let bytes_len = len * envelope_size;
16633 let offset = decoder.out_of_line_offset(bytes_len)?;
16634 let mut _next_ordinal_to_read = 0;
16636 let mut next_offset = offset;
16637 let end_offset = offset + bytes_len;
16638 _next_ordinal_to_read += 1;
16639 if next_offset >= end_offset {
16640 return Ok(());
16641 }
16642
16643 while _next_ordinal_to_read < 1 {
16645 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16646 _next_ordinal_to_read += 1;
16647 next_offset += envelope_size;
16648 }
16649
16650 let next_out_of_line = decoder.next_out_of_line();
16651 let handles_before = decoder.remaining_handles();
16652 if let Some((inlined, num_bytes, num_handles)) =
16653 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16654 {
16655 let member_inline_size = <fidl::encoding::Endpoint<
16656 fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
16657 > as fidl::encoding::TypeMarker>::inline_size(
16658 decoder.context
16659 );
16660 if inlined != (member_inline_size <= 4) {
16661 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16662 }
16663 let inner_offset;
16664 let mut inner_depth = depth.clone();
16665 if inlined {
16666 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16667 inner_offset = next_offset;
16668 } else {
16669 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16670 inner_depth.increment()?;
16671 }
16672 let val_ref = self.legacy_hal.get_or_insert_with(|| {
16673 fidl::new_empty!(
16674 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16675 fidl::encoding::DefaultFuchsiaResourceDialect
16676 )
16677 });
16678 fidl::decode!(
16679 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16680 fidl::encoding::DefaultFuchsiaResourceDialect,
16681 val_ref,
16682 decoder,
16683 inner_offset,
16684 inner_depth
16685 )?;
16686 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16687 {
16688 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16689 }
16690 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16691 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16692 }
16693 }
16694
16695 next_offset += envelope_size;
16696
16697 while next_offset < end_offset {
16699 _next_ordinal_to_read += 1;
16700 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16701 next_offset += envelope_size;
16702 }
16703
16704 Ok(())
16705 }
16706 }
16707
16708 impl WlanixGetWifiRequest {
16709 #[inline(always)]
16710 fn max_ordinal_present(&self) -> u64 {
16711 if let Some(_) = self.wifi {
16712 return 1;
16713 }
16714 0
16715 }
16716 }
16717
16718 impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
16719 type Borrowed<'a> = &'a mut Self;
16720 fn take_or_borrow<'a>(
16721 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16722 ) -> Self::Borrowed<'a> {
16723 value
16724 }
16725 }
16726
16727 unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
16728 type Owned = Self;
16729
16730 #[inline(always)]
16731 fn inline_align(_context: fidl::encoding::Context) -> usize {
16732 8
16733 }
16734
16735 #[inline(always)]
16736 fn inline_size(_context: fidl::encoding::Context) -> usize {
16737 16
16738 }
16739 }
16740
16741 unsafe impl
16742 fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
16743 for &mut WlanixGetWifiRequest
16744 {
16745 unsafe fn encode(
16746 self,
16747 encoder: &mut fidl::encoding::Encoder<
16748 '_,
16749 fidl::encoding::DefaultFuchsiaResourceDialect,
16750 >,
16751 offset: usize,
16752 mut depth: fidl::encoding::Depth,
16753 ) -> fidl::Result<()> {
16754 encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
16755 let max_ordinal: u64 = self.max_ordinal_present();
16757 encoder.write_num(max_ordinal, offset);
16758 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16759 if max_ordinal == 0 {
16761 return Ok(());
16762 }
16763 depth.increment()?;
16764 let envelope_size = 8;
16765 let bytes_len = max_ordinal as usize * envelope_size;
16766 #[allow(unused_variables)]
16767 let offset = encoder.out_of_line_offset(bytes_len);
16768 let mut _prev_end_offset: usize = 0;
16769 if 1 > max_ordinal {
16770 return Ok(());
16771 }
16772
16773 let cur_offset: usize = (1 - 1) * envelope_size;
16776
16777 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16779
16780 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16785 self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16786 encoder, offset + cur_offset, depth
16787 )?;
16788
16789 _prev_end_offset = cur_offset + envelope_size;
16790
16791 Ok(())
16792 }
16793 }
16794
16795 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16796 for WlanixGetWifiRequest
16797 {
16798 #[inline(always)]
16799 fn new_empty() -> Self {
16800 Self::default()
16801 }
16802
16803 unsafe fn decode(
16804 &mut self,
16805 decoder: &mut fidl::encoding::Decoder<
16806 '_,
16807 fidl::encoding::DefaultFuchsiaResourceDialect,
16808 >,
16809 offset: usize,
16810 mut depth: fidl::encoding::Depth,
16811 ) -> fidl::Result<()> {
16812 decoder.debug_check_bounds::<Self>(offset);
16813 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16814 None => return Err(fidl::Error::NotNullable),
16815 Some(len) => len,
16816 };
16817 if len == 0 {
16819 return Ok(());
16820 };
16821 depth.increment()?;
16822 let envelope_size = 8;
16823 let bytes_len = len * envelope_size;
16824 let offset = decoder.out_of_line_offset(bytes_len)?;
16825 let mut _next_ordinal_to_read = 0;
16827 let mut next_offset = offset;
16828 let end_offset = offset + bytes_len;
16829 _next_ordinal_to_read += 1;
16830 if next_offset >= end_offset {
16831 return Ok(());
16832 }
16833
16834 while _next_ordinal_to_read < 1 {
16836 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16837 _next_ordinal_to_read += 1;
16838 next_offset += envelope_size;
16839 }
16840
16841 let next_out_of_line = decoder.next_out_of_line();
16842 let handles_before = decoder.remaining_handles();
16843 if let Some((inlined, num_bytes, num_handles)) =
16844 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16845 {
16846 let member_inline_size = <fidl::encoding::Endpoint<
16847 fidl::endpoints::ServerEnd<WifiMarker>,
16848 > as fidl::encoding::TypeMarker>::inline_size(
16849 decoder.context
16850 );
16851 if inlined != (member_inline_size <= 4) {
16852 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16853 }
16854 let inner_offset;
16855 let mut inner_depth = depth.clone();
16856 if inlined {
16857 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16858 inner_offset = next_offset;
16859 } else {
16860 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16861 inner_depth.increment()?;
16862 }
16863 let val_ref = self.wifi.get_or_insert_with(|| {
16864 fidl::new_empty!(
16865 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16866 fidl::encoding::DefaultFuchsiaResourceDialect
16867 )
16868 });
16869 fidl::decode!(
16870 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16871 fidl::encoding::DefaultFuchsiaResourceDialect,
16872 val_ref,
16873 decoder,
16874 inner_offset,
16875 inner_depth
16876 )?;
16877 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16878 {
16879 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16880 }
16881 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16882 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16883 }
16884 }
16885
16886 next_offset += envelope_size;
16887
16888 while next_offset < end_offset {
16890 _next_ordinal_to_read += 1;
16891 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16892 next_offset += envelope_size;
16893 }
16894
16895 Ok(())
16896 }
16897 }
16898}