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 let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
367 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
368 }
369
370 pub fn into_channel(self) -> fidl::Channel {
371 self.client.into_channel()
372 }
373
374 pub fn wait_for_event(
377 &self,
378 deadline: zx::MonotonicInstant,
379 ) -> Result<Nl80211Event, fidl::Error> {
380 Nl80211Event::decode(self.client.wait_for_event(deadline)?)
381 }
382
383 pub fn r#get_multicast(
384 &self,
385 mut payload: Nl80211GetMulticastRequest,
386 ) -> Result<(), fidl::Error> {
387 self.client.send::<Nl80211GetMulticastRequest>(
388 &mut payload,
389 0x58b73dd089681dc2,
390 fidl::encoding::DynamicFlags::FLEXIBLE,
391 )
392 }
393
394 pub fn r#message(
395 &self,
396 mut payload: Nl80211MessageRequest,
397 ___deadline: zx::MonotonicInstant,
398 ) -> Result<Nl80211MessageResult, fidl::Error> {
399 let _response = self.client.send_query::<
400 Nl80211MessageRequest,
401 fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
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 >(
421 (message,),
422 0x4626796aba1e2987,
423 fidl::encoding::DynamicFlags::FLEXIBLE,
424 ___deadline,
425 )?
426 .into_result::<Nl80211Marker>("message_v2")?;
427 Ok(_response.map(|x| x.response))
428 }
429}
430
431#[cfg(target_os = "fuchsia")]
432impl From<Nl80211SynchronousProxy> for zx::NullableHandle {
433 fn from(value: Nl80211SynchronousProxy) -> Self {
434 value.into_channel().into()
435 }
436}
437
438#[cfg(target_os = "fuchsia")]
439impl From<fidl::Channel> for Nl80211SynchronousProxy {
440 fn from(value: fidl::Channel) -> Self {
441 Self::new(value)
442 }
443}
444
445#[cfg(target_os = "fuchsia")]
446impl fidl::endpoints::FromClient for Nl80211SynchronousProxy {
447 type Protocol = Nl80211Marker;
448
449 fn from_client(value: fidl::endpoints::ClientEnd<Nl80211Marker>) -> Self {
450 Self::new(value.into_channel())
451 }
452}
453
454#[derive(Debug, Clone)]
455pub struct Nl80211Proxy {
456 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
457}
458
459impl fidl::endpoints::Proxy for Nl80211Proxy {
460 type Protocol = Nl80211Marker;
461
462 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
463 Self::new(inner)
464 }
465
466 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
467 self.client.into_channel().map_err(|client| Self { client })
468 }
469
470 fn as_channel(&self) -> &::fidl::AsyncChannel {
471 self.client.as_channel()
472 }
473}
474
475impl Nl80211Proxy {
476 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
478 let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
479 Self { client: fidl::client::Client::new(channel, protocol_name) }
480 }
481
482 pub fn take_event_stream(&self) -> Nl80211EventStream {
488 Nl80211EventStream { event_receiver: self.client.take_event_receiver() }
489 }
490
491 pub fn r#get_multicast(
492 &self,
493 mut payload: Nl80211GetMulticastRequest,
494 ) -> Result<(), fidl::Error> {
495 Nl80211ProxyInterface::r#get_multicast(self, payload)
496 }
497
498 pub fn r#message(
499 &self,
500 mut payload: Nl80211MessageRequest,
501 ) -> fidl::client::QueryResponseFut<
502 Nl80211MessageResult,
503 fidl::encoding::DefaultFuchsiaResourceDialect,
504 > {
505 Nl80211ProxyInterface::r#message(self, payload)
506 }
507
508 pub fn r#message_v2(
509 &self,
510 mut message: &Nl80211Message,
511 ) -> fidl::client::QueryResponseFut<
512 Nl80211MessageV2Result,
513 fidl::encoding::DefaultFuchsiaResourceDialect,
514 > {
515 Nl80211ProxyInterface::r#message_v2(self, message)
516 }
517}
518
519impl Nl80211ProxyInterface for Nl80211Proxy {
520 fn r#get_multicast(&self, mut payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error> {
521 self.client.send::<Nl80211GetMulticastRequest>(
522 &mut payload,
523 0x58b73dd089681dc2,
524 fidl::encoding::DynamicFlags::FLEXIBLE,
525 )
526 }
527
528 type MessageResponseFut = fidl::client::QueryResponseFut<
529 Nl80211MessageResult,
530 fidl::encoding::DefaultFuchsiaResourceDialect,
531 >;
532 fn r#message(&self, mut payload: Nl80211MessageRequest) -> Self::MessageResponseFut {
533 fn _decode(
534 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
535 ) -> Result<Nl80211MessageResult, fidl::Error> {
536 let _response = fidl::client::decode_transaction_body::<
537 fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
538 fidl::encoding::DefaultFuchsiaResourceDialect,
539 0x6336259e15bb3795,
540 >(_buf?)?
541 .into_result::<Nl80211Marker>("message")?;
542 Ok(_response.map(|x| x))
543 }
544 self.client.send_query_and_decode::<Nl80211MessageRequest, Nl80211MessageResult>(
545 &mut payload,
546 0x6336259e15bb3795,
547 fidl::encoding::DynamicFlags::FLEXIBLE,
548 _decode,
549 )
550 }
551
552 type MessageV2ResponseFut = fidl::client::QueryResponseFut<
553 Nl80211MessageV2Result,
554 fidl::encoding::DefaultFuchsiaResourceDialect,
555 >;
556 fn r#message_v2(&self, mut message: &Nl80211Message) -> Self::MessageV2ResponseFut {
557 fn _decode(
558 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
559 ) -> Result<Nl80211MessageV2Result, fidl::Error> {
560 let _response = fidl::client::decode_transaction_body::<
561 fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
562 fidl::encoding::DefaultFuchsiaResourceDialect,
563 0x4626796aba1e2987,
564 >(_buf?)?
565 .into_result::<Nl80211Marker>("message_v2")?;
566 Ok(_response.map(|x| x.response))
567 }
568 self.client.send_query_and_decode::<Nl80211MessageV2Request, Nl80211MessageV2Result>(
569 (message,),
570 0x4626796aba1e2987,
571 fidl::encoding::DynamicFlags::FLEXIBLE,
572 _decode,
573 )
574 }
575}
576
577pub struct Nl80211EventStream {
578 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
579}
580
581impl std::marker::Unpin for Nl80211EventStream {}
582
583impl futures::stream::FusedStream for Nl80211EventStream {
584 fn is_terminated(&self) -> bool {
585 self.event_receiver.is_terminated()
586 }
587}
588
589impl futures::Stream for Nl80211EventStream {
590 type Item = Result<Nl80211Event, fidl::Error>;
591
592 fn poll_next(
593 mut self: std::pin::Pin<&mut Self>,
594 cx: &mut std::task::Context<'_>,
595 ) -> std::task::Poll<Option<Self::Item>> {
596 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
597 &mut self.event_receiver,
598 cx
599 )?) {
600 Some(buf) => std::task::Poll::Ready(Some(Nl80211Event::decode(buf))),
601 None => std::task::Poll::Ready(None),
602 }
603 }
604}
605
606#[derive(Debug)]
607pub enum Nl80211Event {
608 #[non_exhaustive]
609 _UnknownEvent {
610 ordinal: u64,
612 },
613}
614
615impl Nl80211Event {
616 fn decode(
618 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
619 ) -> Result<Nl80211Event, fidl::Error> {
620 let (bytes, _handles) = buf.split_mut();
621 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
622 debug_assert_eq!(tx_header.tx_id, 0);
623 match tx_header.ordinal {
624 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
625 Ok(Nl80211Event::_UnknownEvent { ordinal: tx_header.ordinal })
626 }
627 _ => Err(fidl::Error::UnknownOrdinal {
628 ordinal: tx_header.ordinal,
629 protocol_name: <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
630 }),
631 }
632 }
633}
634
635pub struct Nl80211RequestStream {
637 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
638 is_terminated: bool,
639}
640
641impl std::marker::Unpin for Nl80211RequestStream {}
642
643impl futures::stream::FusedStream for Nl80211RequestStream {
644 fn is_terminated(&self) -> bool {
645 self.is_terminated
646 }
647}
648
649impl fidl::endpoints::RequestStream for Nl80211RequestStream {
650 type Protocol = Nl80211Marker;
651 type ControlHandle = Nl80211ControlHandle;
652
653 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
654 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
655 }
656
657 fn control_handle(&self) -> Self::ControlHandle {
658 Nl80211ControlHandle { inner: self.inner.clone() }
659 }
660
661 fn into_inner(
662 self,
663 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
664 {
665 (self.inner, self.is_terminated)
666 }
667
668 fn from_inner(
669 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
670 is_terminated: bool,
671 ) -> Self {
672 Self { inner, is_terminated }
673 }
674}
675
676impl futures::Stream for Nl80211RequestStream {
677 type Item = Result<Nl80211Request, fidl::Error>;
678
679 fn poll_next(
680 mut self: std::pin::Pin<&mut Self>,
681 cx: &mut std::task::Context<'_>,
682 ) -> std::task::Poll<Option<Self::Item>> {
683 let this = &mut *self;
684 if this.inner.check_shutdown(cx) {
685 this.is_terminated = true;
686 return std::task::Poll::Ready(None);
687 }
688 if this.is_terminated {
689 panic!("polled Nl80211RequestStream after completion");
690 }
691 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
692 |bytes, handles| {
693 match this.inner.channel().read_etc(cx, bytes, handles) {
694 std::task::Poll::Ready(Ok(())) => {}
695 std::task::Poll::Pending => return std::task::Poll::Pending,
696 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
697 this.is_terminated = true;
698 return std::task::Poll::Ready(None);
699 }
700 std::task::Poll::Ready(Err(e)) => {
701 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
702 e.into(),
703 ))));
704 }
705 }
706
707 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
709
710 std::task::Poll::Ready(Some(match header.ordinal {
711 0x58b73dd089681dc2 => {
712 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
713 let mut req = fidl::new_empty!(
714 Nl80211GetMulticastRequest,
715 fidl::encoding::DefaultFuchsiaResourceDialect
716 );
717 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211GetMulticastRequest>(&header, _body_bytes, handles, &mut req)?;
718 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
719 Ok(Nl80211Request::GetMulticast { payload: req, control_handle })
720 }
721 0x6336259e15bb3795 => {
722 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
723 let mut req = fidl::new_empty!(
724 Nl80211MessageRequest,
725 fidl::encoding::DefaultFuchsiaResourceDialect
726 );
727 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageRequest>(&header, _body_bytes, handles, &mut req)?;
728 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
729 Ok(Nl80211Request::Message {
730 payload: req,
731 responder: Nl80211MessageResponder {
732 control_handle: std::mem::ManuallyDrop::new(control_handle),
733 tx_id: header.tx_id,
734 },
735 })
736 }
737 0x4626796aba1e2987 => {
738 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
739 let mut req = fidl::new_empty!(
740 Nl80211MessageV2Request,
741 fidl::encoding::DefaultFuchsiaResourceDialect
742 );
743 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageV2Request>(&header, _body_bytes, handles, &mut req)?;
744 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
745 Ok(Nl80211Request::MessageV2 {
746 message: req.message,
747
748 responder: Nl80211MessageV2Responder {
749 control_handle: std::mem::ManuallyDrop::new(control_handle),
750 tx_id: header.tx_id,
751 },
752 })
753 }
754 _ if header.tx_id == 0
755 && header
756 .dynamic_flags()
757 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
758 {
759 Ok(Nl80211Request::_UnknownMethod {
760 ordinal: header.ordinal,
761 control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
762 method_type: fidl::MethodType::OneWay,
763 })
764 }
765 _ if header
766 .dynamic_flags()
767 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
768 {
769 this.inner.send_framework_err(
770 fidl::encoding::FrameworkErr::UnknownMethod,
771 header.tx_id,
772 header.ordinal,
773 header.dynamic_flags(),
774 (bytes, handles),
775 )?;
776 Ok(Nl80211Request::_UnknownMethod {
777 ordinal: header.ordinal,
778 control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
779 method_type: fidl::MethodType::TwoWay,
780 })
781 }
782 _ => Err(fidl::Error::UnknownOrdinal {
783 ordinal: header.ordinal,
784 protocol_name:
785 <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
786 }),
787 }))
788 },
789 )
790 }
791}
792
793#[derive(Debug)]
794pub enum Nl80211Request {
795 GetMulticast {
796 payload: Nl80211GetMulticastRequest,
797 control_handle: Nl80211ControlHandle,
798 },
799 Message {
800 payload: Nl80211MessageRequest,
801 responder: Nl80211MessageResponder,
802 },
803 MessageV2 {
804 message: Nl80211Message,
805 responder: Nl80211MessageV2Responder,
806 },
807 #[non_exhaustive]
809 _UnknownMethod {
810 ordinal: u64,
812 control_handle: Nl80211ControlHandle,
813 method_type: fidl::MethodType,
814 },
815}
816
817impl Nl80211Request {
818 #[allow(irrefutable_let_patterns)]
819 pub fn into_get_multicast(self) -> Option<(Nl80211GetMulticastRequest, Nl80211ControlHandle)> {
820 if let Nl80211Request::GetMulticast { payload, control_handle } = self {
821 Some((payload, control_handle))
822 } else {
823 None
824 }
825 }
826
827 #[allow(irrefutable_let_patterns)]
828 pub fn into_message(self) -> Option<(Nl80211MessageRequest, Nl80211MessageResponder)> {
829 if let Nl80211Request::Message { payload, responder } = self {
830 Some((payload, responder))
831 } else {
832 None
833 }
834 }
835
836 #[allow(irrefutable_let_patterns)]
837 pub fn into_message_v2(self) -> Option<(Nl80211Message, Nl80211MessageV2Responder)> {
838 if let Nl80211Request::MessageV2 { message, responder } = self {
839 Some((message, responder))
840 } else {
841 None
842 }
843 }
844
845 pub fn method_name(&self) -> &'static str {
847 match *self {
848 Nl80211Request::GetMulticast { .. } => "get_multicast",
849 Nl80211Request::Message { .. } => "message",
850 Nl80211Request::MessageV2 { .. } => "message_v2",
851 Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
852 "unknown one-way method"
853 }
854 Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
855 "unknown two-way method"
856 }
857 }
858 }
859}
860
861#[derive(Debug, Clone)]
862pub struct Nl80211ControlHandle {
863 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
864}
865
866impl fidl::endpoints::ControlHandle for Nl80211ControlHandle {
867 fn shutdown(&self) {
868 self.inner.shutdown()
869 }
870
871 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
872 self.inner.shutdown_with_epitaph(status)
873 }
874
875 fn is_closed(&self) -> bool {
876 self.inner.channel().is_closed()
877 }
878 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
879 self.inner.channel().on_closed()
880 }
881
882 #[cfg(target_os = "fuchsia")]
883 fn signal_peer(
884 &self,
885 clear_mask: zx::Signals,
886 set_mask: zx::Signals,
887 ) -> Result<(), zx_status::Status> {
888 use fidl::Peered;
889 self.inner.channel().signal_peer(clear_mask, set_mask)
890 }
891}
892
893impl Nl80211ControlHandle {}
894
895#[must_use = "FIDL methods require a response to be sent"]
896#[derive(Debug)]
897pub struct Nl80211MessageResponder {
898 control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
899 tx_id: u32,
900}
901
902impl std::ops::Drop for Nl80211MessageResponder {
906 fn drop(&mut self) {
907 self.control_handle.shutdown();
908 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
910 }
911}
912
913impl fidl::endpoints::Responder for Nl80211MessageResponder {
914 type ControlHandle = Nl80211ControlHandle;
915
916 fn control_handle(&self) -> &Nl80211ControlHandle {
917 &self.control_handle
918 }
919
920 fn drop_without_shutdown(mut self) {
921 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
923 std::mem::forget(self);
925 }
926}
927
928impl Nl80211MessageResponder {
929 pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
933 let _result = self.send_raw(result);
934 if _result.is_err() {
935 self.control_handle.shutdown();
936 }
937 self.drop_without_shutdown();
938 _result
939 }
940
941 pub fn send_no_shutdown_on_err(
943 self,
944 mut result: Result<Nl80211MessageResponse, i32>,
945 ) -> Result<(), fidl::Error> {
946 let _result = self.send_raw(result);
947 self.drop_without_shutdown();
948 _result
949 }
950
951 fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
952 self.control_handle
953 .inner
954 .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
955 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
956 self.tx_id,
957 0x6336259e15bb3795,
958 fidl::encoding::DynamicFlags::FLEXIBLE,
959 )
960 }
961}
962
963#[must_use = "FIDL methods require a response to be sent"]
964#[derive(Debug)]
965pub struct Nl80211MessageV2Responder {
966 control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
967 tx_id: u32,
968}
969
970impl std::ops::Drop for Nl80211MessageV2Responder {
974 fn drop(&mut self) {
975 self.control_handle.shutdown();
976 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
978 }
979}
980
981impl fidl::endpoints::Responder for Nl80211MessageV2Responder {
982 type ControlHandle = Nl80211ControlHandle;
983
984 fn control_handle(&self) -> &Nl80211ControlHandle {
985 &self.control_handle
986 }
987
988 fn drop_without_shutdown(mut self) {
989 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
991 std::mem::forget(self);
993 }
994}
995
996impl Nl80211MessageV2Responder {
997 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1001 let _result = self.send_raw(result);
1002 if _result.is_err() {
1003 self.control_handle.shutdown();
1004 }
1005 self.drop_without_shutdown();
1006 _result
1007 }
1008
1009 pub fn send_no_shutdown_on_err(
1011 self,
1012 mut result: Result<fidl::Vmo, i32>,
1013 ) -> Result<(), fidl::Error> {
1014 let _result = self.send_raw(result);
1015 self.drop_without_shutdown();
1016 _result
1017 }
1018
1019 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1020 self.control_handle
1021 .inner
1022 .send::<fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>>(
1023 fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1024 self.tx_id,
1025 0x4626796aba1e2987,
1026 fidl::encoding::DynamicFlags::FLEXIBLE,
1027 )
1028 }
1029}
1030
1031#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1032pub struct Nl80211MulticastMarker;
1033
1034impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
1035 type Proxy = Nl80211MulticastProxy;
1036 type RequestStream = Nl80211MulticastRequestStream;
1037 #[cfg(target_os = "fuchsia")]
1038 type SynchronousProxy = Nl80211MulticastSynchronousProxy;
1039
1040 const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
1041}
1042
1043pub trait Nl80211MulticastProxyInterface: Send + Sync {
1044 fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
1045}
1046#[derive(Debug)]
1047#[cfg(target_os = "fuchsia")]
1048pub struct Nl80211MulticastSynchronousProxy {
1049 client: fidl::client::sync::Client,
1050}
1051
1052#[cfg(target_os = "fuchsia")]
1053impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
1054 type Proxy = Nl80211MulticastProxy;
1055 type Protocol = Nl80211MulticastMarker;
1056
1057 fn from_channel(inner: fidl::Channel) -> Self {
1058 Self::new(inner)
1059 }
1060
1061 fn into_channel(self) -> fidl::Channel {
1062 self.client.into_channel()
1063 }
1064
1065 fn as_channel(&self) -> &fidl::Channel {
1066 self.client.as_channel()
1067 }
1068}
1069
1070#[cfg(target_os = "fuchsia")]
1071impl Nl80211MulticastSynchronousProxy {
1072 pub fn new(channel: fidl::Channel) -> Self {
1073 let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1074 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
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(self.client.wait_for_event(deadline)?)
1088 }
1089
1090 pub fn r#message(
1091 &self,
1092 mut payload: Nl80211MulticastMessageRequest,
1093 ) -> Result<(), fidl::Error> {
1094 self.client.send::<Nl80211MulticastMessageRequest>(
1095 &mut payload,
1096 0x4cc9241f302f16c0,
1097 fidl::encoding::DynamicFlags::FLEXIBLE,
1098 )
1099 }
1100}
1101
1102#[cfg(target_os = "fuchsia")]
1103impl From<Nl80211MulticastSynchronousProxy> for zx::NullableHandle {
1104 fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
1105 value.into_channel().into()
1106 }
1107}
1108
1109#[cfg(target_os = "fuchsia")]
1110impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
1111 fn from(value: fidl::Channel) -> Self {
1112 Self::new(value)
1113 }
1114}
1115
1116#[cfg(target_os = "fuchsia")]
1117impl fidl::endpoints::FromClient for Nl80211MulticastSynchronousProxy {
1118 type Protocol = Nl80211MulticastMarker;
1119
1120 fn from_client(value: fidl::endpoints::ClientEnd<Nl80211MulticastMarker>) -> Self {
1121 Self::new(value.into_channel())
1122 }
1123}
1124
1125#[derive(Debug, Clone)]
1126pub struct Nl80211MulticastProxy {
1127 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1128}
1129
1130impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
1131 type Protocol = Nl80211MulticastMarker;
1132
1133 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1134 Self::new(inner)
1135 }
1136
1137 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1138 self.client.into_channel().map_err(|client| Self { client })
1139 }
1140
1141 fn as_channel(&self) -> &::fidl::AsyncChannel {
1142 self.client.as_channel()
1143 }
1144}
1145
1146impl Nl80211MulticastProxy {
1147 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1149 let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1150 Self { client: fidl::client::Client::new(channel, protocol_name) }
1151 }
1152
1153 pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
1159 Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
1160 }
1161
1162 pub fn r#message(
1163 &self,
1164 mut payload: Nl80211MulticastMessageRequest,
1165 ) -> Result<(), fidl::Error> {
1166 Nl80211MulticastProxyInterface::r#message(self, payload)
1167 }
1168}
1169
1170impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
1171 fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
1172 self.client.send::<Nl80211MulticastMessageRequest>(
1173 &mut payload,
1174 0x4cc9241f302f16c0,
1175 fidl::encoding::DynamicFlags::FLEXIBLE,
1176 )
1177 }
1178}
1179
1180pub struct Nl80211MulticastEventStream {
1181 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1182}
1183
1184impl std::marker::Unpin for Nl80211MulticastEventStream {}
1185
1186impl futures::stream::FusedStream for Nl80211MulticastEventStream {
1187 fn is_terminated(&self) -> bool {
1188 self.event_receiver.is_terminated()
1189 }
1190}
1191
1192impl futures::Stream for Nl80211MulticastEventStream {
1193 type Item = Result<Nl80211MulticastEvent, fidl::Error>;
1194
1195 fn poll_next(
1196 mut self: std::pin::Pin<&mut Self>,
1197 cx: &mut std::task::Context<'_>,
1198 ) -> std::task::Poll<Option<Self::Item>> {
1199 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1200 &mut self.event_receiver,
1201 cx
1202 )?) {
1203 Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
1204 None => std::task::Poll::Ready(None),
1205 }
1206 }
1207}
1208
1209#[derive(Debug)]
1210pub enum Nl80211MulticastEvent {
1211 #[non_exhaustive]
1212 _UnknownEvent {
1213 ordinal: u64,
1215 },
1216}
1217
1218impl Nl80211MulticastEvent {
1219 fn decode(
1221 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1222 ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1223 let (bytes, _handles) = buf.split_mut();
1224 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1225 debug_assert_eq!(tx_header.tx_id, 0);
1226 match tx_header.ordinal {
1227 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1228 Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1229 }
1230 _ => Err(fidl::Error::UnknownOrdinal {
1231 ordinal: tx_header.ordinal,
1232 protocol_name:
1233 <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1234 }),
1235 }
1236 }
1237}
1238
1239pub struct Nl80211MulticastRequestStream {
1241 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1242 is_terminated: bool,
1243}
1244
1245impl std::marker::Unpin for Nl80211MulticastRequestStream {}
1246
1247impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
1248 fn is_terminated(&self) -> bool {
1249 self.is_terminated
1250 }
1251}
1252
1253impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
1254 type Protocol = Nl80211MulticastMarker;
1255 type ControlHandle = Nl80211MulticastControlHandle;
1256
1257 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1258 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1259 }
1260
1261 fn control_handle(&self) -> Self::ControlHandle {
1262 Nl80211MulticastControlHandle { inner: self.inner.clone() }
1263 }
1264
1265 fn into_inner(
1266 self,
1267 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1268 {
1269 (self.inner, self.is_terminated)
1270 }
1271
1272 fn from_inner(
1273 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1274 is_terminated: bool,
1275 ) -> Self {
1276 Self { inner, is_terminated }
1277 }
1278}
1279
1280impl futures::Stream for Nl80211MulticastRequestStream {
1281 type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1282
1283 fn poll_next(
1284 mut self: std::pin::Pin<&mut Self>,
1285 cx: &mut std::task::Context<'_>,
1286 ) -> std::task::Poll<Option<Self::Item>> {
1287 let this = &mut *self;
1288 if this.inner.check_shutdown(cx) {
1289 this.is_terminated = true;
1290 return std::task::Poll::Ready(None);
1291 }
1292 if this.is_terminated {
1293 panic!("polled Nl80211MulticastRequestStream after completion");
1294 }
1295 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1296 |bytes, handles| {
1297 match this.inner.channel().read_etc(cx, bytes, handles) {
1298 std::task::Poll::Ready(Ok(())) => {}
1299 std::task::Poll::Pending => return std::task::Poll::Pending,
1300 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1301 this.is_terminated = true;
1302 return std::task::Poll::Ready(None);
1303 }
1304 std::task::Poll::Ready(Err(e)) => {
1305 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1306 e.into(),
1307 ))));
1308 }
1309 }
1310
1311 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1313
1314 std::task::Poll::Ready(Some(match header.ordinal {
1315 0x4cc9241f302f16c0 => {
1316 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1317 let mut req = fidl::new_empty!(
1318 Nl80211MulticastMessageRequest,
1319 fidl::encoding::DefaultFuchsiaResourceDialect
1320 );
1321 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1322 let control_handle =
1323 Nl80211MulticastControlHandle { inner: this.inner.clone() };
1324 Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1325 }
1326 _ if header.tx_id == 0
1327 && header
1328 .dynamic_flags()
1329 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1330 {
1331 Ok(Nl80211MulticastRequest::_UnknownMethod {
1332 ordinal: header.ordinal,
1333 control_handle: Nl80211MulticastControlHandle {
1334 inner: this.inner.clone(),
1335 },
1336 method_type: fidl::MethodType::OneWay,
1337 })
1338 }
1339 _ if header
1340 .dynamic_flags()
1341 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1342 {
1343 this.inner.send_framework_err(
1344 fidl::encoding::FrameworkErr::UnknownMethod,
1345 header.tx_id,
1346 header.ordinal,
1347 header.dynamic_flags(),
1348 (bytes, handles),
1349 )?;
1350 Ok(Nl80211MulticastRequest::_UnknownMethod {
1351 ordinal: header.ordinal,
1352 control_handle: Nl80211MulticastControlHandle {
1353 inner: this.inner.clone(),
1354 },
1355 method_type: fidl::MethodType::TwoWay,
1356 })
1357 }
1358 _ => Err(fidl::Error::UnknownOrdinal {
1359 ordinal: header.ordinal,
1360 protocol_name:
1361 <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1362 }),
1363 }))
1364 },
1365 )
1366 }
1367}
1368
1369#[derive(Debug)]
1370pub enum Nl80211MulticastRequest {
1371 Message {
1372 payload: Nl80211MulticastMessageRequest,
1373 control_handle: Nl80211MulticastControlHandle,
1374 },
1375 #[non_exhaustive]
1377 _UnknownMethod {
1378 ordinal: u64,
1380 control_handle: Nl80211MulticastControlHandle,
1381 method_type: fidl::MethodType,
1382 },
1383}
1384
1385impl Nl80211MulticastRequest {
1386 #[allow(irrefutable_let_patterns)]
1387 pub fn into_message(
1388 self,
1389 ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1390 if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1391 Some((payload, control_handle))
1392 } else {
1393 None
1394 }
1395 }
1396
1397 pub fn method_name(&self) -> &'static str {
1399 match *self {
1400 Nl80211MulticastRequest::Message { .. } => "message",
1401 Nl80211MulticastRequest::_UnknownMethod {
1402 method_type: fidl::MethodType::OneWay,
1403 ..
1404 } => "unknown one-way method",
1405 Nl80211MulticastRequest::_UnknownMethod {
1406 method_type: fidl::MethodType::TwoWay,
1407 ..
1408 } => "unknown two-way method",
1409 }
1410 }
1411}
1412
1413#[derive(Debug, Clone)]
1414pub struct Nl80211MulticastControlHandle {
1415 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1416}
1417
1418impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1419 fn shutdown(&self) {
1420 self.inner.shutdown()
1421 }
1422
1423 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1424 self.inner.shutdown_with_epitaph(status)
1425 }
1426
1427 fn is_closed(&self) -> bool {
1428 self.inner.channel().is_closed()
1429 }
1430 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1431 self.inner.channel().on_closed()
1432 }
1433
1434 #[cfg(target_os = "fuchsia")]
1435 fn signal_peer(
1436 &self,
1437 clear_mask: zx::Signals,
1438 set_mask: zx::Signals,
1439 ) -> Result<(), zx_status::Status> {
1440 use fidl::Peered;
1441 self.inner.channel().signal_peer(clear_mask, set_mask)
1442 }
1443}
1444
1445impl Nl80211MulticastControlHandle {}
1446
1447#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1448pub struct SupplicantMarker;
1449
1450impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1451 type Proxy = SupplicantProxy;
1452 type RequestStream = SupplicantRequestStream;
1453 #[cfg(target_os = "fuchsia")]
1454 type SynchronousProxy = SupplicantSynchronousProxy;
1455
1456 const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1457}
1458
1459pub trait SupplicantProxyInterface: Send + Sync {
1460 fn r#add_sta_interface(
1461 &self,
1462 payload: SupplicantAddStaInterfaceRequest,
1463 ) -> Result<(), fidl::Error>;
1464 fn r#remove_interface(
1465 &self,
1466 payload: SupplicantRemoveInterfaceRequest,
1467 ) -> Result<(), fidl::Error>;
1468}
1469#[derive(Debug)]
1470#[cfg(target_os = "fuchsia")]
1471pub struct SupplicantSynchronousProxy {
1472 client: fidl::client::sync::Client,
1473}
1474
1475#[cfg(target_os = "fuchsia")]
1476impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1477 type Proxy = SupplicantProxy;
1478 type Protocol = SupplicantMarker;
1479
1480 fn from_channel(inner: fidl::Channel) -> Self {
1481 Self::new(inner)
1482 }
1483
1484 fn into_channel(self) -> fidl::Channel {
1485 self.client.into_channel()
1486 }
1487
1488 fn as_channel(&self) -> &fidl::Channel {
1489 self.client.as_channel()
1490 }
1491}
1492
1493#[cfg(target_os = "fuchsia")]
1494impl SupplicantSynchronousProxy {
1495 pub fn new(channel: fidl::Channel) -> Self {
1496 let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1497 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1498 }
1499
1500 pub fn into_channel(self) -> fidl::Channel {
1501 self.client.into_channel()
1502 }
1503
1504 pub fn wait_for_event(
1507 &self,
1508 deadline: zx::MonotonicInstant,
1509 ) -> Result<SupplicantEvent, fidl::Error> {
1510 SupplicantEvent::decode(self.client.wait_for_event(deadline)?)
1511 }
1512
1513 pub fn r#add_sta_interface(
1514 &self,
1515 mut payload: SupplicantAddStaInterfaceRequest,
1516 ) -> Result<(), fidl::Error> {
1517 self.client.send::<SupplicantAddStaInterfaceRequest>(
1518 &mut payload,
1519 0x73194b2afe9b367e,
1520 fidl::encoding::DynamicFlags::FLEXIBLE,
1521 )
1522 }
1523
1524 pub fn r#remove_interface(
1525 &self,
1526 mut payload: SupplicantRemoveInterfaceRequest,
1527 ) -> Result<(), fidl::Error> {
1528 self.client.send::<SupplicantRemoveInterfaceRequest>(
1529 &mut payload,
1530 0x7f83e5b75b27d242,
1531 fidl::encoding::DynamicFlags::FLEXIBLE,
1532 )
1533 }
1534}
1535
1536#[cfg(target_os = "fuchsia")]
1537impl From<SupplicantSynchronousProxy> for zx::NullableHandle {
1538 fn from(value: SupplicantSynchronousProxy) -> Self {
1539 value.into_channel().into()
1540 }
1541}
1542
1543#[cfg(target_os = "fuchsia")]
1544impl From<fidl::Channel> for SupplicantSynchronousProxy {
1545 fn from(value: fidl::Channel) -> Self {
1546 Self::new(value)
1547 }
1548}
1549
1550#[cfg(target_os = "fuchsia")]
1551impl fidl::endpoints::FromClient for SupplicantSynchronousProxy {
1552 type Protocol = SupplicantMarker;
1553
1554 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantMarker>) -> Self {
1555 Self::new(value.into_channel())
1556 }
1557}
1558
1559#[derive(Debug, Clone)]
1560pub struct SupplicantProxy {
1561 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1562}
1563
1564impl fidl::endpoints::Proxy for SupplicantProxy {
1565 type Protocol = SupplicantMarker;
1566
1567 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1568 Self::new(inner)
1569 }
1570
1571 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1572 self.client.into_channel().map_err(|client| Self { client })
1573 }
1574
1575 fn as_channel(&self) -> &::fidl::AsyncChannel {
1576 self.client.as_channel()
1577 }
1578}
1579
1580impl SupplicantProxy {
1581 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1583 let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1584 Self { client: fidl::client::Client::new(channel, protocol_name) }
1585 }
1586
1587 pub fn take_event_stream(&self) -> SupplicantEventStream {
1593 SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1594 }
1595
1596 pub fn r#add_sta_interface(
1597 &self,
1598 mut payload: SupplicantAddStaInterfaceRequest,
1599 ) -> Result<(), fidl::Error> {
1600 SupplicantProxyInterface::r#add_sta_interface(self, payload)
1601 }
1602
1603 pub fn r#remove_interface(
1604 &self,
1605 mut payload: SupplicantRemoveInterfaceRequest,
1606 ) -> Result<(), fidl::Error> {
1607 SupplicantProxyInterface::r#remove_interface(self, payload)
1608 }
1609}
1610
1611impl SupplicantProxyInterface for SupplicantProxy {
1612 fn r#add_sta_interface(
1613 &self,
1614 mut payload: SupplicantAddStaInterfaceRequest,
1615 ) -> Result<(), fidl::Error> {
1616 self.client.send::<SupplicantAddStaInterfaceRequest>(
1617 &mut payload,
1618 0x73194b2afe9b367e,
1619 fidl::encoding::DynamicFlags::FLEXIBLE,
1620 )
1621 }
1622
1623 fn r#remove_interface(
1624 &self,
1625 mut payload: SupplicantRemoveInterfaceRequest,
1626 ) -> Result<(), fidl::Error> {
1627 self.client.send::<SupplicantRemoveInterfaceRequest>(
1628 &mut payload,
1629 0x7f83e5b75b27d242,
1630 fidl::encoding::DynamicFlags::FLEXIBLE,
1631 )
1632 }
1633}
1634
1635pub struct SupplicantEventStream {
1636 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1637}
1638
1639impl std::marker::Unpin for SupplicantEventStream {}
1640
1641impl futures::stream::FusedStream for SupplicantEventStream {
1642 fn is_terminated(&self) -> bool {
1643 self.event_receiver.is_terminated()
1644 }
1645}
1646
1647impl futures::Stream for SupplicantEventStream {
1648 type Item = Result<SupplicantEvent, fidl::Error>;
1649
1650 fn poll_next(
1651 mut self: std::pin::Pin<&mut Self>,
1652 cx: &mut std::task::Context<'_>,
1653 ) -> std::task::Poll<Option<Self::Item>> {
1654 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1655 &mut self.event_receiver,
1656 cx
1657 )?) {
1658 Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1659 None => std::task::Poll::Ready(None),
1660 }
1661 }
1662}
1663
1664#[derive(Debug)]
1665pub enum SupplicantEvent {
1666 #[non_exhaustive]
1667 _UnknownEvent {
1668 ordinal: u64,
1670 },
1671}
1672
1673impl SupplicantEvent {
1674 fn decode(
1676 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1677 ) -> Result<SupplicantEvent, fidl::Error> {
1678 let (bytes, _handles) = buf.split_mut();
1679 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1680 debug_assert_eq!(tx_header.tx_id, 0);
1681 match tx_header.ordinal {
1682 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1683 Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1684 }
1685 _ => Err(fidl::Error::UnknownOrdinal {
1686 ordinal: tx_header.ordinal,
1687 protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1688 }),
1689 }
1690 }
1691}
1692
1693pub struct SupplicantRequestStream {
1695 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1696 is_terminated: bool,
1697}
1698
1699impl std::marker::Unpin for SupplicantRequestStream {}
1700
1701impl futures::stream::FusedStream for SupplicantRequestStream {
1702 fn is_terminated(&self) -> bool {
1703 self.is_terminated
1704 }
1705}
1706
1707impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1708 type Protocol = SupplicantMarker;
1709 type ControlHandle = SupplicantControlHandle;
1710
1711 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1712 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1713 }
1714
1715 fn control_handle(&self) -> Self::ControlHandle {
1716 SupplicantControlHandle { inner: self.inner.clone() }
1717 }
1718
1719 fn into_inner(
1720 self,
1721 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1722 {
1723 (self.inner, self.is_terminated)
1724 }
1725
1726 fn from_inner(
1727 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1728 is_terminated: bool,
1729 ) -> Self {
1730 Self { inner, is_terminated }
1731 }
1732}
1733
1734impl futures::Stream for SupplicantRequestStream {
1735 type Item = Result<SupplicantRequest, fidl::Error>;
1736
1737 fn poll_next(
1738 mut self: std::pin::Pin<&mut Self>,
1739 cx: &mut std::task::Context<'_>,
1740 ) -> std::task::Poll<Option<Self::Item>> {
1741 let this = &mut *self;
1742 if this.inner.check_shutdown(cx) {
1743 this.is_terminated = true;
1744 return std::task::Poll::Ready(None);
1745 }
1746 if this.is_terminated {
1747 panic!("polled SupplicantRequestStream after completion");
1748 }
1749 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1750 |bytes, handles| {
1751 match this.inner.channel().read_etc(cx, bytes, handles) {
1752 std::task::Poll::Ready(Ok(())) => {}
1753 std::task::Poll::Pending => return std::task::Poll::Pending,
1754 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1755 this.is_terminated = true;
1756 return std::task::Poll::Ready(None);
1757 }
1758 std::task::Poll::Ready(Err(e)) => {
1759 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1760 e.into(),
1761 ))));
1762 }
1763 }
1764
1765 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1767
1768 std::task::Poll::Ready(Some(match header.ordinal {
1769 0x73194b2afe9b367e => {
1770 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1771 let mut req = fidl::new_empty!(
1772 SupplicantAddStaInterfaceRequest,
1773 fidl::encoding::DefaultFuchsiaResourceDialect
1774 );
1775 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1776 let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1777 Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1778 }
1779 0x7f83e5b75b27d242 => {
1780 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1781 let mut req = fidl::new_empty!(
1782 SupplicantRemoveInterfaceRequest,
1783 fidl::encoding::DefaultFuchsiaResourceDialect
1784 );
1785 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantRemoveInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1786 let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1787 Ok(SupplicantRequest::RemoveInterface { payload: req, control_handle })
1788 }
1789 _ if header.tx_id == 0
1790 && header
1791 .dynamic_flags()
1792 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1793 {
1794 Ok(SupplicantRequest::_UnknownMethod {
1795 ordinal: header.ordinal,
1796 control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1797 method_type: fidl::MethodType::OneWay,
1798 })
1799 }
1800 _ if header
1801 .dynamic_flags()
1802 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1803 {
1804 this.inner.send_framework_err(
1805 fidl::encoding::FrameworkErr::UnknownMethod,
1806 header.tx_id,
1807 header.ordinal,
1808 header.dynamic_flags(),
1809 (bytes, handles),
1810 )?;
1811 Ok(SupplicantRequest::_UnknownMethod {
1812 ordinal: header.ordinal,
1813 control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1814 method_type: fidl::MethodType::TwoWay,
1815 })
1816 }
1817 _ => Err(fidl::Error::UnknownOrdinal {
1818 ordinal: header.ordinal,
1819 protocol_name:
1820 <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1821 }),
1822 }))
1823 },
1824 )
1825 }
1826}
1827
1828#[derive(Debug)]
1829pub enum SupplicantRequest {
1830 AddStaInterface {
1831 payload: SupplicantAddStaInterfaceRequest,
1832 control_handle: SupplicantControlHandle,
1833 },
1834 RemoveInterface {
1835 payload: SupplicantRemoveInterfaceRequest,
1836 control_handle: SupplicantControlHandle,
1837 },
1838 #[non_exhaustive]
1840 _UnknownMethod {
1841 ordinal: u64,
1843 control_handle: SupplicantControlHandle,
1844 method_type: fidl::MethodType,
1845 },
1846}
1847
1848impl SupplicantRequest {
1849 #[allow(irrefutable_let_patterns)]
1850 pub fn into_add_sta_interface(
1851 self,
1852 ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1853 if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1854 Some((payload, control_handle))
1855 } else {
1856 None
1857 }
1858 }
1859
1860 #[allow(irrefutable_let_patterns)]
1861 pub fn into_remove_interface(
1862 self,
1863 ) -> Option<(SupplicantRemoveInterfaceRequest, SupplicantControlHandle)> {
1864 if let SupplicantRequest::RemoveInterface { payload, control_handle } = self {
1865 Some((payload, control_handle))
1866 } else {
1867 None
1868 }
1869 }
1870
1871 pub fn method_name(&self) -> &'static str {
1873 match *self {
1874 SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1875 SupplicantRequest::RemoveInterface { .. } => "remove_interface",
1876 SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1877 "unknown one-way method"
1878 }
1879 SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1880 "unknown two-way method"
1881 }
1882 }
1883 }
1884}
1885
1886#[derive(Debug, Clone)]
1887pub struct SupplicantControlHandle {
1888 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1889}
1890
1891impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1892 fn shutdown(&self) {
1893 self.inner.shutdown()
1894 }
1895
1896 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1897 self.inner.shutdown_with_epitaph(status)
1898 }
1899
1900 fn is_closed(&self) -> bool {
1901 self.inner.channel().is_closed()
1902 }
1903 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1904 self.inner.channel().on_closed()
1905 }
1906
1907 #[cfg(target_os = "fuchsia")]
1908 fn signal_peer(
1909 &self,
1910 clear_mask: zx::Signals,
1911 set_mask: zx::Signals,
1912 ) -> Result<(), zx_status::Status> {
1913 use fidl::Peered;
1914 self.inner.channel().signal_peer(clear_mask, set_mask)
1915 }
1916}
1917
1918impl SupplicantControlHandle {}
1919
1920#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1921pub struct SupplicantStaIfaceMarker;
1922
1923impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1924 type Proxy = SupplicantStaIfaceProxy;
1925 type RequestStream = SupplicantStaIfaceRequestStream;
1926 #[cfg(target_os = "fuchsia")]
1927 type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1928
1929 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1930}
1931pub type SupplicantStaIfaceGetMacAddressResult =
1932 Result<SupplicantStaIfaceGetMacAddressResponse, i32>;
1933pub type SupplicantStaIfaceGetFactoryMacAddressResult = Result<[u8; 6], i32>;
1934pub type SupplicantStaIfaceSetBtCoexistenceModeResult = Result<(), WlanixError>;
1935pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1936
1937pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1938 fn r#register_callback(
1939 &self,
1940 payload: SupplicantStaIfaceRegisterCallbackRequest,
1941 ) -> Result<(), fidl::Error>;
1942 fn r#add_network(
1943 &self,
1944 payload: SupplicantStaIfaceAddNetworkRequest,
1945 ) -> Result<(), fidl::Error>;
1946 type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1947 fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1948 type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1949 + Send;
1950 fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1951 type GetFactoryMacAddressResponseFut: std::future::Future<
1952 Output = Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error>,
1953 > + Send;
1954 fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut;
1955 type SetBtCoexistenceModeResponseFut: std::future::Future<
1956 Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1957 > + Send;
1958 fn r#set_bt_coexistence_mode(
1959 &self,
1960 payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1961 ) -> Self::SetBtCoexistenceModeResponseFut;
1962 type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1963 fn r#set_power_save(
1964 &self,
1965 payload: SupplicantStaIfaceSetPowerSaveRequest,
1966 ) -> Self::SetPowerSaveResponseFut;
1967 type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1968 + Send;
1969 fn r#set_suspend_mode_enabled(
1970 &self,
1971 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1972 ) -> Self::SetSuspendModeEnabledResponseFut;
1973 type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1974 + Send;
1975 fn r#set_sta_country_code(
1976 &self,
1977 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1978 ) -> Self::SetStaCountryCodeResponseFut;
1979}
1980#[derive(Debug)]
1981#[cfg(target_os = "fuchsia")]
1982pub struct SupplicantStaIfaceSynchronousProxy {
1983 client: fidl::client::sync::Client,
1984}
1985
1986#[cfg(target_os = "fuchsia")]
1987impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1988 type Proxy = SupplicantStaIfaceProxy;
1989 type Protocol = SupplicantStaIfaceMarker;
1990
1991 fn from_channel(inner: fidl::Channel) -> Self {
1992 Self::new(inner)
1993 }
1994
1995 fn into_channel(self) -> fidl::Channel {
1996 self.client.into_channel()
1997 }
1998
1999 fn as_channel(&self) -> &fidl::Channel {
2000 self.client.as_channel()
2001 }
2002}
2003
2004#[cfg(target_os = "fuchsia")]
2005impl SupplicantStaIfaceSynchronousProxy {
2006 pub fn new(channel: fidl::Channel) -> Self {
2007 let protocol_name =
2008 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2009 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2010 }
2011
2012 pub fn into_channel(self) -> fidl::Channel {
2013 self.client.into_channel()
2014 }
2015
2016 pub fn wait_for_event(
2019 &self,
2020 deadline: zx::MonotonicInstant,
2021 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2022 SupplicantStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
2023 }
2024
2025 pub fn r#register_callback(
2026 &self,
2027 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2028 ) -> Result<(), fidl::Error> {
2029 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2030 &mut payload,
2031 0x1be680e863a8e71,
2032 fidl::encoding::DynamicFlags::FLEXIBLE,
2033 )
2034 }
2035
2036 pub fn r#add_network(
2037 &self,
2038 mut payload: SupplicantStaIfaceAddNetworkRequest,
2039 ) -> Result<(), fidl::Error> {
2040 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2041 &mut payload,
2042 0xa77cf60628766dc,
2043 fidl::encoding::DynamicFlags::FLEXIBLE,
2044 )
2045 }
2046
2047 pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2048 let _response = self.client.send_query::<
2049 fidl::encoding::EmptyPayload,
2050 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2051 >(
2052 (),
2053 0x52a1d38e0b4871fa,
2054 fidl::encoding::DynamicFlags::FLEXIBLE,
2055 ___deadline,
2056 )?
2057 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2058 Ok(_response)
2059 }
2060
2061 pub fn r#get_mac_address(
2062 &self,
2063 ___deadline: zx::MonotonicInstant,
2064 ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2065 let _response = self.client.send_query::<
2066 fidl::encoding::EmptyPayload,
2067 fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2068 >(
2069 (),
2070 0x60591d204a3f537f,
2071 fidl::encoding::DynamicFlags::FLEXIBLE,
2072 ___deadline,
2073 )?
2074 .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2075 Ok(_response.map(|x| x))
2076 }
2077
2078 pub fn r#get_factory_mac_address(
2079 &self,
2080 ___deadline: zx::MonotonicInstant,
2081 ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2082 let _response =
2083 self.client
2084 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2085 SupplicantStaIfaceGetFactoryMacAddressResponse,
2086 i32,
2087 >>(
2088 (), 0x58857179ad71e624, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
2089 )?
2090 .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2091 Ok(_response.map(|x| x.mac_addr))
2092 }
2093
2094 pub fn r#set_bt_coexistence_mode(
2095 &self,
2096 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2097 ___deadline: zx::MonotonicInstant,
2098 ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2099 let _response = self.client.send_query::<
2100 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2101 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2102 >(
2103 payload,
2104 0x14567ff593a9b154,
2105 fidl::encoding::DynamicFlags::FLEXIBLE,
2106 ___deadline,
2107 )?
2108 .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2109 Ok(_response.map(|x| x))
2110 }
2111
2112 pub fn r#set_power_save(
2113 &self,
2114 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2115 ___deadline: zx::MonotonicInstant,
2116 ) -> Result<(), fidl::Error> {
2117 let _response = self.client.send_query::<
2118 SupplicantStaIfaceSetPowerSaveRequest,
2119 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2120 >(
2121 &mut payload,
2122 0x5a04c29320085298,
2123 fidl::encoding::DynamicFlags::FLEXIBLE,
2124 ___deadline,
2125 )?
2126 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2127 Ok(_response)
2128 }
2129
2130 pub fn r#set_suspend_mode_enabled(
2131 &self,
2132 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2133 ___deadline: zx::MonotonicInstant,
2134 ) -> Result<(), fidl::Error> {
2135 let _response = self.client.send_query::<
2136 SupplicantStaIfaceSetSuspendModeEnabledRequest,
2137 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2138 >(
2139 &mut payload,
2140 0xaf10de85bb7023a,
2141 fidl::encoding::DynamicFlags::FLEXIBLE,
2142 ___deadline,
2143 )?
2144 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2145 Ok(_response)
2146 }
2147
2148 pub fn r#set_sta_country_code(
2149 &self,
2150 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2151 ___deadline: zx::MonotonicInstant,
2152 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2153 let _response = self.client.send_query::<
2154 SupplicantStaIfaceSetStaCountryCodeRequest,
2155 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2156 >(
2157 &mut payload,
2158 0x977e22f9b79b26e,
2159 fidl::encoding::DynamicFlags::FLEXIBLE,
2160 ___deadline,
2161 )?
2162 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2163 Ok(_response.map(|x| x))
2164 }
2165}
2166
2167#[cfg(target_os = "fuchsia")]
2168impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2169 fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2170 value.into_channel().into()
2171 }
2172}
2173
2174#[cfg(target_os = "fuchsia")]
2175impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2176 fn from(value: fidl::Channel) -> Self {
2177 Self::new(value)
2178 }
2179}
2180
2181#[cfg(target_os = "fuchsia")]
2182impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2183 type Protocol = SupplicantStaIfaceMarker;
2184
2185 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2186 Self::new(value.into_channel())
2187 }
2188}
2189
2190#[derive(Debug, Clone)]
2191pub struct SupplicantStaIfaceProxy {
2192 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2193}
2194
2195impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2196 type Protocol = SupplicantStaIfaceMarker;
2197
2198 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2199 Self::new(inner)
2200 }
2201
2202 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2203 self.client.into_channel().map_err(|client| Self { client })
2204 }
2205
2206 fn as_channel(&self) -> &::fidl::AsyncChannel {
2207 self.client.as_channel()
2208 }
2209}
2210
2211impl SupplicantStaIfaceProxy {
2212 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2214 let protocol_name =
2215 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2216 Self { client: fidl::client::Client::new(channel, protocol_name) }
2217 }
2218
2219 pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2225 SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2226 }
2227
2228 pub fn r#register_callback(
2229 &self,
2230 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2231 ) -> Result<(), fidl::Error> {
2232 SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2233 }
2234
2235 pub fn r#add_network(
2236 &self,
2237 mut payload: SupplicantStaIfaceAddNetworkRequest,
2238 ) -> Result<(), fidl::Error> {
2239 SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2240 }
2241
2242 pub fn r#disconnect(
2243 &self,
2244 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2245 SupplicantStaIfaceProxyInterface::r#disconnect(self)
2246 }
2247
2248 pub fn r#get_mac_address(
2249 &self,
2250 ) -> fidl::client::QueryResponseFut<
2251 SupplicantStaIfaceGetMacAddressResult,
2252 fidl::encoding::DefaultFuchsiaResourceDialect,
2253 > {
2254 SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2255 }
2256
2257 pub fn r#get_factory_mac_address(
2258 &self,
2259 ) -> fidl::client::QueryResponseFut<
2260 SupplicantStaIfaceGetFactoryMacAddressResult,
2261 fidl::encoding::DefaultFuchsiaResourceDialect,
2262 > {
2263 SupplicantStaIfaceProxyInterface::r#get_factory_mac_address(self)
2264 }
2265
2266 pub fn r#set_bt_coexistence_mode(
2267 &self,
2268 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2269 ) -> fidl::client::QueryResponseFut<
2270 SupplicantStaIfaceSetBtCoexistenceModeResult,
2271 fidl::encoding::DefaultFuchsiaResourceDialect,
2272 > {
2273 SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2274 }
2275
2276 pub fn r#set_power_save(
2277 &self,
2278 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2279 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2280 SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2281 }
2282
2283 pub fn r#set_suspend_mode_enabled(
2284 &self,
2285 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2286 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2287 SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2288 }
2289
2290 pub fn r#set_sta_country_code(
2291 &self,
2292 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2293 ) -> fidl::client::QueryResponseFut<
2294 SupplicantStaIfaceSetStaCountryCodeResult,
2295 fidl::encoding::DefaultFuchsiaResourceDialect,
2296 > {
2297 SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2298 }
2299}
2300
2301impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2302 fn r#register_callback(
2303 &self,
2304 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2305 ) -> Result<(), fidl::Error> {
2306 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2307 &mut payload,
2308 0x1be680e863a8e71,
2309 fidl::encoding::DynamicFlags::FLEXIBLE,
2310 )
2311 }
2312
2313 fn r#add_network(
2314 &self,
2315 mut payload: SupplicantStaIfaceAddNetworkRequest,
2316 ) -> Result<(), fidl::Error> {
2317 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2318 &mut payload,
2319 0xa77cf60628766dc,
2320 fidl::encoding::DynamicFlags::FLEXIBLE,
2321 )
2322 }
2323
2324 type DisconnectResponseFut =
2325 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2326 fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2327 fn _decode(
2328 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2329 ) -> Result<(), fidl::Error> {
2330 let _response = fidl::client::decode_transaction_body::<
2331 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2332 fidl::encoding::DefaultFuchsiaResourceDialect,
2333 0x52a1d38e0b4871fa,
2334 >(_buf?)?
2335 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2336 Ok(_response)
2337 }
2338 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2339 (),
2340 0x52a1d38e0b4871fa,
2341 fidl::encoding::DynamicFlags::FLEXIBLE,
2342 _decode,
2343 )
2344 }
2345
2346 type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2347 SupplicantStaIfaceGetMacAddressResult,
2348 fidl::encoding::DefaultFuchsiaResourceDialect,
2349 >;
2350 fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2351 fn _decode(
2352 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2353 ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2354 let _response = fidl::client::decode_transaction_body::<
2355 fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2356 fidl::encoding::DefaultFuchsiaResourceDialect,
2357 0x60591d204a3f537f,
2358 >(_buf?)?
2359 .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2360 Ok(_response.map(|x| x))
2361 }
2362 self.client.send_query_and_decode::<
2363 fidl::encoding::EmptyPayload,
2364 SupplicantStaIfaceGetMacAddressResult,
2365 >(
2366 (),
2367 0x60591d204a3f537f,
2368 fidl::encoding::DynamicFlags::FLEXIBLE,
2369 _decode,
2370 )
2371 }
2372
2373 type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
2374 SupplicantStaIfaceGetFactoryMacAddressResult,
2375 fidl::encoding::DefaultFuchsiaResourceDialect,
2376 >;
2377 fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
2378 fn _decode(
2379 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2380 ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2381 let _response = fidl::client::decode_transaction_body::<
2382 fidl::encoding::FlexibleResultType<
2383 SupplicantStaIfaceGetFactoryMacAddressResponse,
2384 i32,
2385 >,
2386 fidl::encoding::DefaultFuchsiaResourceDialect,
2387 0x58857179ad71e624,
2388 >(_buf?)?
2389 .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2390 Ok(_response.map(|x| x.mac_addr))
2391 }
2392 self.client.send_query_and_decode::<
2393 fidl::encoding::EmptyPayload,
2394 SupplicantStaIfaceGetFactoryMacAddressResult,
2395 >(
2396 (),
2397 0x58857179ad71e624,
2398 fidl::encoding::DynamicFlags::FLEXIBLE,
2399 _decode,
2400 )
2401 }
2402
2403 type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2404 SupplicantStaIfaceSetBtCoexistenceModeResult,
2405 fidl::encoding::DefaultFuchsiaResourceDialect,
2406 >;
2407 fn r#set_bt_coexistence_mode(
2408 &self,
2409 mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2410 ) -> Self::SetBtCoexistenceModeResponseFut {
2411 fn _decode(
2412 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2413 ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2414 let _response = fidl::client::decode_transaction_body::<
2415 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2416 fidl::encoding::DefaultFuchsiaResourceDialect,
2417 0x14567ff593a9b154,
2418 >(_buf?)?
2419 .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2420 Ok(_response.map(|x| x))
2421 }
2422 self.client.send_query_and_decode::<
2423 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2424 SupplicantStaIfaceSetBtCoexistenceModeResult,
2425 >(
2426 payload,
2427 0x14567ff593a9b154,
2428 fidl::encoding::DynamicFlags::FLEXIBLE,
2429 _decode,
2430 )
2431 }
2432
2433 type SetPowerSaveResponseFut =
2434 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2435 fn r#set_power_save(
2436 &self,
2437 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2438 ) -> Self::SetPowerSaveResponseFut {
2439 fn _decode(
2440 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2441 ) -> Result<(), fidl::Error> {
2442 let _response = fidl::client::decode_transaction_body::<
2443 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2444 fidl::encoding::DefaultFuchsiaResourceDialect,
2445 0x5a04c29320085298,
2446 >(_buf?)?
2447 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2448 Ok(_response)
2449 }
2450 self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2451 &mut payload,
2452 0x5a04c29320085298,
2453 fidl::encoding::DynamicFlags::FLEXIBLE,
2454 _decode,
2455 )
2456 }
2457
2458 type SetSuspendModeEnabledResponseFut =
2459 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2460 fn r#set_suspend_mode_enabled(
2461 &self,
2462 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2463 ) -> Self::SetSuspendModeEnabledResponseFut {
2464 fn _decode(
2465 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2466 ) -> Result<(), fidl::Error> {
2467 let _response = fidl::client::decode_transaction_body::<
2468 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2469 fidl::encoding::DefaultFuchsiaResourceDialect,
2470 0xaf10de85bb7023a,
2471 >(_buf?)?
2472 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2473 Ok(_response)
2474 }
2475 self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2476 &mut payload,
2477 0xaf10de85bb7023a,
2478 fidl::encoding::DynamicFlags::FLEXIBLE,
2479 _decode,
2480 )
2481 }
2482
2483 type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2484 SupplicantStaIfaceSetStaCountryCodeResult,
2485 fidl::encoding::DefaultFuchsiaResourceDialect,
2486 >;
2487 fn r#set_sta_country_code(
2488 &self,
2489 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2490 ) -> Self::SetStaCountryCodeResponseFut {
2491 fn _decode(
2492 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2493 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2494 let _response = fidl::client::decode_transaction_body::<
2495 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2496 fidl::encoding::DefaultFuchsiaResourceDialect,
2497 0x977e22f9b79b26e,
2498 >(_buf?)?
2499 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2500 Ok(_response.map(|x| x))
2501 }
2502 self.client.send_query_and_decode::<
2503 SupplicantStaIfaceSetStaCountryCodeRequest,
2504 SupplicantStaIfaceSetStaCountryCodeResult,
2505 >(
2506 &mut payload,
2507 0x977e22f9b79b26e,
2508 fidl::encoding::DynamicFlags::FLEXIBLE,
2509 _decode,
2510 )
2511 }
2512}
2513
2514pub struct SupplicantStaIfaceEventStream {
2515 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2516}
2517
2518impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2519
2520impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2521 fn is_terminated(&self) -> bool {
2522 self.event_receiver.is_terminated()
2523 }
2524}
2525
2526impl futures::Stream for SupplicantStaIfaceEventStream {
2527 type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2528
2529 fn poll_next(
2530 mut self: std::pin::Pin<&mut Self>,
2531 cx: &mut std::task::Context<'_>,
2532 ) -> std::task::Poll<Option<Self::Item>> {
2533 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2534 &mut self.event_receiver,
2535 cx
2536 )?) {
2537 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2538 None => std::task::Poll::Ready(None),
2539 }
2540 }
2541}
2542
2543#[derive(Debug)]
2544pub enum SupplicantStaIfaceEvent {
2545 #[non_exhaustive]
2546 _UnknownEvent {
2547 ordinal: u64,
2549 },
2550}
2551
2552impl SupplicantStaIfaceEvent {
2553 fn decode(
2555 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2556 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2557 let (bytes, _handles) = buf.split_mut();
2558 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2559 debug_assert_eq!(tx_header.tx_id, 0);
2560 match tx_header.ordinal {
2561 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2562 Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2563 }
2564 _ => Err(fidl::Error::UnknownOrdinal {
2565 ordinal: tx_header.ordinal,
2566 protocol_name:
2567 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2568 }),
2569 }
2570 }
2571}
2572
2573pub struct SupplicantStaIfaceRequestStream {
2575 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2576 is_terminated: bool,
2577}
2578
2579impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2580
2581impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2582 fn is_terminated(&self) -> bool {
2583 self.is_terminated
2584 }
2585}
2586
2587impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2588 type Protocol = SupplicantStaIfaceMarker;
2589 type ControlHandle = SupplicantStaIfaceControlHandle;
2590
2591 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2592 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2593 }
2594
2595 fn control_handle(&self) -> Self::ControlHandle {
2596 SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2597 }
2598
2599 fn into_inner(
2600 self,
2601 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2602 {
2603 (self.inner, self.is_terminated)
2604 }
2605
2606 fn from_inner(
2607 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2608 is_terminated: bool,
2609 ) -> Self {
2610 Self { inner, is_terminated }
2611 }
2612}
2613
2614impl futures::Stream for SupplicantStaIfaceRequestStream {
2615 type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2616
2617 fn poll_next(
2618 mut self: std::pin::Pin<&mut Self>,
2619 cx: &mut std::task::Context<'_>,
2620 ) -> std::task::Poll<Option<Self::Item>> {
2621 let this = &mut *self;
2622 if this.inner.check_shutdown(cx) {
2623 this.is_terminated = true;
2624 return std::task::Poll::Ready(None);
2625 }
2626 if this.is_terminated {
2627 panic!("polled SupplicantStaIfaceRequestStream after completion");
2628 }
2629 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2630 |bytes, handles| {
2631 match this.inner.channel().read_etc(cx, bytes, handles) {
2632 std::task::Poll::Ready(Ok(())) => {}
2633 std::task::Poll::Pending => return std::task::Poll::Pending,
2634 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2635 this.is_terminated = true;
2636 return std::task::Poll::Ready(None);
2637 }
2638 std::task::Poll::Ready(Err(e)) => {
2639 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2640 e.into(),
2641 ))));
2642 }
2643 }
2644
2645 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2647
2648 std::task::Poll::Ready(Some(match header.ordinal {
2649 0x1be680e863a8e71 => {
2650 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2651 let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2652 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2653 let control_handle = SupplicantStaIfaceControlHandle {
2654 inner: this.inner.clone(),
2655 };
2656 Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2657 control_handle,
2658 })
2659 }
2660 0xa77cf60628766dc => {
2661 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2662 let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2663 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2664 let control_handle = SupplicantStaIfaceControlHandle {
2665 inner: this.inner.clone(),
2666 };
2667 Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2668 control_handle,
2669 })
2670 }
2671 0x52a1d38e0b4871fa => {
2672 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2673 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2674 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2675 let control_handle = SupplicantStaIfaceControlHandle {
2676 inner: this.inner.clone(),
2677 };
2678 Ok(SupplicantStaIfaceRequest::Disconnect {
2679 responder: SupplicantStaIfaceDisconnectResponder {
2680 control_handle: std::mem::ManuallyDrop::new(control_handle),
2681 tx_id: header.tx_id,
2682 },
2683 })
2684 }
2685 0x60591d204a3f537f => {
2686 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2687 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2688 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2689 let control_handle = SupplicantStaIfaceControlHandle {
2690 inner: this.inner.clone(),
2691 };
2692 Ok(SupplicantStaIfaceRequest::GetMacAddress {
2693 responder: SupplicantStaIfaceGetMacAddressResponder {
2694 control_handle: std::mem::ManuallyDrop::new(control_handle),
2695 tx_id: header.tx_id,
2696 },
2697 })
2698 }
2699 0x58857179ad71e624 => {
2700 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2701 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2702 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2703 let control_handle = SupplicantStaIfaceControlHandle {
2704 inner: this.inner.clone(),
2705 };
2706 Ok(SupplicantStaIfaceRequest::GetFactoryMacAddress {
2707 responder: SupplicantStaIfaceGetFactoryMacAddressResponder {
2708 control_handle: std::mem::ManuallyDrop::new(control_handle),
2709 tx_id: header.tx_id,
2710 },
2711 })
2712 }
2713 0x14567ff593a9b154 => {
2714 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2715 let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2716 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2717 let control_handle = SupplicantStaIfaceControlHandle {
2718 inner: this.inner.clone(),
2719 };
2720 Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2721 responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2722 control_handle: std::mem::ManuallyDrop::new(control_handle),
2723 tx_id: header.tx_id,
2724 },
2725 })
2726 }
2727 0x5a04c29320085298 => {
2728 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2729 let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2730 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2731 let control_handle = SupplicantStaIfaceControlHandle {
2732 inner: this.inner.clone(),
2733 };
2734 Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2735 responder: SupplicantStaIfaceSetPowerSaveResponder {
2736 control_handle: std::mem::ManuallyDrop::new(control_handle),
2737 tx_id: header.tx_id,
2738 },
2739 })
2740 }
2741 0xaf10de85bb7023a => {
2742 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2743 let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2744 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2745 let control_handle = SupplicantStaIfaceControlHandle {
2746 inner: this.inner.clone(),
2747 };
2748 Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2749 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2750 control_handle: std::mem::ManuallyDrop::new(control_handle),
2751 tx_id: header.tx_id,
2752 },
2753 })
2754 }
2755 0x977e22f9b79b26e => {
2756 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2757 let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2758 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2759 let control_handle = SupplicantStaIfaceControlHandle {
2760 inner: this.inner.clone(),
2761 };
2762 Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2763 responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2764 control_handle: std::mem::ManuallyDrop::new(control_handle),
2765 tx_id: header.tx_id,
2766 },
2767 })
2768 }
2769 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2770 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2771 ordinal: header.ordinal,
2772 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2773 method_type: fidl::MethodType::OneWay,
2774 })
2775 }
2776 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2777 this.inner.send_framework_err(
2778 fidl::encoding::FrameworkErr::UnknownMethod,
2779 header.tx_id,
2780 header.ordinal,
2781 header.dynamic_flags(),
2782 (bytes, handles),
2783 )?;
2784 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2785 ordinal: header.ordinal,
2786 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2787 method_type: fidl::MethodType::TwoWay,
2788 })
2789 }
2790 _ => Err(fidl::Error::UnknownOrdinal {
2791 ordinal: header.ordinal,
2792 protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2793 }),
2794 }))
2795 },
2796 )
2797 }
2798}
2799
2800#[derive(Debug)]
2801pub enum SupplicantStaIfaceRequest {
2802 RegisterCallback {
2803 payload: SupplicantStaIfaceRegisterCallbackRequest,
2804 control_handle: SupplicantStaIfaceControlHandle,
2805 },
2806 AddNetwork {
2807 payload: SupplicantStaIfaceAddNetworkRequest,
2808 control_handle: SupplicantStaIfaceControlHandle,
2809 },
2810 Disconnect {
2811 responder: SupplicantStaIfaceDisconnectResponder,
2812 },
2813 GetMacAddress {
2814 responder: SupplicantStaIfaceGetMacAddressResponder,
2815 },
2816 GetFactoryMacAddress {
2817 responder: SupplicantStaIfaceGetFactoryMacAddressResponder,
2818 },
2819 SetBtCoexistenceMode {
2820 payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2821 responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2822 },
2823 SetPowerSave {
2824 payload: SupplicantStaIfaceSetPowerSaveRequest,
2825 responder: SupplicantStaIfaceSetPowerSaveResponder,
2826 },
2827 SetSuspendModeEnabled {
2828 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2829 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2830 },
2831 SetStaCountryCode {
2832 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2833 responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2834 },
2835 #[non_exhaustive]
2837 _UnknownMethod {
2838 ordinal: u64,
2840 control_handle: SupplicantStaIfaceControlHandle,
2841 method_type: fidl::MethodType,
2842 },
2843}
2844
2845impl SupplicantStaIfaceRequest {
2846 #[allow(irrefutable_let_patterns)]
2847 pub fn into_register_callback(
2848 self,
2849 ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2850 if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2851 Some((payload, control_handle))
2852 } else {
2853 None
2854 }
2855 }
2856
2857 #[allow(irrefutable_let_patterns)]
2858 pub fn into_add_network(
2859 self,
2860 ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2861 if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2862 Some((payload, control_handle))
2863 } else {
2864 None
2865 }
2866 }
2867
2868 #[allow(irrefutable_let_patterns)]
2869 pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2870 if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2871 Some((responder))
2872 } else {
2873 None
2874 }
2875 }
2876
2877 #[allow(irrefutable_let_patterns)]
2878 pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2879 if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2880 Some((responder))
2881 } else {
2882 None
2883 }
2884 }
2885
2886 #[allow(irrefutable_let_patterns)]
2887 pub fn into_get_factory_mac_address(
2888 self,
2889 ) -> Option<(SupplicantStaIfaceGetFactoryMacAddressResponder)> {
2890 if let SupplicantStaIfaceRequest::GetFactoryMacAddress { responder } = self {
2891 Some((responder))
2892 } else {
2893 None
2894 }
2895 }
2896
2897 #[allow(irrefutable_let_patterns)]
2898 pub fn into_set_bt_coexistence_mode(
2899 self,
2900 ) -> Option<(
2901 SupplicantStaIfaceSetBtCoexistenceModeRequest,
2902 SupplicantStaIfaceSetBtCoexistenceModeResponder,
2903 )> {
2904 if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
2905 Some((payload, responder))
2906 } else {
2907 None
2908 }
2909 }
2910
2911 #[allow(irrefutable_let_patterns)]
2912 pub fn into_set_power_save(
2913 self,
2914 ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
2915 {
2916 if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
2917 Some((payload, responder))
2918 } else {
2919 None
2920 }
2921 }
2922
2923 #[allow(irrefutable_let_patterns)]
2924 pub fn into_set_suspend_mode_enabled(
2925 self,
2926 ) -> Option<(
2927 SupplicantStaIfaceSetSuspendModeEnabledRequest,
2928 SupplicantStaIfaceSetSuspendModeEnabledResponder,
2929 )> {
2930 if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
2931 Some((payload, responder))
2932 } else {
2933 None
2934 }
2935 }
2936
2937 #[allow(irrefutable_let_patterns)]
2938 pub fn into_set_sta_country_code(
2939 self,
2940 ) -> Option<(
2941 SupplicantStaIfaceSetStaCountryCodeRequest,
2942 SupplicantStaIfaceSetStaCountryCodeResponder,
2943 )> {
2944 if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
2945 Some((payload, responder))
2946 } else {
2947 None
2948 }
2949 }
2950
2951 pub fn method_name(&self) -> &'static str {
2953 match *self {
2954 SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
2955 SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
2956 SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
2957 SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
2958 SupplicantStaIfaceRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
2959 SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
2960 SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
2961 SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
2962 SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
2963 SupplicantStaIfaceRequest::_UnknownMethod {
2964 method_type: fidl::MethodType::OneWay,
2965 ..
2966 } => "unknown one-way method",
2967 SupplicantStaIfaceRequest::_UnknownMethod {
2968 method_type: fidl::MethodType::TwoWay,
2969 ..
2970 } => "unknown two-way method",
2971 }
2972 }
2973}
2974
2975#[derive(Debug, Clone)]
2976pub struct SupplicantStaIfaceControlHandle {
2977 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2978}
2979
2980impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
2981 fn shutdown(&self) {
2982 self.inner.shutdown()
2983 }
2984
2985 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2986 self.inner.shutdown_with_epitaph(status)
2987 }
2988
2989 fn is_closed(&self) -> bool {
2990 self.inner.channel().is_closed()
2991 }
2992 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2993 self.inner.channel().on_closed()
2994 }
2995
2996 #[cfg(target_os = "fuchsia")]
2997 fn signal_peer(
2998 &self,
2999 clear_mask: zx::Signals,
3000 set_mask: zx::Signals,
3001 ) -> Result<(), zx_status::Status> {
3002 use fidl::Peered;
3003 self.inner.channel().signal_peer(clear_mask, set_mask)
3004 }
3005}
3006
3007impl SupplicantStaIfaceControlHandle {}
3008
3009#[must_use = "FIDL methods require a response to be sent"]
3010#[derive(Debug)]
3011pub struct SupplicantStaIfaceDisconnectResponder {
3012 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3013 tx_id: u32,
3014}
3015
3016impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
3020 fn drop(&mut self) {
3021 self.control_handle.shutdown();
3022 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3024 }
3025}
3026
3027impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
3028 type ControlHandle = SupplicantStaIfaceControlHandle;
3029
3030 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3031 &self.control_handle
3032 }
3033
3034 fn drop_without_shutdown(mut self) {
3035 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3037 std::mem::forget(self);
3039 }
3040}
3041
3042impl SupplicantStaIfaceDisconnectResponder {
3043 pub fn send(self) -> Result<(), fidl::Error> {
3047 let _result = self.send_raw();
3048 if _result.is_err() {
3049 self.control_handle.shutdown();
3050 }
3051 self.drop_without_shutdown();
3052 _result
3053 }
3054
3055 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3057 let _result = self.send_raw();
3058 self.drop_without_shutdown();
3059 _result
3060 }
3061
3062 fn send_raw(&self) -> Result<(), fidl::Error> {
3063 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3064 fidl::encoding::Flexible::new(()),
3065 self.tx_id,
3066 0x52a1d38e0b4871fa,
3067 fidl::encoding::DynamicFlags::FLEXIBLE,
3068 )
3069 }
3070}
3071
3072#[must_use = "FIDL methods require a response to be sent"]
3073#[derive(Debug)]
3074pub struct SupplicantStaIfaceGetMacAddressResponder {
3075 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3076 tx_id: u32,
3077}
3078
3079impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
3083 fn drop(&mut self) {
3084 self.control_handle.shutdown();
3085 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3087 }
3088}
3089
3090impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
3091 type ControlHandle = SupplicantStaIfaceControlHandle;
3092
3093 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3094 &self.control_handle
3095 }
3096
3097 fn drop_without_shutdown(mut self) {
3098 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3100 std::mem::forget(self);
3102 }
3103}
3104
3105impl SupplicantStaIfaceGetMacAddressResponder {
3106 pub fn send(
3110 self,
3111 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3112 ) -> Result<(), fidl::Error> {
3113 let _result = self.send_raw(result);
3114 if _result.is_err() {
3115 self.control_handle.shutdown();
3116 }
3117 self.drop_without_shutdown();
3118 _result
3119 }
3120
3121 pub fn send_no_shutdown_on_err(
3123 self,
3124 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3125 ) -> Result<(), fidl::Error> {
3126 let _result = self.send_raw(result);
3127 self.drop_without_shutdown();
3128 _result
3129 }
3130
3131 fn send_raw(
3132 &self,
3133 mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3134 ) -> Result<(), fidl::Error> {
3135 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3136 SupplicantStaIfaceGetMacAddressResponse,
3137 i32,
3138 >>(
3139 fidl::encoding::FlexibleResult::new(result),
3140 self.tx_id,
3141 0x60591d204a3f537f,
3142 fidl::encoding::DynamicFlags::FLEXIBLE,
3143 )
3144 }
3145}
3146
3147#[must_use = "FIDL methods require a response to be sent"]
3148#[derive(Debug)]
3149pub struct SupplicantStaIfaceGetFactoryMacAddressResponder {
3150 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3151 tx_id: u32,
3152}
3153
3154impl std::ops::Drop for SupplicantStaIfaceGetFactoryMacAddressResponder {
3158 fn drop(&mut self) {
3159 self.control_handle.shutdown();
3160 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3162 }
3163}
3164
3165impl fidl::endpoints::Responder for SupplicantStaIfaceGetFactoryMacAddressResponder {
3166 type ControlHandle = SupplicantStaIfaceControlHandle;
3167
3168 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3169 &self.control_handle
3170 }
3171
3172 fn drop_without_shutdown(mut self) {
3173 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3175 std::mem::forget(self);
3177 }
3178}
3179
3180impl SupplicantStaIfaceGetFactoryMacAddressResponder {
3181 pub fn send(self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3185 let _result = self.send_raw(result);
3186 if _result.is_err() {
3187 self.control_handle.shutdown();
3188 }
3189 self.drop_without_shutdown();
3190 _result
3191 }
3192
3193 pub fn send_no_shutdown_on_err(
3195 self,
3196 mut result: Result<&[u8; 6], i32>,
3197 ) -> Result<(), fidl::Error> {
3198 let _result = self.send_raw(result);
3199 self.drop_without_shutdown();
3200 _result
3201 }
3202
3203 fn send_raw(&self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3204 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3205 SupplicantStaIfaceGetFactoryMacAddressResponse,
3206 i32,
3207 >>(
3208 fidl::encoding::FlexibleResult::new(result.map(|mac_addr| (mac_addr,))),
3209 self.tx_id,
3210 0x58857179ad71e624,
3211 fidl::encoding::DynamicFlags::FLEXIBLE,
3212 )
3213 }
3214}
3215
3216#[must_use = "FIDL methods require a response to be sent"]
3217#[derive(Debug)]
3218pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3219 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3220 tx_id: u32,
3221}
3222
3223impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3227 fn drop(&mut self) {
3228 self.control_handle.shutdown();
3229 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3231 }
3232}
3233
3234impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3235 type ControlHandle = SupplicantStaIfaceControlHandle;
3236
3237 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3238 &self.control_handle
3239 }
3240
3241 fn drop_without_shutdown(mut self) {
3242 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3244 std::mem::forget(self);
3246 }
3247}
3248
3249impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3250 pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3254 let _result = self.send_raw(result);
3255 if _result.is_err() {
3256 self.control_handle.shutdown();
3257 }
3258 self.drop_without_shutdown();
3259 _result
3260 }
3261
3262 pub fn send_no_shutdown_on_err(
3264 self,
3265 mut result: Result<(), WlanixError>,
3266 ) -> Result<(), fidl::Error> {
3267 let _result = self.send_raw(result);
3268 self.drop_without_shutdown();
3269 _result
3270 }
3271
3272 fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3273 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3274 fidl::encoding::EmptyStruct,
3275 WlanixError,
3276 >>(
3277 fidl::encoding::FlexibleResult::new(result),
3278 self.tx_id,
3279 0x14567ff593a9b154,
3280 fidl::encoding::DynamicFlags::FLEXIBLE,
3281 )
3282 }
3283}
3284
3285#[must_use = "FIDL methods require a response to be sent"]
3286#[derive(Debug)]
3287pub struct SupplicantStaIfaceSetPowerSaveResponder {
3288 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3289 tx_id: u32,
3290}
3291
3292impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3296 fn drop(&mut self) {
3297 self.control_handle.shutdown();
3298 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3300 }
3301}
3302
3303impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3304 type ControlHandle = SupplicantStaIfaceControlHandle;
3305
3306 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3307 &self.control_handle
3308 }
3309
3310 fn drop_without_shutdown(mut self) {
3311 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3313 std::mem::forget(self);
3315 }
3316}
3317
3318impl SupplicantStaIfaceSetPowerSaveResponder {
3319 pub fn send(self) -> Result<(), fidl::Error> {
3323 let _result = self.send_raw();
3324 if _result.is_err() {
3325 self.control_handle.shutdown();
3326 }
3327 self.drop_without_shutdown();
3328 _result
3329 }
3330
3331 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3333 let _result = self.send_raw();
3334 self.drop_without_shutdown();
3335 _result
3336 }
3337
3338 fn send_raw(&self) -> Result<(), fidl::Error> {
3339 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3340 fidl::encoding::Flexible::new(()),
3341 self.tx_id,
3342 0x5a04c29320085298,
3343 fidl::encoding::DynamicFlags::FLEXIBLE,
3344 )
3345 }
3346}
3347
3348#[must_use = "FIDL methods require a response to be sent"]
3349#[derive(Debug)]
3350pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3351 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3352 tx_id: u32,
3353}
3354
3355impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3359 fn drop(&mut self) {
3360 self.control_handle.shutdown();
3361 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3363 }
3364}
3365
3366impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3367 type ControlHandle = SupplicantStaIfaceControlHandle;
3368
3369 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3370 &self.control_handle
3371 }
3372
3373 fn drop_without_shutdown(mut self) {
3374 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3376 std::mem::forget(self);
3378 }
3379}
3380
3381impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3382 pub fn send(self) -> Result<(), fidl::Error> {
3386 let _result = self.send_raw();
3387 if _result.is_err() {
3388 self.control_handle.shutdown();
3389 }
3390 self.drop_without_shutdown();
3391 _result
3392 }
3393
3394 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3396 let _result = self.send_raw();
3397 self.drop_without_shutdown();
3398 _result
3399 }
3400
3401 fn send_raw(&self) -> Result<(), fidl::Error> {
3402 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3403 fidl::encoding::Flexible::new(()),
3404 self.tx_id,
3405 0xaf10de85bb7023a,
3406 fidl::encoding::DynamicFlags::FLEXIBLE,
3407 )
3408 }
3409}
3410
3411#[must_use = "FIDL methods require a response to be sent"]
3412#[derive(Debug)]
3413pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3414 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3415 tx_id: u32,
3416}
3417
3418impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3422 fn drop(&mut self) {
3423 self.control_handle.shutdown();
3424 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3426 }
3427}
3428
3429impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3430 type ControlHandle = SupplicantStaIfaceControlHandle;
3431
3432 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3433 &self.control_handle
3434 }
3435
3436 fn drop_without_shutdown(mut self) {
3437 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3439 std::mem::forget(self);
3441 }
3442}
3443
3444impl SupplicantStaIfaceSetStaCountryCodeResponder {
3445 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3449 let _result = self.send_raw(result);
3450 if _result.is_err() {
3451 self.control_handle.shutdown();
3452 }
3453 self.drop_without_shutdown();
3454 _result
3455 }
3456
3457 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3459 let _result = self.send_raw(result);
3460 self.drop_without_shutdown();
3461 _result
3462 }
3463
3464 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3465 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3466 fidl::encoding::EmptyStruct,
3467 i32,
3468 >>(
3469 fidl::encoding::FlexibleResult::new(result),
3470 self.tx_id,
3471 0x977e22f9b79b26e,
3472 fidl::encoding::DynamicFlags::FLEXIBLE,
3473 )
3474 }
3475}
3476
3477#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3478pub struct SupplicantStaIfaceCallbackMarker;
3479
3480impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3481 type Proxy = SupplicantStaIfaceCallbackProxy;
3482 type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3483 #[cfg(target_os = "fuchsia")]
3484 type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3485
3486 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3487}
3488
3489pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3490 fn r#on_state_changed(
3491 &self,
3492 payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3493 ) -> Result<(), fidl::Error>;
3494 fn r#on_disconnected(
3495 &self,
3496 payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3497 ) -> Result<(), fidl::Error>;
3498 fn r#on_association_rejected(
3499 &self,
3500 payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3501 ) -> Result<(), fidl::Error>;
3502}
3503#[derive(Debug)]
3504#[cfg(target_os = "fuchsia")]
3505pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3506 client: fidl::client::sync::Client,
3507}
3508
3509#[cfg(target_os = "fuchsia")]
3510impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3511 type Proxy = SupplicantStaIfaceCallbackProxy;
3512 type Protocol = SupplicantStaIfaceCallbackMarker;
3513
3514 fn from_channel(inner: fidl::Channel) -> Self {
3515 Self::new(inner)
3516 }
3517
3518 fn into_channel(self) -> fidl::Channel {
3519 self.client.into_channel()
3520 }
3521
3522 fn as_channel(&self) -> &fidl::Channel {
3523 self.client.as_channel()
3524 }
3525}
3526
3527#[cfg(target_os = "fuchsia")]
3528impl SupplicantStaIfaceCallbackSynchronousProxy {
3529 pub fn new(channel: fidl::Channel) -> Self {
3530 let protocol_name =
3531 <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3532 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3533 }
3534
3535 pub fn into_channel(self) -> fidl::Channel {
3536 self.client.into_channel()
3537 }
3538
3539 pub fn wait_for_event(
3542 &self,
3543 deadline: zx::MonotonicInstant,
3544 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3545 SupplicantStaIfaceCallbackEvent::decode(self.client.wait_for_event(deadline)?)
3546 }
3547
3548 pub fn r#on_state_changed(
3549 &self,
3550 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3551 ) -> Result<(), fidl::Error> {
3552 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3553 payload,
3554 0x27e086d26c49eb6c,
3555 fidl::encoding::DynamicFlags::FLEXIBLE,
3556 )
3557 }
3558
3559 pub fn r#on_disconnected(
3560 &self,
3561 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3562 ) -> Result<(), fidl::Error> {
3563 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3564 payload,
3565 0x69546475f4dee0cc,
3566 fidl::encoding::DynamicFlags::FLEXIBLE,
3567 )
3568 }
3569
3570 pub fn r#on_association_rejected(
3571 &self,
3572 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3573 ) -> Result<(), fidl::Error> {
3574 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3575 payload,
3576 0x7ef3961518bed988,
3577 fidl::encoding::DynamicFlags::FLEXIBLE,
3578 )
3579 }
3580}
3581
3582#[cfg(target_os = "fuchsia")]
3583impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3584 fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3585 value.into_channel().into()
3586 }
3587}
3588
3589#[cfg(target_os = "fuchsia")]
3590impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3591 fn from(value: fidl::Channel) -> Self {
3592 Self::new(value)
3593 }
3594}
3595
3596#[cfg(target_os = "fuchsia")]
3597impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3598 type Protocol = SupplicantStaIfaceCallbackMarker;
3599
3600 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3601 Self::new(value.into_channel())
3602 }
3603}
3604
3605#[derive(Debug, Clone)]
3606pub struct SupplicantStaIfaceCallbackProxy {
3607 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3608}
3609
3610impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3611 type Protocol = SupplicantStaIfaceCallbackMarker;
3612
3613 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3614 Self::new(inner)
3615 }
3616
3617 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3618 self.client.into_channel().map_err(|client| Self { client })
3619 }
3620
3621 fn as_channel(&self) -> &::fidl::AsyncChannel {
3622 self.client.as_channel()
3623 }
3624}
3625
3626impl SupplicantStaIfaceCallbackProxy {
3627 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3629 let protocol_name =
3630 <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3631 Self { client: fidl::client::Client::new(channel, protocol_name) }
3632 }
3633
3634 pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3640 SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3641 }
3642
3643 pub fn r#on_state_changed(
3644 &self,
3645 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3646 ) -> Result<(), fidl::Error> {
3647 SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3648 }
3649
3650 pub fn r#on_disconnected(
3651 &self,
3652 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3653 ) -> Result<(), fidl::Error> {
3654 SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3655 }
3656
3657 pub fn r#on_association_rejected(
3658 &self,
3659 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3660 ) -> Result<(), fidl::Error> {
3661 SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3662 }
3663}
3664
3665impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3666 fn r#on_state_changed(
3667 &self,
3668 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3669 ) -> Result<(), fidl::Error> {
3670 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3671 payload,
3672 0x27e086d26c49eb6c,
3673 fidl::encoding::DynamicFlags::FLEXIBLE,
3674 )
3675 }
3676
3677 fn r#on_disconnected(
3678 &self,
3679 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3680 ) -> Result<(), fidl::Error> {
3681 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3682 payload,
3683 0x69546475f4dee0cc,
3684 fidl::encoding::DynamicFlags::FLEXIBLE,
3685 )
3686 }
3687
3688 fn r#on_association_rejected(
3689 &self,
3690 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3691 ) -> Result<(), fidl::Error> {
3692 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3693 payload,
3694 0x7ef3961518bed988,
3695 fidl::encoding::DynamicFlags::FLEXIBLE,
3696 )
3697 }
3698}
3699
3700pub struct SupplicantStaIfaceCallbackEventStream {
3701 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3702}
3703
3704impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3705
3706impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3707 fn is_terminated(&self) -> bool {
3708 self.event_receiver.is_terminated()
3709 }
3710}
3711
3712impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3713 type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3714
3715 fn poll_next(
3716 mut self: std::pin::Pin<&mut Self>,
3717 cx: &mut std::task::Context<'_>,
3718 ) -> std::task::Poll<Option<Self::Item>> {
3719 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3720 &mut self.event_receiver,
3721 cx
3722 )?) {
3723 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3724 None => std::task::Poll::Ready(None),
3725 }
3726 }
3727}
3728
3729#[derive(Debug)]
3730pub enum SupplicantStaIfaceCallbackEvent {
3731 #[non_exhaustive]
3732 _UnknownEvent {
3733 ordinal: u64,
3735 },
3736}
3737
3738impl SupplicantStaIfaceCallbackEvent {
3739 fn decode(
3741 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3742 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3743 let (bytes, _handles) = buf.split_mut();
3744 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3745 debug_assert_eq!(tx_header.tx_id, 0);
3746 match tx_header.ordinal {
3747 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3748 Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3749 ordinal: tx_header.ordinal,
3750 })
3751 }
3752 _ => Err(fidl::Error::UnknownOrdinal {
3753 ordinal: tx_header.ordinal,
3754 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3755 })
3756 }
3757 }
3758}
3759
3760pub struct SupplicantStaIfaceCallbackRequestStream {
3762 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3763 is_terminated: bool,
3764}
3765
3766impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3767
3768impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3769 fn is_terminated(&self) -> bool {
3770 self.is_terminated
3771 }
3772}
3773
3774impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3775 type Protocol = SupplicantStaIfaceCallbackMarker;
3776 type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3777
3778 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3779 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3780 }
3781
3782 fn control_handle(&self) -> Self::ControlHandle {
3783 SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3784 }
3785
3786 fn into_inner(
3787 self,
3788 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3789 {
3790 (self.inner, self.is_terminated)
3791 }
3792
3793 fn from_inner(
3794 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3795 is_terminated: bool,
3796 ) -> Self {
3797 Self { inner, is_terminated }
3798 }
3799}
3800
3801impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
3802 type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
3803
3804 fn poll_next(
3805 mut self: std::pin::Pin<&mut Self>,
3806 cx: &mut std::task::Context<'_>,
3807 ) -> std::task::Poll<Option<Self::Item>> {
3808 let this = &mut *self;
3809 if this.inner.check_shutdown(cx) {
3810 this.is_terminated = true;
3811 return std::task::Poll::Ready(None);
3812 }
3813 if this.is_terminated {
3814 panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
3815 }
3816 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3817 |bytes, handles| {
3818 match this.inner.channel().read_etc(cx, bytes, handles) {
3819 std::task::Poll::Ready(Ok(())) => {}
3820 std::task::Poll::Pending => return std::task::Poll::Pending,
3821 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3822 this.is_terminated = true;
3823 return std::task::Poll::Ready(None);
3824 }
3825 std::task::Poll::Ready(Err(e)) => {
3826 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3827 e.into(),
3828 ))));
3829 }
3830 }
3831
3832 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3834
3835 std::task::Poll::Ready(Some(match header.ordinal {
3836 0x27e086d26c49eb6c => {
3837 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3838 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3839 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
3840 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3841 inner: this.inner.clone(),
3842 };
3843 Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
3844 control_handle,
3845 })
3846 }
3847 0x69546475f4dee0cc => {
3848 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3849 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3850 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
3851 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3852 inner: this.inner.clone(),
3853 };
3854 Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
3855 control_handle,
3856 })
3857 }
3858 0x7ef3961518bed988 => {
3859 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3860 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3861 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
3862 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3863 inner: this.inner.clone(),
3864 };
3865 Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
3866 control_handle,
3867 })
3868 }
3869 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3870 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3871 ordinal: header.ordinal,
3872 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3873 method_type: fidl::MethodType::OneWay,
3874 })
3875 }
3876 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3877 this.inner.send_framework_err(
3878 fidl::encoding::FrameworkErr::UnknownMethod,
3879 header.tx_id,
3880 header.ordinal,
3881 header.dynamic_flags(),
3882 (bytes, handles),
3883 )?;
3884 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3885 ordinal: header.ordinal,
3886 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3887 method_type: fidl::MethodType::TwoWay,
3888 })
3889 }
3890 _ => Err(fidl::Error::UnknownOrdinal {
3891 ordinal: header.ordinal,
3892 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3893 }),
3894 }))
3895 },
3896 )
3897 }
3898}
3899
3900#[derive(Debug)]
3901pub enum SupplicantStaIfaceCallbackRequest {
3902 OnStateChanged {
3903 payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
3904 control_handle: SupplicantStaIfaceCallbackControlHandle,
3905 },
3906 OnDisconnected {
3907 payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
3908 control_handle: SupplicantStaIfaceCallbackControlHandle,
3909 },
3910 OnAssociationRejected {
3911 payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3912 control_handle: SupplicantStaIfaceCallbackControlHandle,
3913 },
3914 #[non_exhaustive]
3916 _UnknownMethod {
3917 ordinal: u64,
3919 control_handle: SupplicantStaIfaceCallbackControlHandle,
3920 method_type: fidl::MethodType,
3921 },
3922}
3923
3924impl SupplicantStaIfaceCallbackRequest {
3925 #[allow(irrefutable_let_patterns)]
3926 pub fn into_on_state_changed(
3927 self,
3928 ) -> Option<(
3929 SupplicantStaIfaceCallbackOnStateChangedRequest,
3930 SupplicantStaIfaceCallbackControlHandle,
3931 )> {
3932 if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
3933 {
3934 Some((payload, control_handle))
3935 } else {
3936 None
3937 }
3938 }
3939
3940 #[allow(irrefutable_let_patterns)]
3941 pub fn into_on_disconnected(
3942 self,
3943 ) -> Option<(
3944 SupplicantStaIfaceCallbackOnDisconnectedRequest,
3945 SupplicantStaIfaceCallbackControlHandle,
3946 )> {
3947 if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
3948 {
3949 Some((payload, control_handle))
3950 } else {
3951 None
3952 }
3953 }
3954
3955 #[allow(irrefutable_let_patterns)]
3956 pub fn into_on_association_rejected(
3957 self,
3958 ) -> Option<(
3959 SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3960 SupplicantStaIfaceCallbackControlHandle,
3961 )> {
3962 if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
3963 payload,
3964 control_handle,
3965 } = self
3966 {
3967 Some((payload, control_handle))
3968 } else {
3969 None
3970 }
3971 }
3972
3973 pub fn method_name(&self) -> &'static str {
3975 match *self {
3976 SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
3977 SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
3978 SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
3979 "on_association_rejected"
3980 }
3981 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3982 method_type: fidl::MethodType::OneWay,
3983 ..
3984 } => "unknown one-way method",
3985 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3986 method_type: fidl::MethodType::TwoWay,
3987 ..
3988 } => "unknown two-way method",
3989 }
3990 }
3991}
3992
3993#[derive(Debug, Clone)]
3994pub struct SupplicantStaIfaceCallbackControlHandle {
3995 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3996}
3997
3998impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
3999 fn shutdown(&self) {
4000 self.inner.shutdown()
4001 }
4002
4003 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4004 self.inner.shutdown_with_epitaph(status)
4005 }
4006
4007 fn is_closed(&self) -> bool {
4008 self.inner.channel().is_closed()
4009 }
4010 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4011 self.inner.channel().on_closed()
4012 }
4013
4014 #[cfg(target_os = "fuchsia")]
4015 fn signal_peer(
4016 &self,
4017 clear_mask: zx::Signals,
4018 set_mask: zx::Signals,
4019 ) -> Result<(), zx_status::Status> {
4020 use fidl::Peered;
4021 self.inner.channel().signal_peer(clear_mask, set_mask)
4022 }
4023}
4024
4025impl SupplicantStaIfaceCallbackControlHandle {}
4026
4027#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4028pub struct SupplicantStaNetworkMarker;
4029
4030impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
4031 type Proxy = SupplicantStaNetworkProxy;
4032 type RequestStream = SupplicantStaNetworkRequestStream;
4033 #[cfg(target_os = "fuchsia")]
4034 type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
4035
4036 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
4037}
4038pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
4039
4040pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
4041 fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
4042 -> Result<(), fidl::Error>;
4043 fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
4044 fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
4045 fn r#set_key_mgmt(
4046 &self,
4047 payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4048 ) -> Result<(), fidl::Error>;
4049 fn r#set_psk_passphrase(
4050 &self,
4051 payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4052 ) -> Result<(), fidl::Error>;
4053 fn r#set_sae_password(
4054 &self,
4055 payload: &SupplicantStaNetworkSetSaePasswordRequest,
4056 ) -> Result<(), fidl::Error>;
4057 fn r#set_wep_key(
4058 &self,
4059 payload: &SupplicantStaNetworkSetWepKeyRequest,
4060 ) -> Result<(), fidl::Error>;
4061 fn r#set_wep_tx_key_idx(
4062 &self,
4063 payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4064 ) -> Result<(), fidl::Error>;
4065 type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
4066 + Send;
4067 fn r#select(&self) -> Self::SelectResponseFut;
4068}
4069#[derive(Debug)]
4070#[cfg(target_os = "fuchsia")]
4071pub struct SupplicantStaNetworkSynchronousProxy {
4072 client: fidl::client::sync::Client,
4073}
4074
4075#[cfg(target_os = "fuchsia")]
4076impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
4077 type Proxy = SupplicantStaNetworkProxy;
4078 type Protocol = SupplicantStaNetworkMarker;
4079
4080 fn from_channel(inner: fidl::Channel) -> Self {
4081 Self::new(inner)
4082 }
4083
4084 fn into_channel(self) -> fidl::Channel {
4085 self.client.into_channel()
4086 }
4087
4088 fn as_channel(&self) -> &fidl::Channel {
4089 self.client.as_channel()
4090 }
4091}
4092
4093#[cfg(target_os = "fuchsia")]
4094impl SupplicantStaNetworkSynchronousProxy {
4095 pub fn new(channel: fidl::Channel) -> Self {
4096 let protocol_name =
4097 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4098 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4099 }
4100
4101 pub fn into_channel(self) -> fidl::Channel {
4102 self.client.into_channel()
4103 }
4104
4105 pub fn wait_for_event(
4108 &self,
4109 deadline: zx::MonotonicInstant,
4110 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4111 SupplicantStaNetworkEvent::decode(self.client.wait_for_event(deadline)?)
4112 }
4113
4114 pub fn r#set_bssid(
4115 &self,
4116 mut payload: &SupplicantStaNetworkSetBssidRequest,
4117 ) -> Result<(), fidl::Error> {
4118 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4119 payload,
4120 0x10a91d044ee6374d,
4121 fidl::encoding::DynamicFlags::FLEXIBLE,
4122 )
4123 }
4124
4125 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4126 self.client.send::<fidl::encoding::EmptyPayload>(
4127 (),
4128 0xbc7ad82f541b267,
4129 fidl::encoding::DynamicFlags::FLEXIBLE,
4130 )
4131 }
4132
4133 pub fn r#set_ssid(
4134 &self,
4135 mut payload: &SupplicantStaNetworkSetSsidRequest,
4136 ) -> Result<(), fidl::Error> {
4137 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4138 payload,
4139 0x6b598a7a802e3083,
4140 fidl::encoding::DynamicFlags::FLEXIBLE,
4141 )
4142 }
4143
4144 pub fn r#set_key_mgmt(
4145 &self,
4146 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4147 ) -> Result<(), fidl::Error> {
4148 self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4149 payload,
4150 0xc67082685b75a5c,
4151 fidl::encoding::DynamicFlags::FLEXIBLE,
4152 )
4153 }
4154
4155 pub fn r#set_psk_passphrase(
4156 &self,
4157 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4158 ) -> Result<(), fidl::Error> {
4159 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4160 payload,
4161 0xf6d438225979307,
4162 fidl::encoding::DynamicFlags::FLEXIBLE,
4163 )
4164 }
4165
4166 pub fn r#set_sae_password(
4167 &self,
4168 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4169 ) -> Result<(), fidl::Error> {
4170 self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4171 payload,
4172 0x2982737e196747b8,
4173 fidl::encoding::DynamicFlags::FLEXIBLE,
4174 )
4175 }
4176
4177 pub fn r#set_wep_key(
4178 &self,
4179 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4180 ) -> Result<(), fidl::Error> {
4181 self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4182 payload,
4183 0x22a7e25ec81f2dee,
4184 fidl::encoding::DynamicFlags::FLEXIBLE,
4185 )
4186 }
4187
4188 pub fn r#set_wep_tx_key_idx(
4191 &self,
4192 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4193 ) -> Result<(), fidl::Error> {
4194 self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4195 payload,
4196 0x4f25576c21fcb8cb,
4197 fidl::encoding::DynamicFlags::FLEXIBLE,
4198 )
4199 }
4200
4201 pub fn r#select(
4202 &self,
4203 ___deadline: zx::MonotonicInstant,
4204 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4205 let _response = self.client.send_query::<
4206 fidl::encoding::EmptyPayload,
4207 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4208 >(
4209 (),
4210 0x354bc361a0c77b45,
4211 fidl::encoding::DynamicFlags::FLEXIBLE,
4212 ___deadline,
4213 )?
4214 .into_result::<SupplicantStaNetworkMarker>("select")?;
4215 Ok(_response.map(|x| x))
4216 }
4217}
4218
4219#[cfg(target_os = "fuchsia")]
4220impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4221 fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4222 value.into_channel().into()
4223 }
4224}
4225
4226#[cfg(target_os = "fuchsia")]
4227impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4228 fn from(value: fidl::Channel) -> Self {
4229 Self::new(value)
4230 }
4231}
4232
4233#[cfg(target_os = "fuchsia")]
4234impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4235 type Protocol = SupplicantStaNetworkMarker;
4236
4237 fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4238 Self::new(value.into_channel())
4239 }
4240}
4241
4242#[derive(Debug, Clone)]
4243pub struct SupplicantStaNetworkProxy {
4244 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4245}
4246
4247impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4248 type Protocol = SupplicantStaNetworkMarker;
4249
4250 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4251 Self::new(inner)
4252 }
4253
4254 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4255 self.client.into_channel().map_err(|client| Self { client })
4256 }
4257
4258 fn as_channel(&self) -> &::fidl::AsyncChannel {
4259 self.client.as_channel()
4260 }
4261}
4262
4263impl SupplicantStaNetworkProxy {
4264 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4266 let protocol_name =
4267 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4268 Self { client: fidl::client::Client::new(channel, protocol_name) }
4269 }
4270
4271 pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4277 SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4278 }
4279
4280 pub fn r#set_bssid(
4281 &self,
4282 mut payload: &SupplicantStaNetworkSetBssidRequest,
4283 ) -> Result<(), fidl::Error> {
4284 SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4285 }
4286
4287 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4288 SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4289 }
4290
4291 pub fn r#set_ssid(
4292 &self,
4293 mut payload: &SupplicantStaNetworkSetSsidRequest,
4294 ) -> Result<(), fidl::Error> {
4295 SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4296 }
4297
4298 pub fn r#set_key_mgmt(
4299 &self,
4300 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4301 ) -> Result<(), fidl::Error> {
4302 SupplicantStaNetworkProxyInterface::r#set_key_mgmt(self, payload)
4303 }
4304
4305 pub fn r#set_psk_passphrase(
4306 &self,
4307 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4308 ) -> Result<(), fidl::Error> {
4309 SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4310 }
4311
4312 pub fn r#set_sae_password(
4313 &self,
4314 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4315 ) -> Result<(), fidl::Error> {
4316 SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4317 }
4318
4319 pub fn r#set_wep_key(
4320 &self,
4321 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4322 ) -> Result<(), fidl::Error> {
4323 SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4324 }
4325
4326 pub fn r#set_wep_tx_key_idx(
4329 &self,
4330 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4331 ) -> Result<(), fidl::Error> {
4332 SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4333 }
4334
4335 pub fn r#select(
4336 &self,
4337 ) -> fidl::client::QueryResponseFut<
4338 SupplicantStaNetworkSelectResult,
4339 fidl::encoding::DefaultFuchsiaResourceDialect,
4340 > {
4341 SupplicantStaNetworkProxyInterface::r#select(self)
4342 }
4343}
4344
4345impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4346 fn r#set_bssid(
4347 &self,
4348 mut payload: &SupplicantStaNetworkSetBssidRequest,
4349 ) -> Result<(), fidl::Error> {
4350 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4351 payload,
4352 0x10a91d044ee6374d,
4353 fidl::encoding::DynamicFlags::FLEXIBLE,
4354 )
4355 }
4356
4357 fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4358 self.client.send::<fidl::encoding::EmptyPayload>(
4359 (),
4360 0xbc7ad82f541b267,
4361 fidl::encoding::DynamicFlags::FLEXIBLE,
4362 )
4363 }
4364
4365 fn r#set_ssid(
4366 &self,
4367 mut payload: &SupplicantStaNetworkSetSsidRequest,
4368 ) -> Result<(), fidl::Error> {
4369 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4370 payload,
4371 0x6b598a7a802e3083,
4372 fidl::encoding::DynamicFlags::FLEXIBLE,
4373 )
4374 }
4375
4376 fn r#set_key_mgmt(
4377 &self,
4378 mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4379 ) -> Result<(), fidl::Error> {
4380 self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4381 payload,
4382 0xc67082685b75a5c,
4383 fidl::encoding::DynamicFlags::FLEXIBLE,
4384 )
4385 }
4386
4387 fn r#set_psk_passphrase(
4388 &self,
4389 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4390 ) -> Result<(), fidl::Error> {
4391 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4392 payload,
4393 0xf6d438225979307,
4394 fidl::encoding::DynamicFlags::FLEXIBLE,
4395 )
4396 }
4397
4398 fn r#set_sae_password(
4399 &self,
4400 mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4401 ) -> Result<(), fidl::Error> {
4402 self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4403 payload,
4404 0x2982737e196747b8,
4405 fidl::encoding::DynamicFlags::FLEXIBLE,
4406 )
4407 }
4408
4409 fn r#set_wep_key(
4410 &self,
4411 mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4412 ) -> Result<(), fidl::Error> {
4413 self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4414 payload,
4415 0x22a7e25ec81f2dee,
4416 fidl::encoding::DynamicFlags::FLEXIBLE,
4417 )
4418 }
4419
4420 fn r#set_wep_tx_key_idx(
4421 &self,
4422 mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4423 ) -> Result<(), fidl::Error> {
4424 self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4425 payload,
4426 0x4f25576c21fcb8cb,
4427 fidl::encoding::DynamicFlags::FLEXIBLE,
4428 )
4429 }
4430
4431 type SelectResponseFut = fidl::client::QueryResponseFut<
4432 SupplicantStaNetworkSelectResult,
4433 fidl::encoding::DefaultFuchsiaResourceDialect,
4434 >;
4435 fn r#select(&self) -> Self::SelectResponseFut {
4436 fn _decode(
4437 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4438 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4439 let _response = fidl::client::decode_transaction_body::<
4440 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4441 fidl::encoding::DefaultFuchsiaResourceDialect,
4442 0x354bc361a0c77b45,
4443 >(_buf?)?
4444 .into_result::<SupplicantStaNetworkMarker>("select")?;
4445 Ok(_response.map(|x| x))
4446 }
4447 self.client.send_query_and_decode::<
4448 fidl::encoding::EmptyPayload,
4449 SupplicantStaNetworkSelectResult,
4450 >(
4451 (),
4452 0x354bc361a0c77b45,
4453 fidl::encoding::DynamicFlags::FLEXIBLE,
4454 _decode,
4455 )
4456 }
4457}
4458
4459pub struct SupplicantStaNetworkEventStream {
4460 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4461}
4462
4463impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4464
4465impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4466 fn is_terminated(&self) -> bool {
4467 self.event_receiver.is_terminated()
4468 }
4469}
4470
4471impl futures::Stream for SupplicantStaNetworkEventStream {
4472 type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4473
4474 fn poll_next(
4475 mut self: std::pin::Pin<&mut Self>,
4476 cx: &mut std::task::Context<'_>,
4477 ) -> std::task::Poll<Option<Self::Item>> {
4478 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4479 &mut self.event_receiver,
4480 cx
4481 )?) {
4482 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4483 None => std::task::Poll::Ready(None),
4484 }
4485 }
4486}
4487
4488#[derive(Debug)]
4489pub enum SupplicantStaNetworkEvent {
4490 #[non_exhaustive]
4491 _UnknownEvent {
4492 ordinal: u64,
4494 },
4495}
4496
4497impl SupplicantStaNetworkEvent {
4498 fn decode(
4500 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4501 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4502 let (bytes, _handles) = buf.split_mut();
4503 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4504 debug_assert_eq!(tx_header.tx_id, 0);
4505 match tx_header.ordinal {
4506 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4507 Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4508 }
4509 _ => Err(fidl::Error::UnknownOrdinal {
4510 ordinal: tx_header.ordinal,
4511 protocol_name:
4512 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4513 }),
4514 }
4515 }
4516}
4517
4518pub struct SupplicantStaNetworkRequestStream {
4520 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4521 is_terminated: bool,
4522}
4523
4524impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4525
4526impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4527 fn is_terminated(&self) -> bool {
4528 self.is_terminated
4529 }
4530}
4531
4532impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4533 type Protocol = SupplicantStaNetworkMarker;
4534 type ControlHandle = SupplicantStaNetworkControlHandle;
4535
4536 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4537 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4538 }
4539
4540 fn control_handle(&self) -> Self::ControlHandle {
4541 SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4542 }
4543
4544 fn into_inner(
4545 self,
4546 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4547 {
4548 (self.inner, self.is_terminated)
4549 }
4550
4551 fn from_inner(
4552 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4553 is_terminated: bool,
4554 ) -> Self {
4555 Self { inner, is_terminated }
4556 }
4557}
4558
4559impl futures::Stream for SupplicantStaNetworkRequestStream {
4560 type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4561
4562 fn poll_next(
4563 mut self: std::pin::Pin<&mut Self>,
4564 cx: &mut std::task::Context<'_>,
4565 ) -> std::task::Poll<Option<Self::Item>> {
4566 let this = &mut *self;
4567 if this.inner.check_shutdown(cx) {
4568 this.is_terminated = true;
4569 return std::task::Poll::Ready(None);
4570 }
4571 if this.is_terminated {
4572 panic!("polled SupplicantStaNetworkRequestStream after completion");
4573 }
4574 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4575 |bytes, handles| {
4576 match this.inner.channel().read_etc(cx, bytes, handles) {
4577 std::task::Poll::Ready(Ok(())) => {}
4578 std::task::Poll::Pending => return std::task::Poll::Pending,
4579 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4580 this.is_terminated = true;
4581 return std::task::Poll::Ready(None);
4582 }
4583 std::task::Poll::Ready(Err(e)) => {
4584 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4585 e.into(),
4586 ))));
4587 }
4588 }
4589
4590 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4592
4593 std::task::Poll::Ready(Some(match header.ordinal {
4594 0x10a91d044ee6374d => {
4595 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4596 let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4597 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4598 let control_handle = SupplicantStaNetworkControlHandle {
4599 inner: this.inner.clone(),
4600 };
4601 Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4602 control_handle,
4603 })
4604 }
4605 0xbc7ad82f541b267 => {
4606 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4607 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4608 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4609 let control_handle = SupplicantStaNetworkControlHandle {
4610 inner: this.inner.clone(),
4611 };
4612 Ok(SupplicantStaNetworkRequest::ClearBssid {
4613 control_handle,
4614 })
4615 }
4616 0x6b598a7a802e3083 => {
4617 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4618 let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4619 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4620 let control_handle = SupplicantStaNetworkControlHandle {
4621 inner: this.inner.clone(),
4622 };
4623 Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4624 control_handle,
4625 })
4626 }
4627 0xc67082685b75a5c => {
4628 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4629 let mut req = fidl::new_empty!(SupplicantStaNetworkSetKeyMgmtRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4630 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetKeyMgmtRequest>(&header, _body_bytes, handles, &mut req)?;
4631 let control_handle = SupplicantStaNetworkControlHandle {
4632 inner: this.inner.clone(),
4633 };
4634 Ok(SupplicantStaNetworkRequest::SetKeyMgmt {payload: req,
4635 control_handle,
4636 })
4637 }
4638 0xf6d438225979307 => {
4639 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4640 let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4641 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4642 let control_handle = SupplicantStaNetworkControlHandle {
4643 inner: this.inner.clone(),
4644 };
4645 Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4646 control_handle,
4647 })
4648 }
4649 0x2982737e196747b8 => {
4650 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4651 let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4652 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4653 let control_handle = SupplicantStaNetworkControlHandle {
4654 inner: this.inner.clone(),
4655 };
4656 Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4657 control_handle,
4658 })
4659 }
4660 0x22a7e25ec81f2dee => {
4661 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4662 let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4663 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4664 let control_handle = SupplicantStaNetworkControlHandle {
4665 inner: this.inner.clone(),
4666 };
4667 Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4668 control_handle,
4669 })
4670 }
4671 0x4f25576c21fcb8cb => {
4672 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4673 let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4674 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4675 let control_handle = SupplicantStaNetworkControlHandle {
4676 inner: this.inner.clone(),
4677 };
4678 Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4679 control_handle,
4680 })
4681 }
4682 0x354bc361a0c77b45 => {
4683 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4684 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4685 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4686 let control_handle = SupplicantStaNetworkControlHandle {
4687 inner: this.inner.clone(),
4688 };
4689 Ok(SupplicantStaNetworkRequest::Select {
4690 responder: SupplicantStaNetworkSelectResponder {
4691 control_handle: std::mem::ManuallyDrop::new(control_handle),
4692 tx_id: header.tx_id,
4693 },
4694 })
4695 }
4696 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4697 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4698 ordinal: header.ordinal,
4699 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4700 method_type: fidl::MethodType::OneWay,
4701 })
4702 }
4703 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4704 this.inner.send_framework_err(
4705 fidl::encoding::FrameworkErr::UnknownMethod,
4706 header.tx_id,
4707 header.ordinal,
4708 header.dynamic_flags(),
4709 (bytes, handles),
4710 )?;
4711 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4712 ordinal: header.ordinal,
4713 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4714 method_type: fidl::MethodType::TwoWay,
4715 })
4716 }
4717 _ => Err(fidl::Error::UnknownOrdinal {
4718 ordinal: header.ordinal,
4719 protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4720 }),
4721 }))
4722 },
4723 )
4724 }
4725}
4726
4727#[derive(Debug)]
4728pub enum SupplicantStaNetworkRequest {
4729 SetBssid {
4730 payload: SupplicantStaNetworkSetBssidRequest,
4731 control_handle: SupplicantStaNetworkControlHandle,
4732 },
4733 ClearBssid {
4734 control_handle: SupplicantStaNetworkControlHandle,
4735 },
4736 SetSsid {
4737 payload: SupplicantStaNetworkSetSsidRequest,
4738 control_handle: SupplicantStaNetworkControlHandle,
4739 },
4740 SetKeyMgmt {
4741 payload: SupplicantStaNetworkSetKeyMgmtRequest,
4742 control_handle: SupplicantStaNetworkControlHandle,
4743 },
4744 SetPskPassphrase {
4745 payload: SupplicantStaNetworkSetPskPassphraseRequest,
4746 control_handle: SupplicantStaNetworkControlHandle,
4747 },
4748 SetSaePassword {
4749 payload: SupplicantStaNetworkSetSaePasswordRequest,
4750 control_handle: SupplicantStaNetworkControlHandle,
4751 },
4752 SetWepKey {
4753 payload: SupplicantStaNetworkSetWepKeyRequest,
4754 control_handle: SupplicantStaNetworkControlHandle,
4755 },
4756 SetWepTxKeyIdx {
4759 payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4760 control_handle: SupplicantStaNetworkControlHandle,
4761 },
4762 Select {
4763 responder: SupplicantStaNetworkSelectResponder,
4764 },
4765 #[non_exhaustive]
4767 _UnknownMethod {
4768 ordinal: u64,
4770 control_handle: SupplicantStaNetworkControlHandle,
4771 method_type: fidl::MethodType,
4772 },
4773}
4774
4775impl SupplicantStaNetworkRequest {
4776 #[allow(irrefutable_let_patterns)]
4777 pub fn into_set_bssid(
4778 self,
4779 ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4780 if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4781 Some((payload, control_handle))
4782 } else {
4783 None
4784 }
4785 }
4786
4787 #[allow(irrefutable_let_patterns)]
4788 pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4789 if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4790 Some((control_handle))
4791 } else {
4792 None
4793 }
4794 }
4795
4796 #[allow(irrefutable_let_patterns)]
4797 pub fn into_set_ssid(
4798 self,
4799 ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4800 if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4801 Some((payload, control_handle))
4802 } else {
4803 None
4804 }
4805 }
4806
4807 #[allow(irrefutable_let_patterns)]
4808 pub fn into_set_key_mgmt(
4809 self,
4810 ) -> Option<(SupplicantStaNetworkSetKeyMgmtRequest, SupplicantStaNetworkControlHandle)> {
4811 if let SupplicantStaNetworkRequest::SetKeyMgmt { 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_psk_passphrase(
4820 self,
4821 ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
4822 {
4823 if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
4824 Some((payload, control_handle))
4825 } else {
4826 None
4827 }
4828 }
4829
4830 #[allow(irrefutable_let_patterns)]
4831 pub fn into_set_sae_password(
4832 self,
4833 ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
4834 {
4835 if let SupplicantStaNetworkRequest::SetSaePassword { payload, control_handle } = self {
4836 Some((payload, control_handle))
4837 } else {
4838 None
4839 }
4840 }
4841
4842 #[allow(irrefutable_let_patterns)]
4843 pub fn into_set_wep_key(
4844 self,
4845 ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
4846 if let SupplicantStaNetworkRequest::SetWepKey { 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_tx_key_idx(
4855 self,
4856 ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
4857 {
4858 if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
4859 Some((payload, control_handle))
4860 } else {
4861 None
4862 }
4863 }
4864
4865 #[allow(irrefutable_let_patterns)]
4866 pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
4867 if let SupplicantStaNetworkRequest::Select { responder } = self {
4868 Some((responder))
4869 } else {
4870 None
4871 }
4872 }
4873
4874 pub fn method_name(&self) -> &'static str {
4876 match *self {
4877 SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
4878 SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
4879 SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
4880 SupplicantStaNetworkRequest::SetKeyMgmt { .. } => "set_key_mgmt",
4881 SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
4882 SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
4883 SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
4884 SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
4885 SupplicantStaNetworkRequest::Select { .. } => "select",
4886 SupplicantStaNetworkRequest::_UnknownMethod {
4887 method_type: fidl::MethodType::OneWay,
4888 ..
4889 } => "unknown one-way method",
4890 SupplicantStaNetworkRequest::_UnknownMethod {
4891 method_type: fidl::MethodType::TwoWay,
4892 ..
4893 } => "unknown two-way method",
4894 }
4895 }
4896}
4897
4898#[derive(Debug, Clone)]
4899pub struct SupplicantStaNetworkControlHandle {
4900 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4901}
4902
4903impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
4904 fn shutdown(&self) {
4905 self.inner.shutdown()
4906 }
4907
4908 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4909 self.inner.shutdown_with_epitaph(status)
4910 }
4911
4912 fn is_closed(&self) -> bool {
4913 self.inner.channel().is_closed()
4914 }
4915 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4916 self.inner.channel().on_closed()
4917 }
4918
4919 #[cfg(target_os = "fuchsia")]
4920 fn signal_peer(
4921 &self,
4922 clear_mask: zx::Signals,
4923 set_mask: zx::Signals,
4924 ) -> Result<(), zx_status::Status> {
4925 use fidl::Peered;
4926 self.inner.channel().signal_peer(clear_mask, set_mask)
4927 }
4928}
4929
4930impl SupplicantStaNetworkControlHandle {}
4931
4932#[must_use = "FIDL methods require a response to be sent"]
4933#[derive(Debug)]
4934pub struct SupplicantStaNetworkSelectResponder {
4935 control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
4936 tx_id: u32,
4937}
4938
4939impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
4943 fn drop(&mut self) {
4944 self.control_handle.shutdown();
4945 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4947 }
4948}
4949
4950impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
4951 type ControlHandle = SupplicantStaNetworkControlHandle;
4952
4953 fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
4954 &self.control_handle
4955 }
4956
4957 fn drop_without_shutdown(mut self) {
4958 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4960 std::mem::forget(self);
4962 }
4963}
4964
4965impl SupplicantStaNetworkSelectResponder {
4966 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4970 let _result = self.send_raw(result);
4971 if _result.is_err() {
4972 self.control_handle.shutdown();
4973 }
4974 self.drop_without_shutdown();
4975 _result
4976 }
4977
4978 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4980 let _result = self.send_raw(result);
4981 self.drop_without_shutdown();
4982 _result
4983 }
4984
4985 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4986 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4987 fidl::encoding::EmptyStruct,
4988 i32,
4989 >>(
4990 fidl::encoding::FlexibleResult::new(result),
4991 self.tx_id,
4992 0x354bc361a0c77b45,
4993 fidl::encoding::DynamicFlags::FLEXIBLE,
4994 )
4995 }
4996}
4997
4998#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4999pub struct WifiMarker;
5000
5001impl fidl::endpoints::ProtocolMarker for WifiMarker {
5002 type Proxy = WifiProxy;
5003 type RequestStream = WifiRequestStream;
5004 #[cfg(target_os = "fuchsia")]
5005 type SynchronousProxy = WifiSynchronousProxy;
5006
5007 const DEBUG_NAME: &'static str = "(anonymous) Wifi";
5008}
5009pub type WifiStartResult = Result<(), i32>;
5010pub type WifiStopResult = Result<(), i32>;
5011pub type WifiGetChipResult = Result<(), i32>;
5012
5013pub trait WifiProxyInterface: Send + Sync {
5014 fn r#register_event_callback(
5015 &self,
5016 payload: WifiRegisterEventCallbackRequest,
5017 ) -> Result<(), fidl::Error>;
5018 type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
5019 fn r#start(&self) -> Self::StartResponseFut;
5020 type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
5021 fn r#stop(&self) -> Self::StopResponseFut;
5022 type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
5023 + Send;
5024 fn r#get_state(&self) -> Self::GetStateResponseFut;
5025 type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
5026 + Send;
5027 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
5028 type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
5029 + Send;
5030 fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
5031}
5032#[derive(Debug)]
5033#[cfg(target_os = "fuchsia")]
5034pub struct WifiSynchronousProxy {
5035 client: fidl::client::sync::Client,
5036}
5037
5038#[cfg(target_os = "fuchsia")]
5039impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
5040 type Proxy = WifiProxy;
5041 type Protocol = WifiMarker;
5042
5043 fn from_channel(inner: fidl::Channel) -> Self {
5044 Self::new(inner)
5045 }
5046
5047 fn into_channel(self) -> fidl::Channel {
5048 self.client.into_channel()
5049 }
5050
5051 fn as_channel(&self) -> &fidl::Channel {
5052 self.client.as_channel()
5053 }
5054}
5055
5056#[cfg(target_os = "fuchsia")]
5057impl WifiSynchronousProxy {
5058 pub fn new(channel: fidl::Channel) -> Self {
5059 let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5060 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5061 }
5062
5063 pub fn into_channel(self) -> fidl::Channel {
5064 self.client.into_channel()
5065 }
5066
5067 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
5070 WifiEvent::decode(self.client.wait_for_event(deadline)?)
5071 }
5072
5073 pub fn r#register_event_callback(
5076 &self,
5077 mut payload: WifiRegisterEventCallbackRequest,
5078 ) -> Result<(), fidl::Error> {
5079 self.client.send::<WifiRegisterEventCallbackRequest>(
5080 &mut payload,
5081 0x12abbdea948dd67b,
5082 fidl::encoding::DynamicFlags::FLEXIBLE,
5083 )
5084 }
5085
5086 pub fn r#start(
5090 &self,
5091 ___deadline: zx::MonotonicInstant,
5092 ) -> Result<WifiStartResult, fidl::Error> {
5093 let _response = self.client.send_query::<
5094 fidl::encoding::EmptyPayload,
5095 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5096 >(
5097 (),
5098 0x427030e4dc6ec07a,
5099 fidl::encoding::DynamicFlags::FLEXIBLE,
5100 ___deadline,
5101 )?
5102 .into_result::<WifiMarker>("start")?;
5103 Ok(_response.map(|x| x))
5104 }
5105
5106 pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
5110 let _response = self.client.send_query::<
5111 fidl::encoding::EmptyPayload,
5112 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5113 >(
5114 (),
5115 0x67c9bdf61b2888d,
5116 fidl::encoding::DynamicFlags::FLEXIBLE,
5117 ___deadline,
5118 )?
5119 .into_result::<WifiMarker>("stop")?;
5120 Ok(_response.map(|x| x))
5121 }
5122
5123 pub fn r#get_state(
5125 &self,
5126 ___deadline: zx::MonotonicInstant,
5127 ) -> Result<WifiGetStateResponse, fidl::Error> {
5128 let _response = self.client.send_query::<
5129 fidl::encoding::EmptyPayload,
5130 fidl::encoding::FlexibleType<WifiGetStateResponse>,
5131 >(
5132 (),
5133 0x4616114a937d1fb0,
5134 fidl::encoding::DynamicFlags::FLEXIBLE,
5135 ___deadline,
5136 )?
5137 .into_result::<WifiMarker>("get_state")?;
5138 Ok(_response)
5139 }
5140
5141 pub fn r#get_chip_ids(
5143 &self,
5144 ___deadline: zx::MonotonicInstant,
5145 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5146 let _response = self.client.send_query::<
5147 fidl::encoding::EmptyPayload,
5148 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5149 >(
5150 (),
5151 0x2fb4f92351d802b5,
5152 fidl::encoding::DynamicFlags::FLEXIBLE,
5153 ___deadline,
5154 )?
5155 .into_result::<WifiMarker>("get_chip_ids")?;
5156 Ok(_response)
5157 }
5158
5159 pub fn r#get_chip(
5162 &self,
5163 mut payload: WifiGetChipRequest,
5164 ___deadline: zx::MonotonicInstant,
5165 ) -> Result<WifiGetChipResult, fidl::Error> {
5166 let _response = self.client.send_query::<
5167 WifiGetChipRequest,
5168 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5169 >(
5170 &mut payload,
5171 0xef95d8246612540,
5172 fidl::encoding::DynamicFlags::FLEXIBLE,
5173 ___deadline,
5174 )?
5175 .into_result::<WifiMarker>("get_chip")?;
5176 Ok(_response.map(|x| x))
5177 }
5178}
5179
5180#[cfg(target_os = "fuchsia")]
5181impl From<WifiSynchronousProxy> for zx::NullableHandle {
5182 fn from(value: WifiSynchronousProxy) -> Self {
5183 value.into_channel().into()
5184 }
5185}
5186
5187#[cfg(target_os = "fuchsia")]
5188impl From<fidl::Channel> for WifiSynchronousProxy {
5189 fn from(value: fidl::Channel) -> Self {
5190 Self::new(value)
5191 }
5192}
5193
5194#[cfg(target_os = "fuchsia")]
5195impl fidl::endpoints::FromClient for WifiSynchronousProxy {
5196 type Protocol = WifiMarker;
5197
5198 fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
5199 Self::new(value.into_channel())
5200 }
5201}
5202
5203#[derive(Debug, Clone)]
5204pub struct WifiProxy {
5205 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5206}
5207
5208impl fidl::endpoints::Proxy for WifiProxy {
5209 type Protocol = WifiMarker;
5210
5211 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5212 Self::new(inner)
5213 }
5214
5215 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5216 self.client.into_channel().map_err(|client| Self { client })
5217 }
5218
5219 fn as_channel(&self) -> &::fidl::AsyncChannel {
5220 self.client.as_channel()
5221 }
5222}
5223
5224impl WifiProxy {
5225 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5227 let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5228 Self { client: fidl::client::Client::new(channel, protocol_name) }
5229 }
5230
5231 pub fn take_event_stream(&self) -> WifiEventStream {
5237 WifiEventStream { event_receiver: self.client.take_event_receiver() }
5238 }
5239
5240 pub fn r#register_event_callback(
5243 &self,
5244 mut payload: WifiRegisterEventCallbackRequest,
5245 ) -> Result<(), fidl::Error> {
5246 WifiProxyInterface::r#register_event_callback(self, payload)
5247 }
5248
5249 pub fn r#start(
5253 &self,
5254 ) -> fidl::client::QueryResponseFut<
5255 WifiStartResult,
5256 fidl::encoding::DefaultFuchsiaResourceDialect,
5257 > {
5258 WifiProxyInterface::r#start(self)
5259 }
5260
5261 pub fn r#stop(
5265 &self,
5266 ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5267 {
5268 WifiProxyInterface::r#stop(self)
5269 }
5270
5271 pub fn r#get_state(
5273 &self,
5274 ) -> fidl::client::QueryResponseFut<
5275 WifiGetStateResponse,
5276 fidl::encoding::DefaultFuchsiaResourceDialect,
5277 > {
5278 WifiProxyInterface::r#get_state(self)
5279 }
5280
5281 pub fn r#get_chip_ids(
5283 &self,
5284 ) -> fidl::client::QueryResponseFut<
5285 WifiGetChipIdsResponse,
5286 fidl::encoding::DefaultFuchsiaResourceDialect,
5287 > {
5288 WifiProxyInterface::r#get_chip_ids(self)
5289 }
5290
5291 pub fn r#get_chip(
5294 &self,
5295 mut payload: WifiGetChipRequest,
5296 ) -> fidl::client::QueryResponseFut<
5297 WifiGetChipResult,
5298 fidl::encoding::DefaultFuchsiaResourceDialect,
5299 > {
5300 WifiProxyInterface::r#get_chip(self, payload)
5301 }
5302}
5303
5304impl WifiProxyInterface for WifiProxy {
5305 fn r#register_event_callback(
5306 &self,
5307 mut payload: WifiRegisterEventCallbackRequest,
5308 ) -> Result<(), fidl::Error> {
5309 self.client.send::<WifiRegisterEventCallbackRequest>(
5310 &mut payload,
5311 0x12abbdea948dd67b,
5312 fidl::encoding::DynamicFlags::FLEXIBLE,
5313 )
5314 }
5315
5316 type StartResponseFut = fidl::client::QueryResponseFut<
5317 WifiStartResult,
5318 fidl::encoding::DefaultFuchsiaResourceDialect,
5319 >;
5320 fn r#start(&self) -> Self::StartResponseFut {
5321 fn _decode(
5322 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5323 ) -> Result<WifiStartResult, fidl::Error> {
5324 let _response = fidl::client::decode_transaction_body::<
5325 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5326 fidl::encoding::DefaultFuchsiaResourceDialect,
5327 0x427030e4dc6ec07a,
5328 >(_buf?)?
5329 .into_result::<WifiMarker>("start")?;
5330 Ok(_response.map(|x| x))
5331 }
5332 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5333 (),
5334 0x427030e4dc6ec07a,
5335 fidl::encoding::DynamicFlags::FLEXIBLE,
5336 _decode,
5337 )
5338 }
5339
5340 type StopResponseFut = fidl::client::QueryResponseFut<
5341 WifiStopResult,
5342 fidl::encoding::DefaultFuchsiaResourceDialect,
5343 >;
5344 fn r#stop(&self) -> Self::StopResponseFut {
5345 fn _decode(
5346 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5347 ) -> Result<WifiStopResult, fidl::Error> {
5348 let _response = fidl::client::decode_transaction_body::<
5349 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5350 fidl::encoding::DefaultFuchsiaResourceDialect,
5351 0x67c9bdf61b2888d,
5352 >(_buf?)?
5353 .into_result::<WifiMarker>("stop")?;
5354 Ok(_response.map(|x| x))
5355 }
5356 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5357 (),
5358 0x67c9bdf61b2888d,
5359 fidl::encoding::DynamicFlags::FLEXIBLE,
5360 _decode,
5361 )
5362 }
5363
5364 type GetStateResponseFut = fidl::client::QueryResponseFut<
5365 WifiGetStateResponse,
5366 fidl::encoding::DefaultFuchsiaResourceDialect,
5367 >;
5368 fn r#get_state(&self) -> Self::GetStateResponseFut {
5369 fn _decode(
5370 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5371 ) -> Result<WifiGetStateResponse, fidl::Error> {
5372 let _response = fidl::client::decode_transaction_body::<
5373 fidl::encoding::FlexibleType<WifiGetStateResponse>,
5374 fidl::encoding::DefaultFuchsiaResourceDialect,
5375 0x4616114a937d1fb0,
5376 >(_buf?)?
5377 .into_result::<WifiMarker>("get_state")?;
5378 Ok(_response)
5379 }
5380 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5381 (),
5382 0x4616114a937d1fb0,
5383 fidl::encoding::DynamicFlags::FLEXIBLE,
5384 _decode,
5385 )
5386 }
5387
5388 type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5389 WifiGetChipIdsResponse,
5390 fidl::encoding::DefaultFuchsiaResourceDialect,
5391 >;
5392 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5393 fn _decode(
5394 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5395 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5396 let _response = fidl::client::decode_transaction_body::<
5397 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5398 fidl::encoding::DefaultFuchsiaResourceDialect,
5399 0x2fb4f92351d802b5,
5400 >(_buf?)?
5401 .into_result::<WifiMarker>("get_chip_ids")?;
5402 Ok(_response)
5403 }
5404 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5405 (),
5406 0x2fb4f92351d802b5,
5407 fidl::encoding::DynamicFlags::FLEXIBLE,
5408 _decode,
5409 )
5410 }
5411
5412 type GetChipResponseFut = fidl::client::QueryResponseFut<
5413 WifiGetChipResult,
5414 fidl::encoding::DefaultFuchsiaResourceDialect,
5415 >;
5416 fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5417 fn _decode(
5418 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5419 ) -> Result<WifiGetChipResult, fidl::Error> {
5420 let _response = fidl::client::decode_transaction_body::<
5421 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5422 fidl::encoding::DefaultFuchsiaResourceDialect,
5423 0xef95d8246612540,
5424 >(_buf?)?
5425 .into_result::<WifiMarker>("get_chip")?;
5426 Ok(_response.map(|x| x))
5427 }
5428 self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5429 &mut payload,
5430 0xef95d8246612540,
5431 fidl::encoding::DynamicFlags::FLEXIBLE,
5432 _decode,
5433 )
5434 }
5435}
5436
5437pub struct WifiEventStream {
5438 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5439}
5440
5441impl std::marker::Unpin for WifiEventStream {}
5442
5443impl futures::stream::FusedStream for WifiEventStream {
5444 fn is_terminated(&self) -> bool {
5445 self.event_receiver.is_terminated()
5446 }
5447}
5448
5449impl futures::Stream for WifiEventStream {
5450 type Item = Result<WifiEvent, fidl::Error>;
5451
5452 fn poll_next(
5453 mut self: std::pin::Pin<&mut Self>,
5454 cx: &mut std::task::Context<'_>,
5455 ) -> std::task::Poll<Option<Self::Item>> {
5456 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5457 &mut self.event_receiver,
5458 cx
5459 )?) {
5460 Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5461 None => std::task::Poll::Ready(None),
5462 }
5463 }
5464}
5465
5466#[derive(Debug)]
5467pub enum WifiEvent {
5468 #[non_exhaustive]
5469 _UnknownEvent {
5470 ordinal: u64,
5472 },
5473}
5474
5475impl WifiEvent {
5476 fn decode(
5478 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5479 ) -> Result<WifiEvent, fidl::Error> {
5480 let (bytes, _handles) = buf.split_mut();
5481 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5482 debug_assert_eq!(tx_header.tx_id, 0);
5483 match tx_header.ordinal {
5484 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5485 Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5486 }
5487 _ => Err(fidl::Error::UnknownOrdinal {
5488 ordinal: tx_header.ordinal,
5489 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5490 }),
5491 }
5492 }
5493}
5494
5495pub struct WifiRequestStream {
5497 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5498 is_terminated: bool,
5499}
5500
5501impl std::marker::Unpin for WifiRequestStream {}
5502
5503impl futures::stream::FusedStream for WifiRequestStream {
5504 fn is_terminated(&self) -> bool {
5505 self.is_terminated
5506 }
5507}
5508
5509impl fidl::endpoints::RequestStream for WifiRequestStream {
5510 type Protocol = WifiMarker;
5511 type ControlHandle = WifiControlHandle;
5512
5513 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5514 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5515 }
5516
5517 fn control_handle(&self) -> Self::ControlHandle {
5518 WifiControlHandle { inner: self.inner.clone() }
5519 }
5520
5521 fn into_inner(
5522 self,
5523 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5524 {
5525 (self.inner, self.is_terminated)
5526 }
5527
5528 fn from_inner(
5529 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5530 is_terminated: bool,
5531 ) -> Self {
5532 Self { inner, is_terminated }
5533 }
5534}
5535
5536impl futures::Stream for WifiRequestStream {
5537 type Item = Result<WifiRequest, fidl::Error>;
5538
5539 fn poll_next(
5540 mut self: std::pin::Pin<&mut Self>,
5541 cx: &mut std::task::Context<'_>,
5542 ) -> std::task::Poll<Option<Self::Item>> {
5543 let this = &mut *self;
5544 if this.inner.check_shutdown(cx) {
5545 this.is_terminated = true;
5546 return std::task::Poll::Ready(None);
5547 }
5548 if this.is_terminated {
5549 panic!("polled WifiRequestStream after completion");
5550 }
5551 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5552 |bytes, handles| {
5553 match this.inner.channel().read_etc(cx, bytes, handles) {
5554 std::task::Poll::Ready(Ok(())) => {}
5555 std::task::Poll::Pending => return std::task::Poll::Pending,
5556 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5557 this.is_terminated = true;
5558 return std::task::Poll::Ready(None);
5559 }
5560 std::task::Poll::Ready(Err(e)) => {
5561 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5562 e.into(),
5563 ))));
5564 }
5565 }
5566
5567 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5569
5570 std::task::Poll::Ready(Some(match header.ordinal {
5571 0x12abbdea948dd67b => {
5572 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5573 let mut req = fidl::new_empty!(
5574 WifiRegisterEventCallbackRequest,
5575 fidl::encoding::DefaultFuchsiaResourceDialect
5576 );
5577 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5578 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5579 Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5580 }
5581 0x427030e4dc6ec07a => {
5582 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5583 let mut req = fidl::new_empty!(
5584 fidl::encoding::EmptyPayload,
5585 fidl::encoding::DefaultFuchsiaResourceDialect
5586 );
5587 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5588 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5589 Ok(WifiRequest::Start {
5590 responder: WifiStartResponder {
5591 control_handle: std::mem::ManuallyDrop::new(control_handle),
5592 tx_id: header.tx_id,
5593 },
5594 })
5595 }
5596 0x67c9bdf61b2888d => {
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::Stop {
5605 responder: WifiStopResponder {
5606 control_handle: std::mem::ManuallyDrop::new(control_handle),
5607 tx_id: header.tx_id,
5608 },
5609 })
5610 }
5611 0x4616114a937d1fb0 => {
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::GetState {
5620 responder: WifiGetStateResponder {
5621 control_handle: std::mem::ManuallyDrop::new(control_handle),
5622 tx_id: header.tx_id,
5623 },
5624 })
5625 }
5626 0x2fb4f92351d802b5 => {
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::GetChipIds {
5635 responder: WifiGetChipIdsResponder {
5636 control_handle: std::mem::ManuallyDrop::new(control_handle),
5637 tx_id: header.tx_id,
5638 },
5639 })
5640 }
5641 0xef95d8246612540 => {
5642 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5643 let mut req = fidl::new_empty!(
5644 WifiGetChipRequest,
5645 fidl::encoding::DefaultFuchsiaResourceDialect
5646 );
5647 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5648 let control_handle = WifiControlHandle { inner: this.inner.clone() };
5649 Ok(WifiRequest::GetChip {
5650 payload: req,
5651 responder: WifiGetChipResponder {
5652 control_handle: std::mem::ManuallyDrop::new(control_handle),
5653 tx_id: header.tx_id,
5654 },
5655 })
5656 }
5657 _ if header.tx_id == 0
5658 && header
5659 .dynamic_flags()
5660 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5661 {
5662 Ok(WifiRequest::_UnknownMethod {
5663 ordinal: header.ordinal,
5664 control_handle: WifiControlHandle { inner: this.inner.clone() },
5665 method_type: fidl::MethodType::OneWay,
5666 })
5667 }
5668 _ if header
5669 .dynamic_flags()
5670 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5671 {
5672 this.inner.send_framework_err(
5673 fidl::encoding::FrameworkErr::UnknownMethod,
5674 header.tx_id,
5675 header.ordinal,
5676 header.dynamic_flags(),
5677 (bytes, handles),
5678 )?;
5679 Ok(WifiRequest::_UnknownMethod {
5680 ordinal: header.ordinal,
5681 control_handle: WifiControlHandle { inner: this.inner.clone() },
5682 method_type: fidl::MethodType::TwoWay,
5683 })
5684 }
5685 _ => Err(fidl::Error::UnknownOrdinal {
5686 ordinal: header.ordinal,
5687 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5688 }),
5689 }))
5690 },
5691 )
5692 }
5693}
5694
5695#[derive(Debug)]
5696pub enum WifiRequest {
5697 RegisterEventCallback {
5700 payload: WifiRegisterEventCallbackRequest,
5701 control_handle: WifiControlHandle,
5702 },
5703 Start { responder: WifiStartResponder },
5707 Stop { responder: WifiStopResponder },
5711 GetState { responder: WifiGetStateResponder },
5713 GetChipIds { responder: WifiGetChipIdsResponder },
5715 GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5718 #[non_exhaustive]
5720 _UnknownMethod {
5721 ordinal: u64,
5723 control_handle: WifiControlHandle,
5724 method_type: fidl::MethodType,
5725 },
5726}
5727
5728impl WifiRequest {
5729 #[allow(irrefutable_let_patterns)]
5730 pub fn into_register_event_callback(
5731 self,
5732 ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5733 if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5734 Some((payload, control_handle))
5735 } else {
5736 None
5737 }
5738 }
5739
5740 #[allow(irrefutable_let_patterns)]
5741 pub fn into_start(self) -> Option<(WifiStartResponder)> {
5742 if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5743 }
5744
5745 #[allow(irrefutable_let_patterns)]
5746 pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5747 if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5748 }
5749
5750 #[allow(irrefutable_let_patterns)]
5751 pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5752 if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5753 }
5754
5755 #[allow(irrefutable_let_patterns)]
5756 pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5757 if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5758 }
5759
5760 #[allow(irrefutable_let_patterns)]
5761 pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5762 if let WifiRequest::GetChip { payload, responder } = self {
5763 Some((payload, responder))
5764 } else {
5765 None
5766 }
5767 }
5768
5769 pub fn method_name(&self) -> &'static str {
5771 match *self {
5772 WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5773 WifiRequest::Start { .. } => "start",
5774 WifiRequest::Stop { .. } => "stop",
5775 WifiRequest::GetState { .. } => "get_state",
5776 WifiRequest::GetChipIds { .. } => "get_chip_ids",
5777 WifiRequest::GetChip { .. } => "get_chip",
5778 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5779 "unknown one-way method"
5780 }
5781 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5782 "unknown two-way method"
5783 }
5784 }
5785 }
5786}
5787
5788#[derive(Debug, Clone)]
5789pub struct WifiControlHandle {
5790 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5791}
5792
5793impl fidl::endpoints::ControlHandle for WifiControlHandle {
5794 fn shutdown(&self) {
5795 self.inner.shutdown()
5796 }
5797
5798 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5799 self.inner.shutdown_with_epitaph(status)
5800 }
5801
5802 fn is_closed(&self) -> bool {
5803 self.inner.channel().is_closed()
5804 }
5805 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5806 self.inner.channel().on_closed()
5807 }
5808
5809 #[cfg(target_os = "fuchsia")]
5810 fn signal_peer(
5811 &self,
5812 clear_mask: zx::Signals,
5813 set_mask: zx::Signals,
5814 ) -> Result<(), zx_status::Status> {
5815 use fidl::Peered;
5816 self.inner.channel().signal_peer(clear_mask, set_mask)
5817 }
5818}
5819
5820impl WifiControlHandle {}
5821
5822#[must_use = "FIDL methods require a response to be sent"]
5823#[derive(Debug)]
5824pub struct WifiStartResponder {
5825 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5826 tx_id: u32,
5827}
5828
5829impl std::ops::Drop for WifiStartResponder {
5833 fn drop(&mut self) {
5834 self.control_handle.shutdown();
5835 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5837 }
5838}
5839
5840impl fidl::endpoints::Responder for WifiStartResponder {
5841 type ControlHandle = WifiControlHandle;
5842
5843 fn control_handle(&self) -> &WifiControlHandle {
5844 &self.control_handle
5845 }
5846
5847 fn drop_without_shutdown(mut self) {
5848 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5850 std::mem::forget(self);
5852 }
5853}
5854
5855impl WifiStartResponder {
5856 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5860 let _result = self.send_raw(result);
5861 if _result.is_err() {
5862 self.control_handle.shutdown();
5863 }
5864 self.drop_without_shutdown();
5865 _result
5866 }
5867
5868 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5870 let _result = self.send_raw(result);
5871 self.drop_without_shutdown();
5872 _result
5873 }
5874
5875 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5876 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5877 fidl::encoding::EmptyStruct,
5878 i32,
5879 >>(
5880 fidl::encoding::FlexibleResult::new(result),
5881 self.tx_id,
5882 0x427030e4dc6ec07a,
5883 fidl::encoding::DynamicFlags::FLEXIBLE,
5884 )
5885 }
5886}
5887
5888#[must_use = "FIDL methods require a response to be sent"]
5889#[derive(Debug)]
5890pub struct WifiStopResponder {
5891 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5892 tx_id: u32,
5893}
5894
5895impl std::ops::Drop for WifiStopResponder {
5899 fn drop(&mut self) {
5900 self.control_handle.shutdown();
5901 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5903 }
5904}
5905
5906impl fidl::endpoints::Responder for WifiStopResponder {
5907 type ControlHandle = WifiControlHandle;
5908
5909 fn control_handle(&self) -> &WifiControlHandle {
5910 &self.control_handle
5911 }
5912
5913 fn drop_without_shutdown(mut self) {
5914 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5916 std::mem::forget(self);
5918 }
5919}
5920
5921impl WifiStopResponder {
5922 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5926 let _result = self.send_raw(result);
5927 if _result.is_err() {
5928 self.control_handle.shutdown();
5929 }
5930 self.drop_without_shutdown();
5931 _result
5932 }
5933
5934 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5936 let _result = self.send_raw(result);
5937 self.drop_without_shutdown();
5938 _result
5939 }
5940
5941 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5942 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5943 fidl::encoding::EmptyStruct,
5944 i32,
5945 >>(
5946 fidl::encoding::FlexibleResult::new(result),
5947 self.tx_id,
5948 0x67c9bdf61b2888d,
5949 fidl::encoding::DynamicFlags::FLEXIBLE,
5950 )
5951 }
5952}
5953
5954#[must_use = "FIDL methods require a response to be sent"]
5955#[derive(Debug)]
5956pub struct WifiGetStateResponder {
5957 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5958 tx_id: u32,
5959}
5960
5961impl std::ops::Drop for WifiGetStateResponder {
5965 fn drop(&mut self) {
5966 self.control_handle.shutdown();
5967 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5969 }
5970}
5971
5972impl fidl::endpoints::Responder for WifiGetStateResponder {
5973 type ControlHandle = WifiControlHandle;
5974
5975 fn control_handle(&self) -> &WifiControlHandle {
5976 &self.control_handle
5977 }
5978
5979 fn drop_without_shutdown(mut self) {
5980 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5982 std::mem::forget(self);
5984 }
5985}
5986
5987impl WifiGetStateResponder {
5988 pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5992 let _result = self.send_raw(payload);
5993 if _result.is_err() {
5994 self.control_handle.shutdown();
5995 }
5996 self.drop_without_shutdown();
5997 _result
5998 }
5999
6000 pub fn send_no_shutdown_on_err(
6002 self,
6003 mut payload: &WifiGetStateResponse,
6004 ) -> Result<(), fidl::Error> {
6005 let _result = self.send_raw(payload);
6006 self.drop_without_shutdown();
6007 _result
6008 }
6009
6010 fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6011 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
6012 fidl::encoding::Flexible::new(payload),
6013 self.tx_id,
6014 0x4616114a937d1fb0,
6015 fidl::encoding::DynamicFlags::FLEXIBLE,
6016 )
6017 }
6018}
6019
6020#[must_use = "FIDL methods require a response to be sent"]
6021#[derive(Debug)]
6022pub struct WifiGetChipIdsResponder {
6023 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6024 tx_id: u32,
6025}
6026
6027impl std::ops::Drop for WifiGetChipIdsResponder {
6031 fn drop(&mut self) {
6032 self.control_handle.shutdown();
6033 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6035 }
6036}
6037
6038impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
6039 type ControlHandle = WifiControlHandle;
6040
6041 fn control_handle(&self) -> &WifiControlHandle {
6042 &self.control_handle
6043 }
6044
6045 fn drop_without_shutdown(mut self) {
6046 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6048 std::mem::forget(self);
6050 }
6051}
6052
6053impl WifiGetChipIdsResponder {
6054 pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6058 let _result = self.send_raw(payload);
6059 if _result.is_err() {
6060 self.control_handle.shutdown();
6061 }
6062 self.drop_without_shutdown();
6063 _result
6064 }
6065
6066 pub fn send_no_shutdown_on_err(
6068 self,
6069 mut payload: &WifiGetChipIdsResponse,
6070 ) -> Result<(), fidl::Error> {
6071 let _result = self.send_raw(payload);
6072 self.drop_without_shutdown();
6073 _result
6074 }
6075
6076 fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6077 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
6078 fidl::encoding::Flexible::new(payload),
6079 self.tx_id,
6080 0x2fb4f92351d802b5,
6081 fidl::encoding::DynamicFlags::FLEXIBLE,
6082 )
6083 }
6084}
6085
6086#[must_use = "FIDL methods require a response to be sent"]
6087#[derive(Debug)]
6088pub struct WifiGetChipResponder {
6089 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6090 tx_id: u32,
6091}
6092
6093impl std::ops::Drop for WifiGetChipResponder {
6097 fn drop(&mut self) {
6098 self.control_handle.shutdown();
6099 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6101 }
6102}
6103
6104impl fidl::endpoints::Responder for WifiGetChipResponder {
6105 type ControlHandle = WifiControlHandle;
6106
6107 fn control_handle(&self) -> &WifiControlHandle {
6108 &self.control_handle
6109 }
6110
6111 fn drop_without_shutdown(mut self) {
6112 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6114 std::mem::forget(self);
6116 }
6117}
6118
6119impl WifiGetChipResponder {
6120 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6124 let _result = self.send_raw(result);
6125 if _result.is_err() {
6126 self.control_handle.shutdown();
6127 }
6128 self.drop_without_shutdown();
6129 _result
6130 }
6131
6132 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6134 let _result = self.send_raw(result);
6135 self.drop_without_shutdown();
6136 _result
6137 }
6138
6139 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6140 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6141 fidl::encoding::EmptyStruct,
6142 i32,
6143 >>(
6144 fidl::encoding::FlexibleResult::new(result),
6145 self.tx_id,
6146 0xef95d8246612540,
6147 fidl::encoding::DynamicFlags::FLEXIBLE,
6148 )
6149 }
6150}
6151
6152#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6153pub struct WifiChipMarker;
6154
6155impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
6156 type Proxy = WifiChipProxy;
6157 type RequestStream = WifiChipRequestStream;
6158 #[cfg(target_os = "fuchsia")]
6159 type SynchronousProxy = WifiChipSynchronousProxy;
6160
6161 const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
6162}
6163pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
6164pub type WifiChipGetStaIfaceResult = Result<(), i32>;
6165pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
6166pub type WifiChipSetCountryCodeResult = Result<(), i32>;
6167pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
6168
6169pub trait WifiChipProxyInterface: Send + Sync {
6170 type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
6171 + Send;
6172 fn r#create_sta_iface(
6173 &self,
6174 payload: WifiChipCreateStaIfaceRequest,
6175 ) -> Self::CreateStaIfaceResponseFut;
6176 type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
6177 + Send;
6178 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
6179 type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
6180 + Send;
6181 fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
6182 type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
6183 + Send;
6184 fn r#remove_sta_iface(
6185 &self,
6186 payload: WifiChipRemoveStaIfaceRequest,
6187 ) -> Self::RemoveStaIfaceResponseFut;
6188 type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
6189 + Send;
6190 fn r#set_country_code(
6191 &self,
6192 payload: WifiChipSetCountryCodeRequest,
6193 ) -> Self::SetCountryCodeResponseFut;
6194 type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
6195 + Send;
6196 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
6197 type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
6198 + Send;
6199 fn r#get_id(&self) -> Self::GetIdResponseFut;
6200 type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
6201 + Send;
6202 fn r#get_mode(&self) -> Self::GetModeResponseFut;
6203 type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
6204 + Send;
6205 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
6206 type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
6207 + Send;
6208 fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
6209 type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6210 + Send;
6211 fn r#select_tx_power_scenario(
6212 &self,
6213 scenario: WifiChipTxPowerScenario,
6214 ) -> Self::SelectTxPowerScenarioResponseFut;
6215 type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6216 + Send;
6217 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
6218}
6219#[derive(Debug)]
6220#[cfg(target_os = "fuchsia")]
6221pub struct WifiChipSynchronousProxy {
6222 client: fidl::client::sync::Client,
6223}
6224
6225#[cfg(target_os = "fuchsia")]
6226impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6227 type Proxy = WifiChipProxy;
6228 type Protocol = WifiChipMarker;
6229
6230 fn from_channel(inner: fidl::Channel) -> Self {
6231 Self::new(inner)
6232 }
6233
6234 fn into_channel(self) -> fidl::Channel {
6235 self.client.into_channel()
6236 }
6237
6238 fn as_channel(&self) -> &fidl::Channel {
6239 self.client.as_channel()
6240 }
6241}
6242
6243#[cfg(target_os = "fuchsia")]
6244impl WifiChipSynchronousProxy {
6245 pub fn new(channel: fidl::Channel) -> Self {
6246 let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6247 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6248 }
6249
6250 pub fn into_channel(self) -> fidl::Channel {
6251 self.client.into_channel()
6252 }
6253
6254 pub fn wait_for_event(
6257 &self,
6258 deadline: zx::MonotonicInstant,
6259 ) -> Result<WifiChipEvent, fidl::Error> {
6260 WifiChipEvent::decode(self.client.wait_for_event(deadline)?)
6261 }
6262
6263 pub fn r#create_sta_iface(
6265 &self,
6266 mut payload: WifiChipCreateStaIfaceRequest,
6267 ___deadline: zx::MonotonicInstant,
6268 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6269 let _response = self.client.send_query::<
6270 WifiChipCreateStaIfaceRequest,
6271 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6272 >(
6273 &mut payload,
6274 0x6fb2d5892face7af,
6275 fidl::encoding::DynamicFlags::FLEXIBLE,
6276 ___deadline,
6277 )?
6278 .into_result::<WifiChipMarker>("create_sta_iface")?;
6279 Ok(_response.map(|x| x))
6280 }
6281
6282 pub fn r#get_sta_iface_names(
6284 &self,
6285 ___deadline: zx::MonotonicInstant,
6286 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6287 let _response = self.client.send_query::<
6288 fidl::encoding::EmptyPayload,
6289 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6290 >(
6291 (),
6292 0x349257482df6a000,
6293 fidl::encoding::DynamicFlags::FLEXIBLE,
6294 ___deadline,
6295 )?
6296 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6297 Ok(_response)
6298 }
6299
6300 pub fn r#get_sta_iface(
6302 &self,
6303 mut payload: WifiChipGetStaIfaceRequest,
6304 ___deadline: zx::MonotonicInstant,
6305 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6306 let _response = self.client.send_query::<
6307 WifiChipGetStaIfaceRequest,
6308 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6309 >(
6310 &mut payload,
6311 0x6d9704eeb36f28a2,
6312 fidl::encoding::DynamicFlags::FLEXIBLE,
6313 ___deadline,
6314 )?
6315 .into_result::<WifiChipMarker>("get_sta_iface")?;
6316 Ok(_response.map(|x| x))
6317 }
6318
6319 pub fn r#remove_sta_iface(
6321 &self,
6322 mut payload: WifiChipRemoveStaIfaceRequest,
6323 ___deadline: zx::MonotonicInstant,
6324 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6325 let _response = self.client.send_query::<
6326 WifiChipRemoveStaIfaceRequest,
6327 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6328 >(
6329 &mut payload,
6330 0x4cd8eee466f8b04c,
6331 fidl::encoding::DynamicFlags::FLEXIBLE,
6332 ___deadline,
6333 )?
6334 .into_result::<WifiChipMarker>("remove_sta_iface")?;
6335 Ok(_response.map(|x| x))
6336 }
6337
6338 pub fn r#set_country_code(
6339 &self,
6340 mut payload: WifiChipSetCountryCodeRequest,
6341 ___deadline: zx::MonotonicInstant,
6342 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6343 let _response = self.client.send_query::<
6344 WifiChipSetCountryCodeRequest,
6345 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6346 >(
6347 &mut payload,
6348 0x1dfe372d1d61a490,
6349 fidl::encoding::DynamicFlags::FLEXIBLE,
6350 ___deadline,
6351 )?
6352 .into_result::<WifiChipMarker>("set_country_code")?;
6353 Ok(_response.map(|x| x))
6354 }
6355
6356 pub fn r#get_available_modes(
6360 &self,
6361 ___deadline: zx::MonotonicInstant,
6362 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6363 let _response = self.client.send_query::<
6364 fidl::encoding::EmptyPayload,
6365 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6366 >(
6367 (),
6368 0x1701095b452a3acd,
6369 fidl::encoding::DynamicFlags::FLEXIBLE,
6370 ___deadline,
6371 )?
6372 .into_result::<WifiChipMarker>("get_available_modes")?;
6373 Ok(_response)
6374 }
6375
6376 pub fn r#get_id(
6378 &self,
6379 ___deadline: zx::MonotonicInstant,
6380 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6381 let _response = self.client.send_query::<
6382 fidl::encoding::EmptyPayload,
6383 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6384 >(
6385 (),
6386 0x37d5197325bb3370,
6387 fidl::encoding::DynamicFlags::FLEXIBLE,
6388 ___deadline,
6389 )?
6390 .into_result::<WifiChipMarker>("get_id")?;
6391 Ok(_response)
6392 }
6393
6394 pub fn r#get_mode(
6396 &self,
6397 ___deadline: zx::MonotonicInstant,
6398 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6399 let _response = self.client.send_query::<
6400 fidl::encoding::EmptyPayload,
6401 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6402 >(
6403 (),
6404 0x4d209e0f3ac84d6f,
6405 fidl::encoding::DynamicFlags::FLEXIBLE,
6406 ___deadline,
6407 )?
6408 .into_result::<WifiChipMarker>("get_mode")?;
6409 Ok(_response)
6410 }
6411
6412 pub fn r#get_capabilities(
6414 &self,
6415 ___deadline: zx::MonotonicInstant,
6416 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6417 let _response = self.client.send_query::<
6418 fidl::encoding::EmptyPayload,
6419 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6420 >(
6421 (),
6422 0x1b253f396dcaa2e0,
6423 fidl::encoding::DynamicFlags::FLEXIBLE,
6424 ___deadline,
6425 )?
6426 .into_result::<WifiChipMarker>("get_capabilities")?;
6427 Ok(_response)
6428 }
6429
6430 pub fn r#trigger_subsystem_restart(
6433 &self,
6434 ___deadline: zx::MonotonicInstant,
6435 ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6436 let _response = self.client.send_query::<
6437 fidl::encoding::EmptyPayload,
6438 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6439 >(
6440 (),
6441 0x42ffcae5aad196f9,
6442 fidl::encoding::DynamicFlags::FLEXIBLE,
6443 ___deadline,
6444 )?
6445 .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6446 Ok(_response.map(|x| x))
6447 }
6448
6449 pub fn r#select_tx_power_scenario(
6451 &self,
6452 mut scenario: WifiChipTxPowerScenario,
6453 ___deadline: zx::MonotonicInstant,
6454 ) -> Result<(), fidl::Error> {
6455 let _response = self.client.send_query::<
6456 WifiChipSelectTxPowerScenarioRequest,
6457 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6458 >(
6459 (scenario,),
6460 0x19287ab52ea72281,
6461 fidl::encoding::DynamicFlags::FLEXIBLE,
6462 ___deadline,
6463 )?
6464 .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6465 Ok(_response)
6466 }
6467
6468 pub fn r#reset_tx_power_scenario(
6470 &self,
6471 ___deadline: zx::MonotonicInstant,
6472 ) -> Result<(), fidl::Error> {
6473 let _response = self.client.send_query::<
6474 fidl::encoding::EmptyPayload,
6475 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6476 >(
6477 (),
6478 0x46408a2fb1eb9d09,
6479 fidl::encoding::DynamicFlags::FLEXIBLE,
6480 ___deadline,
6481 )?
6482 .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6483 Ok(_response)
6484 }
6485}
6486
6487#[cfg(target_os = "fuchsia")]
6488impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6489 fn from(value: WifiChipSynchronousProxy) -> Self {
6490 value.into_channel().into()
6491 }
6492}
6493
6494#[cfg(target_os = "fuchsia")]
6495impl From<fidl::Channel> for WifiChipSynchronousProxy {
6496 fn from(value: fidl::Channel) -> Self {
6497 Self::new(value)
6498 }
6499}
6500
6501#[cfg(target_os = "fuchsia")]
6502impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6503 type Protocol = WifiChipMarker;
6504
6505 fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6506 Self::new(value.into_channel())
6507 }
6508}
6509
6510#[derive(Debug, Clone)]
6511pub struct WifiChipProxy {
6512 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6513}
6514
6515impl fidl::endpoints::Proxy for WifiChipProxy {
6516 type Protocol = WifiChipMarker;
6517
6518 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6519 Self::new(inner)
6520 }
6521
6522 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6523 self.client.into_channel().map_err(|client| Self { client })
6524 }
6525
6526 fn as_channel(&self) -> &::fidl::AsyncChannel {
6527 self.client.as_channel()
6528 }
6529}
6530
6531impl WifiChipProxy {
6532 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6534 let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6535 Self { client: fidl::client::Client::new(channel, protocol_name) }
6536 }
6537
6538 pub fn take_event_stream(&self) -> WifiChipEventStream {
6544 WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6545 }
6546
6547 pub fn r#create_sta_iface(
6549 &self,
6550 mut payload: WifiChipCreateStaIfaceRequest,
6551 ) -> fidl::client::QueryResponseFut<
6552 WifiChipCreateStaIfaceResult,
6553 fidl::encoding::DefaultFuchsiaResourceDialect,
6554 > {
6555 WifiChipProxyInterface::r#create_sta_iface(self, payload)
6556 }
6557
6558 pub fn r#get_sta_iface_names(
6560 &self,
6561 ) -> fidl::client::QueryResponseFut<
6562 WifiChipGetStaIfaceNamesResponse,
6563 fidl::encoding::DefaultFuchsiaResourceDialect,
6564 > {
6565 WifiChipProxyInterface::r#get_sta_iface_names(self)
6566 }
6567
6568 pub fn r#get_sta_iface(
6570 &self,
6571 mut payload: WifiChipGetStaIfaceRequest,
6572 ) -> fidl::client::QueryResponseFut<
6573 WifiChipGetStaIfaceResult,
6574 fidl::encoding::DefaultFuchsiaResourceDialect,
6575 > {
6576 WifiChipProxyInterface::r#get_sta_iface(self, payload)
6577 }
6578
6579 pub fn r#remove_sta_iface(
6581 &self,
6582 mut payload: WifiChipRemoveStaIfaceRequest,
6583 ) -> fidl::client::QueryResponseFut<
6584 WifiChipRemoveStaIfaceResult,
6585 fidl::encoding::DefaultFuchsiaResourceDialect,
6586 > {
6587 WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6588 }
6589
6590 pub fn r#set_country_code(
6591 &self,
6592 mut payload: WifiChipSetCountryCodeRequest,
6593 ) -> fidl::client::QueryResponseFut<
6594 WifiChipSetCountryCodeResult,
6595 fidl::encoding::DefaultFuchsiaResourceDialect,
6596 > {
6597 WifiChipProxyInterface::r#set_country_code(self, payload)
6598 }
6599
6600 pub fn r#get_available_modes(
6604 &self,
6605 ) -> fidl::client::QueryResponseFut<
6606 WifiChipGetAvailableModesResponse,
6607 fidl::encoding::DefaultFuchsiaResourceDialect,
6608 > {
6609 WifiChipProxyInterface::r#get_available_modes(self)
6610 }
6611
6612 pub fn r#get_id(
6614 &self,
6615 ) -> fidl::client::QueryResponseFut<
6616 WifiChipGetIdResponse,
6617 fidl::encoding::DefaultFuchsiaResourceDialect,
6618 > {
6619 WifiChipProxyInterface::r#get_id(self)
6620 }
6621
6622 pub fn r#get_mode(
6624 &self,
6625 ) -> fidl::client::QueryResponseFut<
6626 WifiChipGetModeResponse,
6627 fidl::encoding::DefaultFuchsiaResourceDialect,
6628 > {
6629 WifiChipProxyInterface::r#get_mode(self)
6630 }
6631
6632 pub fn r#get_capabilities(
6634 &self,
6635 ) -> fidl::client::QueryResponseFut<
6636 WifiChipGetCapabilitiesResponse,
6637 fidl::encoding::DefaultFuchsiaResourceDialect,
6638 > {
6639 WifiChipProxyInterface::r#get_capabilities(self)
6640 }
6641
6642 pub fn r#trigger_subsystem_restart(
6645 &self,
6646 ) -> fidl::client::QueryResponseFut<
6647 WifiChipTriggerSubsystemRestartResult,
6648 fidl::encoding::DefaultFuchsiaResourceDialect,
6649 > {
6650 WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6651 }
6652
6653 pub fn r#select_tx_power_scenario(
6655 &self,
6656 mut scenario: WifiChipTxPowerScenario,
6657 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6658 WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6659 }
6660
6661 pub fn r#reset_tx_power_scenario(
6663 &self,
6664 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6665 WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6666 }
6667}
6668
6669impl WifiChipProxyInterface for WifiChipProxy {
6670 type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6671 WifiChipCreateStaIfaceResult,
6672 fidl::encoding::DefaultFuchsiaResourceDialect,
6673 >;
6674 fn r#create_sta_iface(
6675 &self,
6676 mut payload: WifiChipCreateStaIfaceRequest,
6677 ) -> Self::CreateStaIfaceResponseFut {
6678 fn _decode(
6679 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6680 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6681 let _response = fidl::client::decode_transaction_body::<
6682 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6683 fidl::encoding::DefaultFuchsiaResourceDialect,
6684 0x6fb2d5892face7af,
6685 >(_buf?)?
6686 .into_result::<WifiChipMarker>("create_sta_iface")?;
6687 Ok(_response.map(|x| x))
6688 }
6689 self.client
6690 .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6691 &mut payload,
6692 0x6fb2d5892face7af,
6693 fidl::encoding::DynamicFlags::FLEXIBLE,
6694 _decode,
6695 )
6696 }
6697
6698 type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6699 WifiChipGetStaIfaceNamesResponse,
6700 fidl::encoding::DefaultFuchsiaResourceDialect,
6701 >;
6702 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6703 fn _decode(
6704 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6705 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6706 let _response = fidl::client::decode_transaction_body::<
6707 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6708 fidl::encoding::DefaultFuchsiaResourceDialect,
6709 0x349257482df6a000,
6710 >(_buf?)?
6711 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6712 Ok(_response)
6713 }
6714 self.client.send_query_and_decode::<
6715 fidl::encoding::EmptyPayload,
6716 WifiChipGetStaIfaceNamesResponse,
6717 >(
6718 (),
6719 0x349257482df6a000,
6720 fidl::encoding::DynamicFlags::FLEXIBLE,
6721 _decode,
6722 )
6723 }
6724
6725 type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6726 WifiChipGetStaIfaceResult,
6727 fidl::encoding::DefaultFuchsiaResourceDialect,
6728 >;
6729 fn r#get_sta_iface(
6730 &self,
6731 mut payload: WifiChipGetStaIfaceRequest,
6732 ) -> Self::GetStaIfaceResponseFut {
6733 fn _decode(
6734 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6735 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6736 let _response = fidl::client::decode_transaction_body::<
6737 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6738 fidl::encoding::DefaultFuchsiaResourceDialect,
6739 0x6d9704eeb36f28a2,
6740 >(_buf?)?
6741 .into_result::<WifiChipMarker>("get_sta_iface")?;
6742 Ok(_response.map(|x| x))
6743 }
6744 self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6745 &mut payload,
6746 0x6d9704eeb36f28a2,
6747 fidl::encoding::DynamicFlags::FLEXIBLE,
6748 _decode,
6749 )
6750 }
6751
6752 type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6753 WifiChipRemoveStaIfaceResult,
6754 fidl::encoding::DefaultFuchsiaResourceDialect,
6755 >;
6756 fn r#remove_sta_iface(
6757 &self,
6758 mut payload: WifiChipRemoveStaIfaceRequest,
6759 ) -> Self::RemoveStaIfaceResponseFut {
6760 fn _decode(
6761 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6762 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6763 let _response = fidl::client::decode_transaction_body::<
6764 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6765 fidl::encoding::DefaultFuchsiaResourceDialect,
6766 0x4cd8eee466f8b04c,
6767 >(_buf?)?
6768 .into_result::<WifiChipMarker>("remove_sta_iface")?;
6769 Ok(_response.map(|x| x))
6770 }
6771 self.client
6772 .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6773 &mut payload,
6774 0x4cd8eee466f8b04c,
6775 fidl::encoding::DynamicFlags::FLEXIBLE,
6776 _decode,
6777 )
6778 }
6779
6780 type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6781 WifiChipSetCountryCodeResult,
6782 fidl::encoding::DefaultFuchsiaResourceDialect,
6783 >;
6784 fn r#set_country_code(
6785 &self,
6786 mut payload: WifiChipSetCountryCodeRequest,
6787 ) -> Self::SetCountryCodeResponseFut {
6788 fn _decode(
6789 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6790 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6791 let _response = fidl::client::decode_transaction_body::<
6792 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6793 fidl::encoding::DefaultFuchsiaResourceDialect,
6794 0x1dfe372d1d61a490,
6795 >(_buf?)?
6796 .into_result::<WifiChipMarker>("set_country_code")?;
6797 Ok(_response.map(|x| x))
6798 }
6799 self.client
6800 .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6801 &mut payload,
6802 0x1dfe372d1d61a490,
6803 fidl::encoding::DynamicFlags::FLEXIBLE,
6804 _decode,
6805 )
6806 }
6807
6808 type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
6809 WifiChipGetAvailableModesResponse,
6810 fidl::encoding::DefaultFuchsiaResourceDialect,
6811 >;
6812 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
6813 fn _decode(
6814 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6815 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6816 let _response = fidl::client::decode_transaction_body::<
6817 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6818 fidl::encoding::DefaultFuchsiaResourceDialect,
6819 0x1701095b452a3acd,
6820 >(_buf?)?
6821 .into_result::<WifiChipMarker>("get_available_modes")?;
6822 Ok(_response)
6823 }
6824 self.client.send_query_and_decode::<
6825 fidl::encoding::EmptyPayload,
6826 WifiChipGetAvailableModesResponse,
6827 >(
6828 (),
6829 0x1701095b452a3acd,
6830 fidl::encoding::DynamicFlags::FLEXIBLE,
6831 _decode,
6832 )
6833 }
6834
6835 type GetIdResponseFut = fidl::client::QueryResponseFut<
6836 WifiChipGetIdResponse,
6837 fidl::encoding::DefaultFuchsiaResourceDialect,
6838 >;
6839 fn r#get_id(&self) -> Self::GetIdResponseFut {
6840 fn _decode(
6841 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6842 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6843 let _response = fidl::client::decode_transaction_body::<
6844 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6845 fidl::encoding::DefaultFuchsiaResourceDialect,
6846 0x37d5197325bb3370,
6847 >(_buf?)?
6848 .into_result::<WifiChipMarker>("get_id")?;
6849 Ok(_response)
6850 }
6851 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
6852 (),
6853 0x37d5197325bb3370,
6854 fidl::encoding::DynamicFlags::FLEXIBLE,
6855 _decode,
6856 )
6857 }
6858
6859 type GetModeResponseFut = fidl::client::QueryResponseFut<
6860 WifiChipGetModeResponse,
6861 fidl::encoding::DefaultFuchsiaResourceDialect,
6862 >;
6863 fn r#get_mode(&self) -> Self::GetModeResponseFut {
6864 fn _decode(
6865 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6866 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6867 let _response = fidl::client::decode_transaction_body::<
6868 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6869 fidl::encoding::DefaultFuchsiaResourceDialect,
6870 0x4d209e0f3ac84d6f,
6871 >(_buf?)?
6872 .into_result::<WifiChipMarker>("get_mode")?;
6873 Ok(_response)
6874 }
6875 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
6876 (),
6877 0x4d209e0f3ac84d6f,
6878 fidl::encoding::DynamicFlags::FLEXIBLE,
6879 _decode,
6880 )
6881 }
6882
6883 type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
6884 WifiChipGetCapabilitiesResponse,
6885 fidl::encoding::DefaultFuchsiaResourceDialect,
6886 >;
6887 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
6888 fn _decode(
6889 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6890 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6891 let _response = fidl::client::decode_transaction_body::<
6892 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6893 fidl::encoding::DefaultFuchsiaResourceDialect,
6894 0x1b253f396dcaa2e0,
6895 >(_buf?)?
6896 .into_result::<WifiChipMarker>("get_capabilities")?;
6897 Ok(_response)
6898 }
6899 self.client
6900 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
6901 (),
6902 0x1b253f396dcaa2e0,
6903 fidl::encoding::DynamicFlags::FLEXIBLE,
6904 _decode,
6905 )
6906 }
6907
6908 type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
6909 WifiChipTriggerSubsystemRestartResult,
6910 fidl::encoding::DefaultFuchsiaResourceDialect,
6911 >;
6912 fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
6913 fn _decode(
6914 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6915 ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6916 let _response = fidl::client::decode_transaction_body::<
6917 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6918 fidl::encoding::DefaultFuchsiaResourceDialect,
6919 0x42ffcae5aad196f9,
6920 >(_buf?)?
6921 .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6922 Ok(_response.map(|x| x))
6923 }
6924 self.client.send_query_and_decode::<
6925 fidl::encoding::EmptyPayload,
6926 WifiChipTriggerSubsystemRestartResult,
6927 >(
6928 (),
6929 0x42ffcae5aad196f9,
6930 fidl::encoding::DynamicFlags::FLEXIBLE,
6931 _decode,
6932 )
6933 }
6934
6935 type SelectTxPowerScenarioResponseFut =
6936 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6937 fn r#select_tx_power_scenario(
6938 &self,
6939 mut scenario: WifiChipTxPowerScenario,
6940 ) -> Self::SelectTxPowerScenarioResponseFut {
6941 fn _decode(
6942 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6943 ) -> Result<(), fidl::Error> {
6944 let _response = fidl::client::decode_transaction_body::<
6945 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6946 fidl::encoding::DefaultFuchsiaResourceDialect,
6947 0x19287ab52ea72281,
6948 >(_buf?)?
6949 .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6950 Ok(_response)
6951 }
6952 self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
6953 (scenario,),
6954 0x19287ab52ea72281,
6955 fidl::encoding::DynamicFlags::FLEXIBLE,
6956 _decode,
6957 )
6958 }
6959
6960 type ResetTxPowerScenarioResponseFut =
6961 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6962 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
6963 fn _decode(
6964 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6965 ) -> Result<(), fidl::Error> {
6966 let _response = fidl::client::decode_transaction_body::<
6967 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6968 fidl::encoding::DefaultFuchsiaResourceDialect,
6969 0x46408a2fb1eb9d09,
6970 >(_buf?)?
6971 .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6972 Ok(_response)
6973 }
6974 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
6975 (),
6976 0x46408a2fb1eb9d09,
6977 fidl::encoding::DynamicFlags::FLEXIBLE,
6978 _decode,
6979 )
6980 }
6981}
6982
6983pub struct WifiChipEventStream {
6984 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6985}
6986
6987impl std::marker::Unpin for WifiChipEventStream {}
6988
6989impl futures::stream::FusedStream for WifiChipEventStream {
6990 fn is_terminated(&self) -> bool {
6991 self.event_receiver.is_terminated()
6992 }
6993}
6994
6995impl futures::Stream for WifiChipEventStream {
6996 type Item = Result<WifiChipEvent, fidl::Error>;
6997
6998 fn poll_next(
6999 mut self: std::pin::Pin<&mut Self>,
7000 cx: &mut std::task::Context<'_>,
7001 ) -> std::task::Poll<Option<Self::Item>> {
7002 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7003 &mut self.event_receiver,
7004 cx
7005 )?) {
7006 Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
7007 None => std::task::Poll::Ready(None),
7008 }
7009 }
7010}
7011
7012#[derive(Debug)]
7013pub enum WifiChipEvent {
7014 #[non_exhaustive]
7015 _UnknownEvent {
7016 ordinal: u64,
7018 },
7019}
7020
7021impl WifiChipEvent {
7022 fn decode(
7024 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7025 ) -> Result<WifiChipEvent, fidl::Error> {
7026 let (bytes, _handles) = buf.split_mut();
7027 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7028 debug_assert_eq!(tx_header.tx_id, 0);
7029 match tx_header.ordinal {
7030 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7031 Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7032 }
7033 _ => Err(fidl::Error::UnknownOrdinal {
7034 ordinal: tx_header.ordinal,
7035 protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7036 }),
7037 }
7038 }
7039}
7040
7041pub struct WifiChipRequestStream {
7043 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7044 is_terminated: bool,
7045}
7046
7047impl std::marker::Unpin for WifiChipRequestStream {}
7048
7049impl futures::stream::FusedStream for WifiChipRequestStream {
7050 fn is_terminated(&self) -> bool {
7051 self.is_terminated
7052 }
7053}
7054
7055impl fidl::endpoints::RequestStream for WifiChipRequestStream {
7056 type Protocol = WifiChipMarker;
7057 type ControlHandle = WifiChipControlHandle;
7058
7059 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7060 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7061 }
7062
7063 fn control_handle(&self) -> Self::ControlHandle {
7064 WifiChipControlHandle { inner: self.inner.clone() }
7065 }
7066
7067 fn into_inner(
7068 self,
7069 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7070 {
7071 (self.inner, self.is_terminated)
7072 }
7073
7074 fn from_inner(
7075 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7076 is_terminated: bool,
7077 ) -> Self {
7078 Self { inner, is_terminated }
7079 }
7080}
7081
7082impl futures::Stream for WifiChipRequestStream {
7083 type Item = Result<WifiChipRequest, fidl::Error>;
7084
7085 fn poll_next(
7086 mut self: std::pin::Pin<&mut Self>,
7087 cx: &mut std::task::Context<'_>,
7088 ) -> std::task::Poll<Option<Self::Item>> {
7089 let this = &mut *self;
7090 if this.inner.check_shutdown(cx) {
7091 this.is_terminated = true;
7092 return std::task::Poll::Ready(None);
7093 }
7094 if this.is_terminated {
7095 panic!("polled WifiChipRequestStream after completion");
7096 }
7097 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7098 |bytes, handles| {
7099 match this.inner.channel().read_etc(cx, bytes, handles) {
7100 std::task::Poll::Ready(Ok(())) => {}
7101 std::task::Poll::Pending => return std::task::Poll::Pending,
7102 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7103 this.is_terminated = true;
7104 return std::task::Poll::Ready(None);
7105 }
7106 std::task::Poll::Ready(Err(e)) => {
7107 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7108 e.into(),
7109 ))));
7110 }
7111 }
7112
7113 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7115
7116 std::task::Poll::Ready(Some(match header.ordinal {
7117 0x6fb2d5892face7af => {
7118 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7119 let mut req = fidl::new_empty!(
7120 WifiChipCreateStaIfaceRequest,
7121 fidl::encoding::DefaultFuchsiaResourceDialect
7122 );
7123 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7124 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7125 Ok(WifiChipRequest::CreateStaIface {
7126 payload: req,
7127 responder: WifiChipCreateStaIfaceResponder {
7128 control_handle: std::mem::ManuallyDrop::new(control_handle),
7129 tx_id: header.tx_id,
7130 },
7131 })
7132 }
7133 0x349257482df6a000 => {
7134 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7135 let mut req = fidl::new_empty!(
7136 fidl::encoding::EmptyPayload,
7137 fidl::encoding::DefaultFuchsiaResourceDialect
7138 );
7139 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7140 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7141 Ok(WifiChipRequest::GetStaIfaceNames {
7142 responder: WifiChipGetStaIfaceNamesResponder {
7143 control_handle: std::mem::ManuallyDrop::new(control_handle),
7144 tx_id: header.tx_id,
7145 },
7146 })
7147 }
7148 0x6d9704eeb36f28a2 => {
7149 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7150 let mut req = fidl::new_empty!(
7151 WifiChipGetStaIfaceRequest,
7152 fidl::encoding::DefaultFuchsiaResourceDialect
7153 );
7154 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7155 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7156 Ok(WifiChipRequest::GetStaIface {
7157 payload: req,
7158 responder: WifiChipGetStaIfaceResponder {
7159 control_handle: std::mem::ManuallyDrop::new(control_handle),
7160 tx_id: header.tx_id,
7161 },
7162 })
7163 }
7164 0x4cd8eee466f8b04c => {
7165 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7166 let mut req = fidl::new_empty!(
7167 WifiChipRemoveStaIfaceRequest,
7168 fidl::encoding::DefaultFuchsiaResourceDialect
7169 );
7170 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7171 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7172 Ok(WifiChipRequest::RemoveStaIface {
7173 payload: req,
7174 responder: WifiChipRemoveStaIfaceResponder {
7175 control_handle: std::mem::ManuallyDrop::new(control_handle),
7176 tx_id: header.tx_id,
7177 },
7178 })
7179 }
7180 0x1dfe372d1d61a490 => {
7181 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7182 let mut req = fidl::new_empty!(
7183 WifiChipSetCountryCodeRequest,
7184 fidl::encoding::DefaultFuchsiaResourceDialect
7185 );
7186 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
7187 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7188 Ok(WifiChipRequest::SetCountryCode {
7189 payload: req,
7190 responder: WifiChipSetCountryCodeResponder {
7191 control_handle: std::mem::ManuallyDrop::new(control_handle),
7192 tx_id: header.tx_id,
7193 },
7194 })
7195 }
7196 0x1701095b452a3acd => {
7197 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7198 let mut req = fidl::new_empty!(
7199 fidl::encoding::EmptyPayload,
7200 fidl::encoding::DefaultFuchsiaResourceDialect
7201 );
7202 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7203 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7204 Ok(WifiChipRequest::GetAvailableModes {
7205 responder: WifiChipGetAvailableModesResponder {
7206 control_handle: std::mem::ManuallyDrop::new(control_handle),
7207 tx_id: header.tx_id,
7208 },
7209 })
7210 }
7211 0x37d5197325bb3370 => {
7212 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7213 let mut req = fidl::new_empty!(
7214 fidl::encoding::EmptyPayload,
7215 fidl::encoding::DefaultFuchsiaResourceDialect
7216 );
7217 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7218 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7219 Ok(WifiChipRequest::GetId {
7220 responder: WifiChipGetIdResponder {
7221 control_handle: std::mem::ManuallyDrop::new(control_handle),
7222 tx_id: header.tx_id,
7223 },
7224 })
7225 }
7226 0x4d209e0f3ac84d6f => {
7227 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7228 let mut req = fidl::new_empty!(
7229 fidl::encoding::EmptyPayload,
7230 fidl::encoding::DefaultFuchsiaResourceDialect
7231 );
7232 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7233 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7234 Ok(WifiChipRequest::GetMode {
7235 responder: WifiChipGetModeResponder {
7236 control_handle: std::mem::ManuallyDrop::new(control_handle),
7237 tx_id: header.tx_id,
7238 },
7239 })
7240 }
7241 0x1b253f396dcaa2e0 => {
7242 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7243 let mut req = fidl::new_empty!(
7244 fidl::encoding::EmptyPayload,
7245 fidl::encoding::DefaultFuchsiaResourceDialect
7246 );
7247 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7248 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7249 Ok(WifiChipRequest::GetCapabilities {
7250 responder: WifiChipGetCapabilitiesResponder {
7251 control_handle: std::mem::ManuallyDrop::new(control_handle),
7252 tx_id: header.tx_id,
7253 },
7254 })
7255 }
7256 0x42ffcae5aad196f9 => {
7257 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7258 let mut req = fidl::new_empty!(
7259 fidl::encoding::EmptyPayload,
7260 fidl::encoding::DefaultFuchsiaResourceDialect
7261 );
7262 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7263 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7264 Ok(WifiChipRequest::TriggerSubsystemRestart {
7265 responder: WifiChipTriggerSubsystemRestartResponder {
7266 control_handle: std::mem::ManuallyDrop::new(control_handle),
7267 tx_id: header.tx_id,
7268 },
7269 })
7270 }
7271 0x19287ab52ea72281 => {
7272 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7273 let mut req = fidl::new_empty!(
7274 WifiChipSelectTxPowerScenarioRequest,
7275 fidl::encoding::DefaultFuchsiaResourceDialect
7276 );
7277 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7278 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7279 Ok(WifiChipRequest::SelectTxPowerScenario {
7280 scenario: req.scenario,
7281
7282 responder: WifiChipSelectTxPowerScenarioResponder {
7283 control_handle: std::mem::ManuallyDrop::new(control_handle),
7284 tx_id: header.tx_id,
7285 },
7286 })
7287 }
7288 0x46408a2fb1eb9d09 => {
7289 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7290 let mut req = fidl::new_empty!(
7291 fidl::encoding::EmptyPayload,
7292 fidl::encoding::DefaultFuchsiaResourceDialect
7293 );
7294 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7295 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7296 Ok(WifiChipRequest::ResetTxPowerScenario {
7297 responder: WifiChipResetTxPowerScenarioResponder {
7298 control_handle: std::mem::ManuallyDrop::new(control_handle),
7299 tx_id: header.tx_id,
7300 },
7301 })
7302 }
7303 _ if header.tx_id == 0
7304 && header
7305 .dynamic_flags()
7306 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7307 {
7308 Ok(WifiChipRequest::_UnknownMethod {
7309 ordinal: header.ordinal,
7310 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7311 method_type: fidl::MethodType::OneWay,
7312 })
7313 }
7314 _ if header
7315 .dynamic_flags()
7316 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7317 {
7318 this.inner.send_framework_err(
7319 fidl::encoding::FrameworkErr::UnknownMethod,
7320 header.tx_id,
7321 header.ordinal,
7322 header.dynamic_flags(),
7323 (bytes, handles),
7324 )?;
7325 Ok(WifiChipRequest::_UnknownMethod {
7326 ordinal: header.ordinal,
7327 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7328 method_type: fidl::MethodType::TwoWay,
7329 })
7330 }
7331 _ => Err(fidl::Error::UnknownOrdinal {
7332 ordinal: header.ordinal,
7333 protocol_name:
7334 <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7335 }),
7336 }))
7337 },
7338 )
7339 }
7340}
7341
7342#[derive(Debug)]
7343pub enum WifiChipRequest {
7344 CreateStaIface {
7346 payload: WifiChipCreateStaIfaceRequest,
7347 responder: WifiChipCreateStaIfaceResponder,
7348 },
7349 GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7351 GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7353 RemoveStaIface {
7355 payload: WifiChipRemoveStaIfaceRequest,
7356 responder: WifiChipRemoveStaIfaceResponder,
7357 },
7358 SetCountryCode {
7359 payload: WifiChipSetCountryCodeRequest,
7360 responder: WifiChipSetCountryCodeResponder,
7361 },
7362 GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7366 GetId { responder: WifiChipGetIdResponder },
7368 GetMode { responder: WifiChipGetModeResponder },
7370 GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7372 TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7375 SelectTxPowerScenario {
7377 scenario: WifiChipTxPowerScenario,
7378 responder: WifiChipSelectTxPowerScenarioResponder,
7379 },
7380 ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7382 #[non_exhaustive]
7384 _UnknownMethod {
7385 ordinal: u64,
7387 control_handle: WifiChipControlHandle,
7388 method_type: fidl::MethodType,
7389 },
7390}
7391
7392impl WifiChipRequest {
7393 #[allow(irrefutable_let_patterns)]
7394 pub fn into_create_sta_iface(
7395 self,
7396 ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7397 if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7398 Some((payload, responder))
7399 } else {
7400 None
7401 }
7402 }
7403
7404 #[allow(irrefutable_let_patterns)]
7405 pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7406 if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7407 Some((responder))
7408 } else {
7409 None
7410 }
7411 }
7412
7413 #[allow(irrefutable_let_patterns)]
7414 pub fn into_get_sta_iface(
7415 self,
7416 ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7417 if let WifiChipRequest::GetStaIface { payload, responder } = self {
7418 Some((payload, responder))
7419 } else {
7420 None
7421 }
7422 }
7423
7424 #[allow(irrefutable_let_patterns)]
7425 pub fn into_remove_sta_iface(
7426 self,
7427 ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7428 if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7429 Some((payload, responder))
7430 } else {
7431 None
7432 }
7433 }
7434
7435 #[allow(irrefutable_let_patterns)]
7436 pub fn into_set_country_code(
7437 self,
7438 ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7439 if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7440 Some((payload, responder))
7441 } else {
7442 None
7443 }
7444 }
7445
7446 #[allow(irrefutable_let_patterns)]
7447 pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7448 if let WifiChipRequest::GetAvailableModes { responder } = self {
7449 Some((responder))
7450 } else {
7451 None
7452 }
7453 }
7454
7455 #[allow(irrefutable_let_patterns)]
7456 pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7457 if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7458 }
7459
7460 #[allow(irrefutable_let_patterns)]
7461 pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7462 if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7463 }
7464
7465 #[allow(irrefutable_let_patterns)]
7466 pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7467 if let WifiChipRequest::GetCapabilities { responder } = self {
7468 Some((responder))
7469 } else {
7470 None
7471 }
7472 }
7473
7474 #[allow(irrefutable_let_patterns)]
7475 pub fn into_trigger_subsystem_restart(
7476 self,
7477 ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7478 if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7479 Some((responder))
7480 } else {
7481 None
7482 }
7483 }
7484
7485 #[allow(irrefutable_let_patterns)]
7486 pub fn into_select_tx_power_scenario(
7487 self,
7488 ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7489 if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7490 Some((scenario, responder))
7491 } else {
7492 None
7493 }
7494 }
7495
7496 #[allow(irrefutable_let_patterns)]
7497 pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7498 if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7499 Some((responder))
7500 } else {
7501 None
7502 }
7503 }
7504
7505 pub fn method_name(&self) -> &'static str {
7507 match *self {
7508 WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7509 WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7510 WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7511 WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7512 WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7513 WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7514 WifiChipRequest::GetId { .. } => "get_id",
7515 WifiChipRequest::GetMode { .. } => "get_mode",
7516 WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7517 WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7518 WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7519 WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7520 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7521 "unknown one-way method"
7522 }
7523 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7524 "unknown two-way method"
7525 }
7526 }
7527 }
7528}
7529
7530#[derive(Debug, Clone)]
7531pub struct WifiChipControlHandle {
7532 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7533}
7534
7535impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7536 fn shutdown(&self) {
7537 self.inner.shutdown()
7538 }
7539
7540 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7541 self.inner.shutdown_with_epitaph(status)
7542 }
7543
7544 fn is_closed(&self) -> bool {
7545 self.inner.channel().is_closed()
7546 }
7547 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7548 self.inner.channel().on_closed()
7549 }
7550
7551 #[cfg(target_os = "fuchsia")]
7552 fn signal_peer(
7553 &self,
7554 clear_mask: zx::Signals,
7555 set_mask: zx::Signals,
7556 ) -> Result<(), zx_status::Status> {
7557 use fidl::Peered;
7558 self.inner.channel().signal_peer(clear_mask, set_mask)
7559 }
7560}
7561
7562impl WifiChipControlHandle {}
7563
7564#[must_use = "FIDL methods require a response to be sent"]
7565#[derive(Debug)]
7566pub struct WifiChipCreateStaIfaceResponder {
7567 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7568 tx_id: u32,
7569}
7570
7571impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7575 fn drop(&mut self) {
7576 self.control_handle.shutdown();
7577 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7579 }
7580}
7581
7582impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7583 type ControlHandle = WifiChipControlHandle;
7584
7585 fn control_handle(&self) -> &WifiChipControlHandle {
7586 &self.control_handle
7587 }
7588
7589 fn drop_without_shutdown(mut self) {
7590 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7592 std::mem::forget(self);
7594 }
7595}
7596
7597impl WifiChipCreateStaIfaceResponder {
7598 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7602 let _result = self.send_raw(result);
7603 if _result.is_err() {
7604 self.control_handle.shutdown();
7605 }
7606 self.drop_without_shutdown();
7607 _result
7608 }
7609
7610 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7612 let _result = self.send_raw(result);
7613 self.drop_without_shutdown();
7614 _result
7615 }
7616
7617 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7618 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7619 fidl::encoding::EmptyStruct,
7620 i32,
7621 >>(
7622 fidl::encoding::FlexibleResult::new(result),
7623 self.tx_id,
7624 0x6fb2d5892face7af,
7625 fidl::encoding::DynamicFlags::FLEXIBLE,
7626 )
7627 }
7628}
7629
7630#[must_use = "FIDL methods require a response to be sent"]
7631#[derive(Debug)]
7632pub struct WifiChipGetStaIfaceNamesResponder {
7633 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7634 tx_id: u32,
7635}
7636
7637impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7641 fn drop(&mut self) {
7642 self.control_handle.shutdown();
7643 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7645 }
7646}
7647
7648impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7649 type ControlHandle = WifiChipControlHandle;
7650
7651 fn control_handle(&self) -> &WifiChipControlHandle {
7652 &self.control_handle
7653 }
7654
7655 fn drop_without_shutdown(mut self) {
7656 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7658 std::mem::forget(self);
7660 }
7661}
7662
7663impl WifiChipGetStaIfaceNamesResponder {
7664 pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7668 let _result = self.send_raw(payload);
7669 if _result.is_err() {
7670 self.control_handle.shutdown();
7671 }
7672 self.drop_without_shutdown();
7673 _result
7674 }
7675
7676 pub fn send_no_shutdown_on_err(
7678 self,
7679 mut payload: &WifiChipGetStaIfaceNamesResponse,
7680 ) -> Result<(), fidl::Error> {
7681 let _result = self.send_raw(payload);
7682 self.drop_without_shutdown();
7683 _result
7684 }
7685
7686 fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7687 self.control_handle
7688 .inner
7689 .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7690 fidl::encoding::Flexible::new(payload),
7691 self.tx_id,
7692 0x349257482df6a000,
7693 fidl::encoding::DynamicFlags::FLEXIBLE,
7694 )
7695 }
7696}
7697
7698#[must_use = "FIDL methods require a response to be sent"]
7699#[derive(Debug)]
7700pub struct WifiChipGetStaIfaceResponder {
7701 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7702 tx_id: u32,
7703}
7704
7705impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7709 fn drop(&mut self) {
7710 self.control_handle.shutdown();
7711 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7713 }
7714}
7715
7716impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7717 type ControlHandle = WifiChipControlHandle;
7718
7719 fn control_handle(&self) -> &WifiChipControlHandle {
7720 &self.control_handle
7721 }
7722
7723 fn drop_without_shutdown(mut self) {
7724 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7726 std::mem::forget(self);
7728 }
7729}
7730
7731impl WifiChipGetStaIfaceResponder {
7732 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7736 let _result = self.send_raw(result);
7737 if _result.is_err() {
7738 self.control_handle.shutdown();
7739 }
7740 self.drop_without_shutdown();
7741 _result
7742 }
7743
7744 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7746 let _result = self.send_raw(result);
7747 self.drop_without_shutdown();
7748 _result
7749 }
7750
7751 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7752 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7753 fidl::encoding::EmptyStruct,
7754 i32,
7755 >>(
7756 fidl::encoding::FlexibleResult::new(result),
7757 self.tx_id,
7758 0x6d9704eeb36f28a2,
7759 fidl::encoding::DynamicFlags::FLEXIBLE,
7760 )
7761 }
7762}
7763
7764#[must_use = "FIDL methods require a response to be sent"]
7765#[derive(Debug)]
7766pub struct WifiChipRemoveStaIfaceResponder {
7767 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7768 tx_id: u32,
7769}
7770
7771impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
7775 fn drop(&mut self) {
7776 self.control_handle.shutdown();
7777 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7779 }
7780}
7781
7782impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
7783 type ControlHandle = WifiChipControlHandle;
7784
7785 fn control_handle(&self) -> &WifiChipControlHandle {
7786 &self.control_handle
7787 }
7788
7789 fn drop_without_shutdown(mut self) {
7790 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7792 std::mem::forget(self);
7794 }
7795}
7796
7797impl WifiChipRemoveStaIfaceResponder {
7798 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7802 let _result = self.send_raw(result);
7803 if _result.is_err() {
7804 self.control_handle.shutdown();
7805 }
7806 self.drop_without_shutdown();
7807 _result
7808 }
7809
7810 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7812 let _result = self.send_raw(result);
7813 self.drop_without_shutdown();
7814 _result
7815 }
7816
7817 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7818 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7819 fidl::encoding::EmptyStruct,
7820 i32,
7821 >>(
7822 fidl::encoding::FlexibleResult::new(result),
7823 self.tx_id,
7824 0x4cd8eee466f8b04c,
7825 fidl::encoding::DynamicFlags::FLEXIBLE,
7826 )
7827 }
7828}
7829
7830#[must_use = "FIDL methods require a response to be sent"]
7831#[derive(Debug)]
7832pub struct WifiChipSetCountryCodeResponder {
7833 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7834 tx_id: u32,
7835}
7836
7837impl std::ops::Drop for WifiChipSetCountryCodeResponder {
7841 fn drop(&mut self) {
7842 self.control_handle.shutdown();
7843 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7845 }
7846}
7847
7848impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
7849 type ControlHandle = WifiChipControlHandle;
7850
7851 fn control_handle(&self) -> &WifiChipControlHandle {
7852 &self.control_handle
7853 }
7854
7855 fn drop_without_shutdown(mut self) {
7856 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7858 std::mem::forget(self);
7860 }
7861}
7862
7863impl WifiChipSetCountryCodeResponder {
7864 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7868 let _result = self.send_raw(result);
7869 if _result.is_err() {
7870 self.control_handle.shutdown();
7871 }
7872 self.drop_without_shutdown();
7873 _result
7874 }
7875
7876 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7878 let _result = self.send_raw(result);
7879 self.drop_without_shutdown();
7880 _result
7881 }
7882
7883 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7884 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7885 fidl::encoding::EmptyStruct,
7886 i32,
7887 >>(
7888 fidl::encoding::FlexibleResult::new(result),
7889 self.tx_id,
7890 0x1dfe372d1d61a490,
7891 fidl::encoding::DynamicFlags::FLEXIBLE,
7892 )
7893 }
7894}
7895
7896#[must_use = "FIDL methods require a response to be sent"]
7897#[derive(Debug)]
7898pub struct WifiChipGetAvailableModesResponder {
7899 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7900 tx_id: u32,
7901}
7902
7903impl std::ops::Drop for WifiChipGetAvailableModesResponder {
7907 fn drop(&mut self) {
7908 self.control_handle.shutdown();
7909 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7911 }
7912}
7913
7914impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
7915 type ControlHandle = WifiChipControlHandle;
7916
7917 fn control_handle(&self) -> &WifiChipControlHandle {
7918 &self.control_handle
7919 }
7920
7921 fn drop_without_shutdown(mut self) {
7922 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7924 std::mem::forget(self);
7926 }
7927}
7928
7929impl WifiChipGetAvailableModesResponder {
7930 pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7934 let _result = self.send_raw(payload);
7935 if _result.is_err() {
7936 self.control_handle.shutdown();
7937 }
7938 self.drop_without_shutdown();
7939 _result
7940 }
7941
7942 pub fn send_no_shutdown_on_err(
7944 self,
7945 mut payload: &WifiChipGetAvailableModesResponse,
7946 ) -> Result<(), fidl::Error> {
7947 let _result = self.send_raw(payload);
7948 self.drop_without_shutdown();
7949 _result
7950 }
7951
7952 fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7953 self.control_handle
7954 .inner
7955 .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
7956 fidl::encoding::Flexible::new(payload),
7957 self.tx_id,
7958 0x1701095b452a3acd,
7959 fidl::encoding::DynamicFlags::FLEXIBLE,
7960 )
7961 }
7962}
7963
7964#[must_use = "FIDL methods require a response to be sent"]
7965#[derive(Debug)]
7966pub struct WifiChipGetIdResponder {
7967 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7968 tx_id: u32,
7969}
7970
7971impl std::ops::Drop for WifiChipGetIdResponder {
7975 fn drop(&mut self) {
7976 self.control_handle.shutdown();
7977 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7979 }
7980}
7981
7982impl fidl::endpoints::Responder for WifiChipGetIdResponder {
7983 type ControlHandle = WifiChipControlHandle;
7984
7985 fn control_handle(&self) -> &WifiChipControlHandle {
7986 &self.control_handle
7987 }
7988
7989 fn drop_without_shutdown(mut self) {
7990 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7992 std::mem::forget(self);
7994 }
7995}
7996
7997impl WifiChipGetIdResponder {
7998 pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8002 let _result = self.send_raw(payload);
8003 if _result.is_err() {
8004 self.control_handle.shutdown();
8005 }
8006 self.drop_without_shutdown();
8007 _result
8008 }
8009
8010 pub fn send_no_shutdown_on_err(
8012 self,
8013 mut payload: &WifiChipGetIdResponse,
8014 ) -> Result<(), fidl::Error> {
8015 let _result = self.send_raw(payload);
8016 self.drop_without_shutdown();
8017 _result
8018 }
8019
8020 fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8021 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
8022 fidl::encoding::Flexible::new(payload),
8023 self.tx_id,
8024 0x37d5197325bb3370,
8025 fidl::encoding::DynamicFlags::FLEXIBLE,
8026 )
8027 }
8028}
8029
8030#[must_use = "FIDL methods require a response to be sent"]
8031#[derive(Debug)]
8032pub struct WifiChipGetModeResponder {
8033 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8034 tx_id: u32,
8035}
8036
8037impl std::ops::Drop for WifiChipGetModeResponder {
8041 fn drop(&mut self) {
8042 self.control_handle.shutdown();
8043 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8045 }
8046}
8047
8048impl fidl::endpoints::Responder for WifiChipGetModeResponder {
8049 type ControlHandle = WifiChipControlHandle;
8050
8051 fn control_handle(&self) -> &WifiChipControlHandle {
8052 &self.control_handle
8053 }
8054
8055 fn drop_without_shutdown(mut self) {
8056 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8058 std::mem::forget(self);
8060 }
8061}
8062
8063impl WifiChipGetModeResponder {
8064 pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8068 let _result = self.send_raw(payload);
8069 if _result.is_err() {
8070 self.control_handle.shutdown();
8071 }
8072 self.drop_without_shutdown();
8073 _result
8074 }
8075
8076 pub fn send_no_shutdown_on_err(
8078 self,
8079 mut payload: &WifiChipGetModeResponse,
8080 ) -> Result<(), fidl::Error> {
8081 let _result = self.send_raw(payload);
8082 self.drop_without_shutdown();
8083 _result
8084 }
8085
8086 fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8087 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
8088 fidl::encoding::Flexible::new(payload),
8089 self.tx_id,
8090 0x4d209e0f3ac84d6f,
8091 fidl::encoding::DynamicFlags::FLEXIBLE,
8092 )
8093 }
8094}
8095
8096#[must_use = "FIDL methods require a response to be sent"]
8097#[derive(Debug)]
8098pub struct WifiChipGetCapabilitiesResponder {
8099 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8100 tx_id: u32,
8101}
8102
8103impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
8107 fn drop(&mut self) {
8108 self.control_handle.shutdown();
8109 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8111 }
8112}
8113
8114impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
8115 type ControlHandle = WifiChipControlHandle;
8116
8117 fn control_handle(&self) -> &WifiChipControlHandle {
8118 &self.control_handle
8119 }
8120
8121 fn drop_without_shutdown(mut self) {
8122 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8124 std::mem::forget(self);
8126 }
8127}
8128
8129impl WifiChipGetCapabilitiesResponder {
8130 pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8134 let _result = self.send_raw(payload);
8135 if _result.is_err() {
8136 self.control_handle.shutdown();
8137 }
8138 self.drop_without_shutdown();
8139 _result
8140 }
8141
8142 pub fn send_no_shutdown_on_err(
8144 self,
8145 mut payload: &WifiChipGetCapabilitiesResponse,
8146 ) -> Result<(), fidl::Error> {
8147 let _result = self.send_raw(payload);
8148 self.drop_without_shutdown();
8149 _result
8150 }
8151
8152 fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8153 self.control_handle
8154 .inner
8155 .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
8156 fidl::encoding::Flexible::new(payload),
8157 self.tx_id,
8158 0x1b253f396dcaa2e0,
8159 fidl::encoding::DynamicFlags::FLEXIBLE,
8160 )
8161 }
8162}
8163
8164#[must_use = "FIDL methods require a response to be sent"]
8165#[derive(Debug)]
8166pub struct WifiChipTriggerSubsystemRestartResponder {
8167 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8168 tx_id: u32,
8169}
8170
8171impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
8175 fn drop(&mut self) {
8176 self.control_handle.shutdown();
8177 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8179 }
8180}
8181
8182impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
8183 type ControlHandle = WifiChipControlHandle;
8184
8185 fn control_handle(&self) -> &WifiChipControlHandle {
8186 &self.control_handle
8187 }
8188
8189 fn drop_without_shutdown(mut self) {
8190 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8192 std::mem::forget(self);
8194 }
8195}
8196
8197impl WifiChipTriggerSubsystemRestartResponder {
8198 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8202 let _result = self.send_raw(result);
8203 if _result.is_err() {
8204 self.control_handle.shutdown();
8205 }
8206 self.drop_without_shutdown();
8207 _result
8208 }
8209
8210 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8212 let _result = self.send_raw(result);
8213 self.drop_without_shutdown();
8214 _result
8215 }
8216
8217 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8218 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8219 fidl::encoding::EmptyStruct,
8220 i32,
8221 >>(
8222 fidl::encoding::FlexibleResult::new(result),
8223 self.tx_id,
8224 0x42ffcae5aad196f9,
8225 fidl::encoding::DynamicFlags::FLEXIBLE,
8226 )
8227 }
8228}
8229
8230#[must_use = "FIDL methods require a response to be sent"]
8231#[derive(Debug)]
8232pub struct WifiChipSelectTxPowerScenarioResponder {
8233 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8234 tx_id: u32,
8235}
8236
8237impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8241 fn drop(&mut self) {
8242 self.control_handle.shutdown();
8243 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8245 }
8246}
8247
8248impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8249 type ControlHandle = WifiChipControlHandle;
8250
8251 fn control_handle(&self) -> &WifiChipControlHandle {
8252 &self.control_handle
8253 }
8254
8255 fn drop_without_shutdown(mut self) {
8256 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8258 std::mem::forget(self);
8260 }
8261}
8262
8263impl WifiChipSelectTxPowerScenarioResponder {
8264 pub fn send(self) -> Result<(), fidl::Error> {
8268 let _result = self.send_raw();
8269 if _result.is_err() {
8270 self.control_handle.shutdown();
8271 }
8272 self.drop_without_shutdown();
8273 _result
8274 }
8275
8276 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8278 let _result = self.send_raw();
8279 self.drop_without_shutdown();
8280 _result
8281 }
8282
8283 fn send_raw(&self) -> Result<(), fidl::Error> {
8284 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8285 fidl::encoding::Flexible::new(()),
8286 self.tx_id,
8287 0x19287ab52ea72281,
8288 fidl::encoding::DynamicFlags::FLEXIBLE,
8289 )
8290 }
8291}
8292
8293#[must_use = "FIDL methods require a response to be sent"]
8294#[derive(Debug)]
8295pub struct WifiChipResetTxPowerScenarioResponder {
8296 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8297 tx_id: u32,
8298}
8299
8300impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8304 fn drop(&mut self) {
8305 self.control_handle.shutdown();
8306 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8308 }
8309}
8310
8311impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8312 type ControlHandle = WifiChipControlHandle;
8313
8314 fn control_handle(&self) -> &WifiChipControlHandle {
8315 &self.control_handle
8316 }
8317
8318 fn drop_without_shutdown(mut self) {
8319 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8321 std::mem::forget(self);
8323 }
8324}
8325
8326impl WifiChipResetTxPowerScenarioResponder {
8327 pub fn send(self) -> Result<(), fidl::Error> {
8331 let _result = self.send_raw();
8332 if _result.is_err() {
8333 self.control_handle.shutdown();
8334 }
8335 self.drop_without_shutdown();
8336 _result
8337 }
8338
8339 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8341 let _result = self.send_raw();
8342 self.drop_without_shutdown();
8343 _result
8344 }
8345
8346 fn send_raw(&self) -> Result<(), fidl::Error> {
8347 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8348 fidl::encoding::Flexible::new(()),
8349 self.tx_id,
8350 0x46408a2fb1eb9d09,
8351 fidl::encoding::DynamicFlags::FLEXIBLE,
8352 )
8353 }
8354}
8355
8356#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8357pub struct WifiEventCallbackMarker;
8358
8359impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8360 type Proxy = WifiEventCallbackProxy;
8361 type RequestStream = WifiEventCallbackRequestStream;
8362 #[cfg(target_os = "fuchsia")]
8363 type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8364
8365 const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8366}
8367
8368pub trait WifiEventCallbackProxyInterface: Send + Sync {
8369 fn r#on_start(&self) -> Result<(), fidl::Error>;
8370 fn r#on_stop(&self) -> Result<(), fidl::Error>;
8371 fn r#on_subsystem_restart(
8372 &self,
8373 payload: WifiEventCallbackOnSubsystemRestartRequest,
8374 ) -> Result<(), fidl::Error>;
8375}
8376#[derive(Debug)]
8377#[cfg(target_os = "fuchsia")]
8378pub struct WifiEventCallbackSynchronousProxy {
8379 client: fidl::client::sync::Client,
8380}
8381
8382#[cfg(target_os = "fuchsia")]
8383impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8384 type Proxy = WifiEventCallbackProxy;
8385 type Protocol = WifiEventCallbackMarker;
8386
8387 fn from_channel(inner: fidl::Channel) -> Self {
8388 Self::new(inner)
8389 }
8390
8391 fn into_channel(self) -> fidl::Channel {
8392 self.client.into_channel()
8393 }
8394
8395 fn as_channel(&self) -> &fidl::Channel {
8396 self.client.as_channel()
8397 }
8398}
8399
8400#[cfg(target_os = "fuchsia")]
8401impl WifiEventCallbackSynchronousProxy {
8402 pub fn new(channel: fidl::Channel) -> Self {
8403 let protocol_name =
8404 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8405 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8406 }
8407
8408 pub fn into_channel(self) -> fidl::Channel {
8409 self.client.into_channel()
8410 }
8411
8412 pub fn wait_for_event(
8415 &self,
8416 deadline: zx::MonotonicInstant,
8417 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8418 WifiEventCallbackEvent::decode(self.client.wait_for_event(deadline)?)
8419 }
8420
8421 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8422 self.client.send::<fidl::encoding::EmptyPayload>(
8423 (),
8424 0x61189ff44f9d35f3,
8425 fidl::encoding::DynamicFlags::FLEXIBLE,
8426 )
8427 }
8428
8429 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8430 self.client.send::<fidl::encoding::EmptyPayload>(
8431 (),
8432 0x58b697bcd475e0f9,
8433 fidl::encoding::DynamicFlags::FLEXIBLE,
8434 )
8435 }
8436
8437 pub fn r#on_subsystem_restart(
8438 &self,
8439 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8440 ) -> Result<(), fidl::Error> {
8441 self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8442 &mut payload,
8443 0x69dfee4d3475db21,
8444 fidl::encoding::DynamicFlags::FLEXIBLE,
8445 )
8446 }
8447}
8448
8449#[cfg(target_os = "fuchsia")]
8450impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8451 fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8452 value.into_channel().into()
8453 }
8454}
8455
8456#[cfg(target_os = "fuchsia")]
8457impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8458 fn from(value: fidl::Channel) -> Self {
8459 Self::new(value)
8460 }
8461}
8462
8463#[cfg(target_os = "fuchsia")]
8464impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8465 type Protocol = WifiEventCallbackMarker;
8466
8467 fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8468 Self::new(value.into_channel())
8469 }
8470}
8471
8472#[derive(Debug, Clone)]
8473pub struct WifiEventCallbackProxy {
8474 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8475}
8476
8477impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8478 type Protocol = WifiEventCallbackMarker;
8479
8480 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8481 Self::new(inner)
8482 }
8483
8484 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8485 self.client.into_channel().map_err(|client| Self { client })
8486 }
8487
8488 fn as_channel(&self) -> &::fidl::AsyncChannel {
8489 self.client.as_channel()
8490 }
8491}
8492
8493impl WifiEventCallbackProxy {
8494 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8496 let protocol_name =
8497 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8498 Self { client: fidl::client::Client::new(channel, protocol_name) }
8499 }
8500
8501 pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8507 WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8508 }
8509
8510 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8511 WifiEventCallbackProxyInterface::r#on_start(self)
8512 }
8513
8514 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8515 WifiEventCallbackProxyInterface::r#on_stop(self)
8516 }
8517
8518 pub fn r#on_subsystem_restart(
8519 &self,
8520 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8521 ) -> Result<(), fidl::Error> {
8522 WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8523 }
8524}
8525
8526impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8527 fn r#on_start(&self) -> Result<(), fidl::Error> {
8528 self.client.send::<fidl::encoding::EmptyPayload>(
8529 (),
8530 0x61189ff44f9d35f3,
8531 fidl::encoding::DynamicFlags::FLEXIBLE,
8532 )
8533 }
8534
8535 fn r#on_stop(&self) -> Result<(), fidl::Error> {
8536 self.client.send::<fidl::encoding::EmptyPayload>(
8537 (),
8538 0x58b697bcd475e0f9,
8539 fidl::encoding::DynamicFlags::FLEXIBLE,
8540 )
8541 }
8542
8543 fn r#on_subsystem_restart(
8544 &self,
8545 mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8546 ) -> Result<(), fidl::Error> {
8547 self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8548 &mut payload,
8549 0x69dfee4d3475db21,
8550 fidl::encoding::DynamicFlags::FLEXIBLE,
8551 )
8552 }
8553}
8554
8555pub struct WifiEventCallbackEventStream {
8556 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8557}
8558
8559impl std::marker::Unpin for WifiEventCallbackEventStream {}
8560
8561impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8562 fn is_terminated(&self) -> bool {
8563 self.event_receiver.is_terminated()
8564 }
8565}
8566
8567impl futures::Stream for WifiEventCallbackEventStream {
8568 type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8569
8570 fn poll_next(
8571 mut self: std::pin::Pin<&mut Self>,
8572 cx: &mut std::task::Context<'_>,
8573 ) -> std::task::Poll<Option<Self::Item>> {
8574 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8575 &mut self.event_receiver,
8576 cx
8577 )?) {
8578 Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8579 None => std::task::Poll::Ready(None),
8580 }
8581 }
8582}
8583
8584#[derive(Debug)]
8585pub enum WifiEventCallbackEvent {
8586 #[non_exhaustive]
8587 _UnknownEvent {
8588 ordinal: u64,
8590 },
8591}
8592
8593impl WifiEventCallbackEvent {
8594 fn decode(
8596 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8597 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8598 let (bytes, _handles) = buf.split_mut();
8599 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8600 debug_assert_eq!(tx_header.tx_id, 0);
8601 match tx_header.ordinal {
8602 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8603 Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8604 }
8605 _ => Err(fidl::Error::UnknownOrdinal {
8606 ordinal: tx_header.ordinal,
8607 protocol_name:
8608 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8609 }),
8610 }
8611 }
8612}
8613
8614pub struct WifiEventCallbackRequestStream {
8616 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8617 is_terminated: bool,
8618}
8619
8620impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8621
8622impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8623 fn is_terminated(&self) -> bool {
8624 self.is_terminated
8625 }
8626}
8627
8628impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8629 type Protocol = WifiEventCallbackMarker;
8630 type ControlHandle = WifiEventCallbackControlHandle;
8631
8632 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8633 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8634 }
8635
8636 fn control_handle(&self) -> Self::ControlHandle {
8637 WifiEventCallbackControlHandle { inner: self.inner.clone() }
8638 }
8639
8640 fn into_inner(
8641 self,
8642 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8643 {
8644 (self.inner, self.is_terminated)
8645 }
8646
8647 fn from_inner(
8648 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8649 is_terminated: bool,
8650 ) -> Self {
8651 Self { inner, is_terminated }
8652 }
8653}
8654
8655impl futures::Stream for WifiEventCallbackRequestStream {
8656 type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8657
8658 fn poll_next(
8659 mut self: std::pin::Pin<&mut Self>,
8660 cx: &mut std::task::Context<'_>,
8661 ) -> std::task::Poll<Option<Self::Item>> {
8662 let this = &mut *self;
8663 if this.inner.check_shutdown(cx) {
8664 this.is_terminated = true;
8665 return std::task::Poll::Ready(None);
8666 }
8667 if this.is_terminated {
8668 panic!("polled WifiEventCallbackRequestStream after completion");
8669 }
8670 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8671 |bytes, handles| {
8672 match this.inner.channel().read_etc(cx, bytes, handles) {
8673 std::task::Poll::Ready(Ok(())) => {}
8674 std::task::Poll::Pending => return std::task::Poll::Pending,
8675 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8676 this.is_terminated = true;
8677 return std::task::Poll::Ready(None);
8678 }
8679 std::task::Poll::Ready(Err(e)) => {
8680 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8681 e.into(),
8682 ))));
8683 }
8684 }
8685
8686 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8688
8689 std::task::Poll::Ready(Some(match header.ordinal {
8690 0x61189ff44f9d35f3 => {
8691 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8692 let mut req = fidl::new_empty!(
8693 fidl::encoding::EmptyPayload,
8694 fidl::encoding::DefaultFuchsiaResourceDialect
8695 );
8696 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8697 let control_handle =
8698 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8699 Ok(WifiEventCallbackRequest::OnStart { control_handle })
8700 }
8701 0x58b697bcd475e0f9 => {
8702 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8703 let mut req = fidl::new_empty!(
8704 fidl::encoding::EmptyPayload,
8705 fidl::encoding::DefaultFuchsiaResourceDialect
8706 );
8707 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8708 let control_handle =
8709 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8710 Ok(WifiEventCallbackRequest::OnStop { control_handle })
8711 }
8712 0x69dfee4d3475db21 => {
8713 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8714 let mut req = fidl::new_empty!(
8715 WifiEventCallbackOnSubsystemRestartRequest,
8716 fidl::encoding::DefaultFuchsiaResourceDialect
8717 );
8718 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8719 let control_handle =
8720 WifiEventCallbackControlHandle { inner: this.inner.clone() };
8721 Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8722 payload: req,
8723 control_handle,
8724 })
8725 }
8726 _ if header.tx_id == 0
8727 && header
8728 .dynamic_flags()
8729 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8730 {
8731 Ok(WifiEventCallbackRequest::_UnknownMethod {
8732 ordinal: header.ordinal,
8733 control_handle: WifiEventCallbackControlHandle {
8734 inner: this.inner.clone(),
8735 },
8736 method_type: fidl::MethodType::OneWay,
8737 })
8738 }
8739 _ if header
8740 .dynamic_flags()
8741 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8742 {
8743 this.inner.send_framework_err(
8744 fidl::encoding::FrameworkErr::UnknownMethod,
8745 header.tx_id,
8746 header.ordinal,
8747 header.dynamic_flags(),
8748 (bytes, handles),
8749 )?;
8750 Ok(WifiEventCallbackRequest::_UnknownMethod {
8751 ordinal: header.ordinal,
8752 control_handle: WifiEventCallbackControlHandle {
8753 inner: this.inner.clone(),
8754 },
8755 method_type: fidl::MethodType::TwoWay,
8756 })
8757 }
8758 _ => Err(fidl::Error::UnknownOrdinal {
8759 ordinal: header.ordinal,
8760 protocol_name:
8761 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8762 }),
8763 }))
8764 },
8765 )
8766 }
8767}
8768
8769#[derive(Debug)]
8770pub enum WifiEventCallbackRequest {
8771 OnStart {
8772 control_handle: WifiEventCallbackControlHandle,
8773 },
8774 OnStop {
8775 control_handle: WifiEventCallbackControlHandle,
8776 },
8777 OnSubsystemRestart {
8778 payload: WifiEventCallbackOnSubsystemRestartRequest,
8779 control_handle: WifiEventCallbackControlHandle,
8780 },
8781 #[non_exhaustive]
8783 _UnknownMethod {
8784 ordinal: u64,
8786 control_handle: WifiEventCallbackControlHandle,
8787 method_type: fidl::MethodType,
8788 },
8789}
8790
8791impl WifiEventCallbackRequest {
8792 #[allow(irrefutable_let_patterns)]
8793 pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
8794 if let WifiEventCallbackRequest::OnStart { control_handle } = self {
8795 Some((control_handle))
8796 } else {
8797 None
8798 }
8799 }
8800
8801 #[allow(irrefutable_let_patterns)]
8802 pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
8803 if let WifiEventCallbackRequest::OnStop { control_handle } = self {
8804 Some((control_handle))
8805 } else {
8806 None
8807 }
8808 }
8809
8810 #[allow(irrefutable_let_patterns)]
8811 pub fn into_on_subsystem_restart(
8812 self,
8813 ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
8814 if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
8815 Some((payload, control_handle))
8816 } else {
8817 None
8818 }
8819 }
8820
8821 pub fn method_name(&self) -> &'static str {
8823 match *self {
8824 WifiEventCallbackRequest::OnStart { .. } => "on_start",
8825 WifiEventCallbackRequest::OnStop { .. } => "on_stop",
8826 WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
8827 WifiEventCallbackRequest::_UnknownMethod {
8828 method_type: fidl::MethodType::OneWay,
8829 ..
8830 } => "unknown one-way method",
8831 WifiEventCallbackRequest::_UnknownMethod {
8832 method_type: fidl::MethodType::TwoWay,
8833 ..
8834 } => "unknown two-way method",
8835 }
8836 }
8837}
8838
8839#[derive(Debug, Clone)]
8840pub struct WifiEventCallbackControlHandle {
8841 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8842}
8843
8844impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
8845 fn shutdown(&self) {
8846 self.inner.shutdown()
8847 }
8848
8849 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8850 self.inner.shutdown_with_epitaph(status)
8851 }
8852
8853 fn is_closed(&self) -> bool {
8854 self.inner.channel().is_closed()
8855 }
8856 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8857 self.inner.channel().on_closed()
8858 }
8859
8860 #[cfg(target_os = "fuchsia")]
8861 fn signal_peer(
8862 &self,
8863 clear_mask: zx::Signals,
8864 set_mask: zx::Signals,
8865 ) -> Result<(), zx_status::Status> {
8866 use fidl::Peered;
8867 self.inner.channel().signal_peer(clear_mask, set_mask)
8868 }
8869}
8870
8871impl WifiEventCallbackControlHandle {}
8872
8873#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8874pub struct WifiLegacyHalMarker;
8875
8876impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
8877 type Proxy = WifiLegacyHalProxy;
8878 type RequestStream = WifiLegacyHalRequestStream;
8879 #[cfg(target_os = "fuchsia")]
8880 type SynchronousProxy = WifiLegacyHalSynchronousProxy;
8881
8882 const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
8883}
8884pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8885pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8886
8887pub trait WifiLegacyHalProxyInterface: Send + Sync {
8888 type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
8889 + Send;
8890 fn r#select_tx_power_scenario(
8891 &self,
8892 payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8893 ) -> Self::SelectTxPowerScenarioResponseFut;
8894 type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
8895 + Send;
8896 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
8897}
8898#[derive(Debug)]
8899#[cfg(target_os = "fuchsia")]
8900pub struct WifiLegacyHalSynchronousProxy {
8901 client: fidl::client::sync::Client,
8902}
8903
8904#[cfg(target_os = "fuchsia")]
8905impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
8906 type Proxy = WifiLegacyHalProxy;
8907 type Protocol = WifiLegacyHalMarker;
8908
8909 fn from_channel(inner: fidl::Channel) -> Self {
8910 Self::new(inner)
8911 }
8912
8913 fn into_channel(self) -> fidl::Channel {
8914 self.client.into_channel()
8915 }
8916
8917 fn as_channel(&self) -> &fidl::Channel {
8918 self.client.as_channel()
8919 }
8920}
8921
8922#[cfg(target_os = "fuchsia")]
8923impl WifiLegacyHalSynchronousProxy {
8924 pub fn new(channel: fidl::Channel) -> Self {
8925 let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8926 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8927 }
8928
8929 pub fn into_channel(self) -> fidl::Channel {
8930 self.client.into_channel()
8931 }
8932
8933 pub fn wait_for_event(
8936 &self,
8937 deadline: zx::MonotonicInstant,
8938 ) -> Result<WifiLegacyHalEvent, fidl::Error> {
8939 WifiLegacyHalEvent::decode(self.client.wait_for_event(deadline)?)
8940 }
8941
8942 pub fn r#select_tx_power_scenario(
8944 &self,
8945 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8946 ___deadline: zx::MonotonicInstant,
8947 ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
8948 let _response = self.client.send_query::<
8949 WifiLegacyHalSelectTxPowerScenarioRequest,
8950 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
8951 >(
8952 &mut payload,
8953 0x49f42620e0a3caf9,
8954 fidl::encoding::DynamicFlags::FLEXIBLE,
8955 ___deadline,
8956 )?
8957 .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
8958 Ok(_response.map(|x| x))
8959 }
8960
8961 pub fn r#reset_tx_power_scenario(
8963 &self,
8964 ___deadline: zx::MonotonicInstant,
8965 ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
8966 let _response =
8967 self.client
8968 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
8969 fidl::encoding::EmptyStruct,
8970 WifiLegacyHalStatus,
8971 >>(
8972 (), 0x6c0f8e9203167d8e, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
8973 )?
8974 .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
8975 Ok(_response.map(|x| x))
8976 }
8977}
8978
8979#[cfg(target_os = "fuchsia")]
8980impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
8981 fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
8982 value.into_channel().into()
8983 }
8984}
8985
8986#[cfg(target_os = "fuchsia")]
8987impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
8988 fn from(value: fidl::Channel) -> Self {
8989 Self::new(value)
8990 }
8991}
8992
8993#[cfg(target_os = "fuchsia")]
8994impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
8995 type Protocol = WifiLegacyHalMarker;
8996
8997 fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
8998 Self::new(value.into_channel())
8999 }
9000}
9001
9002#[derive(Debug, Clone)]
9003pub struct WifiLegacyHalProxy {
9004 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9005}
9006
9007impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
9008 type Protocol = WifiLegacyHalMarker;
9009
9010 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9011 Self::new(inner)
9012 }
9013
9014 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9015 self.client.into_channel().map_err(|client| Self { client })
9016 }
9017
9018 fn as_channel(&self) -> &::fidl::AsyncChannel {
9019 self.client.as_channel()
9020 }
9021}
9022
9023impl WifiLegacyHalProxy {
9024 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9026 let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9027 Self { client: fidl::client::Client::new(channel, protocol_name) }
9028 }
9029
9030 pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
9036 WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
9037 }
9038
9039 pub fn r#select_tx_power_scenario(
9041 &self,
9042 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9043 ) -> fidl::client::QueryResponseFut<
9044 WifiLegacyHalSelectTxPowerScenarioResult,
9045 fidl::encoding::DefaultFuchsiaResourceDialect,
9046 > {
9047 WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
9048 }
9049
9050 pub fn r#reset_tx_power_scenario(
9052 &self,
9053 ) -> fidl::client::QueryResponseFut<
9054 WifiLegacyHalResetTxPowerScenarioResult,
9055 fidl::encoding::DefaultFuchsiaResourceDialect,
9056 > {
9057 WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
9058 }
9059}
9060
9061impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
9062 type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9063 WifiLegacyHalSelectTxPowerScenarioResult,
9064 fidl::encoding::DefaultFuchsiaResourceDialect,
9065 >;
9066 fn r#select_tx_power_scenario(
9067 &self,
9068 mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9069 ) -> Self::SelectTxPowerScenarioResponseFut {
9070 fn _decode(
9071 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9072 ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9073 let _response = fidl::client::decode_transaction_body::<
9074 fidl::encoding::FlexibleResultType<
9075 fidl::encoding::EmptyStruct,
9076 WifiLegacyHalStatus,
9077 >,
9078 fidl::encoding::DefaultFuchsiaResourceDialect,
9079 0x49f42620e0a3caf9,
9080 >(_buf?)?
9081 .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9082 Ok(_response.map(|x| x))
9083 }
9084 self.client.send_query_and_decode::<
9085 WifiLegacyHalSelectTxPowerScenarioRequest,
9086 WifiLegacyHalSelectTxPowerScenarioResult,
9087 >(
9088 &mut payload,
9089 0x49f42620e0a3caf9,
9090 fidl::encoding::DynamicFlags::FLEXIBLE,
9091 _decode,
9092 )
9093 }
9094
9095 type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9096 WifiLegacyHalResetTxPowerScenarioResult,
9097 fidl::encoding::DefaultFuchsiaResourceDialect,
9098 >;
9099 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
9100 fn _decode(
9101 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9102 ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9103 let _response = fidl::client::decode_transaction_body::<
9104 fidl::encoding::FlexibleResultType<
9105 fidl::encoding::EmptyStruct,
9106 WifiLegacyHalStatus,
9107 >,
9108 fidl::encoding::DefaultFuchsiaResourceDialect,
9109 0x6c0f8e9203167d8e,
9110 >(_buf?)?
9111 .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9112 Ok(_response.map(|x| x))
9113 }
9114 self.client.send_query_and_decode::<
9115 fidl::encoding::EmptyPayload,
9116 WifiLegacyHalResetTxPowerScenarioResult,
9117 >(
9118 (),
9119 0x6c0f8e9203167d8e,
9120 fidl::encoding::DynamicFlags::FLEXIBLE,
9121 _decode,
9122 )
9123 }
9124}
9125
9126pub struct WifiLegacyHalEventStream {
9127 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9128}
9129
9130impl std::marker::Unpin for WifiLegacyHalEventStream {}
9131
9132impl futures::stream::FusedStream for WifiLegacyHalEventStream {
9133 fn is_terminated(&self) -> bool {
9134 self.event_receiver.is_terminated()
9135 }
9136}
9137
9138impl futures::Stream for WifiLegacyHalEventStream {
9139 type Item = Result<WifiLegacyHalEvent, fidl::Error>;
9140
9141 fn poll_next(
9142 mut self: std::pin::Pin<&mut Self>,
9143 cx: &mut std::task::Context<'_>,
9144 ) -> std::task::Poll<Option<Self::Item>> {
9145 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9146 &mut self.event_receiver,
9147 cx
9148 )?) {
9149 Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
9150 None => std::task::Poll::Ready(None),
9151 }
9152 }
9153}
9154
9155#[derive(Debug)]
9156pub enum WifiLegacyHalEvent {
9157 #[non_exhaustive]
9158 _UnknownEvent {
9159 ordinal: u64,
9161 },
9162}
9163
9164impl WifiLegacyHalEvent {
9165 fn decode(
9167 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9168 ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9169 let (bytes, _handles) = buf.split_mut();
9170 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9171 debug_assert_eq!(tx_header.tx_id, 0);
9172 match tx_header.ordinal {
9173 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9174 Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9175 }
9176 _ => Err(fidl::Error::UnknownOrdinal {
9177 ordinal: tx_header.ordinal,
9178 protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9179 }),
9180 }
9181 }
9182}
9183
9184pub struct WifiLegacyHalRequestStream {
9186 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9187 is_terminated: bool,
9188}
9189
9190impl std::marker::Unpin for WifiLegacyHalRequestStream {}
9191
9192impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
9193 fn is_terminated(&self) -> bool {
9194 self.is_terminated
9195 }
9196}
9197
9198impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
9199 type Protocol = WifiLegacyHalMarker;
9200 type ControlHandle = WifiLegacyHalControlHandle;
9201
9202 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9203 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9204 }
9205
9206 fn control_handle(&self) -> Self::ControlHandle {
9207 WifiLegacyHalControlHandle { inner: self.inner.clone() }
9208 }
9209
9210 fn into_inner(
9211 self,
9212 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9213 {
9214 (self.inner, self.is_terminated)
9215 }
9216
9217 fn from_inner(
9218 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9219 is_terminated: bool,
9220 ) -> Self {
9221 Self { inner, is_terminated }
9222 }
9223}
9224
9225impl futures::Stream for WifiLegacyHalRequestStream {
9226 type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9227
9228 fn poll_next(
9229 mut self: std::pin::Pin<&mut Self>,
9230 cx: &mut std::task::Context<'_>,
9231 ) -> std::task::Poll<Option<Self::Item>> {
9232 let this = &mut *self;
9233 if this.inner.check_shutdown(cx) {
9234 this.is_terminated = true;
9235 return std::task::Poll::Ready(None);
9236 }
9237 if this.is_terminated {
9238 panic!("polled WifiLegacyHalRequestStream after completion");
9239 }
9240 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9241 |bytes, handles| {
9242 match this.inner.channel().read_etc(cx, bytes, handles) {
9243 std::task::Poll::Ready(Ok(())) => {}
9244 std::task::Poll::Pending => return std::task::Poll::Pending,
9245 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9246 this.is_terminated = true;
9247 return std::task::Poll::Ready(None);
9248 }
9249 std::task::Poll::Ready(Err(e)) => {
9250 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9251 e.into(),
9252 ))));
9253 }
9254 }
9255
9256 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9258
9259 std::task::Poll::Ready(Some(match header.ordinal {
9260 0x49f42620e0a3caf9 => {
9261 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9262 let mut req = fidl::new_empty!(
9263 WifiLegacyHalSelectTxPowerScenarioRequest,
9264 fidl::encoding::DefaultFuchsiaResourceDialect
9265 );
9266 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9267 let control_handle =
9268 WifiLegacyHalControlHandle { inner: this.inner.clone() };
9269 Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9270 payload: req,
9271 responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9272 control_handle: std::mem::ManuallyDrop::new(control_handle),
9273 tx_id: header.tx_id,
9274 },
9275 })
9276 }
9277 0x6c0f8e9203167d8e => {
9278 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9279 let mut req = fidl::new_empty!(
9280 fidl::encoding::EmptyPayload,
9281 fidl::encoding::DefaultFuchsiaResourceDialect
9282 );
9283 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9284 let control_handle =
9285 WifiLegacyHalControlHandle { inner: this.inner.clone() };
9286 Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9287 responder: WifiLegacyHalResetTxPowerScenarioResponder {
9288 control_handle: std::mem::ManuallyDrop::new(control_handle),
9289 tx_id: header.tx_id,
9290 },
9291 })
9292 }
9293 _ if header.tx_id == 0
9294 && header
9295 .dynamic_flags()
9296 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9297 {
9298 Ok(WifiLegacyHalRequest::_UnknownMethod {
9299 ordinal: header.ordinal,
9300 control_handle: WifiLegacyHalControlHandle {
9301 inner: this.inner.clone(),
9302 },
9303 method_type: fidl::MethodType::OneWay,
9304 })
9305 }
9306 _ if header
9307 .dynamic_flags()
9308 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9309 {
9310 this.inner.send_framework_err(
9311 fidl::encoding::FrameworkErr::UnknownMethod,
9312 header.tx_id,
9313 header.ordinal,
9314 header.dynamic_flags(),
9315 (bytes, handles),
9316 )?;
9317 Ok(WifiLegacyHalRequest::_UnknownMethod {
9318 ordinal: header.ordinal,
9319 control_handle: WifiLegacyHalControlHandle {
9320 inner: this.inner.clone(),
9321 },
9322 method_type: fidl::MethodType::TwoWay,
9323 })
9324 }
9325 _ => Err(fidl::Error::UnknownOrdinal {
9326 ordinal: header.ordinal,
9327 protocol_name:
9328 <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9329 }),
9330 }))
9331 },
9332 )
9333 }
9334}
9335
9336#[derive(Debug)]
9337pub enum WifiLegacyHalRequest {
9338 SelectTxPowerScenario {
9340 payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9341 responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9342 },
9343 ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9345 #[non_exhaustive]
9347 _UnknownMethod {
9348 ordinal: u64,
9350 control_handle: WifiLegacyHalControlHandle,
9351 method_type: fidl::MethodType,
9352 },
9353}
9354
9355impl WifiLegacyHalRequest {
9356 #[allow(irrefutable_let_patterns)]
9357 pub fn into_select_tx_power_scenario(
9358 self,
9359 ) -> Option<(
9360 WifiLegacyHalSelectTxPowerScenarioRequest,
9361 WifiLegacyHalSelectTxPowerScenarioResponder,
9362 )> {
9363 if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9364 Some((payload, responder))
9365 } else {
9366 None
9367 }
9368 }
9369
9370 #[allow(irrefutable_let_patterns)]
9371 pub fn into_reset_tx_power_scenario(
9372 self,
9373 ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9374 if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9375 Some((responder))
9376 } else {
9377 None
9378 }
9379 }
9380
9381 pub fn method_name(&self) -> &'static str {
9383 match *self {
9384 WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9385 WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9386 WifiLegacyHalRequest::_UnknownMethod {
9387 method_type: fidl::MethodType::OneWay, ..
9388 } => "unknown one-way method",
9389 WifiLegacyHalRequest::_UnknownMethod {
9390 method_type: fidl::MethodType::TwoWay, ..
9391 } => "unknown two-way method",
9392 }
9393 }
9394}
9395
9396#[derive(Debug, Clone)]
9397pub struct WifiLegacyHalControlHandle {
9398 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9399}
9400
9401impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9402 fn shutdown(&self) {
9403 self.inner.shutdown()
9404 }
9405
9406 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9407 self.inner.shutdown_with_epitaph(status)
9408 }
9409
9410 fn is_closed(&self) -> bool {
9411 self.inner.channel().is_closed()
9412 }
9413 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9414 self.inner.channel().on_closed()
9415 }
9416
9417 #[cfg(target_os = "fuchsia")]
9418 fn signal_peer(
9419 &self,
9420 clear_mask: zx::Signals,
9421 set_mask: zx::Signals,
9422 ) -> Result<(), zx_status::Status> {
9423 use fidl::Peered;
9424 self.inner.channel().signal_peer(clear_mask, set_mask)
9425 }
9426}
9427
9428impl WifiLegacyHalControlHandle {}
9429
9430#[must_use = "FIDL methods require a response to be sent"]
9431#[derive(Debug)]
9432pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9433 control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9434 tx_id: u32,
9435}
9436
9437impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9441 fn drop(&mut self) {
9442 self.control_handle.shutdown();
9443 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9445 }
9446}
9447
9448impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9449 type ControlHandle = WifiLegacyHalControlHandle;
9450
9451 fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9452 &self.control_handle
9453 }
9454
9455 fn drop_without_shutdown(mut self) {
9456 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9458 std::mem::forget(self);
9460 }
9461}
9462
9463impl WifiLegacyHalSelectTxPowerScenarioResponder {
9464 pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9468 let _result = self.send_raw(result);
9469 if _result.is_err() {
9470 self.control_handle.shutdown();
9471 }
9472 self.drop_without_shutdown();
9473 _result
9474 }
9475
9476 pub fn send_no_shutdown_on_err(
9478 self,
9479 mut result: Result<(), WifiLegacyHalStatus>,
9480 ) -> Result<(), fidl::Error> {
9481 let _result = self.send_raw(result);
9482 self.drop_without_shutdown();
9483 _result
9484 }
9485
9486 fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9487 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9488 fidl::encoding::EmptyStruct,
9489 WifiLegacyHalStatus,
9490 >>(
9491 fidl::encoding::FlexibleResult::new(result),
9492 self.tx_id,
9493 0x49f42620e0a3caf9,
9494 fidl::encoding::DynamicFlags::FLEXIBLE,
9495 )
9496 }
9497}
9498
9499#[must_use = "FIDL methods require a response to be sent"]
9500#[derive(Debug)]
9501pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9502 control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9503 tx_id: u32,
9504}
9505
9506impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9510 fn drop(&mut self) {
9511 self.control_handle.shutdown();
9512 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9514 }
9515}
9516
9517impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9518 type ControlHandle = WifiLegacyHalControlHandle;
9519
9520 fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9521 &self.control_handle
9522 }
9523
9524 fn drop_without_shutdown(mut self) {
9525 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9527 std::mem::forget(self);
9529 }
9530}
9531
9532impl WifiLegacyHalResetTxPowerScenarioResponder {
9533 pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9537 let _result = self.send_raw(result);
9538 if _result.is_err() {
9539 self.control_handle.shutdown();
9540 }
9541 self.drop_without_shutdown();
9542 _result
9543 }
9544
9545 pub fn send_no_shutdown_on_err(
9547 self,
9548 mut result: Result<(), WifiLegacyHalStatus>,
9549 ) -> Result<(), fidl::Error> {
9550 let _result = self.send_raw(result);
9551 self.drop_without_shutdown();
9552 _result
9553 }
9554
9555 fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9556 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9557 fidl::encoding::EmptyStruct,
9558 WifiLegacyHalStatus,
9559 >>(
9560 fidl::encoding::FlexibleResult::new(result),
9561 self.tx_id,
9562 0x6c0f8e9203167d8e,
9563 fidl::encoding::DynamicFlags::FLEXIBLE,
9564 )
9565 }
9566}
9567
9568#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9569pub struct WifiStaIfaceMarker;
9570
9571impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9572 type Proxy = WifiStaIfaceProxy;
9573 type RequestStream = WifiStaIfaceRequestStream;
9574 #[cfg(target_os = "fuchsia")]
9575 type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9576
9577 const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9578}
9579pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9580pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9581
9582pub trait WifiStaIfaceProxyInterface: Send + Sync {
9583 type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9584 + Send;
9585 fn r#get_name(&self) -> Self::GetNameResponseFut;
9586 type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9587 + Send;
9588 fn r#set_scan_only_mode(
9589 &self,
9590 payload: WifiStaIfaceSetScanOnlyModeRequest,
9591 ) -> Self::SetScanOnlyModeResponseFut;
9592 type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9593 + Send;
9594 fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9595}
9596#[derive(Debug)]
9597#[cfg(target_os = "fuchsia")]
9598pub struct WifiStaIfaceSynchronousProxy {
9599 client: fidl::client::sync::Client,
9600}
9601
9602#[cfg(target_os = "fuchsia")]
9603impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9604 type Proxy = WifiStaIfaceProxy;
9605 type Protocol = WifiStaIfaceMarker;
9606
9607 fn from_channel(inner: fidl::Channel) -> Self {
9608 Self::new(inner)
9609 }
9610
9611 fn into_channel(self) -> fidl::Channel {
9612 self.client.into_channel()
9613 }
9614
9615 fn as_channel(&self) -> &fidl::Channel {
9616 self.client.as_channel()
9617 }
9618}
9619
9620#[cfg(target_os = "fuchsia")]
9621impl WifiStaIfaceSynchronousProxy {
9622 pub fn new(channel: fidl::Channel) -> Self {
9623 let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9624 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9625 }
9626
9627 pub fn into_channel(self) -> fidl::Channel {
9628 self.client.into_channel()
9629 }
9630
9631 pub fn wait_for_event(
9634 &self,
9635 deadline: zx::MonotonicInstant,
9636 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9637 WifiStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
9638 }
9639
9640 pub fn r#get_name(
9642 &self,
9643 ___deadline: zx::MonotonicInstant,
9644 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9645 let _response = self.client.send_query::<
9646 fidl::encoding::EmptyPayload,
9647 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9648 >(
9649 (),
9650 0x5c150b91c80c5789,
9651 fidl::encoding::DynamicFlags::FLEXIBLE,
9652 ___deadline,
9653 )?
9654 .into_result::<WifiStaIfaceMarker>("get_name")?;
9655 Ok(_response)
9656 }
9657
9658 pub fn r#set_scan_only_mode(
9659 &self,
9660 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9661 ___deadline: zx::MonotonicInstant,
9662 ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9663 let _response = self.client.send_query::<
9664 WifiStaIfaceSetScanOnlyModeRequest,
9665 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9666 >(
9667 &mut payload,
9668 0x22550328583bf0e3,
9669 fidl::encoding::DynamicFlags::FLEXIBLE,
9670 ___deadline,
9671 )?
9672 .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9673 Ok(_response.map(|x| x))
9674 }
9675
9676 pub fn r#set_mac_address(
9680 &self,
9681 mut mac_addr: &[u8; 6],
9682 ___deadline: zx::MonotonicInstant,
9683 ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9684 let _response = self.client.send_query::<
9685 WifiStaIfaceSetMacAddressRequest,
9686 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9687 >(
9688 (mac_addr,),
9689 0x39c4f355079421b9,
9690 fidl::encoding::DynamicFlags::FLEXIBLE,
9691 ___deadline,
9692 )?
9693 .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9694 Ok(_response.map(|x| x))
9695 }
9696}
9697
9698#[cfg(target_os = "fuchsia")]
9699impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
9700 fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
9701 value.into_channel().into()
9702 }
9703}
9704
9705#[cfg(target_os = "fuchsia")]
9706impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
9707 fn from(value: fidl::Channel) -> Self {
9708 Self::new(value)
9709 }
9710}
9711
9712#[cfg(target_os = "fuchsia")]
9713impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
9714 type Protocol = WifiStaIfaceMarker;
9715
9716 fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
9717 Self::new(value.into_channel())
9718 }
9719}
9720
9721#[derive(Debug, Clone)]
9722pub struct WifiStaIfaceProxy {
9723 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9724}
9725
9726impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
9727 type Protocol = WifiStaIfaceMarker;
9728
9729 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9730 Self::new(inner)
9731 }
9732
9733 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9734 self.client.into_channel().map_err(|client| Self { client })
9735 }
9736
9737 fn as_channel(&self) -> &::fidl::AsyncChannel {
9738 self.client.as_channel()
9739 }
9740}
9741
9742impl WifiStaIfaceProxy {
9743 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9745 let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9746 Self { client: fidl::client::Client::new(channel, protocol_name) }
9747 }
9748
9749 pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
9755 WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
9756 }
9757
9758 pub fn r#get_name(
9760 &self,
9761 ) -> fidl::client::QueryResponseFut<
9762 WifiStaIfaceGetNameResponse,
9763 fidl::encoding::DefaultFuchsiaResourceDialect,
9764 > {
9765 WifiStaIfaceProxyInterface::r#get_name(self)
9766 }
9767
9768 pub fn r#set_scan_only_mode(
9769 &self,
9770 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9771 ) -> fidl::client::QueryResponseFut<
9772 WifiStaIfaceSetScanOnlyModeResult,
9773 fidl::encoding::DefaultFuchsiaResourceDialect,
9774 > {
9775 WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
9776 }
9777
9778 pub fn r#set_mac_address(
9782 &self,
9783 mut mac_addr: &[u8; 6],
9784 ) -> fidl::client::QueryResponseFut<
9785 WifiStaIfaceSetMacAddressResult,
9786 fidl::encoding::DefaultFuchsiaResourceDialect,
9787 > {
9788 WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
9789 }
9790}
9791
9792impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
9793 type GetNameResponseFut = fidl::client::QueryResponseFut<
9794 WifiStaIfaceGetNameResponse,
9795 fidl::encoding::DefaultFuchsiaResourceDialect,
9796 >;
9797 fn r#get_name(&self) -> Self::GetNameResponseFut {
9798 fn _decode(
9799 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9800 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9801 let _response = fidl::client::decode_transaction_body::<
9802 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9803 fidl::encoding::DefaultFuchsiaResourceDialect,
9804 0x5c150b91c80c5789,
9805 >(_buf?)?
9806 .into_result::<WifiStaIfaceMarker>("get_name")?;
9807 Ok(_response)
9808 }
9809 self.client
9810 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
9811 (),
9812 0x5c150b91c80c5789,
9813 fidl::encoding::DynamicFlags::FLEXIBLE,
9814 _decode,
9815 )
9816 }
9817
9818 type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
9819 WifiStaIfaceSetScanOnlyModeResult,
9820 fidl::encoding::DefaultFuchsiaResourceDialect,
9821 >;
9822 fn r#set_scan_only_mode(
9823 &self,
9824 mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9825 ) -> Self::SetScanOnlyModeResponseFut {
9826 fn _decode(
9827 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9828 ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9829 let _response = fidl::client::decode_transaction_body::<
9830 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9831 fidl::encoding::DefaultFuchsiaResourceDialect,
9832 0x22550328583bf0e3,
9833 >(_buf?)?
9834 .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9835 Ok(_response.map(|x| x))
9836 }
9837 self.client.send_query_and_decode::<
9838 WifiStaIfaceSetScanOnlyModeRequest,
9839 WifiStaIfaceSetScanOnlyModeResult,
9840 >(
9841 &mut payload,
9842 0x22550328583bf0e3,
9843 fidl::encoding::DynamicFlags::FLEXIBLE,
9844 _decode,
9845 )
9846 }
9847
9848 type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
9849 WifiStaIfaceSetMacAddressResult,
9850 fidl::encoding::DefaultFuchsiaResourceDialect,
9851 >;
9852 fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
9853 fn _decode(
9854 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9855 ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9856 let _response = fidl::client::decode_transaction_body::<
9857 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9858 fidl::encoding::DefaultFuchsiaResourceDialect,
9859 0x39c4f355079421b9,
9860 >(_buf?)?
9861 .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9862 Ok(_response.map(|x| x))
9863 }
9864 self.client.send_query_and_decode::<
9865 WifiStaIfaceSetMacAddressRequest,
9866 WifiStaIfaceSetMacAddressResult,
9867 >(
9868 (mac_addr,),
9869 0x39c4f355079421b9,
9870 fidl::encoding::DynamicFlags::FLEXIBLE,
9871 _decode,
9872 )
9873 }
9874}
9875
9876pub struct WifiStaIfaceEventStream {
9877 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9878}
9879
9880impl std::marker::Unpin for WifiStaIfaceEventStream {}
9881
9882impl futures::stream::FusedStream for WifiStaIfaceEventStream {
9883 fn is_terminated(&self) -> bool {
9884 self.event_receiver.is_terminated()
9885 }
9886}
9887
9888impl futures::Stream for WifiStaIfaceEventStream {
9889 type Item = Result<WifiStaIfaceEvent, fidl::Error>;
9890
9891 fn poll_next(
9892 mut self: std::pin::Pin<&mut Self>,
9893 cx: &mut std::task::Context<'_>,
9894 ) -> std::task::Poll<Option<Self::Item>> {
9895 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9896 &mut self.event_receiver,
9897 cx
9898 )?) {
9899 Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
9900 None => std::task::Poll::Ready(None),
9901 }
9902 }
9903}
9904
9905#[derive(Debug)]
9906pub enum WifiStaIfaceEvent {
9907 #[non_exhaustive]
9908 _UnknownEvent {
9909 ordinal: u64,
9911 },
9912}
9913
9914impl WifiStaIfaceEvent {
9915 fn decode(
9917 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9918 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9919 let (bytes, _handles) = buf.split_mut();
9920 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9921 debug_assert_eq!(tx_header.tx_id, 0);
9922 match tx_header.ordinal {
9923 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9924 Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9925 }
9926 _ => Err(fidl::Error::UnknownOrdinal {
9927 ordinal: tx_header.ordinal,
9928 protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9929 }),
9930 }
9931 }
9932}
9933
9934pub struct WifiStaIfaceRequestStream {
9936 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9937 is_terminated: bool,
9938}
9939
9940impl std::marker::Unpin for WifiStaIfaceRequestStream {}
9941
9942impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
9943 fn is_terminated(&self) -> bool {
9944 self.is_terminated
9945 }
9946}
9947
9948impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
9949 type Protocol = WifiStaIfaceMarker;
9950 type ControlHandle = WifiStaIfaceControlHandle;
9951
9952 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9953 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9954 }
9955
9956 fn control_handle(&self) -> Self::ControlHandle {
9957 WifiStaIfaceControlHandle { inner: self.inner.clone() }
9958 }
9959
9960 fn into_inner(
9961 self,
9962 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9963 {
9964 (self.inner, self.is_terminated)
9965 }
9966
9967 fn from_inner(
9968 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9969 is_terminated: bool,
9970 ) -> Self {
9971 Self { inner, is_terminated }
9972 }
9973}
9974
9975impl futures::Stream for WifiStaIfaceRequestStream {
9976 type Item = Result<WifiStaIfaceRequest, fidl::Error>;
9977
9978 fn poll_next(
9979 mut self: std::pin::Pin<&mut Self>,
9980 cx: &mut std::task::Context<'_>,
9981 ) -> std::task::Poll<Option<Self::Item>> {
9982 let this = &mut *self;
9983 if this.inner.check_shutdown(cx) {
9984 this.is_terminated = true;
9985 return std::task::Poll::Ready(None);
9986 }
9987 if this.is_terminated {
9988 panic!("polled WifiStaIfaceRequestStream after completion");
9989 }
9990 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9991 |bytes, handles| {
9992 match this.inner.channel().read_etc(cx, bytes, handles) {
9993 std::task::Poll::Ready(Ok(())) => {}
9994 std::task::Poll::Pending => return std::task::Poll::Pending,
9995 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9996 this.is_terminated = true;
9997 return std::task::Poll::Ready(None);
9998 }
9999 std::task::Poll::Ready(Err(e)) => {
10000 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10001 e.into(),
10002 ))));
10003 }
10004 }
10005
10006 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10008
10009 std::task::Poll::Ready(Some(match header.ordinal {
10010 0x5c150b91c80c5789 => {
10011 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10012 let mut req = fidl::new_empty!(
10013 fidl::encoding::EmptyPayload,
10014 fidl::encoding::DefaultFuchsiaResourceDialect
10015 );
10016 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10017 let control_handle =
10018 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10019 Ok(WifiStaIfaceRequest::GetName {
10020 responder: WifiStaIfaceGetNameResponder {
10021 control_handle: std::mem::ManuallyDrop::new(control_handle),
10022 tx_id: header.tx_id,
10023 },
10024 })
10025 }
10026 0x22550328583bf0e3 => {
10027 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10028 let mut req = fidl::new_empty!(
10029 WifiStaIfaceSetScanOnlyModeRequest,
10030 fidl::encoding::DefaultFuchsiaResourceDialect
10031 );
10032 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
10033 let control_handle =
10034 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10035 Ok(WifiStaIfaceRequest::SetScanOnlyMode {
10036 payload: req,
10037 responder: WifiStaIfaceSetScanOnlyModeResponder {
10038 control_handle: std::mem::ManuallyDrop::new(control_handle),
10039 tx_id: header.tx_id,
10040 },
10041 })
10042 }
10043 0x39c4f355079421b9 => {
10044 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10045 let mut req = fidl::new_empty!(
10046 WifiStaIfaceSetMacAddressRequest,
10047 fidl::encoding::DefaultFuchsiaResourceDialect
10048 );
10049 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
10050 let control_handle =
10051 WifiStaIfaceControlHandle { inner: this.inner.clone() };
10052 Ok(WifiStaIfaceRequest::SetMacAddress {
10053 mac_addr: req.mac_addr,
10054
10055 responder: WifiStaIfaceSetMacAddressResponder {
10056 control_handle: std::mem::ManuallyDrop::new(control_handle),
10057 tx_id: header.tx_id,
10058 },
10059 })
10060 }
10061 _ if header.tx_id == 0
10062 && header
10063 .dynamic_flags()
10064 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10065 {
10066 Ok(WifiStaIfaceRequest::_UnknownMethod {
10067 ordinal: header.ordinal,
10068 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10069 method_type: fidl::MethodType::OneWay,
10070 })
10071 }
10072 _ if header
10073 .dynamic_flags()
10074 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10075 {
10076 this.inner.send_framework_err(
10077 fidl::encoding::FrameworkErr::UnknownMethod,
10078 header.tx_id,
10079 header.ordinal,
10080 header.dynamic_flags(),
10081 (bytes, handles),
10082 )?;
10083 Ok(WifiStaIfaceRequest::_UnknownMethod {
10084 ordinal: header.ordinal,
10085 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10086 method_type: fidl::MethodType::TwoWay,
10087 })
10088 }
10089 _ => Err(fidl::Error::UnknownOrdinal {
10090 ordinal: header.ordinal,
10091 protocol_name:
10092 <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10093 }),
10094 }))
10095 },
10096 )
10097 }
10098}
10099
10100#[derive(Debug)]
10101pub enum WifiStaIfaceRequest {
10102 GetName { responder: WifiStaIfaceGetNameResponder },
10104 SetScanOnlyMode {
10105 payload: WifiStaIfaceSetScanOnlyModeRequest,
10106 responder: WifiStaIfaceSetScanOnlyModeResponder,
10107 },
10108 SetMacAddress { mac_addr: [u8; 6], responder: WifiStaIfaceSetMacAddressResponder },
10112 #[non_exhaustive]
10114 _UnknownMethod {
10115 ordinal: u64,
10117 control_handle: WifiStaIfaceControlHandle,
10118 method_type: fidl::MethodType,
10119 },
10120}
10121
10122impl WifiStaIfaceRequest {
10123 #[allow(irrefutable_let_patterns)]
10124 pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
10125 if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
10126 }
10127
10128 #[allow(irrefutable_let_patterns)]
10129 pub fn into_set_scan_only_mode(
10130 self,
10131 ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
10132 if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
10133 Some((payload, responder))
10134 } else {
10135 None
10136 }
10137 }
10138
10139 #[allow(irrefutable_let_patterns)]
10140 pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
10141 if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
10142 Some((mac_addr, responder))
10143 } else {
10144 None
10145 }
10146 }
10147
10148 pub fn method_name(&self) -> &'static str {
10150 match *self {
10151 WifiStaIfaceRequest::GetName { .. } => "get_name",
10152 WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
10153 WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
10154 WifiStaIfaceRequest::_UnknownMethod {
10155 method_type: fidl::MethodType::OneWay, ..
10156 } => "unknown one-way method",
10157 WifiStaIfaceRequest::_UnknownMethod {
10158 method_type: fidl::MethodType::TwoWay, ..
10159 } => "unknown two-way method",
10160 }
10161 }
10162}
10163
10164#[derive(Debug, Clone)]
10165pub struct WifiStaIfaceControlHandle {
10166 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10167}
10168
10169impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
10170 fn shutdown(&self) {
10171 self.inner.shutdown()
10172 }
10173
10174 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10175 self.inner.shutdown_with_epitaph(status)
10176 }
10177
10178 fn is_closed(&self) -> bool {
10179 self.inner.channel().is_closed()
10180 }
10181 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10182 self.inner.channel().on_closed()
10183 }
10184
10185 #[cfg(target_os = "fuchsia")]
10186 fn signal_peer(
10187 &self,
10188 clear_mask: zx::Signals,
10189 set_mask: zx::Signals,
10190 ) -> Result<(), zx_status::Status> {
10191 use fidl::Peered;
10192 self.inner.channel().signal_peer(clear_mask, set_mask)
10193 }
10194}
10195
10196impl WifiStaIfaceControlHandle {}
10197
10198#[must_use = "FIDL methods require a response to be sent"]
10199#[derive(Debug)]
10200pub struct WifiStaIfaceGetNameResponder {
10201 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10202 tx_id: u32,
10203}
10204
10205impl std::ops::Drop for WifiStaIfaceGetNameResponder {
10209 fn drop(&mut self) {
10210 self.control_handle.shutdown();
10211 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10213 }
10214}
10215
10216impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
10217 type ControlHandle = WifiStaIfaceControlHandle;
10218
10219 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10220 &self.control_handle
10221 }
10222
10223 fn drop_without_shutdown(mut self) {
10224 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10226 std::mem::forget(self);
10228 }
10229}
10230
10231impl WifiStaIfaceGetNameResponder {
10232 pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10236 let _result = self.send_raw(payload);
10237 if _result.is_err() {
10238 self.control_handle.shutdown();
10239 }
10240 self.drop_without_shutdown();
10241 _result
10242 }
10243
10244 pub fn send_no_shutdown_on_err(
10246 self,
10247 mut payload: &WifiStaIfaceGetNameResponse,
10248 ) -> Result<(), fidl::Error> {
10249 let _result = self.send_raw(payload);
10250 self.drop_without_shutdown();
10251 _result
10252 }
10253
10254 fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10255 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10256 fidl::encoding::Flexible::new(payload),
10257 self.tx_id,
10258 0x5c150b91c80c5789,
10259 fidl::encoding::DynamicFlags::FLEXIBLE,
10260 )
10261 }
10262}
10263
10264#[must_use = "FIDL methods require a response to be sent"]
10265#[derive(Debug)]
10266pub struct WifiStaIfaceSetScanOnlyModeResponder {
10267 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10268 tx_id: u32,
10269}
10270
10271impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10275 fn drop(&mut self) {
10276 self.control_handle.shutdown();
10277 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10279 }
10280}
10281
10282impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10283 type ControlHandle = WifiStaIfaceControlHandle;
10284
10285 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10286 &self.control_handle
10287 }
10288
10289 fn drop_without_shutdown(mut self) {
10290 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10292 std::mem::forget(self);
10294 }
10295}
10296
10297impl WifiStaIfaceSetScanOnlyModeResponder {
10298 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10302 let _result = self.send_raw(result);
10303 if _result.is_err() {
10304 self.control_handle.shutdown();
10305 }
10306 self.drop_without_shutdown();
10307 _result
10308 }
10309
10310 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10312 let _result = self.send_raw(result);
10313 self.drop_without_shutdown();
10314 _result
10315 }
10316
10317 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10318 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10319 fidl::encoding::EmptyStruct,
10320 i32,
10321 >>(
10322 fidl::encoding::FlexibleResult::new(result),
10323 self.tx_id,
10324 0x22550328583bf0e3,
10325 fidl::encoding::DynamicFlags::FLEXIBLE,
10326 )
10327 }
10328}
10329
10330#[must_use = "FIDL methods require a response to be sent"]
10331#[derive(Debug)]
10332pub struct WifiStaIfaceSetMacAddressResponder {
10333 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10334 tx_id: u32,
10335}
10336
10337impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
10341 fn drop(&mut self) {
10342 self.control_handle.shutdown();
10343 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10345 }
10346}
10347
10348impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
10349 type ControlHandle = WifiStaIfaceControlHandle;
10350
10351 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10352 &self.control_handle
10353 }
10354
10355 fn drop_without_shutdown(mut self) {
10356 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10358 std::mem::forget(self);
10360 }
10361}
10362
10363impl WifiStaIfaceSetMacAddressResponder {
10364 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10368 let _result = self.send_raw(result);
10369 if _result.is_err() {
10370 self.control_handle.shutdown();
10371 }
10372 self.drop_without_shutdown();
10373 _result
10374 }
10375
10376 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10378 let _result = self.send_raw(result);
10379 self.drop_without_shutdown();
10380 _result
10381 }
10382
10383 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10384 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10385 fidl::encoding::EmptyStruct,
10386 i32,
10387 >>(
10388 fidl::encoding::FlexibleResult::new(result),
10389 self.tx_id,
10390 0x39c4f355079421b9,
10391 fidl::encoding::DynamicFlags::FLEXIBLE,
10392 )
10393 }
10394}
10395
10396#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10397pub struct WlanixMarker;
10398
10399impl fidl::endpoints::ProtocolMarker for WlanixMarker {
10400 type Proxy = WlanixProxy;
10401 type RequestStream = WlanixRequestStream;
10402 #[cfg(target_os = "fuchsia")]
10403 type SynchronousProxy = WlanixSynchronousProxy;
10404
10405 const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
10406}
10407impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
10408
10409pub trait WlanixProxyInterface: Send + Sync {
10410 fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
10411 fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
10412 fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
10413 fn r#get_wifi_legacy_hal(
10414 &self,
10415 payload: WlanixGetWifiLegacyHalRequest,
10416 ) -> Result<(), fidl::Error>;
10417}
10418#[derive(Debug)]
10419#[cfg(target_os = "fuchsia")]
10420pub struct WlanixSynchronousProxy {
10421 client: fidl::client::sync::Client,
10422}
10423
10424#[cfg(target_os = "fuchsia")]
10425impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
10426 type Proxy = WlanixProxy;
10427 type Protocol = WlanixMarker;
10428
10429 fn from_channel(inner: fidl::Channel) -> Self {
10430 Self::new(inner)
10431 }
10432
10433 fn into_channel(self) -> fidl::Channel {
10434 self.client.into_channel()
10435 }
10436
10437 fn as_channel(&self) -> &fidl::Channel {
10438 self.client.as_channel()
10439 }
10440}
10441
10442#[cfg(target_os = "fuchsia")]
10443impl WlanixSynchronousProxy {
10444 pub fn new(channel: fidl::Channel) -> Self {
10445 let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10446 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10447 }
10448
10449 pub fn into_channel(self) -> fidl::Channel {
10450 self.client.into_channel()
10451 }
10452
10453 pub fn wait_for_event(
10456 &self,
10457 deadline: zx::MonotonicInstant,
10458 ) -> Result<WlanixEvent, fidl::Error> {
10459 WlanixEvent::decode(self.client.wait_for_event(deadline)?)
10460 }
10461
10462 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10464 self.client.send::<WlanixGetWifiRequest>(
10465 &mut payload,
10466 0x142511f44b2c338c,
10467 fidl::encoding::DynamicFlags::FLEXIBLE,
10468 )
10469 }
10470
10471 pub fn r#get_supplicant(
10472 &self,
10473 mut payload: WlanixGetSupplicantRequest,
10474 ) -> Result<(), fidl::Error> {
10475 self.client.send::<WlanixGetSupplicantRequest>(
10476 &mut payload,
10477 0x55554b37c4021d3d,
10478 fidl::encoding::DynamicFlags::FLEXIBLE,
10479 )
10480 }
10481
10482 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10483 self.client.send::<WlanixGetNl80211Request>(
10484 &mut payload,
10485 0x48028a25bd855ef9,
10486 fidl::encoding::DynamicFlags::FLEXIBLE,
10487 )
10488 }
10489
10490 pub fn r#get_wifi_legacy_hal(
10491 &self,
10492 mut payload: WlanixGetWifiLegacyHalRequest,
10493 ) -> Result<(), fidl::Error> {
10494 self.client.send::<WlanixGetWifiLegacyHalRequest>(
10495 &mut payload,
10496 0x7302d9bb3b8d1edc,
10497 fidl::encoding::DynamicFlags::FLEXIBLE,
10498 )
10499 }
10500}
10501
10502#[cfg(target_os = "fuchsia")]
10503impl From<WlanixSynchronousProxy> for zx::NullableHandle {
10504 fn from(value: WlanixSynchronousProxy) -> Self {
10505 value.into_channel().into()
10506 }
10507}
10508
10509#[cfg(target_os = "fuchsia")]
10510impl From<fidl::Channel> for WlanixSynchronousProxy {
10511 fn from(value: fidl::Channel) -> Self {
10512 Self::new(value)
10513 }
10514}
10515
10516#[cfg(target_os = "fuchsia")]
10517impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
10518 type Protocol = WlanixMarker;
10519
10520 fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
10521 Self::new(value.into_channel())
10522 }
10523}
10524
10525#[derive(Debug, Clone)]
10526pub struct WlanixProxy {
10527 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10528}
10529
10530impl fidl::endpoints::Proxy for WlanixProxy {
10531 type Protocol = WlanixMarker;
10532
10533 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10534 Self::new(inner)
10535 }
10536
10537 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10538 self.client.into_channel().map_err(|client| Self { client })
10539 }
10540
10541 fn as_channel(&self) -> &::fidl::AsyncChannel {
10542 self.client.as_channel()
10543 }
10544}
10545
10546impl WlanixProxy {
10547 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10549 let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10550 Self { client: fidl::client::Client::new(channel, protocol_name) }
10551 }
10552
10553 pub fn take_event_stream(&self) -> WlanixEventStream {
10559 WlanixEventStream { event_receiver: self.client.take_event_receiver() }
10560 }
10561
10562 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10564 WlanixProxyInterface::r#get_wifi(self, payload)
10565 }
10566
10567 pub fn r#get_supplicant(
10568 &self,
10569 mut payload: WlanixGetSupplicantRequest,
10570 ) -> Result<(), fidl::Error> {
10571 WlanixProxyInterface::r#get_supplicant(self, payload)
10572 }
10573
10574 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10575 WlanixProxyInterface::r#get_nl80211(self, payload)
10576 }
10577
10578 pub fn r#get_wifi_legacy_hal(
10579 &self,
10580 mut payload: WlanixGetWifiLegacyHalRequest,
10581 ) -> Result<(), fidl::Error> {
10582 WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
10583 }
10584}
10585
10586impl WlanixProxyInterface for WlanixProxy {
10587 fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10588 self.client.send::<WlanixGetWifiRequest>(
10589 &mut payload,
10590 0x142511f44b2c338c,
10591 fidl::encoding::DynamicFlags::FLEXIBLE,
10592 )
10593 }
10594
10595 fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
10596 self.client.send::<WlanixGetSupplicantRequest>(
10597 &mut payload,
10598 0x55554b37c4021d3d,
10599 fidl::encoding::DynamicFlags::FLEXIBLE,
10600 )
10601 }
10602
10603 fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10604 self.client.send::<WlanixGetNl80211Request>(
10605 &mut payload,
10606 0x48028a25bd855ef9,
10607 fidl::encoding::DynamicFlags::FLEXIBLE,
10608 )
10609 }
10610
10611 fn r#get_wifi_legacy_hal(
10612 &self,
10613 mut payload: WlanixGetWifiLegacyHalRequest,
10614 ) -> Result<(), fidl::Error> {
10615 self.client.send::<WlanixGetWifiLegacyHalRequest>(
10616 &mut payload,
10617 0x7302d9bb3b8d1edc,
10618 fidl::encoding::DynamicFlags::FLEXIBLE,
10619 )
10620 }
10621}
10622
10623pub struct WlanixEventStream {
10624 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10625}
10626
10627impl std::marker::Unpin for WlanixEventStream {}
10628
10629impl futures::stream::FusedStream for WlanixEventStream {
10630 fn is_terminated(&self) -> bool {
10631 self.event_receiver.is_terminated()
10632 }
10633}
10634
10635impl futures::Stream for WlanixEventStream {
10636 type Item = Result<WlanixEvent, fidl::Error>;
10637
10638 fn poll_next(
10639 mut self: std::pin::Pin<&mut Self>,
10640 cx: &mut std::task::Context<'_>,
10641 ) -> std::task::Poll<Option<Self::Item>> {
10642 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10643 &mut self.event_receiver,
10644 cx
10645 )?) {
10646 Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
10647 None => std::task::Poll::Ready(None),
10648 }
10649 }
10650}
10651
10652#[derive(Debug)]
10653pub enum WlanixEvent {
10654 #[non_exhaustive]
10655 _UnknownEvent {
10656 ordinal: u64,
10658 },
10659}
10660
10661impl WlanixEvent {
10662 fn decode(
10664 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10665 ) -> Result<WlanixEvent, fidl::Error> {
10666 let (bytes, _handles) = buf.split_mut();
10667 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10668 debug_assert_eq!(tx_header.tx_id, 0);
10669 match tx_header.ordinal {
10670 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10671 Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10672 }
10673 _ => Err(fidl::Error::UnknownOrdinal {
10674 ordinal: tx_header.ordinal,
10675 protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10676 }),
10677 }
10678 }
10679}
10680
10681pub struct WlanixRequestStream {
10683 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10684 is_terminated: bool,
10685}
10686
10687impl std::marker::Unpin for WlanixRequestStream {}
10688
10689impl futures::stream::FusedStream for WlanixRequestStream {
10690 fn is_terminated(&self) -> bool {
10691 self.is_terminated
10692 }
10693}
10694
10695impl fidl::endpoints::RequestStream for WlanixRequestStream {
10696 type Protocol = WlanixMarker;
10697 type ControlHandle = WlanixControlHandle;
10698
10699 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10700 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10701 }
10702
10703 fn control_handle(&self) -> Self::ControlHandle {
10704 WlanixControlHandle { inner: self.inner.clone() }
10705 }
10706
10707 fn into_inner(
10708 self,
10709 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10710 {
10711 (self.inner, self.is_terminated)
10712 }
10713
10714 fn from_inner(
10715 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10716 is_terminated: bool,
10717 ) -> Self {
10718 Self { inner, is_terminated }
10719 }
10720}
10721
10722impl futures::Stream for WlanixRequestStream {
10723 type Item = Result<WlanixRequest, fidl::Error>;
10724
10725 fn poll_next(
10726 mut self: std::pin::Pin<&mut Self>,
10727 cx: &mut std::task::Context<'_>,
10728 ) -> std::task::Poll<Option<Self::Item>> {
10729 let this = &mut *self;
10730 if this.inner.check_shutdown(cx) {
10731 this.is_terminated = true;
10732 return std::task::Poll::Ready(None);
10733 }
10734 if this.is_terminated {
10735 panic!("polled WlanixRequestStream after completion");
10736 }
10737 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10738 |bytes, handles| {
10739 match this.inner.channel().read_etc(cx, bytes, handles) {
10740 std::task::Poll::Ready(Ok(())) => {}
10741 std::task::Poll::Pending => return std::task::Poll::Pending,
10742 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10743 this.is_terminated = true;
10744 return std::task::Poll::Ready(None);
10745 }
10746 std::task::Poll::Ready(Err(e)) => {
10747 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10748 e.into(),
10749 ))));
10750 }
10751 }
10752
10753 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10755
10756 std::task::Poll::Ready(Some(match header.ordinal {
10757 0x142511f44b2c338c => {
10758 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10759 let mut req = fidl::new_empty!(
10760 WlanixGetWifiRequest,
10761 fidl::encoding::DefaultFuchsiaResourceDialect
10762 );
10763 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
10764 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10765 Ok(WlanixRequest::GetWifi { payload: req, control_handle })
10766 }
10767 0x55554b37c4021d3d => {
10768 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10769 let mut req = fidl::new_empty!(
10770 WlanixGetSupplicantRequest,
10771 fidl::encoding::DefaultFuchsiaResourceDialect
10772 );
10773 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
10774 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10775 Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
10776 }
10777 0x48028a25bd855ef9 => {
10778 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10779 let mut req = fidl::new_empty!(
10780 WlanixGetNl80211Request,
10781 fidl::encoding::DefaultFuchsiaResourceDialect
10782 );
10783 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
10784 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10785 Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
10786 }
10787 0x7302d9bb3b8d1edc => {
10788 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10789 let mut req = fidl::new_empty!(
10790 WlanixGetWifiLegacyHalRequest,
10791 fidl::encoding::DefaultFuchsiaResourceDialect
10792 );
10793 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
10794 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10795 Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
10796 }
10797 _ if header.tx_id == 0
10798 && header
10799 .dynamic_flags()
10800 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10801 {
10802 Ok(WlanixRequest::_UnknownMethod {
10803 ordinal: header.ordinal,
10804 control_handle: WlanixControlHandle { inner: this.inner.clone() },
10805 method_type: fidl::MethodType::OneWay,
10806 })
10807 }
10808 _ if header
10809 .dynamic_flags()
10810 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10811 {
10812 this.inner.send_framework_err(
10813 fidl::encoding::FrameworkErr::UnknownMethod,
10814 header.tx_id,
10815 header.ordinal,
10816 header.dynamic_flags(),
10817 (bytes, handles),
10818 )?;
10819 Ok(WlanixRequest::_UnknownMethod {
10820 ordinal: header.ordinal,
10821 control_handle: WlanixControlHandle { inner: this.inner.clone() },
10822 method_type: fidl::MethodType::TwoWay,
10823 })
10824 }
10825 _ => Err(fidl::Error::UnknownOrdinal {
10826 ordinal: header.ordinal,
10827 protocol_name:
10828 <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10829 }),
10830 }))
10831 },
10832 )
10833 }
10834}
10835
10836#[derive(Debug)]
10838pub enum WlanixRequest {
10839 GetWifi {
10841 payload: WlanixGetWifiRequest,
10842 control_handle: WlanixControlHandle,
10843 },
10844 GetSupplicant {
10845 payload: WlanixGetSupplicantRequest,
10846 control_handle: WlanixControlHandle,
10847 },
10848 GetNl80211 {
10849 payload: WlanixGetNl80211Request,
10850 control_handle: WlanixControlHandle,
10851 },
10852 GetWifiLegacyHal {
10853 payload: WlanixGetWifiLegacyHalRequest,
10854 control_handle: WlanixControlHandle,
10855 },
10856 #[non_exhaustive]
10858 _UnknownMethod {
10859 ordinal: u64,
10861 control_handle: WlanixControlHandle,
10862 method_type: fidl::MethodType,
10863 },
10864}
10865
10866impl WlanixRequest {
10867 #[allow(irrefutable_let_patterns)]
10868 pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
10869 if let WlanixRequest::GetWifi { payload, control_handle } = self {
10870 Some((payload, control_handle))
10871 } else {
10872 None
10873 }
10874 }
10875
10876 #[allow(irrefutable_let_patterns)]
10877 pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
10878 if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
10879 Some((payload, control_handle))
10880 } else {
10881 None
10882 }
10883 }
10884
10885 #[allow(irrefutable_let_patterns)]
10886 pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
10887 if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
10888 Some((payload, control_handle))
10889 } else {
10890 None
10891 }
10892 }
10893
10894 #[allow(irrefutable_let_patterns)]
10895 pub fn into_get_wifi_legacy_hal(
10896 self,
10897 ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
10898 if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
10899 Some((payload, control_handle))
10900 } else {
10901 None
10902 }
10903 }
10904
10905 pub fn method_name(&self) -> &'static str {
10907 match *self {
10908 WlanixRequest::GetWifi { .. } => "get_wifi",
10909 WlanixRequest::GetSupplicant { .. } => "get_supplicant",
10910 WlanixRequest::GetNl80211 { .. } => "get_nl80211",
10911 WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
10912 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10913 "unknown one-way method"
10914 }
10915 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10916 "unknown two-way method"
10917 }
10918 }
10919 }
10920}
10921
10922#[derive(Debug, Clone)]
10923pub struct WlanixControlHandle {
10924 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10925}
10926
10927impl fidl::endpoints::ControlHandle for WlanixControlHandle {
10928 fn shutdown(&self) {
10929 self.inner.shutdown()
10930 }
10931
10932 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10933 self.inner.shutdown_with_epitaph(status)
10934 }
10935
10936 fn is_closed(&self) -> bool {
10937 self.inner.channel().is_closed()
10938 }
10939 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10940 self.inner.channel().on_closed()
10941 }
10942
10943 #[cfg(target_os = "fuchsia")]
10944 fn signal_peer(
10945 &self,
10946 clear_mask: zx::Signals,
10947 set_mask: zx::Signals,
10948 ) -> Result<(), zx_status::Status> {
10949 use fidl::Peered;
10950 self.inner.channel().signal_peer(clear_mask, set_mask)
10951 }
10952}
10953
10954impl WlanixControlHandle {}
10955
10956mod internal {
10957 use super::*;
10958
10959 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
10960 type Borrowed<'a> = &'a mut Self;
10961 fn take_or_borrow<'a>(
10962 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10963 ) -> Self::Borrowed<'a> {
10964 value
10965 }
10966 }
10967
10968 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
10969 type Owned = Self;
10970
10971 #[inline(always)]
10972 fn inline_align(_context: fidl::encoding::Context) -> usize {
10973 8
10974 }
10975
10976 #[inline(always)]
10977 fn inline_size(_context: fidl::encoding::Context) -> usize {
10978 16
10979 }
10980 }
10981
10982 unsafe impl
10983 fidl::encoding::Encode<
10984 Nl80211MessageV2Request,
10985 fidl::encoding::DefaultFuchsiaResourceDialect,
10986 > for &mut Nl80211MessageV2Request
10987 {
10988 #[inline]
10989 unsafe fn encode(
10990 self,
10991 encoder: &mut fidl::encoding::Encoder<
10992 '_,
10993 fidl::encoding::DefaultFuchsiaResourceDialect,
10994 >,
10995 offset: usize,
10996 _depth: fidl::encoding::Depth,
10997 ) -> fidl::Result<()> {
10998 encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
10999 fidl::encoding::Encode::<
11001 Nl80211MessageV2Request,
11002 fidl::encoding::DefaultFuchsiaResourceDialect,
11003 >::encode(
11004 (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
11005 encoder,
11006 offset,
11007 _depth,
11008 )
11009 }
11010 }
11011 unsafe impl<
11012 T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
11013 >
11014 fidl::encoding::Encode<
11015 Nl80211MessageV2Request,
11016 fidl::encoding::DefaultFuchsiaResourceDialect,
11017 > for (T0,)
11018 {
11019 #[inline]
11020 unsafe fn encode(
11021 self,
11022 encoder: &mut fidl::encoding::Encoder<
11023 '_,
11024 fidl::encoding::DefaultFuchsiaResourceDialect,
11025 >,
11026 offset: usize,
11027 depth: fidl::encoding::Depth,
11028 ) -> fidl::Result<()> {
11029 encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11030 self.0.encode(encoder, offset + 0, depth)?;
11034 Ok(())
11035 }
11036 }
11037
11038 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11039 for Nl80211MessageV2Request
11040 {
11041 #[inline(always)]
11042 fn new_empty() -> Self {
11043 Self {
11044 message: fidl::new_empty!(
11045 Nl80211Message,
11046 fidl::encoding::DefaultFuchsiaResourceDialect
11047 ),
11048 }
11049 }
11050
11051 #[inline]
11052 unsafe fn decode(
11053 &mut self,
11054 decoder: &mut fidl::encoding::Decoder<
11055 '_,
11056 fidl::encoding::DefaultFuchsiaResourceDialect,
11057 >,
11058 offset: usize,
11059 _depth: fidl::encoding::Depth,
11060 ) -> fidl::Result<()> {
11061 decoder.debug_check_bounds::<Self>(offset);
11062 fidl::decode!(
11064 Nl80211Message,
11065 fidl::encoding::DefaultFuchsiaResourceDialect,
11066 &mut self.message,
11067 decoder,
11068 offset + 0,
11069 _depth
11070 )?;
11071 Ok(())
11072 }
11073 }
11074
11075 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
11076 type Borrowed<'a> = &'a mut Self;
11077 fn take_or_borrow<'a>(
11078 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11079 ) -> Self::Borrowed<'a> {
11080 value
11081 }
11082 }
11083
11084 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
11085 type Owned = Self;
11086
11087 #[inline(always)]
11088 fn inline_align(_context: fidl::encoding::Context) -> usize {
11089 4
11090 }
11091
11092 #[inline(always)]
11093 fn inline_size(_context: fidl::encoding::Context) -> usize {
11094 4
11095 }
11096 }
11097
11098 unsafe impl
11099 fidl::encoding::Encode<
11100 Nl80211MessageV2Response,
11101 fidl::encoding::DefaultFuchsiaResourceDialect,
11102 > for &mut Nl80211MessageV2Response
11103 {
11104 #[inline]
11105 unsafe fn encode(
11106 self,
11107 encoder: &mut fidl::encoding::Encoder<
11108 '_,
11109 fidl::encoding::DefaultFuchsiaResourceDialect,
11110 >,
11111 offset: usize,
11112 _depth: fidl::encoding::Depth,
11113 ) -> fidl::Result<()> {
11114 encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11115 fidl::encoding::Encode::<
11117 Nl80211MessageV2Response,
11118 fidl::encoding::DefaultFuchsiaResourceDialect,
11119 >::encode(
11120 (<fidl::encoding::HandleType<
11121 fidl::Vmo,
11122 { fidl::ObjectType::VMO.into_raw() },
11123 2147483648,
11124 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11125 &mut self.response
11126 ),),
11127 encoder,
11128 offset,
11129 _depth,
11130 )
11131 }
11132 }
11133 unsafe impl<
11134 T0: fidl::encoding::Encode<
11135 fidl::encoding::HandleType<
11136 fidl::Vmo,
11137 { fidl::ObjectType::VMO.into_raw() },
11138 2147483648,
11139 >,
11140 fidl::encoding::DefaultFuchsiaResourceDialect,
11141 >,
11142 >
11143 fidl::encoding::Encode<
11144 Nl80211MessageV2Response,
11145 fidl::encoding::DefaultFuchsiaResourceDialect,
11146 > for (T0,)
11147 {
11148 #[inline]
11149 unsafe fn encode(
11150 self,
11151 encoder: &mut fidl::encoding::Encoder<
11152 '_,
11153 fidl::encoding::DefaultFuchsiaResourceDialect,
11154 >,
11155 offset: usize,
11156 depth: fidl::encoding::Depth,
11157 ) -> fidl::Result<()> {
11158 encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11159 self.0.encode(encoder, offset + 0, depth)?;
11163 Ok(())
11164 }
11165 }
11166
11167 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11168 for Nl80211MessageV2Response
11169 {
11170 #[inline(always)]
11171 fn new_empty() -> Self {
11172 Self {
11173 response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11174 }
11175 }
11176
11177 #[inline]
11178 unsafe fn decode(
11179 &mut self,
11180 decoder: &mut fidl::encoding::Decoder<
11181 '_,
11182 fidl::encoding::DefaultFuchsiaResourceDialect,
11183 >,
11184 offset: usize,
11185 _depth: fidl::encoding::Depth,
11186 ) -> fidl::Result<()> {
11187 decoder.debug_check_bounds::<Self>(offset);
11188 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
11190 Ok(())
11191 }
11192 }
11193
11194 impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
11195 type Borrowed<'a> = &'a mut Self;
11196 fn take_or_borrow<'a>(
11197 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11198 ) -> Self::Borrowed<'a> {
11199 value
11200 }
11201 }
11202
11203 unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
11204 type Owned = Self;
11205
11206 #[inline(always)]
11207 fn inline_align(_context: fidl::encoding::Context) -> usize {
11208 1
11209 }
11210
11211 #[inline(always)]
11212 fn inline_size(_context: fidl::encoding::Context) -> usize {
11213 6
11214 }
11215 #[inline(always)]
11216 fn encode_is_copy() -> bool {
11217 true
11218 }
11219
11220 #[inline(always)]
11221 fn decode_is_copy() -> bool {
11222 true
11223 }
11224 }
11225
11226 unsafe impl
11227 fidl::encoding::Encode<
11228 WifiStaIfaceSetMacAddressRequest,
11229 fidl::encoding::DefaultFuchsiaResourceDialect,
11230 > for &mut WifiStaIfaceSetMacAddressRequest
11231 {
11232 #[inline]
11233 unsafe fn encode(
11234 self,
11235 encoder: &mut fidl::encoding::Encoder<
11236 '_,
11237 fidl::encoding::DefaultFuchsiaResourceDialect,
11238 >,
11239 offset: usize,
11240 _depth: fidl::encoding::Depth,
11241 ) -> fidl::Result<()> {
11242 encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11243 unsafe {
11244 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11246 (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
11247 .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
11248 }
11251 Ok(())
11252 }
11253 }
11254 unsafe impl<
11255 T0: fidl::encoding::Encode<
11256 fidl::encoding::Array<u8, 6>,
11257 fidl::encoding::DefaultFuchsiaResourceDialect,
11258 >,
11259 >
11260 fidl::encoding::Encode<
11261 WifiStaIfaceSetMacAddressRequest,
11262 fidl::encoding::DefaultFuchsiaResourceDialect,
11263 > for (T0,)
11264 {
11265 #[inline]
11266 unsafe fn encode(
11267 self,
11268 encoder: &mut fidl::encoding::Encoder<
11269 '_,
11270 fidl::encoding::DefaultFuchsiaResourceDialect,
11271 >,
11272 offset: usize,
11273 depth: fidl::encoding::Depth,
11274 ) -> fidl::Result<()> {
11275 encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11276 self.0.encode(encoder, offset + 0, depth)?;
11280 Ok(())
11281 }
11282 }
11283
11284 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11285 for WifiStaIfaceSetMacAddressRequest
11286 {
11287 #[inline(always)]
11288 fn new_empty() -> Self {
11289 Self {
11290 mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
11291 }
11292 }
11293
11294 #[inline]
11295 unsafe fn decode(
11296 &mut self,
11297 decoder: &mut fidl::encoding::Decoder<
11298 '_,
11299 fidl::encoding::DefaultFuchsiaResourceDialect,
11300 >,
11301 offset: usize,
11302 _depth: fidl::encoding::Depth,
11303 ) -> fidl::Result<()> {
11304 decoder.debug_check_bounds::<Self>(offset);
11305 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11306 unsafe {
11309 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
11310 }
11311 Ok(())
11312 }
11313 }
11314
11315 impl Nl80211GetMulticastRequest {
11316 #[inline(always)]
11317 fn max_ordinal_present(&self) -> u64 {
11318 if let Some(_) = self.multicast {
11319 return 2;
11320 }
11321 if let Some(_) = self.group {
11322 return 1;
11323 }
11324 0
11325 }
11326 }
11327
11328 impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
11329 type Borrowed<'a> = &'a mut Self;
11330 fn take_or_borrow<'a>(
11331 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11332 ) -> Self::Borrowed<'a> {
11333 value
11334 }
11335 }
11336
11337 unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
11338 type Owned = Self;
11339
11340 #[inline(always)]
11341 fn inline_align(_context: fidl::encoding::Context) -> usize {
11342 8
11343 }
11344
11345 #[inline(always)]
11346 fn inline_size(_context: fidl::encoding::Context) -> usize {
11347 16
11348 }
11349 }
11350
11351 unsafe impl
11352 fidl::encoding::Encode<
11353 Nl80211GetMulticastRequest,
11354 fidl::encoding::DefaultFuchsiaResourceDialect,
11355 > for &mut Nl80211GetMulticastRequest
11356 {
11357 unsafe fn encode(
11358 self,
11359 encoder: &mut fidl::encoding::Encoder<
11360 '_,
11361 fidl::encoding::DefaultFuchsiaResourceDialect,
11362 >,
11363 offset: usize,
11364 mut depth: fidl::encoding::Depth,
11365 ) -> fidl::Result<()> {
11366 encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
11367 let max_ordinal: u64 = self.max_ordinal_present();
11369 encoder.write_num(max_ordinal, offset);
11370 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11371 if max_ordinal == 0 {
11373 return Ok(());
11374 }
11375 depth.increment()?;
11376 let envelope_size = 8;
11377 let bytes_len = max_ordinal as usize * envelope_size;
11378 #[allow(unused_variables)]
11379 let offset = encoder.out_of_line_offset(bytes_len);
11380 let mut _prev_end_offset: usize = 0;
11381 if 1 > max_ordinal {
11382 return Ok(());
11383 }
11384
11385 let cur_offset: usize = (1 - 1) * envelope_size;
11388
11389 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11391
11392 fidl::encoding::encode_in_envelope_optional::<
11397 fidl::encoding::BoundedString<32>,
11398 fidl::encoding::DefaultFuchsiaResourceDialect,
11399 >(
11400 self.group.as_ref().map(
11401 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
11402 ),
11403 encoder,
11404 offset + cur_offset,
11405 depth,
11406 )?;
11407
11408 _prev_end_offset = cur_offset + envelope_size;
11409 if 2 > max_ordinal {
11410 return Ok(());
11411 }
11412
11413 let cur_offset: usize = (2 - 1) * envelope_size;
11416
11417 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11419
11420 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11425 self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11426 encoder, offset + cur_offset, depth
11427 )?;
11428
11429 _prev_end_offset = cur_offset + envelope_size;
11430
11431 Ok(())
11432 }
11433 }
11434
11435 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11436 for Nl80211GetMulticastRequest
11437 {
11438 #[inline(always)]
11439 fn new_empty() -> Self {
11440 Self::default()
11441 }
11442
11443 unsafe fn decode(
11444 &mut self,
11445 decoder: &mut fidl::encoding::Decoder<
11446 '_,
11447 fidl::encoding::DefaultFuchsiaResourceDialect,
11448 >,
11449 offset: usize,
11450 mut depth: fidl::encoding::Depth,
11451 ) -> fidl::Result<()> {
11452 decoder.debug_check_bounds::<Self>(offset);
11453 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11454 None => return Err(fidl::Error::NotNullable),
11455 Some(len) => len,
11456 };
11457 if len == 0 {
11459 return Ok(());
11460 };
11461 depth.increment()?;
11462 let envelope_size = 8;
11463 let bytes_len = len * envelope_size;
11464 let offset = decoder.out_of_line_offset(bytes_len)?;
11465 let mut _next_ordinal_to_read = 0;
11467 let mut next_offset = offset;
11468 let end_offset = offset + bytes_len;
11469 _next_ordinal_to_read += 1;
11470 if next_offset >= end_offset {
11471 return Ok(());
11472 }
11473
11474 while _next_ordinal_to_read < 1 {
11476 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11477 _next_ordinal_to_read += 1;
11478 next_offset += envelope_size;
11479 }
11480
11481 let next_out_of_line = decoder.next_out_of_line();
11482 let handles_before = decoder.remaining_handles();
11483 if let Some((inlined, num_bytes, num_handles)) =
11484 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11485 {
11486 let member_inline_size =
11487 <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
11488 decoder.context,
11489 );
11490 if inlined != (member_inline_size <= 4) {
11491 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11492 }
11493 let inner_offset;
11494 let mut inner_depth = depth.clone();
11495 if inlined {
11496 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11497 inner_offset = next_offset;
11498 } else {
11499 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11500 inner_depth.increment()?;
11501 }
11502 let val_ref = self.group.get_or_insert_with(|| {
11503 fidl::new_empty!(
11504 fidl::encoding::BoundedString<32>,
11505 fidl::encoding::DefaultFuchsiaResourceDialect
11506 )
11507 });
11508 fidl::decode!(
11509 fidl::encoding::BoundedString<32>,
11510 fidl::encoding::DefaultFuchsiaResourceDialect,
11511 val_ref,
11512 decoder,
11513 inner_offset,
11514 inner_depth
11515 )?;
11516 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11517 {
11518 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11519 }
11520 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11521 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11522 }
11523 }
11524
11525 next_offset += envelope_size;
11526 _next_ordinal_to_read += 1;
11527 if next_offset >= end_offset {
11528 return Ok(());
11529 }
11530
11531 while _next_ordinal_to_read < 2 {
11533 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11534 _next_ordinal_to_read += 1;
11535 next_offset += envelope_size;
11536 }
11537
11538 let next_out_of_line = decoder.next_out_of_line();
11539 let handles_before = decoder.remaining_handles();
11540 if let Some((inlined, num_bytes, num_handles)) =
11541 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11542 {
11543 let member_inline_size = <fidl::encoding::Endpoint<
11544 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
11545 > as fidl::encoding::TypeMarker>::inline_size(
11546 decoder.context
11547 );
11548 if inlined != (member_inline_size <= 4) {
11549 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11550 }
11551 let inner_offset;
11552 let mut inner_depth = depth.clone();
11553 if inlined {
11554 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11555 inner_offset = next_offset;
11556 } else {
11557 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11558 inner_depth.increment()?;
11559 }
11560 let val_ref = self.multicast.get_or_insert_with(|| {
11561 fidl::new_empty!(
11562 fidl::encoding::Endpoint<
11563 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
11564 >,
11565 fidl::encoding::DefaultFuchsiaResourceDialect
11566 )
11567 });
11568 fidl::decode!(
11569 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
11570 fidl::encoding::DefaultFuchsiaResourceDialect,
11571 val_ref,
11572 decoder,
11573 inner_offset,
11574 inner_depth
11575 )?;
11576 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11577 {
11578 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11579 }
11580 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11581 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11582 }
11583 }
11584
11585 next_offset += envelope_size;
11586
11587 while next_offset < end_offset {
11589 _next_ordinal_to_read += 1;
11590 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11591 next_offset += envelope_size;
11592 }
11593
11594 Ok(())
11595 }
11596 }
11597
11598 impl Nl80211MessageRequest {
11599 #[inline(always)]
11600 fn max_ordinal_present(&self) -> u64 {
11601 if let Some(_) = self.message {
11602 return 1;
11603 }
11604 0
11605 }
11606 }
11607
11608 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
11609 type Borrowed<'a> = &'a mut Self;
11610 fn take_or_borrow<'a>(
11611 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11612 ) -> Self::Borrowed<'a> {
11613 value
11614 }
11615 }
11616
11617 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
11618 type Owned = Self;
11619
11620 #[inline(always)]
11621 fn inline_align(_context: fidl::encoding::Context) -> usize {
11622 8
11623 }
11624
11625 #[inline(always)]
11626 fn inline_size(_context: fidl::encoding::Context) -> usize {
11627 16
11628 }
11629 }
11630
11631 unsafe impl
11632 fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
11633 for &mut Nl80211MessageRequest
11634 {
11635 unsafe fn encode(
11636 self,
11637 encoder: &mut fidl::encoding::Encoder<
11638 '_,
11639 fidl::encoding::DefaultFuchsiaResourceDialect,
11640 >,
11641 offset: usize,
11642 mut depth: fidl::encoding::Depth,
11643 ) -> fidl::Result<()> {
11644 encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
11645 let max_ordinal: u64 = self.max_ordinal_present();
11647 encoder.write_num(max_ordinal, offset);
11648 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11649 if max_ordinal == 0 {
11651 return Ok(());
11652 }
11653 depth.increment()?;
11654 let envelope_size = 8;
11655 let bytes_len = max_ordinal as usize * envelope_size;
11656 #[allow(unused_variables)]
11657 let offset = encoder.out_of_line_offset(bytes_len);
11658 let mut _prev_end_offset: usize = 0;
11659 if 1 > max_ordinal {
11660 return Ok(());
11661 }
11662
11663 let cur_offset: usize = (1 - 1) * envelope_size;
11666
11667 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11669
11670 fidl::encoding::encode_in_envelope_optional::<
11675 Nl80211Message,
11676 fidl::encoding::DefaultFuchsiaResourceDialect,
11677 >(
11678 self.message
11679 .as_ref()
11680 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
11681 encoder,
11682 offset + cur_offset,
11683 depth,
11684 )?;
11685
11686 _prev_end_offset = cur_offset + envelope_size;
11687
11688 Ok(())
11689 }
11690 }
11691
11692 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11693 for Nl80211MessageRequest
11694 {
11695 #[inline(always)]
11696 fn new_empty() -> Self {
11697 Self::default()
11698 }
11699
11700 unsafe fn decode(
11701 &mut self,
11702 decoder: &mut fidl::encoding::Decoder<
11703 '_,
11704 fidl::encoding::DefaultFuchsiaResourceDialect,
11705 >,
11706 offset: usize,
11707 mut depth: fidl::encoding::Depth,
11708 ) -> fidl::Result<()> {
11709 decoder.debug_check_bounds::<Self>(offset);
11710 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11711 None => return Err(fidl::Error::NotNullable),
11712 Some(len) => len,
11713 };
11714 if len == 0 {
11716 return Ok(());
11717 };
11718 depth.increment()?;
11719 let envelope_size = 8;
11720 let bytes_len = len * envelope_size;
11721 let offset = decoder.out_of_line_offset(bytes_len)?;
11722 let mut _next_ordinal_to_read = 0;
11724 let mut next_offset = offset;
11725 let end_offset = offset + bytes_len;
11726 _next_ordinal_to_read += 1;
11727 if next_offset >= end_offset {
11728 return Ok(());
11729 }
11730
11731 while _next_ordinal_to_read < 1 {
11733 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11734 _next_ordinal_to_read += 1;
11735 next_offset += envelope_size;
11736 }
11737
11738 let next_out_of_line = decoder.next_out_of_line();
11739 let handles_before = decoder.remaining_handles();
11740 if let Some((inlined, num_bytes, num_handles)) =
11741 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11742 {
11743 let member_inline_size =
11744 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11745 if inlined != (member_inline_size <= 4) {
11746 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11747 }
11748 let inner_offset;
11749 let mut inner_depth = depth.clone();
11750 if inlined {
11751 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11752 inner_offset = next_offset;
11753 } else {
11754 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11755 inner_depth.increment()?;
11756 }
11757 let val_ref = self.message.get_or_insert_with(|| {
11758 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
11759 });
11760 fidl::decode!(
11761 Nl80211Message,
11762 fidl::encoding::DefaultFuchsiaResourceDialect,
11763 val_ref,
11764 decoder,
11765 inner_offset,
11766 inner_depth
11767 )?;
11768 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11769 {
11770 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11771 }
11772 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11773 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11774 }
11775 }
11776
11777 next_offset += envelope_size;
11778
11779 while next_offset < end_offset {
11781 _next_ordinal_to_read += 1;
11782 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11783 next_offset += envelope_size;
11784 }
11785
11786 Ok(())
11787 }
11788 }
11789
11790 impl Nl80211MulticastMessageRequest {
11791 #[inline(always)]
11792 fn max_ordinal_present(&self) -> u64 {
11793 if let Some(_) = self.message {
11794 return 1;
11795 }
11796 0
11797 }
11798 }
11799
11800 impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
11801 type Borrowed<'a> = &'a mut Self;
11802 fn take_or_borrow<'a>(
11803 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11804 ) -> Self::Borrowed<'a> {
11805 value
11806 }
11807 }
11808
11809 unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
11810 type Owned = Self;
11811
11812 #[inline(always)]
11813 fn inline_align(_context: fidl::encoding::Context) -> usize {
11814 8
11815 }
11816
11817 #[inline(always)]
11818 fn inline_size(_context: fidl::encoding::Context) -> usize {
11819 16
11820 }
11821 }
11822
11823 unsafe impl
11824 fidl::encoding::Encode<
11825 Nl80211MulticastMessageRequest,
11826 fidl::encoding::DefaultFuchsiaResourceDialect,
11827 > for &mut Nl80211MulticastMessageRequest
11828 {
11829 unsafe fn encode(
11830 self,
11831 encoder: &mut fidl::encoding::Encoder<
11832 '_,
11833 fidl::encoding::DefaultFuchsiaResourceDialect,
11834 >,
11835 offset: usize,
11836 mut depth: fidl::encoding::Depth,
11837 ) -> fidl::Result<()> {
11838 encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
11839 let max_ordinal: u64 = self.max_ordinal_present();
11841 encoder.write_num(max_ordinal, offset);
11842 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11843 if max_ordinal == 0 {
11845 return Ok(());
11846 }
11847 depth.increment()?;
11848 let envelope_size = 8;
11849 let bytes_len = max_ordinal as usize * envelope_size;
11850 #[allow(unused_variables)]
11851 let offset = encoder.out_of_line_offset(bytes_len);
11852 let mut _prev_end_offset: usize = 0;
11853 if 1 > max_ordinal {
11854 return Ok(());
11855 }
11856
11857 let cur_offset: usize = (1 - 1) * envelope_size;
11860
11861 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11863
11864 fidl::encoding::encode_in_envelope_optional::<
11869 Nl80211Message,
11870 fidl::encoding::DefaultFuchsiaResourceDialect,
11871 >(
11872 self.message
11873 .as_ref()
11874 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
11875 encoder,
11876 offset + cur_offset,
11877 depth,
11878 )?;
11879
11880 _prev_end_offset = cur_offset + envelope_size;
11881
11882 Ok(())
11883 }
11884 }
11885
11886 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11887 for Nl80211MulticastMessageRequest
11888 {
11889 #[inline(always)]
11890 fn new_empty() -> Self {
11891 Self::default()
11892 }
11893
11894 unsafe fn decode(
11895 &mut self,
11896 decoder: &mut fidl::encoding::Decoder<
11897 '_,
11898 fidl::encoding::DefaultFuchsiaResourceDialect,
11899 >,
11900 offset: usize,
11901 mut depth: fidl::encoding::Depth,
11902 ) -> fidl::Result<()> {
11903 decoder.debug_check_bounds::<Self>(offset);
11904 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11905 None => return Err(fidl::Error::NotNullable),
11906 Some(len) => len,
11907 };
11908 if len == 0 {
11910 return Ok(());
11911 };
11912 depth.increment()?;
11913 let envelope_size = 8;
11914 let bytes_len = len * envelope_size;
11915 let offset = decoder.out_of_line_offset(bytes_len)?;
11916 let mut _next_ordinal_to_read = 0;
11918 let mut next_offset = offset;
11919 let end_offset = offset + bytes_len;
11920 _next_ordinal_to_read += 1;
11921 if next_offset >= end_offset {
11922 return Ok(());
11923 }
11924
11925 while _next_ordinal_to_read < 1 {
11927 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11928 _next_ordinal_to_read += 1;
11929 next_offset += envelope_size;
11930 }
11931
11932 let next_out_of_line = decoder.next_out_of_line();
11933 let handles_before = decoder.remaining_handles();
11934 if let Some((inlined, num_bytes, num_handles)) =
11935 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11936 {
11937 let member_inline_size =
11938 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11939 if inlined != (member_inline_size <= 4) {
11940 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11941 }
11942 let inner_offset;
11943 let mut inner_depth = depth.clone();
11944 if inlined {
11945 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11946 inner_offset = next_offset;
11947 } else {
11948 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11949 inner_depth.increment()?;
11950 }
11951 let val_ref = self.message.get_or_insert_with(|| {
11952 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
11953 });
11954 fidl::decode!(
11955 Nl80211Message,
11956 fidl::encoding::DefaultFuchsiaResourceDialect,
11957 val_ref,
11958 decoder,
11959 inner_offset,
11960 inner_depth
11961 )?;
11962 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11963 {
11964 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11965 }
11966 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11967 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11968 }
11969 }
11970
11971 next_offset += envelope_size;
11972
11973 while next_offset < end_offset {
11975 _next_ordinal_to_read += 1;
11976 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11977 next_offset += envelope_size;
11978 }
11979
11980 Ok(())
11981 }
11982 }
11983
11984 impl Nl80211MessageResponse {
11985 #[inline(always)]
11986 fn max_ordinal_present(&self) -> u64 {
11987 if let Some(_) = self.responses {
11988 return 1;
11989 }
11990 0
11991 }
11992 }
11993
11994 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
11995 type Borrowed<'a> = &'a mut Self;
11996 fn take_or_borrow<'a>(
11997 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11998 ) -> Self::Borrowed<'a> {
11999 value
12000 }
12001 }
12002
12003 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
12004 type Owned = Self;
12005
12006 #[inline(always)]
12007 fn inline_align(_context: fidl::encoding::Context) -> usize {
12008 8
12009 }
12010
12011 #[inline(always)]
12012 fn inline_size(_context: fidl::encoding::Context) -> usize {
12013 16
12014 }
12015 }
12016
12017 unsafe impl
12018 fidl::encoding::Encode<
12019 Nl80211MessageResponse,
12020 fidl::encoding::DefaultFuchsiaResourceDialect,
12021 > for &mut Nl80211MessageResponse
12022 {
12023 unsafe fn encode(
12024 self,
12025 encoder: &mut fidl::encoding::Encoder<
12026 '_,
12027 fidl::encoding::DefaultFuchsiaResourceDialect,
12028 >,
12029 offset: usize,
12030 mut depth: fidl::encoding::Depth,
12031 ) -> fidl::Result<()> {
12032 encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
12033 let max_ordinal: u64 = self.max_ordinal_present();
12035 encoder.write_num(max_ordinal, offset);
12036 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12037 if max_ordinal == 0 {
12039 return Ok(());
12040 }
12041 depth.increment()?;
12042 let envelope_size = 8;
12043 let bytes_len = max_ordinal as usize * envelope_size;
12044 #[allow(unused_variables)]
12045 let offset = encoder.out_of_line_offset(bytes_len);
12046 let mut _prev_end_offset: usize = 0;
12047 if 1 > max_ordinal {
12048 return Ok(());
12049 }
12050
12051 let cur_offset: usize = (1 - 1) * envelope_size;
12054
12055 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12057
12058 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12063 self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
12064 encoder, offset + cur_offset, depth
12065 )?;
12066
12067 _prev_end_offset = cur_offset + envelope_size;
12068
12069 Ok(())
12070 }
12071 }
12072
12073 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12074 for Nl80211MessageResponse
12075 {
12076 #[inline(always)]
12077 fn new_empty() -> Self {
12078 Self::default()
12079 }
12080
12081 unsafe fn decode(
12082 &mut self,
12083 decoder: &mut fidl::encoding::Decoder<
12084 '_,
12085 fidl::encoding::DefaultFuchsiaResourceDialect,
12086 >,
12087 offset: usize,
12088 mut depth: fidl::encoding::Depth,
12089 ) -> fidl::Result<()> {
12090 decoder.debug_check_bounds::<Self>(offset);
12091 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12092 None => return Err(fidl::Error::NotNullable),
12093 Some(len) => len,
12094 };
12095 if len == 0 {
12097 return Ok(());
12098 };
12099 depth.increment()?;
12100 let envelope_size = 8;
12101 let bytes_len = len * envelope_size;
12102 let offset = decoder.out_of_line_offset(bytes_len)?;
12103 let mut _next_ordinal_to_read = 0;
12105 let mut next_offset = offset;
12106 let end_offset = offset + bytes_len;
12107 _next_ordinal_to_read += 1;
12108 if next_offset >= end_offset {
12109 return Ok(());
12110 }
12111
12112 while _next_ordinal_to_read < 1 {
12114 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12115 _next_ordinal_to_read += 1;
12116 next_offset += envelope_size;
12117 }
12118
12119 let next_out_of_line = decoder.next_out_of_line();
12120 let handles_before = decoder.remaining_handles();
12121 if let Some((inlined, num_bytes, num_handles)) =
12122 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12123 {
12124 let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
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.responses.get_or_insert_with(|| {
12138 fidl::new_empty!(
12139 fidl::encoding::UnboundedVector<Nl80211Message>,
12140 fidl::encoding::DefaultFuchsiaResourceDialect
12141 )
12142 });
12143 fidl::decode!(
12144 fidl::encoding::UnboundedVector<Nl80211Message>,
12145 fidl::encoding::DefaultFuchsiaResourceDialect,
12146 val_ref,
12147 decoder,
12148 inner_offset,
12149 inner_depth
12150 )?;
12151 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12152 {
12153 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12154 }
12155 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12156 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12157 }
12158 }
12159
12160 next_offset += envelope_size;
12161
12162 while next_offset < end_offset {
12164 _next_ordinal_to_read += 1;
12165 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12166 next_offset += envelope_size;
12167 }
12168
12169 Ok(())
12170 }
12171 }
12172
12173 impl SupplicantAddStaInterfaceRequest {
12174 #[inline(always)]
12175 fn max_ordinal_present(&self) -> u64 {
12176 if let Some(_) = self.iface_name {
12177 return 2;
12178 }
12179 if let Some(_) = self.iface {
12180 return 1;
12181 }
12182 0
12183 }
12184 }
12185
12186 impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
12187 type Borrowed<'a> = &'a mut Self;
12188 fn take_or_borrow<'a>(
12189 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12190 ) -> Self::Borrowed<'a> {
12191 value
12192 }
12193 }
12194
12195 unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
12196 type Owned = Self;
12197
12198 #[inline(always)]
12199 fn inline_align(_context: fidl::encoding::Context) -> usize {
12200 8
12201 }
12202
12203 #[inline(always)]
12204 fn inline_size(_context: fidl::encoding::Context) -> usize {
12205 16
12206 }
12207 }
12208
12209 unsafe impl
12210 fidl::encoding::Encode<
12211 SupplicantAddStaInterfaceRequest,
12212 fidl::encoding::DefaultFuchsiaResourceDialect,
12213 > for &mut SupplicantAddStaInterfaceRequest
12214 {
12215 unsafe fn encode(
12216 self,
12217 encoder: &mut fidl::encoding::Encoder<
12218 '_,
12219 fidl::encoding::DefaultFuchsiaResourceDialect,
12220 >,
12221 offset: usize,
12222 mut depth: fidl::encoding::Depth,
12223 ) -> fidl::Result<()> {
12224 encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
12225 let max_ordinal: u64 = self.max_ordinal_present();
12227 encoder.write_num(max_ordinal, offset);
12228 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12229 if max_ordinal == 0 {
12231 return Ok(());
12232 }
12233 depth.increment()?;
12234 let envelope_size = 8;
12235 let bytes_len = max_ordinal as usize * envelope_size;
12236 #[allow(unused_variables)]
12237 let offset = encoder.out_of_line_offset(bytes_len);
12238 let mut _prev_end_offset: usize = 0;
12239 if 1 > max_ordinal {
12240 return Ok(());
12241 }
12242
12243 let cur_offset: usize = (1 - 1) * envelope_size;
12246
12247 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12249
12250 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12255 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12256 encoder, offset + cur_offset, depth
12257 )?;
12258
12259 _prev_end_offset = cur_offset + envelope_size;
12260 if 2 > max_ordinal {
12261 return Ok(());
12262 }
12263
12264 let cur_offset: usize = (2 - 1) * envelope_size;
12267
12268 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12270
12271 fidl::encoding::encode_in_envelope_optional::<
12276 fidl::encoding::BoundedString<16>,
12277 fidl::encoding::DefaultFuchsiaResourceDialect,
12278 >(
12279 self.iface_name.as_ref().map(
12280 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12281 ),
12282 encoder,
12283 offset + cur_offset,
12284 depth,
12285 )?;
12286
12287 _prev_end_offset = cur_offset + envelope_size;
12288
12289 Ok(())
12290 }
12291 }
12292
12293 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12294 for SupplicantAddStaInterfaceRequest
12295 {
12296 #[inline(always)]
12297 fn new_empty() -> Self {
12298 Self::default()
12299 }
12300
12301 unsafe fn decode(
12302 &mut self,
12303 decoder: &mut fidl::encoding::Decoder<
12304 '_,
12305 fidl::encoding::DefaultFuchsiaResourceDialect,
12306 >,
12307 offset: usize,
12308 mut depth: fidl::encoding::Depth,
12309 ) -> fidl::Result<()> {
12310 decoder.debug_check_bounds::<Self>(offset);
12311 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12312 None => return Err(fidl::Error::NotNullable),
12313 Some(len) => len,
12314 };
12315 if len == 0 {
12317 return Ok(());
12318 };
12319 depth.increment()?;
12320 let envelope_size = 8;
12321 let bytes_len = len * envelope_size;
12322 let offset = decoder.out_of_line_offset(bytes_len)?;
12323 let mut _next_ordinal_to_read = 0;
12325 let mut next_offset = offset;
12326 let end_offset = offset + bytes_len;
12327 _next_ordinal_to_read += 1;
12328 if next_offset >= end_offset {
12329 return Ok(());
12330 }
12331
12332 while _next_ordinal_to_read < 1 {
12334 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12335 _next_ordinal_to_read += 1;
12336 next_offset += envelope_size;
12337 }
12338
12339 let next_out_of_line = decoder.next_out_of_line();
12340 let handles_before = decoder.remaining_handles();
12341 if let Some((inlined, num_bytes, num_handles)) =
12342 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12343 {
12344 let member_inline_size = <fidl::encoding::Endpoint<
12345 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12346 > as fidl::encoding::TypeMarker>::inline_size(
12347 decoder.context
12348 );
12349 if inlined != (member_inline_size <= 4) {
12350 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12351 }
12352 let inner_offset;
12353 let mut inner_depth = depth.clone();
12354 if inlined {
12355 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12356 inner_offset = next_offset;
12357 } else {
12358 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12359 inner_depth.increment()?;
12360 }
12361 let val_ref = self.iface.get_or_insert_with(|| {
12362 fidl::new_empty!(
12363 fidl::encoding::Endpoint<
12364 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12365 >,
12366 fidl::encoding::DefaultFuchsiaResourceDialect
12367 )
12368 });
12369 fidl::decode!(
12370 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
12371 fidl::encoding::DefaultFuchsiaResourceDialect,
12372 val_ref,
12373 decoder,
12374 inner_offset,
12375 inner_depth
12376 )?;
12377 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12378 {
12379 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12380 }
12381 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12382 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12383 }
12384 }
12385
12386 next_offset += envelope_size;
12387 _next_ordinal_to_read += 1;
12388 if next_offset >= end_offset {
12389 return Ok(());
12390 }
12391
12392 while _next_ordinal_to_read < 2 {
12394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12395 _next_ordinal_to_read += 1;
12396 next_offset += envelope_size;
12397 }
12398
12399 let next_out_of_line = decoder.next_out_of_line();
12400 let handles_before = decoder.remaining_handles();
12401 if let Some((inlined, num_bytes, num_handles)) =
12402 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12403 {
12404 let member_inline_size =
12405 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12406 decoder.context,
12407 );
12408 if inlined != (member_inline_size <= 4) {
12409 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12410 }
12411 let inner_offset;
12412 let mut inner_depth = depth.clone();
12413 if inlined {
12414 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12415 inner_offset = next_offset;
12416 } else {
12417 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12418 inner_depth.increment()?;
12419 }
12420 let val_ref = self.iface_name.get_or_insert_with(|| {
12421 fidl::new_empty!(
12422 fidl::encoding::BoundedString<16>,
12423 fidl::encoding::DefaultFuchsiaResourceDialect
12424 )
12425 });
12426 fidl::decode!(
12427 fidl::encoding::BoundedString<16>,
12428 fidl::encoding::DefaultFuchsiaResourceDialect,
12429 val_ref,
12430 decoder,
12431 inner_offset,
12432 inner_depth
12433 )?;
12434 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12435 {
12436 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12437 }
12438 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12439 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12440 }
12441 }
12442
12443 next_offset += envelope_size;
12444
12445 while next_offset < end_offset {
12447 _next_ordinal_to_read += 1;
12448 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12449 next_offset += envelope_size;
12450 }
12451
12452 Ok(())
12453 }
12454 }
12455
12456 impl SupplicantRemoveInterfaceRequest {
12457 #[inline(always)]
12458 fn max_ordinal_present(&self) -> u64 {
12459 if let Some(_) = self.iface_name {
12460 return 1;
12461 }
12462 0
12463 }
12464 }
12465
12466 impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
12467 type Borrowed<'a> = &'a mut Self;
12468 fn take_or_borrow<'a>(
12469 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12470 ) -> Self::Borrowed<'a> {
12471 value
12472 }
12473 }
12474
12475 unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
12476 type Owned = Self;
12477
12478 #[inline(always)]
12479 fn inline_align(_context: fidl::encoding::Context) -> usize {
12480 8
12481 }
12482
12483 #[inline(always)]
12484 fn inline_size(_context: fidl::encoding::Context) -> usize {
12485 16
12486 }
12487 }
12488
12489 unsafe impl
12490 fidl::encoding::Encode<
12491 SupplicantRemoveInterfaceRequest,
12492 fidl::encoding::DefaultFuchsiaResourceDialect,
12493 > for &mut SupplicantRemoveInterfaceRequest
12494 {
12495 unsafe fn encode(
12496 self,
12497 encoder: &mut fidl::encoding::Encoder<
12498 '_,
12499 fidl::encoding::DefaultFuchsiaResourceDialect,
12500 >,
12501 offset: usize,
12502 mut depth: fidl::encoding::Depth,
12503 ) -> fidl::Result<()> {
12504 encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
12505 let max_ordinal: u64 = self.max_ordinal_present();
12507 encoder.write_num(max_ordinal, offset);
12508 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12509 if max_ordinal == 0 {
12511 return Ok(());
12512 }
12513 depth.increment()?;
12514 let envelope_size = 8;
12515 let bytes_len = max_ordinal as usize * envelope_size;
12516 #[allow(unused_variables)]
12517 let offset = encoder.out_of_line_offset(bytes_len);
12518 let mut _prev_end_offset: usize = 0;
12519 if 1 > max_ordinal {
12520 return Ok(());
12521 }
12522
12523 let cur_offset: usize = (1 - 1) * envelope_size;
12526
12527 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12529
12530 fidl::encoding::encode_in_envelope_optional::<
12535 fidl::encoding::BoundedString<16>,
12536 fidl::encoding::DefaultFuchsiaResourceDialect,
12537 >(
12538 self.iface_name.as_ref().map(
12539 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12540 ),
12541 encoder,
12542 offset + cur_offset,
12543 depth,
12544 )?;
12545
12546 _prev_end_offset = cur_offset + envelope_size;
12547
12548 Ok(())
12549 }
12550 }
12551
12552 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12553 for SupplicantRemoveInterfaceRequest
12554 {
12555 #[inline(always)]
12556 fn new_empty() -> Self {
12557 Self::default()
12558 }
12559
12560 unsafe fn decode(
12561 &mut self,
12562 decoder: &mut fidl::encoding::Decoder<
12563 '_,
12564 fidl::encoding::DefaultFuchsiaResourceDialect,
12565 >,
12566 offset: usize,
12567 mut depth: fidl::encoding::Depth,
12568 ) -> fidl::Result<()> {
12569 decoder.debug_check_bounds::<Self>(offset);
12570 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12571 None => return Err(fidl::Error::NotNullable),
12572 Some(len) => len,
12573 };
12574 if len == 0 {
12576 return Ok(());
12577 };
12578 depth.increment()?;
12579 let envelope_size = 8;
12580 let bytes_len = len * envelope_size;
12581 let offset = decoder.out_of_line_offset(bytes_len)?;
12582 let mut _next_ordinal_to_read = 0;
12584 let mut next_offset = offset;
12585 let end_offset = offset + bytes_len;
12586 _next_ordinal_to_read += 1;
12587 if next_offset >= end_offset {
12588 return Ok(());
12589 }
12590
12591 while _next_ordinal_to_read < 1 {
12593 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12594 _next_ordinal_to_read += 1;
12595 next_offset += envelope_size;
12596 }
12597
12598 let next_out_of_line = decoder.next_out_of_line();
12599 let handles_before = decoder.remaining_handles();
12600 if let Some((inlined, num_bytes, num_handles)) =
12601 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12602 {
12603 let member_inline_size =
12604 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12605 decoder.context,
12606 );
12607 if inlined != (member_inline_size <= 4) {
12608 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12609 }
12610 let inner_offset;
12611 let mut inner_depth = depth.clone();
12612 if inlined {
12613 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12614 inner_offset = next_offset;
12615 } else {
12616 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12617 inner_depth.increment()?;
12618 }
12619 let val_ref = self.iface_name.get_or_insert_with(|| {
12620 fidl::new_empty!(
12621 fidl::encoding::BoundedString<16>,
12622 fidl::encoding::DefaultFuchsiaResourceDialect
12623 )
12624 });
12625 fidl::decode!(
12626 fidl::encoding::BoundedString<16>,
12627 fidl::encoding::DefaultFuchsiaResourceDialect,
12628 val_ref,
12629 decoder,
12630 inner_offset,
12631 inner_depth
12632 )?;
12633 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12634 {
12635 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12636 }
12637 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12638 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12639 }
12640 }
12641
12642 next_offset += envelope_size;
12643
12644 while next_offset < end_offset {
12646 _next_ordinal_to_read += 1;
12647 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12648 next_offset += envelope_size;
12649 }
12650
12651 Ok(())
12652 }
12653 }
12654
12655 impl SupplicantStaIfaceAddNetworkRequest {
12656 #[inline(always)]
12657 fn max_ordinal_present(&self) -> u64 {
12658 if let Some(_) = self.network {
12659 return 1;
12660 }
12661 0
12662 }
12663 }
12664
12665 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
12666 type Borrowed<'a> = &'a mut Self;
12667 fn take_or_borrow<'a>(
12668 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12669 ) -> Self::Borrowed<'a> {
12670 value
12671 }
12672 }
12673
12674 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
12675 type Owned = Self;
12676
12677 #[inline(always)]
12678 fn inline_align(_context: fidl::encoding::Context) -> usize {
12679 8
12680 }
12681
12682 #[inline(always)]
12683 fn inline_size(_context: fidl::encoding::Context) -> usize {
12684 16
12685 }
12686 }
12687
12688 unsafe impl
12689 fidl::encoding::Encode<
12690 SupplicantStaIfaceAddNetworkRequest,
12691 fidl::encoding::DefaultFuchsiaResourceDialect,
12692 > for &mut SupplicantStaIfaceAddNetworkRequest
12693 {
12694 unsafe fn encode(
12695 self,
12696 encoder: &mut fidl::encoding::Encoder<
12697 '_,
12698 fidl::encoding::DefaultFuchsiaResourceDialect,
12699 >,
12700 offset: usize,
12701 mut depth: fidl::encoding::Depth,
12702 ) -> fidl::Result<()> {
12703 encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
12704 let max_ordinal: u64 = self.max_ordinal_present();
12706 encoder.write_num(max_ordinal, offset);
12707 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12708 if max_ordinal == 0 {
12710 return Ok(());
12711 }
12712 depth.increment()?;
12713 let envelope_size = 8;
12714 let bytes_len = max_ordinal as usize * envelope_size;
12715 #[allow(unused_variables)]
12716 let offset = encoder.out_of_line_offset(bytes_len);
12717 let mut _prev_end_offset: usize = 0;
12718 if 1 > max_ordinal {
12719 return Ok(());
12720 }
12721
12722 let cur_offset: usize = (1 - 1) * envelope_size;
12725
12726 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12728
12729 fidl::encoding::encode_in_envelope_optional::<
12734 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
12735 fidl::encoding::DefaultFuchsiaResourceDialect,
12736 >(
12737 self.network.as_mut().map(
12738 <fidl::encoding::Endpoint<
12739 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12740 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12741 ),
12742 encoder,
12743 offset + cur_offset,
12744 depth,
12745 )?;
12746
12747 _prev_end_offset = cur_offset + envelope_size;
12748
12749 Ok(())
12750 }
12751 }
12752
12753 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12754 for SupplicantStaIfaceAddNetworkRequest
12755 {
12756 #[inline(always)]
12757 fn new_empty() -> Self {
12758 Self::default()
12759 }
12760
12761 unsafe fn decode(
12762 &mut self,
12763 decoder: &mut fidl::encoding::Decoder<
12764 '_,
12765 fidl::encoding::DefaultFuchsiaResourceDialect,
12766 >,
12767 offset: usize,
12768 mut depth: fidl::encoding::Depth,
12769 ) -> fidl::Result<()> {
12770 decoder.debug_check_bounds::<Self>(offset);
12771 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12772 None => return Err(fidl::Error::NotNullable),
12773 Some(len) => len,
12774 };
12775 if len == 0 {
12777 return Ok(());
12778 };
12779 depth.increment()?;
12780 let envelope_size = 8;
12781 let bytes_len = len * envelope_size;
12782 let offset = decoder.out_of_line_offset(bytes_len)?;
12783 let mut _next_ordinal_to_read = 0;
12785 let mut next_offset = offset;
12786 let end_offset = offset + bytes_len;
12787 _next_ordinal_to_read += 1;
12788 if next_offset >= end_offset {
12789 return Ok(());
12790 }
12791
12792 while _next_ordinal_to_read < 1 {
12794 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12795 _next_ordinal_to_read += 1;
12796 next_offset += envelope_size;
12797 }
12798
12799 let next_out_of_line = decoder.next_out_of_line();
12800 let handles_before = decoder.remaining_handles();
12801 if let Some((inlined, num_bytes, num_handles)) =
12802 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12803 {
12804 let member_inline_size = <fidl::encoding::Endpoint<
12805 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12806 > as fidl::encoding::TypeMarker>::inline_size(
12807 decoder.context
12808 );
12809 if inlined != (member_inline_size <= 4) {
12810 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12811 }
12812 let inner_offset;
12813 let mut inner_depth = depth.clone();
12814 if inlined {
12815 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12816 inner_offset = next_offset;
12817 } else {
12818 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12819 inner_depth.increment()?;
12820 }
12821 let val_ref = self.network.get_or_insert_with(|| {
12822 fidl::new_empty!(
12823 fidl::encoding::Endpoint<
12824 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12825 >,
12826 fidl::encoding::DefaultFuchsiaResourceDialect
12827 )
12828 });
12829 fidl::decode!(
12830 fidl::encoding::Endpoint<
12831 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12832 >,
12833 fidl::encoding::DefaultFuchsiaResourceDialect,
12834 val_ref,
12835 decoder,
12836 inner_offset,
12837 inner_depth
12838 )?;
12839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12840 {
12841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12842 }
12843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12845 }
12846 }
12847
12848 next_offset += envelope_size;
12849
12850 while next_offset < end_offset {
12852 _next_ordinal_to_read += 1;
12853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12854 next_offset += envelope_size;
12855 }
12856
12857 Ok(())
12858 }
12859 }
12860
12861 impl SupplicantStaIfaceRegisterCallbackRequest {
12862 #[inline(always)]
12863 fn max_ordinal_present(&self) -> u64 {
12864 if let Some(_) = self.callback {
12865 return 1;
12866 }
12867 0
12868 }
12869 }
12870
12871 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
12872 type Borrowed<'a> = &'a mut Self;
12873 fn take_or_borrow<'a>(
12874 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12875 ) -> Self::Borrowed<'a> {
12876 value
12877 }
12878 }
12879
12880 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
12881 type Owned = Self;
12882
12883 #[inline(always)]
12884 fn inline_align(_context: fidl::encoding::Context) -> usize {
12885 8
12886 }
12887
12888 #[inline(always)]
12889 fn inline_size(_context: fidl::encoding::Context) -> usize {
12890 16
12891 }
12892 }
12893
12894 unsafe impl
12895 fidl::encoding::Encode<
12896 SupplicantStaIfaceRegisterCallbackRequest,
12897 fidl::encoding::DefaultFuchsiaResourceDialect,
12898 > for &mut SupplicantStaIfaceRegisterCallbackRequest
12899 {
12900 unsafe fn encode(
12901 self,
12902 encoder: &mut fidl::encoding::Encoder<
12903 '_,
12904 fidl::encoding::DefaultFuchsiaResourceDialect,
12905 >,
12906 offset: usize,
12907 mut depth: fidl::encoding::Depth,
12908 ) -> fidl::Result<()> {
12909 encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
12910 let max_ordinal: u64 = self.max_ordinal_present();
12912 encoder.write_num(max_ordinal, offset);
12913 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12914 if max_ordinal == 0 {
12916 return Ok(());
12917 }
12918 depth.increment()?;
12919 let envelope_size = 8;
12920 let bytes_len = max_ordinal as usize * envelope_size;
12921 #[allow(unused_variables)]
12922 let offset = encoder.out_of_line_offset(bytes_len);
12923 let mut _prev_end_offset: usize = 0;
12924 if 1 > max_ordinal {
12925 return Ok(());
12926 }
12927
12928 let cur_offset: usize = (1 - 1) * envelope_size;
12931
12932 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12934
12935 fidl::encoding::encode_in_envelope_optional::<
12940 fidl::encoding::Endpoint<
12941 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12942 >,
12943 fidl::encoding::DefaultFuchsiaResourceDialect,
12944 >(
12945 self.callback.as_mut().map(
12946 <fidl::encoding::Endpoint<
12947 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12948 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12949 ),
12950 encoder,
12951 offset + cur_offset,
12952 depth,
12953 )?;
12954
12955 _prev_end_offset = cur_offset + envelope_size;
12956
12957 Ok(())
12958 }
12959 }
12960
12961 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12962 for SupplicantStaIfaceRegisterCallbackRequest
12963 {
12964 #[inline(always)]
12965 fn new_empty() -> Self {
12966 Self::default()
12967 }
12968
12969 unsafe fn decode(
12970 &mut self,
12971 decoder: &mut fidl::encoding::Decoder<
12972 '_,
12973 fidl::encoding::DefaultFuchsiaResourceDialect,
12974 >,
12975 offset: usize,
12976 mut depth: fidl::encoding::Depth,
12977 ) -> fidl::Result<()> {
12978 decoder.debug_check_bounds::<Self>(offset);
12979 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12980 None => return Err(fidl::Error::NotNullable),
12981 Some(len) => len,
12982 };
12983 if len == 0 {
12985 return Ok(());
12986 };
12987 depth.increment()?;
12988 let envelope_size = 8;
12989 let bytes_len = len * envelope_size;
12990 let offset = decoder.out_of_line_offset(bytes_len)?;
12991 let mut _next_ordinal_to_read = 0;
12993 let mut next_offset = offset;
12994 let end_offset = offset + bytes_len;
12995 _next_ordinal_to_read += 1;
12996 if next_offset >= end_offset {
12997 return Ok(());
12998 }
12999
13000 while _next_ordinal_to_read < 1 {
13002 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13003 _next_ordinal_to_read += 1;
13004 next_offset += envelope_size;
13005 }
13006
13007 let next_out_of_line = decoder.next_out_of_line();
13008 let handles_before = decoder.remaining_handles();
13009 if let Some((inlined, num_bytes, num_handles)) =
13010 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13011 {
13012 let member_inline_size = <fidl::encoding::Endpoint<
13013 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13014 > as fidl::encoding::TypeMarker>::inline_size(
13015 decoder.context
13016 );
13017 if inlined != (member_inline_size <= 4) {
13018 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13019 }
13020 let inner_offset;
13021 let mut inner_depth = depth.clone();
13022 if inlined {
13023 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13024 inner_offset = next_offset;
13025 } else {
13026 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13027 inner_depth.increment()?;
13028 }
13029 let val_ref = self.callback.get_or_insert_with(|| {
13030 fidl::new_empty!(
13031 fidl::encoding::Endpoint<
13032 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13033 >,
13034 fidl::encoding::DefaultFuchsiaResourceDialect
13035 )
13036 });
13037 fidl::decode!(
13038 fidl::encoding::Endpoint<
13039 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13040 >,
13041 fidl::encoding::DefaultFuchsiaResourceDialect,
13042 val_ref,
13043 decoder,
13044 inner_offset,
13045 inner_depth
13046 )?;
13047 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13048 {
13049 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13050 }
13051 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13052 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13053 }
13054 }
13055
13056 next_offset += envelope_size;
13057
13058 while next_offset < end_offset {
13060 _next_ordinal_to_read += 1;
13061 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13062 next_offset += envelope_size;
13063 }
13064
13065 Ok(())
13066 }
13067 }
13068
13069 impl SupplicantStaIfaceSetPowerSaveRequest {
13070 #[inline(always)]
13071 fn max_ordinal_present(&self) -> u64 {
13072 if let Some(_) = self.enable {
13073 return 1;
13074 }
13075 0
13076 }
13077 }
13078
13079 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13080 type Borrowed<'a> = &'a mut Self;
13081 fn take_or_borrow<'a>(
13082 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13083 ) -> Self::Borrowed<'a> {
13084 value
13085 }
13086 }
13087
13088 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13089 type Owned = Self;
13090
13091 #[inline(always)]
13092 fn inline_align(_context: fidl::encoding::Context) -> usize {
13093 8
13094 }
13095
13096 #[inline(always)]
13097 fn inline_size(_context: fidl::encoding::Context) -> usize {
13098 16
13099 }
13100 }
13101
13102 unsafe impl
13103 fidl::encoding::Encode<
13104 SupplicantStaIfaceSetPowerSaveRequest,
13105 fidl::encoding::DefaultFuchsiaResourceDialect,
13106 > for &mut SupplicantStaIfaceSetPowerSaveRequest
13107 {
13108 unsafe fn encode(
13109 self,
13110 encoder: &mut fidl::encoding::Encoder<
13111 '_,
13112 fidl::encoding::DefaultFuchsiaResourceDialect,
13113 >,
13114 offset: usize,
13115 mut depth: fidl::encoding::Depth,
13116 ) -> fidl::Result<()> {
13117 encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
13118 let max_ordinal: u64 = self.max_ordinal_present();
13120 encoder.write_num(max_ordinal, offset);
13121 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13122 if max_ordinal == 0 {
13124 return Ok(());
13125 }
13126 depth.increment()?;
13127 let envelope_size = 8;
13128 let bytes_len = max_ordinal as usize * envelope_size;
13129 #[allow(unused_variables)]
13130 let offset = encoder.out_of_line_offset(bytes_len);
13131 let mut _prev_end_offset: usize = 0;
13132 if 1 > max_ordinal {
13133 return Ok(());
13134 }
13135
13136 let cur_offset: usize = (1 - 1) * envelope_size;
13139
13140 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13142
13143 fidl::encoding::encode_in_envelope_optional::<
13148 bool,
13149 fidl::encoding::DefaultFuchsiaResourceDialect,
13150 >(
13151 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13152 encoder,
13153 offset + cur_offset,
13154 depth,
13155 )?;
13156
13157 _prev_end_offset = cur_offset + envelope_size;
13158
13159 Ok(())
13160 }
13161 }
13162
13163 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13164 for SupplicantStaIfaceSetPowerSaveRequest
13165 {
13166 #[inline(always)]
13167 fn new_empty() -> Self {
13168 Self::default()
13169 }
13170
13171 unsafe fn decode(
13172 &mut self,
13173 decoder: &mut fidl::encoding::Decoder<
13174 '_,
13175 fidl::encoding::DefaultFuchsiaResourceDialect,
13176 >,
13177 offset: usize,
13178 mut depth: fidl::encoding::Depth,
13179 ) -> fidl::Result<()> {
13180 decoder.debug_check_bounds::<Self>(offset);
13181 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13182 None => return Err(fidl::Error::NotNullable),
13183 Some(len) => len,
13184 };
13185 if len == 0 {
13187 return Ok(());
13188 };
13189 depth.increment()?;
13190 let envelope_size = 8;
13191 let bytes_len = len * envelope_size;
13192 let offset = decoder.out_of_line_offset(bytes_len)?;
13193 let mut _next_ordinal_to_read = 0;
13195 let mut next_offset = offset;
13196 let end_offset = offset + bytes_len;
13197 _next_ordinal_to_read += 1;
13198 if next_offset >= end_offset {
13199 return Ok(());
13200 }
13201
13202 while _next_ordinal_to_read < 1 {
13204 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13205 _next_ordinal_to_read += 1;
13206 next_offset += envelope_size;
13207 }
13208
13209 let next_out_of_line = decoder.next_out_of_line();
13210 let handles_before = decoder.remaining_handles();
13211 if let Some((inlined, num_bytes, num_handles)) =
13212 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13213 {
13214 let member_inline_size =
13215 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13216 if inlined != (member_inline_size <= 4) {
13217 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13218 }
13219 let inner_offset;
13220 let mut inner_depth = depth.clone();
13221 if inlined {
13222 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13223 inner_offset = next_offset;
13224 } else {
13225 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13226 inner_depth.increment()?;
13227 }
13228 let val_ref = self.enable.get_or_insert_with(|| {
13229 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13230 });
13231 fidl::decode!(
13232 bool,
13233 fidl::encoding::DefaultFuchsiaResourceDialect,
13234 val_ref,
13235 decoder,
13236 inner_offset,
13237 inner_depth
13238 )?;
13239 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13240 {
13241 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13242 }
13243 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13244 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13245 }
13246 }
13247
13248 next_offset += envelope_size;
13249
13250 while next_offset < end_offset {
13252 _next_ordinal_to_read += 1;
13253 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13254 next_offset += envelope_size;
13255 }
13256
13257 Ok(())
13258 }
13259 }
13260
13261 impl SupplicantStaIfaceSetStaCountryCodeRequest {
13262 #[inline(always)]
13263 fn max_ordinal_present(&self) -> u64 {
13264 if let Some(_) = self.code {
13265 return 1;
13266 }
13267 0
13268 }
13269 }
13270
13271 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13272 type Borrowed<'a> = &'a mut Self;
13273 fn take_or_borrow<'a>(
13274 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13275 ) -> Self::Borrowed<'a> {
13276 value
13277 }
13278 }
13279
13280 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13281 type Owned = Self;
13282
13283 #[inline(always)]
13284 fn inline_align(_context: fidl::encoding::Context) -> usize {
13285 8
13286 }
13287
13288 #[inline(always)]
13289 fn inline_size(_context: fidl::encoding::Context) -> usize {
13290 16
13291 }
13292 }
13293
13294 unsafe impl
13295 fidl::encoding::Encode<
13296 SupplicantStaIfaceSetStaCountryCodeRequest,
13297 fidl::encoding::DefaultFuchsiaResourceDialect,
13298 > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
13299 {
13300 unsafe fn encode(
13301 self,
13302 encoder: &mut fidl::encoding::Encoder<
13303 '_,
13304 fidl::encoding::DefaultFuchsiaResourceDialect,
13305 >,
13306 offset: usize,
13307 mut depth: fidl::encoding::Depth,
13308 ) -> fidl::Result<()> {
13309 encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
13310 let max_ordinal: u64 = self.max_ordinal_present();
13312 encoder.write_num(max_ordinal, offset);
13313 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13314 if max_ordinal == 0 {
13316 return Ok(());
13317 }
13318 depth.increment()?;
13319 let envelope_size = 8;
13320 let bytes_len = max_ordinal as usize * envelope_size;
13321 #[allow(unused_variables)]
13322 let offset = encoder.out_of_line_offset(bytes_len);
13323 let mut _prev_end_offset: usize = 0;
13324 if 1 > max_ordinal {
13325 return Ok(());
13326 }
13327
13328 let cur_offset: usize = (1 - 1) * envelope_size;
13331
13332 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13334
13335 fidl::encoding::encode_in_envelope_optional::<
13340 fidl::encoding::Array<u8, 2>,
13341 fidl::encoding::DefaultFuchsiaResourceDialect,
13342 >(
13343 self.code
13344 .as_ref()
13345 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
13346 encoder,
13347 offset + cur_offset,
13348 depth,
13349 )?;
13350
13351 _prev_end_offset = cur_offset + envelope_size;
13352
13353 Ok(())
13354 }
13355 }
13356
13357 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13358 for SupplicantStaIfaceSetStaCountryCodeRequest
13359 {
13360 #[inline(always)]
13361 fn new_empty() -> Self {
13362 Self::default()
13363 }
13364
13365 unsafe fn decode(
13366 &mut self,
13367 decoder: &mut fidl::encoding::Decoder<
13368 '_,
13369 fidl::encoding::DefaultFuchsiaResourceDialect,
13370 >,
13371 offset: usize,
13372 mut depth: fidl::encoding::Depth,
13373 ) -> fidl::Result<()> {
13374 decoder.debug_check_bounds::<Self>(offset);
13375 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13376 None => return Err(fidl::Error::NotNullable),
13377 Some(len) => len,
13378 };
13379 if len == 0 {
13381 return Ok(());
13382 };
13383 depth.increment()?;
13384 let envelope_size = 8;
13385 let bytes_len = len * envelope_size;
13386 let offset = decoder.out_of_line_offset(bytes_len)?;
13387 let mut _next_ordinal_to_read = 0;
13389 let mut next_offset = offset;
13390 let end_offset = offset + bytes_len;
13391 _next_ordinal_to_read += 1;
13392 if next_offset >= end_offset {
13393 return Ok(());
13394 }
13395
13396 while _next_ordinal_to_read < 1 {
13398 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13399 _next_ordinal_to_read += 1;
13400 next_offset += envelope_size;
13401 }
13402
13403 let next_out_of_line = decoder.next_out_of_line();
13404 let handles_before = decoder.remaining_handles();
13405 if let Some((inlined, num_bytes, num_handles)) =
13406 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13407 {
13408 let member_inline_size =
13409 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
13410 decoder.context,
13411 );
13412 if inlined != (member_inline_size <= 4) {
13413 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13414 }
13415 let inner_offset;
13416 let mut inner_depth = depth.clone();
13417 if inlined {
13418 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13419 inner_offset = next_offset;
13420 } else {
13421 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13422 inner_depth.increment()?;
13423 }
13424 let val_ref =
13425 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
13426 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13427 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13428 {
13429 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13430 }
13431 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13432 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13433 }
13434 }
13435
13436 next_offset += envelope_size;
13437
13438 while next_offset < end_offset {
13440 _next_ordinal_to_read += 1;
13441 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13442 next_offset += envelope_size;
13443 }
13444
13445 Ok(())
13446 }
13447 }
13448
13449 impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
13450 #[inline(always)]
13451 fn max_ordinal_present(&self) -> u64 {
13452 if let Some(_) = self.enable {
13453 return 1;
13454 }
13455 0
13456 }
13457 }
13458
13459 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
13460 type Borrowed<'a> = &'a mut Self;
13461 fn take_or_borrow<'a>(
13462 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13463 ) -> Self::Borrowed<'a> {
13464 value
13465 }
13466 }
13467
13468 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
13469 type Owned = Self;
13470
13471 #[inline(always)]
13472 fn inline_align(_context: fidl::encoding::Context) -> usize {
13473 8
13474 }
13475
13476 #[inline(always)]
13477 fn inline_size(_context: fidl::encoding::Context) -> usize {
13478 16
13479 }
13480 }
13481
13482 unsafe impl
13483 fidl::encoding::Encode<
13484 SupplicantStaIfaceSetSuspendModeEnabledRequest,
13485 fidl::encoding::DefaultFuchsiaResourceDialect,
13486 > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
13487 {
13488 unsafe fn encode(
13489 self,
13490 encoder: &mut fidl::encoding::Encoder<
13491 '_,
13492 fidl::encoding::DefaultFuchsiaResourceDialect,
13493 >,
13494 offset: usize,
13495 mut depth: fidl::encoding::Depth,
13496 ) -> fidl::Result<()> {
13497 encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
13498 let max_ordinal: u64 = self.max_ordinal_present();
13500 encoder.write_num(max_ordinal, offset);
13501 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13502 if max_ordinal == 0 {
13504 return Ok(());
13505 }
13506 depth.increment()?;
13507 let envelope_size = 8;
13508 let bytes_len = max_ordinal as usize * envelope_size;
13509 #[allow(unused_variables)]
13510 let offset = encoder.out_of_line_offset(bytes_len);
13511 let mut _prev_end_offset: usize = 0;
13512 if 1 > max_ordinal {
13513 return Ok(());
13514 }
13515
13516 let cur_offset: usize = (1 - 1) * envelope_size;
13519
13520 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13522
13523 fidl::encoding::encode_in_envelope_optional::<
13528 bool,
13529 fidl::encoding::DefaultFuchsiaResourceDialect,
13530 >(
13531 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13532 encoder,
13533 offset + cur_offset,
13534 depth,
13535 )?;
13536
13537 _prev_end_offset = cur_offset + envelope_size;
13538
13539 Ok(())
13540 }
13541 }
13542
13543 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13544 for SupplicantStaIfaceSetSuspendModeEnabledRequest
13545 {
13546 #[inline(always)]
13547 fn new_empty() -> Self {
13548 Self::default()
13549 }
13550
13551 unsafe fn decode(
13552 &mut self,
13553 decoder: &mut fidl::encoding::Decoder<
13554 '_,
13555 fidl::encoding::DefaultFuchsiaResourceDialect,
13556 >,
13557 offset: usize,
13558 mut depth: fidl::encoding::Depth,
13559 ) -> fidl::Result<()> {
13560 decoder.debug_check_bounds::<Self>(offset);
13561 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13562 None => return Err(fidl::Error::NotNullable),
13563 Some(len) => len,
13564 };
13565 if len == 0 {
13567 return Ok(());
13568 };
13569 depth.increment()?;
13570 let envelope_size = 8;
13571 let bytes_len = len * envelope_size;
13572 let offset = decoder.out_of_line_offset(bytes_len)?;
13573 let mut _next_ordinal_to_read = 0;
13575 let mut next_offset = offset;
13576 let end_offset = offset + bytes_len;
13577 _next_ordinal_to_read += 1;
13578 if next_offset >= end_offset {
13579 return Ok(());
13580 }
13581
13582 while _next_ordinal_to_read < 1 {
13584 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13585 _next_ordinal_to_read += 1;
13586 next_offset += envelope_size;
13587 }
13588
13589 let next_out_of_line = decoder.next_out_of_line();
13590 let handles_before = decoder.remaining_handles();
13591 if let Some((inlined, num_bytes, num_handles)) =
13592 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13593 {
13594 let member_inline_size =
13595 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13596 if inlined != (member_inline_size <= 4) {
13597 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13598 }
13599 let inner_offset;
13600 let mut inner_depth = depth.clone();
13601 if inlined {
13602 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13603 inner_offset = next_offset;
13604 } else {
13605 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13606 inner_depth.increment()?;
13607 }
13608 let val_ref = self.enable.get_or_insert_with(|| {
13609 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13610 });
13611 fidl::decode!(
13612 bool,
13613 fidl::encoding::DefaultFuchsiaResourceDialect,
13614 val_ref,
13615 decoder,
13616 inner_offset,
13617 inner_depth
13618 )?;
13619 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13620 {
13621 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13622 }
13623 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13624 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13625 }
13626 }
13627
13628 next_offset += envelope_size;
13629
13630 while next_offset < end_offset {
13632 _next_ordinal_to_read += 1;
13633 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13634 next_offset += envelope_size;
13635 }
13636
13637 Ok(())
13638 }
13639 }
13640
13641 impl WifiChipCreateStaIfaceRequest {
13642 #[inline(always)]
13643 fn max_ordinal_present(&self) -> u64 {
13644 if let Some(_) = self.iface {
13645 return 1;
13646 }
13647 0
13648 }
13649 }
13650
13651 impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
13652 type Borrowed<'a> = &'a mut Self;
13653 fn take_or_borrow<'a>(
13654 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13655 ) -> Self::Borrowed<'a> {
13656 value
13657 }
13658 }
13659
13660 unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
13661 type Owned = Self;
13662
13663 #[inline(always)]
13664 fn inline_align(_context: fidl::encoding::Context) -> usize {
13665 8
13666 }
13667
13668 #[inline(always)]
13669 fn inline_size(_context: fidl::encoding::Context) -> usize {
13670 16
13671 }
13672 }
13673
13674 unsafe impl
13675 fidl::encoding::Encode<
13676 WifiChipCreateStaIfaceRequest,
13677 fidl::encoding::DefaultFuchsiaResourceDialect,
13678 > for &mut WifiChipCreateStaIfaceRequest
13679 {
13680 unsafe fn encode(
13681 self,
13682 encoder: &mut fidl::encoding::Encoder<
13683 '_,
13684 fidl::encoding::DefaultFuchsiaResourceDialect,
13685 >,
13686 offset: usize,
13687 mut depth: fidl::encoding::Depth,
13688 ) -> fidl::Result<()> {
13689 encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
13690 let max_ordinal: u64 = self.max_ordinal_present();
13692 encoder.write_num(max_ordinal, offset);
13693 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13694 if max_ordinal == 0 {
13696 return Ok(());
13697 }
13698 depth.increment()?;
13699 let envelope_size = 8;
13700 let bytes_len = max_ordinal as usize * envelope_size;
13701 #[allow(unused_variables)]
13702 let offset = encoder.out_of_line_offset(bytes_len);
13703 let mut _prev_end_offset: usize = 0;
13704 if 1 > max_ordinal {
13705 return Ok(());
13706 }
13707
13708 let cur_offset: usize = (1 - 1) * envelope_size;
13711
13712 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13714
13715 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13720 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13721 encoder, offset + cur_offset, depth
13722 )?;
13723
13724 _prev_end_offset = cur_offset + envelope_size;
13725
13726 Ok(())
13727 }
13728 }
13729
13730 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13731 for WifiChipCreateStaIfaceRequest
13732 {
13733 #[inline(always)]
13734 fn new_empty() -> Self {
13735 Self::default()
13736 }
13737
13738 unsafe fn decode(
13739 &mut self,
13740 decoder: &mut fidl::encoding::Decoder<
13741 '_,
13742 fidl::encoding::DefaultFuchsiaResourceDialect,
13743 >,
13744 offset: usize,
13745 mut depth: fidl::encoding::Depth,
13746 ) -> fidl::Result<()> {
13747 decoder.debug_check_bounds::<Self>(offset);
13748 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13749 None => return Err(fidl::Error::NotNullable),
13750 Some(len) => len,
13751 };
13752 if len == 0 {
13754 return Ok(());
13755 };
13756 depth.increment()?;
13757 let envelope_size = 8;
13758 let bytes_len = len * envelope_size;
13759 let offset = decoder.out_of_line_offset(bytes_len)?;
13760 let mut _next_ordinal_to_read = 0;
13762 let mut next_offset = offset;
13763 let end_offset = offset + bytes_len;
13764 _next_ordinal_to_read += 1;
13765 if next_offset >= end_offset {
13766 return Ok(());
13767 }
13768
13769 while _next_ordinal_to_read < 1 {
13771 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13772 _next_ordinal_to_read += 1;
13773 next_offset += envelope_size;
13774 }
13775
13776 let next_out_of_line = decoder.next_out_of_line();
13777 let handles_before = decoder.remaining_handles();
13778 if let Some((inlined, num_bytes, num_handles)) =
13779 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13780 {
13781 let member_inline_size = <fidl::encoding::Endpoint<
13782 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
13783 > as fidl::encoding::TypeMarker>::inline_size(
13784 decoder.context
13785 );
13786 if inlined != (member_inline_size <= 4) {
13787 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13788 }
13789 let inner_offset;
13790 let mut inner_depth = depth.clone();
13791 if inlined {
13792 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13793 inner_offset = next_offset;
13794 } else {
13795 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13796 inner_depth.increment()?;
13797 }
13798 let val_ref = self.iface.get_or_insert_with(|| {
13799 fidl::new_empty!(
13800 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13801 fidl::encoding::DefaultFuchsiaResourceDialect
13802 )
13803 });
13804 fidl::decode!(
13805 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13806 fidl::encoding::DefaultFuchsiaResourceDialect,
13807 val_ref,
13808 decoder,
13809 inner_offset,
13810 inner_depth
13811 )?;
13812 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13813 {
13814 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13815 }
13816 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13817 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13818 }
13819 }
13820
13821 next_offset += envelope_size;
13822
13823 while next_offset < end_offset {
13825 _next_ordinal_to_read += 1;
13826 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13827 next_offset += envelope_size;
13828 }
13829
13830 Ok(())
13831 }
13832 }
13833
13834 impl WifiChipGetStaIfaceRequest {
13835 #[inline(always)]
13836 fn max_ordinal_present(&self) -> u64 {
13837 if let Some(_) = self.iface {
13838 return 2;
13839 }
13840 if let Some(_) = self.iface_name {
13841 return 1;
13842 }
13843 0
13844 }
13845 }
13846
13847 impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
13848 type Borrowed<'a> = &'a mut Self;
13849 fn take_or_borrow<'a>(
13850 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13851 ) -> Self::Borrowed<'a> {
13852 value
13853 }
13854 }
13855
13856 unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
13857 type Owned = Self;
13858
13859 #[inline(always)]
13860 fn inline_align(_context: fidl::encoding::Context) -> usize {
13861 8
13862 }
13863
13864 #[inline(always)]
13865 fn inline_size(_context: fidl::encoding::Context) -> usize {
13866 16
13867 }
13868 }
13869
13870 unsafe impl
13871 fidl::encoding::Encode<
13872 WifiChipGetStaIfaceRequest,
13873 fidl::encoding::DefaultFuchsiaResourceDialect,
13874 > for &mut WifiChipGetStaIfaceRequest
13875 {
13876 unsafe fn encode(
13877 self,
13878 encoder: &mut fidl::encoding::Encoder<
13879 '_,
13880 fidl::encoding::DefaultFuchsiaResourceDialect,
13881 >,
13882 offset: usize,
13883 mut depth: fidl::encoding::Depth,
13884 ) -> fidl::Result<()> {
13885 encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
13886 let max_ordinal: u64 = self.max_ordinal_present();
13888 encoder.write_num(max_ordinal, offset);
13889 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13890 if max_ordinal == 0 {
13892 return Ok(());
13893 }
13894 depth.increment()?;
13895 let envelope_size = 8;
13896 let bytes_len = max_ordinal as usize * envelope_size;
13897 #[allow(unused_variables)]
13898 let offset = encoder.out_of_line_offset(bytes_len);
13899 let mut _prev_end_offset: usize = 0;
13900 if 1 > max_ordinal {
13901 return Ok(());
13902 }
13903
13904 let cur_offset: usize = (1 - 1) * envelope_size;
13907
13908 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13910
13911 fidl::encoding::encode_in_envelope_optional::<
13916 fidl::encoding::BoundedString<16>,
13917 fidl::encoding::DefaultFuchsiaResourceDialect,
13918 >(
13919 self.iface_name.as_ref().map(
13920 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13921 ),
13922 encoder,
13923 offset + cur_offset,
13924 depth,
13925 )?;
13926
13927 _prev_end_offset = cur_offset + envelope_size;
13928 if 2 > max_ordinal {
13929 return Ok(());
13930 }
13931
13932 let cur_offset: usize = (2 - 1) * envelope_size;
13935
13936 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13938
13939 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13944 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13945 encoder, offset + cur_offset, depth
13946 )?;
13947
13948 _prev_end_offset = cur_offset + envelope_size;
13949
13950 Ok(())
13951 }
13952 }
13953
13954 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13955 for WifiChipGetStaIfaceRequest
13956 {
13957 #[inline(always)]
13958 fn new_empty() -> Self {
13959 Self::default()
13960 }
13961
13962 unsafe fn decode(
13963 &mut self,
13964 decoder: &mut fidl::encoding::Decoder<
13965 '_,
13966 fidl::encoding::DefaultFuchsiaResourceDialect,
13967 >,
13968 offset: usize,
13969 mut depth: fidl::encoding::Depth,
13970 ) -> fidl::Result<()> {
13971 decoder.debug_check_bounds::<Self>(offset);
13972 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13973 None => return Err(fidl::Error::NotNullable),
13974 Some(len) => len,
13975 };
13976 if len == 0 {
13978 return Ok(());
13979 };
13980 depth.increment()?;
13981 let envelope_size = 8;
13982 let bytes_len = len * envelope_size;
13983 let offset = decoder.out_of_line_offset(bytes_len)?;
13984 let mut _next_ordinal_to_read = 0;
13986 let mut next_offset = offset;
13987 let end_offset = offset + bytes_len;
13988 _next_ordinal_to_read += 1;
13989 if next_offset >= end_offset {
13990 return Ok(());
13991 }
13992
13993 while _next_ordinal_to_read < 1 {
13995 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13996 _next_ordinal_to_read += 1;
13997 next_offset += envelope_size;
13998 }
13999
14000 let next_out_of_line = decoder.next_out_of_line();
14001 let handles_before = decoder.remaining_handles();
14002 if let Some((inlined, num_bytes, num_handles)) =
14003 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14004 {
14005 let member_inline_size =
14006 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14007 decoder.context,
14008 );
14009 if inlined != (member_inline_size <= 4) {
14010 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14011 }
14012 let inner_offset;
14013 let mut inner_depth = depth.clone();
14014 if inlined {
14015 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14016 inner_offset = next_offset;
14017 } else {
14018 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14019 inner_depth.increment()?;
14020 }
14021 let val_ref = self.iface_name.get_or_insert_with(|| {
14022 fidl::new_empty!(
14023 fidl::encoding::BoundedString<16>,
14024 fidl::encoding::DefaultFuchsiaResourceDialect
14025 )
14026 });
14027 fidl::decode!(
14028 fidl::encoding::BoundedString<16>,
14029 fidl::encoding::DefaultFuchsiaResourceDialect,
14030 val_ref,
14031 decoder,
14032 inner_offset,
14033 inner_depth
14034 )?;
14035 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14036 {
14037 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14038 }
14039 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14040 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14041 }
14042 }
14043
14044 next_offset += envelope_size;
14045 _next_ordinal_to_read += 1;
14046 if next_offset >= end_offset {
14047 return Ok(());
14048 }
14049
14050 while _next_ordinal_to_read < 2 {
14052 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14053 _next_ordinal_to_read += 1;
14054 next_offset += envelope_size;
14055 }
14056
14057 let next_out_of_line = decoder.next_out_of_line();
14058 let handles_before = decoder.remaining_handles();
14059 if let Some((inlined, num_bytes, num_handles)) =
14060 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14061 {
14062 let member_inline_size = <fidl::encoding::Endpoint<
14063 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14064 > as fidl::encoding::TypeMarker>::inline_size(
14065 decoder.context
14066 );
14067 if inlined != (member_inline_size <= 4) {
14068 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14069 }
14070 let inner_offset;
14071 let mut inner_depth = depth.clone();
14072 if inlined {
14073 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14074 inner_offset = next_offset;
14075 } else {
14076 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14077 inner_depth.increment()?;
14078 }
14079 let val_ref = self.iface.get_or_insert_with(|| {
14080 fidl::new_empty!(
14081 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14082 fidl::encoding::DefaultFuchsiaResourceDialect
14083 )
14084 });
14085 fidl::decode!(
14086 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14087 fidl::encoding::DefaultFuchsiaResourceDialect,
14088 val_ref,
14089 decoder,
14090 inner_offset,
14091 inner_depth
14092 )?;
14093 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14094 {
14095 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14096 }
14097 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14098 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14099 }
14100 }
14101
14102 next_offset += envelope_size;
14103
14104 while next_offset < end_offset {
14106 _next_ordinal_to_read += 1;
14107 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14108 next_offset += envelope_size;
14109 }
14110
14111 Ok(())
14112 }
14113 }
14114
14115 impl WifiChipRemoveStaIfaceRequest {
14116 #[inline(always)]
14117 fn max_ordinal_present(&self) -> u64 {
14118 if let Some(_) = self.iface_name {
14119 return 1;
14120 }
14121 0
14122 }
14123 }
14124
14125 impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
14126 type Borrowed<'a> = &'a mut Self;
14127 fn take_or_borrow<'a>(
14128 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14129 ) -> Self::Borrowed<'a> {
14130 value
14131 }
14132 }
14133
14134 unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
14135 type Owned = Self;
14136
14137 #[inline(always)]
14138 fn inline_align(_context: fidl::encoding::Context) -> usize {
14139 8
14140 }
14141
14142 #[inline(always)]
14143 fn inline_size(_context: fidl::encoding::Context) -> usize {
14144 16
14145 }
14146 }
14147
14148 unsafe impl
14149 fidl::encoding::Encode<
14150 WifiChipRemoveStaIfaceRequest,
14151 fidl::encoding::DefaultFuchsiaResourceDialect,
14152 > for &mut WifiChipRemoveStaIfaceRequest
14153 {
14154 unsafe fn encode(
14155 self,
14156 encoder: &mut fidl::encoding::Encoder<
14157 '_,
14158 fidl::encoding::DefaultFuchsiaResourceDialect,
14159 >,
14160 offset: usize,
14161 mut depth: fidl::encoding::Depth,
14162 ) -> fidl::Result<()> {
14163 encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
14164 let max_ordinal: u64 = self.max_ordinal_present();
14166 encoder.write_num(max_ordinal, offset);
14167 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14168 if max_ordinal == 0 {
14170 return Ok(());
14171 }
14172 depth.increment()?;
14173 let envelope_size = 8;
14174 let bytes_len = max_ordinal as usize * envelope_size;
14175 #[allow(unused_variables)]
14176 let offset = encoder.out_of_line_offset(bytes_len);
14177 let mut _prev_end_offset: usize = 0;
14178 if 1 > max_ordinal {
14179 return Ok(());
14180 }
14181
14182 let cur_offset: usize = (1 - 1) * envelope_size;
14185
14186 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14188
14189 fidl::encoding::encode_in_envelope_optional::<
14194 fidl::encoding::BoundedString<16>,
14195 fidl::encoding::DefaultFuchsiaResourceDialect,
14196 >(
14197 self.iface_name.as_ref().map(
14198 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14199 ),
14200 encoder,
14201 offset + cur_offset,
14202 depth,
14203 )?;
14204
14205 _prev_end_offset = cur_offset + envelope_size;
14206
14207 Ok(())
14208 }
14209 }
14210
14211 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14212 for WifiChipRemoveStaIfaceRequest
14213 {
14214 #[inline(always)]
14215 fn new_empty() -> Self {
14216 Self::default()
14217 }
14218
14219 unsafe fn decode(
14220 &mut self,
14221 decoder: &mut fidl::encoding::Decoder<
14222 '_,
14223 fidl::encoding::DefaultFuchsiaResourceDialect,
14224 >,
14225 offset: usize,
14226 mut depth: fidl::encoding::Depth,
14227 ) -> fidl::Result<()> {
14228 decoder.debug_check_bounds::<Self>(offset);
14229 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14230 None => return Err(fidl::Error::NotNullable),
14231 Some(len) => len,
14232 };
14233 if len == 0 {
14235 return Ok(());
14236 };
14237 depth.increment()?;
14238 let envelope_size = 8;
14239 let bytes_len = len * envelope_size;
14240 let offset = decoder.out_of_line_offset(bytes_len)?;
14241 let mut _next_ordinal_to_read = 0;
14243 let mut next_offset = offset;
14244 let end_offset = offset + bytes_len;
14245 _next_ordinal_to_read += 1;
14246 if next_offset >= end_offset {
14247 return Ok(());
14248 }
14249
14250 while _next_ordinal_to_read < 1 {
14252 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14253 _next_ordinal_to_read += 1;
14254 next_offset += envelope_size;
14255 }
14256
14257 let next_out_of_line = decoder.next_out_of_line();
14258 let handles_before = decoder.remaining_handles();
14259 if let Some((inlined, num_bytes, num_handles)) =
14260 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14261 {
14262 let member_inline_size =
14263 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14264 decoder.context,
14265 );
14266 if inlined != (member_inline_size <= 4) {
14267 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14268 }
14269 let inner_offset;
14270 let mut inner_depth = depth.clone();
14271 if inlined {
14272 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14273 inner_offset = next_offset;
14274 } else {
14275 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14276 inner_depth.increment()?;
14277 }
14278 let val_ref = self.iface_name.get_or_insert_with(|| {
14279 fidl::new_empty!(
14280 fidl::encoding::BoundedString<16>,
14281 fidl::encoding::DefaultFuchsiaResourceDialect
14282 )
14283 });
14284 fidl::decode!(
14285 fidl::encoding::BoundedString<16>,
14286 fidl::encoding::DefaultFuchsiaResourceDialect,
14287 val_ref,
14288 decoder,
14289 inner_offset,
14290 inner_depth
14291 )?;
14292 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14293 {
14294 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14295 }
14296 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14297 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14298 }
14299 }
14300
14301 next_offset += envelope_size;
14302
14303 while next_offset < end_offset {
14305 _next_ordinal_to_read += 1;
14306 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14307 next_offset += envelope_size;
14308 }
14309
14310 Ok(())
14311 }
14312 }
14313
14314 impl WifiChipSetCountryCodeRequest {
14315 #[inline(always)]
14316 fn max_ordinal_present(&self) -> u64 {
14317 if let Some(_) = self.code {
14318 return 1;
14319 }
14320 0
14321 }
14322 }
14323
14324 impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
14325 type Borrowed<'a> = &'a mut Self;
14326 fn take_or_borrow<'a>(
14327 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14328 ) -> Self::Borrowed<'a> {
14329 value
14330 }
14331 }
14332
14333 unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
14334 type Owned = Self;
14335
14336 #[inline(always)]
14337 fn inline_align(_context: fidl::encoding::Context) -> usize {
14338 8
14339 }
14340
14341 #[inline(always)]
14342 fn inline_size(_context: fidl::encoding::Context) -> usize {
14343 16
14344 }
14345 }
14346
14347 unsafe impl
14348 fidl::encoding::Encode<
14349 WifiChipSetCountryCodeRequest,
14350 fidl::encoding::DefaultFuchsiaResourceDialect,
14351 > for &mut WifiChipSetCountryCodeRequest
14352 {
14353 unsafe fn encode(
14354 self,
14355 encoder: &mut fidl::encoding::Encoder<
14356 '_,
14357 fidl::encoding::DefaultFuchsiaResourceDialect,
14358 >,
14359 offset: usize,
14360 mut depth: fidl::encoding::Depth,
14361 ) -> fidl::Result<()> {
14362 encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
14363 let max_ordinal: u64 = self.max_ordinal_present();
14365 encoder.write_num(max_ordinal, offset);
14366 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14367 if max_ordinal == 0 {
14369 return Ok(());
14370 }
14371 depth.increment()?;
14372 let envelope_size = 8;
14373 let bytes_len = max_ordinal as usize * envelope_size;
14374 #[allow(unused_variables)]
14375 let offset = encoder.out_of_line_offset(bytes_len);
14376 let mut _prev_end_offset: usize = 0;
14377 if 1 > max_ordinal {
14378 return Ok(());
14379 }
14380
14381 let cur_offset: usize = (1 - 1) * envelope_size;
14384
14385 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14387
14388 fidl::encoding::encode_in_envelope_optional::<
14393 fidl::encoding::Array<u8, 2>,
14394 fidl::encoding::DefaultFuchsiaResourceDialect,
14395 >(
14396 self.code
14397 .as_ref()
14398 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14399 encoder,
14400 offset + cur_offset,
14401 depth,
14402 )?;
14403
14404 _prev_end_offset = cur_offset + envelope_size;
14405
14406 Ok(())
14407 }
14408 }
14409
14410 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14411 for WifiChipSetCountryCodeRequest
14412 {
14413 #[inline(always)]
14414 fn new_empty() -> Self {
14415 Self::default()
14416 }
14417
14418 unsafe fn decode(
14419 &mut self,
14420 decoder: &mut fidl::encoding::Decoder<
14421 '_,
14422 fidl::encoding::DefaultFuchsiaResourceDialect,
14423 >,
14424 offset: usize,
14425 mut depth: fidl::encoding::Depth,
14426 ) -> fidl::Result<()> {
14427 decoder.debug_check_bounds::<Self>(offset);
14428 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14429 None => return Err(fidl::Error::NotNullable),
14430 Some(len) => len,
14431 };
14432 if len == 0 {
14434 return Ok(());
14435 };
14436 depth.increment()?;
14437 let envelope_size = 8;
14438 let bytes_len = len * envelope_size;
14439 let offset = decoder.out_of_line_offset(bytes_len)?;
14440 let mut _next_ordinal_to_read = 0;
14442 let mut next_offset = offset;
14443 let end_offset = offset + bytes_len;
14444 _next_ordinal_to_read += 1;
14445 if next_offset >= end_offset {
14446 return Ok(());
14447 }
14448
14449 while _next_ordinal_to_read < 1 {
14451 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14452 _next_ordinal_to_read += 1;
14453 next_offset += envelope_size;
14454 }
14455
14456 let next_out_of_line = decoder.next_out_of_line();
14457 let handles_before = decoder.remaining_handles();
14458 if let Some((inlined, num_bytes, num_handles)) =
14459 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14460 {
14461 let member_inline_size =
14462 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
14463 decoder.context,
14464 );
14465 if inlined != (member_inline_size <= 4) {
14466 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14467 }
14468 let inner_offset;
14469 let mut inner_depth = depth.clone();
14470 if inlined {
14471 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14472 inner_offset = next_offset;
14473 } else {
14474 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14475 inner_depth.increment()?;
14476 }
14477 let val_ref =
14478 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
14479 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14480 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14481 {
14482 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14483 }
14484 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14485 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14486 }
14487 }
14488
14489 next_offset += envelope_size;
14490
14491 while next_offset < end_offset {
14493 _next_ordinal_to_read += 1;
14494 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14495 next_offset += envelope_size;
14496 }
14497
14498 Ok(())
14499 }
14500 }
14501
14502 impl WifiEventCallbackOnSubsystemRestartRequest {
14503 #[inline(always)]
14504 fn max_ordinal_present(&self) -> u64 {
14505 if let Some(_) = self.status {
14506 return 1;
14507 }
14508 0
14509 }
14510 }
14511
14512 impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
14513 type Borrowed<'a> = &'a mut Self;
14514 fn take_or_borrow<'a>(
14515 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14516 ) -> Self::Borrowed<'a> {
14517 value
14518 }
14519 }
14520
14521 unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
14522 type Owned = Self;
14523
14524 #[inline(always)]
14525 fn inline_align(_context: fidl::encoding::Context) -> usize {
14526 8
14527 }
14528
14529 #[inline(always)]
14530 fn inline_size(_context: fidl::encoding::Context) -> usize {
14531 16
14532 }
14533 }
14534
14535 unsafe impl
14536 fidl::encoding::Encode<
14537 WifiEventCallbackOnSubsystemRestartRequest,
14538 fidl::encoding::DefaultFuchsiaResourceDialect,
14539 > for &mut WifiEventCallbackOnSubsystemRestartRequest
14540 {
14541 unsafe fn encode(
14542 self,
14543 encoder: &mut fidl::encoding::Encoder<
14544 '_,
14545 fidl::encoding::DefaultFuchsiaResourceDialect,
14546 >,
14547 offset: usize,
14548 mut depth: fidl::encoding::Depth,
14549 ) -> fidl::Result<()> {
14550 encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
14551 let max_ordinal: u64 = self.max_ordinal_present();
14553 encoder.write_num(max_ordinal, offset);
14554 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14555 if max_ordinal == 0 {
14557 return Ok(());
14558 }
14559 depth.increment()?;
14560 let envelope_size = 8;
14561 let bytes_len = max_ordinal as usize * envelope_size;
14562 #[allow(unused_variables)]
14563 let offset = encoder.out_of_line_offset(bytes_len);
14564 let mut _prev_end_offset: usize = 0;
14565 if 1 > max_ordinal {
14566 return Ok(());
14567 }
14568
14569 let cur_offset: usize = (1 - 1) * envelope_size;
14572
14573 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14575
14576 fidl::encoding::encode_in_envelope_optional::<
14581 i32,
14582 fidl::encoding::DefaultFuchsiaResourceDialect,
14583 >(
14584 self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
14585 encoder,
14586 offset + cur_offset,
14587 depth,
14588 )?;
14589
14590 _prev_end_offset = cur_offset + envelope_size;
14591
14592 Ok(())
14593 }
14594 }
14595
14596 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14597 for WifiEventCallbackOnSubsystemRestartRequest
14598 {
14599 #[inline(always)]
14600 fn new_empty() -> Self {
14601 Self::default()
14602 }
14603
14604 unsafe fn decode(
14605 &mut self,
14606 decoder: &mut fidl::encoding::Decoder<
14607 '_,
14608 fidl::encoding::DefaultFuchsiaResourceDialect,
14609 >,
14610 offset: usize,
14611 mut depth: fidl::encoding::Depth,
14612 ) -> fidl::Result<()> {
14613 decoder.debug_check_bounds::<Self>(offset);
14614 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14615 None => return Err(fidl::Error::NotNullable),
14616 Some(len) => len,
14617 };
14618 if len == 0 {
14620 return Ok(());
14621 };
14622 depth.increment()?;
14623 let envelope_size = 8;
14624 let bytes_len = len * envelope_size;
14625 let offset = decoder.out_of_line_offset(bytes_len)?;
14626 let mut _next_ordinal_to_read = 0;
14628 let mut next_offset = offset;
14629 let end_offset = offset + bytes_len;
14630 _next_ordinal_to_read += 1;
14631 if next_offset >= end_offset {
14632 return Ok(());
14633 }
14634
14635 while _next_ordinal_to_read < 1 {
14637 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14638 _next_ordinal_to_read += 1;
14639 next_offset += envelope_size;
14640 }
14641
14642 let next_out_of_line = decoder.next_out_of_line();
14643 let handles_before = decoder.remaining_handles();
14644 if let Some((inlined, num_bytes, num_handles)) =
14645 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14646 {
14647 let member_inline_size =
14648 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14649 if inlined != (member_inline_size <= 4) {
14650 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14651 }
14652 let inner_offset;
14653 let mut inner_depth = depth.clone();
14654 if inlined {
14655 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14656 inner_offset = next_offset;
14657 } else {
14658 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14659 inner_depth.increment()?;
14660 }
14661 let val_ref = self.status.get_or_insert_with(|| {
14662 fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
14663 });
14664 fidl::decode!(
14665 i32,
14666 fidl::encoding::DefaultFuchsiaResourceDialect,
14667 val_ref,
14668 decoder,
14669 inner_offset,
14670 inner_depth
14671 )?;
14672 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14673 {
14674 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14675 }
14676 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14677 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14678 }
14679 }
14680
14681 next_offset += envelope_size;
14682
14683 while next_offset < end_offset {
14685 _next_ordinal_to_read += 1;
14686 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14687 next_offset += envelope_size;
14688 }
14689
14690 Ok(())
14691 }
14692 }
14693
14694 impl WifiGetChipRequest {
14695 #[inline(always)]
14696 fn max_ordinal_present(&self) -> u64 {
14697 if let Some(_) = self.chip {
14698 return 2;
14699 }
14700 if let Some(_) = self.chip_id {
14701 return 1;
14702 }
14703 0
14704 }
14705 }
14706
14707 impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
14708 type Borrowed<'a> = &'a mut Self;
14709 fn take_or_borrow<'a>(
14710 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14711 ) -> Self::Borrowed<'a> {
14712 value
14713 }
14714 }
14715
14716 unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
14717 type Owned = Self;
14718
14719 #[inline(always)]
14720 fn inline_align(_context: fidl::encoding::Context) -> usize {
14721 8
14722 }
14723
14724 #[inline(always)]
14725 fn inline_size(_context: fidl::encoding::Context) -> usize {
14726 16
14727 }
14728 }
14729
14730 unsafe impl
14731 fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
14732 for &mut WifiGetChipRequest
14733 {
14734 unsafe fn encode(
14735 self,
14736 encoder: &mut fidl::encoding::Encoder<
14737 '_,
14738 fidl::encoding::DefaultFuchsiaResourceDialect,
14739 >,
14740 offset: usize,
14741 mut depth: fidl::encoding::Depth,
14742 ) -> fidl::Result<()> {
14743 encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
14744 let max_ordinal: u64 = self.max_ordinal_present();
14746 encoder.write_num(max_ordinal, offset);
14747 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14748 if max_ordinal == 0 {
14750 return Ok(());
14751 }
14752 depth.increment()?;
14753 let envelope_size = 8;
14754 let bytes_len = max_ordinal as usize * envelope_size;
14755 #[allow(unused_variables)]
14756 let offset = encoder.out_of_line_offset(bytes_len);
14757 let mut _prev_end_offset: usize = 0;
14758 if 1 > max_ordinal {
14759 return Ok(());
14760 }
14761
14762 let cur_offset: usize = (1 - 1) * envelope_size;
14765
14766 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14768
14769 fidl::encoding::encode_in_envelope_optional::<
14774 u32,
14775 fidl::encoding::DefaultFuchsiaResourceDialect,
14776 >(
14777 self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
14778 encoder,
14779 offset + cur_offset,
14780 depth,
14781 )?;
14782
14783 _prev_end_offset = cur_offset + envelope_size;
14784 if 2 > max_ordinal {
14785 return Ok(());
14786 }
14787
14788 let cur_offset: usize = (2 - 1) * envelope_size;
14791
14792 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14794
14795 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14800 self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14801 encoder, offset + cur_offset, depth
14802 )?;
14803
14804 _prev_end_offset = cur_offset + envelope_size;
14805
14806 Ok(())
14807 }
14808 }
14809
14810 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14811 for WifiGetChipRequest
14812 {
14813 #[inline(always)]
14814 fn new_empty() -> Self {
14815 Self::default()
14816 }
14817
14818 unsafe fn decode(
14819 &mut self,
14820 decoder: &mut fidl::encoding::Decoder<
14821 '_,
14822 fidl::encoding::DefaultFuchsiaResourceDialect,
14823 >,
14824 offset: usize,
14825 mut depth: fidl::encoding::Depth,
14826 ) -> fidl::Result<()> {
14827 decoder.debug_check_bounds::<Self>(offset);
14828 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14829 None => return Err(fidl::Error::NotNullable),
14830 Some(len) => len,
14831 };
14832 if len == 0 {
14834 return Ok(());
14835 };
14836 depth.increment()?;
14837 let envelope_size = 8;
14838 let bytes_len = len * envelope_size;
14839 let offset = decoder.out_of_line_offset(bytes_len)?;
14840 let mut _next_ordinal_to_read = 0;
14842 let mut next_offset = offset;
14843 let end_offset = offset + bytes_len;
14844 _next_ordinal_to_read += 1;
14845 if next_offset >= end_offset {
14846 return Ok(());
14847 }
14848
14849 while _next_ordinal_to_read < 1 {
14851 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14852 _next_ordinal_to_read += 1;
14853 next_offset += envelope_size;
14854 }
14855
14856 let next_out_of_line = decoder.next_out_of_line();
14857 let handles_before = decoder.remaining_handles();
14858 if let Some((inlined, num_bytes, num_handles)) =
14859 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14860 {
14861 let member_inline_size =
14862 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14863 if inlined != (member_inline_size <= 4) {
14864 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14865 }
14866 let inner_offset;
14867 let mut inner_depth = depth.clone();
14868 if inlined {
14869 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14870 inner_offset = next_offset;
14871 } else {
14872 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14873 inner_depth.increment()?;
14874 }
14875 let val_ref = self.chip_id.get_or_insert_with(|| {
14876 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
14877 });
14878 fidl::decode!(
14879 u32,
14880 fidl::encoding::DefaultFuchsiaResourceDialect,
14881 val_ref,
14882 decoder,
14883 inner_offset,
14884 inner_depth
14885 )?;
14886 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14887 {
14888 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14889 }
14890 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14891 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14892 }
14893 }
14894
14895 next_offset += envelope_size;
14896 _next_ordinal_to_read += 1;
14897 if next_offset >= end_offset {
14898 return Ok(());
14899 }
14900
14901 while _next_ordinal_to_read < 2 {
14903 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14904 _next_ordinal_to_read += 1;
14905 next_offset += envelope_size;
14906 }
14907
14908 let next_out_of_line = decoder.next_out_of_line();
14909 let handles_before = decoder.remaining_handles();
14910 if let Some((inlined, num_bytes, num_handles)) =
14911 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14912 {
14913 let member_inline_size = <fidl::encoding::Endpoint<
14914 fidl::endpoints::ServerEnd<WifiChipMarker>,
14915 > as fidl::encoding::TypeMarker>::inline_size(
14916 decoder.context
14917 );
14918 if inlined != (member_inline_size <= 4) {
14919 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14920 }
14921 let inner_offset;
14922 let mut inner_depth = depth.clone();
14923 if inlined {
14924 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14925 inner_offset = next_offset;
14926 } else {
14927 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14928 inner_depth.increment()?;
14929 }
14930 let val_ref = self.chip.get_or_insert_with(|| {
14931 fidl::new_empty!(
14932 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
14933 fidl::encoding::DefaultFuchsiaResourceDialect
14934 )
14935 });
14936 fidl::decode!(
14937 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
14938 fidl::encoding::DefaultFuchsiaResourceDialect,
14939 val_ref,
14940 decoder,
14941 inner_offset,
14942 inner_depth
14943 )?;
14944 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14945 {
14946 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14947 }
14948 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14949 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14950 }
14951 }
14952
14953 next_offset += envelope_size;
14954
14955 while next_offset < end_offset {
14957 _next_ordinal_to_read += 1;
14958 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14959 next_offset += envelope_size;
14960 }
14961
14962 Ok(())
14963 }
14964 }
14965
14966 impl WifiLegacyHalSelectTxPowerScenarioRequest {
14967 #[inline(always)]
14968 fn max_ordinal_present(&self) -> u64 {
14969 if let Some(_) = self.scenario {
14970 return 1;
14971 }
14972 0
14973 }
14974 }
14975
14976 impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
14977 type Borrowed<'a> = &'a mut Self;
14978 fn take_or_borrow<'a>(
14979 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14980 ) -> Self::Borrowed<'a> {
14981 value
14982 }
14983 }
14984
14985 unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
14986 type Owned = Self;
14987
14988 #[inline(always)]
14989 fn inline_align(_context: fidl::encoding::Context) -> usize {
14990 8
14991 }
14992
14993 #[inline(always)]
14994 fn inline_size(_context: fidl::encoding::Context) -> usize {
14995 16
14996 }
14997 }
14998
14999 unsafe impl
15000 fidl::encoding::Encode<
15001 WifiLegacyHalSelectTxPowerScenarioRequest,
15002 fidl::encoding::DefaultFuchsiaResourceDialect,
15003 > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
15004 {
15005 unsafe fn encode(
15006 self,
15007 encoder: &mut fidl::encoding::Encoder<
15008 '_,
15009 fidl::encoding::DefaultFuchsiaResourceDialect,
15010 >,
15011 offset: usize,
15012 mut depth: fidl::encoding::Depth,
15013 ) -> fidl::Result<()> {
15014 encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
15015 let max_ordinal: u64 = self.max_ordinal_present();
15017 encoder.write_num(max_ordinal, offset);
15018 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15019 if max_ordinal == 0 {
15021 return Ok(());
15022 }
15023 depth.increment()?;
15024 let envelope_size = 8;
15025 let bytes_len = max_ordinal as usize * envelope_size;
15026 #[allow(unused_variables)]
15027 let offset = encoder.out_of_line_offset(bytes_len);
15028 let mut _prev_end_offset: usize = 0;
15029 if 1 > max_ordinal {
15030 return Ok(());
15031 }
15032
15033 let cur_offset: usize = (1 - 1) * envelope_size;
15036
15037 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15039
15040 fidl::encoding::encode_in_envelope_optional::<
15045 WifiLegacyHalTxPowerScenario,
15046 fidl::encoding::DefaultFuchsiaResourceDialect,
15047 >(
15048 self.scenario
15049 .as_ref()
15050 .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
15051 encoder,
15052 offset + cur_offset,
15053 depth,
15054 )?;
15055
15056 _prev_end_offset = cur_offset + envelope_size;
15057
15058 Ok(())
15059 }
15060 }
15061
15062 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15063 for WifiLegacyHalSelectTxPowerScenarioRequest
15064 {
15065 #[inline(always)]
15066 fn new_empty() -> Self {
15067 Self::default()
15068 }
15069
15070 unsafe fn decode(
15071 &mut self,
15072 decoder: &mut fidl::encoding::Decoder<
15073 '_,
15074 fidl::encoding::DefaultFuchsiaResourceDialect,
15075 >,
15076 offset: usize,
15077 mut depth: fidl::encoding::Depth,
15078 ) -> fidl::Result<()> {
15079 decoder.debug_check_bounds::<Self>(offset);
15080 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15081 None => return Err(fidl::Error::NotNullable),
15082 Some(len) => len,
15083 };
15084 if len == 0 {
15086 return Ok(());
15087 };
15088 depth.increment()?;
15089 let envelope_size = 8;
15090 let bytes_len = len * envelope_size;
15091 let offset = decoder.out_of_line_offset(bytes_len)?;
15092 let mut _next_ordinal_to_read = 0;
15094 let mut next_offset = offset;
15095 let end_offset = offset + bytes_len;
15096 _next_ordinal_to_read += 1;
15097 if next_offset >= end_offset {
15098 return Ok(());
15099 }
15100
15101 while _next_ordinal_to_read < 1 {
15103 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15104 _next_ordinal_to_read += 1;
15105 next_offset += envelope_size;
15106 }
15107
15108 let next_out_of_line = decoder.next_out_of_line();
15109 let handles_before = decoder.remaining_handles();
15110 if let Some((inlined, num_bytes, num_handles)) =
15111 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15112 {
15113 let member_inline_size =
15114 <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
15115 decoder.context,
15116 );
15117 if inlined != (member_inline_size <= 4) {
15118 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15119 }
15120 let inner_offset;
15121 let mut inner_depth = depth.clone();
15122 if inlined {
15123 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15124 inner_offset = next_offset;
15125 } else {
15126 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15127 inner_depth.increment()?;
15128 }
15129 let val_ref = self.scenario.get_or_insert_with(|| {
15130 fidl::new_empty!(
15131 WifiLegacyHalTxPowerScenario,
15132 fidl::encoding::DefaultFuchsiaResourceDialect
15133 )
15134 });
15135 fidl::decode!(
15136 WifiLegacyHalTxPowerScenario,
15137 fidl::encoding::DefaultFuchsiaResourceDialect,
15138 val_ref,
15139 decoder,
15140 inner_offset,
15141 inner_depth
15142 )?;
15143 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15144 {
15145 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15146 }
15147 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15148 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15149 }
15150 }
15151
15152 next_offset += envelope_size;
15153
15154 while next_offset < end_offset {
15156 _next_ordinal_to_read += 1;
15157 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15158 next_offset += envelope_size;
15159 }
15160
15161 Ok(())
15162 }
15163 }
15164
15165 impl WifiRegisterEventCallbackRequest {
15166 #[inline(always)]
15167 fn max_ordinal_present(&self) -> u64 {
15168 if let Some(_) = self.callback {
15169 return 1;
15170 }
15171 0
15172 }
15173 }
15174
15175 impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
15176 type Borrowed<'a> = &'a mut Self;
15177 fn take_or_borrow<'a>(
15178 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15179 ) -> Self::Borrowed<'a> {
15180 value
15181 }
15182 }
15183
15184 unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
15185 type Owned = Self;
15186
15187 #[inline(always)]
15188 fn inline_align(_context: fidl::encoding::Context) -> usize {
15189 8
15190 }
15191
15192 #[inline(always)]
15193 fn inline_size(_context: fidl::encoding::Context) -> usize {
15194 16
15195 }
15196 }
15197
15198 unsafe impl
15199 fidl::encoding::Encode<
15200 WifiRegisterEventCallbackRequest,
15201 fidl::encoding::DefaultFuchsiaResourceDialect,
15202 > for &mut WifiRegisterEventCallbackRequest
15203 {
15204 unsafe fn encode(
15205 self,
15206 encoder: &mut fidl::encoding::Encoder<
15207 '_,
15208 fidl::encoding::DefaultFuchsiaResourceDialect,
15209 >,
15210 offset: usize,
15211 mut depth: fidl::encoding::Depth,
15212 ) -> fidl::Result<()> {
15213 encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
15214 let max_ordinal: u64 = self.max_ordinal_present();
15216 encoder.write_num(max_ordinal, offset);
15217 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15218 if max_ordinal == 0 {
15220 return Ok(());
15221 }
15222 depth.increment()?;
15223 let envelope_size = 8;
15224 let bytes_len = max_ordinal as usize * envelope_size;
15225 #[allow(unused_variables)]
15226 let offset = encoder.out_of_line_offset(bytes_len);
15227 let mut _prev_end_offset: usize = 0;
15228 if 1 > max_ordinal {
15229 return Ok(());
15230 }
15231
15232 let cur_offset: usize = (1 - 1) * envelope_size;
15235
15236 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15238
15239 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15244 self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15245 encoder, offset + cur_offset, depth
15246 )?;
15247
15248 _prev_end_offset = cur_offset + envelope_size;
15249
15250 Ok(())
15251 }
15252 }
15253
15254 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15255 for WifiRegisterEventCallbackRequest
15256 {
15257 #[inline(always)]
15258 fn new_empty() -> Self {
15259 Self::default()
15260 }
15261
15262 unsafe fn decode(
15263 &mut self,
15264 decoder: &mut fidl::encoding::Decoder<
15265 '_,
15266 fidl::encoding::DefaultFuchsiaResourceDialect,
15267 >,
15268 offset: usize,
15269 mut depth: fidl::encoding::Depth,
15270 ) -> fidl::Result<()> {
15271 decoder.debug_check_bounds::<Self>(offset);
15272 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15273 None => return Err(fidl::Error::NotNullable),
15274 Some(len) => len,
15275 };
15276 if len == 0 {
15278 return Ok(());
15279 };
15280 depth.increment()?;
15281 let envelope_size = 8;
15282 let bytes_len = len * envelope_size;
15283 let offset = decoder.out_of_line_offset(bytes_len)?;
15284 let mut _next_ordinal_to_read = 0;
15286 let mut next_offset = offset;
15287 let end_offset = offset + bytes_len;
15288 _next_ordinal_to_read += 1;
15289 if next_offset >= end_offset {
15290 return Ok(());
15291 }
15292
15293 while _next_ordinal_to_read < 1 {
15295 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15296 _next_ordinal_to_read += 1;
15297 next_offset += envelope_size;
15298 }
15299
15300 let next_out_of_line = decoder.next_out_of_line();
15301 let handles_before = decoder.remaining_handles();
15302 if let Some((inlined, num_bytes, num_handles)) =
15303 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15304 {
15305 let member_inline_size = <fidl::encoding::Endpoint<
15306 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15307 > as fidl::encoding::TypeMarker>::inline_size(
15308 decoder.context
15309 );
15310 if inlined != (member_inline_size <= 4) {
15311 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15312 }
15313 let inner_offset;
15314 let mut inner_depth = depth.clone();
15315 if inlined {
15316 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15317 inner_offset = next_offset;
15318 } else {
15319 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15320 inner_depth.increment()?;
15321 }
15322 let val_ref = self.callback.get_or_insert_with(|| {
15323 fidl::new_empty!(
15324 fidl::encoding::Endpoint<
15325 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15326 >,
15327 fidl::encoding::DefaultFuchsiaResourceDialect
15328 )
15329 });
15330 fidl::decode!(
15331 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
15332 fidl::encoding::DefaultFuchsiaResourceDialect,
15333 val_ref,
15334 decoder,
15335 inner_offset,
15336 inner_depth
15337 )?;
15338 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15339 {
15340 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15341 }
15342 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15343 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15344 }
15345 }
15346
15347 next_offset += envelope_size;
15348
15349 while next_offset < end_offset {
15351 _next_ordinal_to_read += 1;
15352 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15353 next_offset += envelope_size;
15354 }
15355
15356 Ok(())
15357 }
15358 }
15359
15360 impl WifiStaIfaceSetScanOnlyModeRequest {
15361 #[inline(always)]
15362 fn max_ordinal_present(&self) -> u64 {
15363 if let Some(_) = self.enable {
15364 return 1;
15365 }
15366 0
15367 }
15368 }
15369
15370 impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15371 type Borrowed<'a> = &'a mut Self;
15372 fn take_or_borrow<'a>(
15373 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15374 ) -> Self::Borrowed<'a> {
15375 value
15376 }
15377 }
15378
15379 unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15380 type Owned = Self;
15381
15382 #[inline(always)]
15383 fn inline_align(_context: fidl::encoding::Context) -> usize {
15384 8
15385 }
15386
15387 #[inline(always)]
15388 fn inline_size(_context: fidl::encoding::Context) -> usize {
15389 16
15390 }
15391 }
15392
15393 unsafe impl
15394 fidl::encoding::Encode<
15395 WifiStaIfaceSetScanOnlyModeRequest,
15396 fidl::encoding::DefaultFuchsiaResourceDialect,
15397 > for &mut WifiStaIfaceSetScanOnlyModeRequest
15398 {
15399 unsafe fn encode(
15400 self,
15401 encoder: &mut fidl::encoding::Encoder<
15402 '_,
15403 fidl::encoding::DefaultFuchsiaResourceDialect,
15404 >,
15405 offset: usize,
15406 mut depth: fidl::encoding::Depth,
15407 ) -> fidl::Result<()> {
15408 encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
15409 let max_ordinal: u64 = self.max_ordinal_present();
15411 encoder.write_num(max_ordinal, offset);
15412 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15413 if max_ordinal == 0 {
15415 return Ok(());
15416 }
15417 depth.increment()?;
15418 let envelope_size = 8;
15419 let bytes_len = max_ordinal as usize * envelope_size;
15420 #[allow(unused_variables)]
15421 let offset = encoder.out_of_line_offset(bytes_len);
15422 let mut _prev_end_offset: usize = 0;
15423 if 1 > max_ordinal {
15424 return Ok(());
15425 }
15426
15427 let cur_offset: usize = (1 - 1) * envelope_size;
15430
15431 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15433
15434 fidl::encoding::encode_in_envelope_optional::<
15439 bool,
15440 fidl::encoding::DefaultFuchsiaResourceDialect,
15441 >(
15442 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15443 encoder,
15444 offset + cur_offset,
15445 depth,
15446 )?;
15447
15448 _prev_end_offset = cur_offset + envelope_size;
15449
15450 Ok(())
15451 }
15452 }
15453
15454 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15455 for WifiStaIfaceSetScanOnlyModeRequest
15456 {
15457 #[inline(always)]
15458 fn new_empty() -> Self {
15459 Self::default()
15460 }
15461
15462 unsafe fn decode(
15463 &mut self,
15464 decoder: &mut fidl::encoding::Decoder<
15465 '_,
15466 fidl::encoding::DefaultFuchsiaResourceDialect,
15467 >,
15468 offset: usize,
15469 mut depth: fidl::encoding::Depth,
15470 ) -> fidl::Result<()> {
15471 decoder.debug_check_bounds::<Self>(offset);
15472 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15473 None => return Err(fidl::Error::NotNullable),
15474 Some(len) => len,
15475 };
15476 if len == 0 {
15478 return Ok(());
15479 };
15480 depth.increment()?;
15481 let envelope_size = 8;
15482 let bytes_len = len * envelope_size;
15483 let offset = decoder.out_of_line_offset(bytes_len)?;
15484 let mut _next_ordinal_to_read = 0;
15486 let mut next_offset = offset;
15487 let end_offset = offset + bytes_len;
15488 _next_ordinal_to_read += 1;
15489 if next_offset >= end_offset {
15490 return Ok(());
15491 }
15492
15493 while _next_ordinal_to_read < 1 {
15495 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15496 _next_ordinal_to_read += 1;
15497 next_offset += envelope_size;
15498 }
15499
15500 let next_out_of_line = decoder.next_out_of_line();
15501 let handles_before = decoder.remaining_handles();
15502 if let Some((inlined, num_bytes, num_handles)) =
15503 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15504 {
15505 let member_inline_size =
15506 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15507 if inlined != (member_inline_size <= 4) {
15508 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15509 }
15510 let inner_offset;
15511 let mut inner_depth = depth.clone();
15512 if inlined {
15513 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15514 inner_offset = next_offset;
15515 } else {
15516 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15517 inner_depth.increment()?;
15518 }
15519 let val_ref = self.enable.get_or_insert_with(|| {
15520 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
15521 });
15522 fidl::decode!(
15523 bool,
15524 fidl::encoding::DefaultFuchsiaResourceDialect,
15525 val_ref,
15526 decoder,
15527 inner_offset,
15528 inner_depth
15529 )?;
15530 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15531 {
15532 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15533 }
15534 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15535 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15536 }
15537 }
15538
15539 next_offset += envelope_size;
15540
15541 while next_offset < end_offset {
15543 _next_ordinal_to_read += 1;
15544 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15545 next_offset += envelope_size;
15546 }
15547
15548 Ok(())
15549 }
15550 }
15551
15552 impl WlanixGetNl80211Request {
15553 #[inline(always)]
15554 fn max_ordinal_present(&self) -> u64 {
15555 if let Some(_) = self.nl80211 {
15556 return 1;
15557 }
15558 0
15559 }
15560 }
15561
15562 impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
15563 type Borrowed<'a> = &'a mut Self;
15564 fn take_or_borrow<'a>(
15565 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15566 ) -> Self::Borrowed<'a> {
15567 value
15568 }
15569 }
15570
15571 unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
15572 type Owned = Self;
15573
15574 #[inline(always)]
15575 fn inline_align(_context: fidl::encoding::Context) -> usize {
15576 8
15577 }
15578
15579 #[inline(always)]
15580 fn inline_size(_context: fidl::encoding::Context) -> usize {
15581 16
15582 }
15583 }
15584
15585 unsafe impl
15586 fidl::encoding::Encode<
15587 WlanixGetNl80211Request,
15588 fidl::encoding::DefaultFuchsiaResourceDialect,
15589 > for &mut WlanixGetNl80211Request
15590 {
15591 unsafe fn encode(
15592 self,
15593 encoder: &mut fidl::encoding::Encoder<
15594 '_,
15595 fidl::encoding::DefaultFuchsiaResourceDialect,
15596 >,
15597 offset: usize,
15598 mut depth: fidl::encoding::Depth,
15599 ) -> fidl::Result<()> {
15600 encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
15601 let max_ordinal: u64 = self.max_ordinal_present();
15603 encoder.write_num(max_ordinal, offset);
15604 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15605 if max_ordinal == 0 {
15607 return Ok(());
15608 }
15609 depth.increment()?;
15610 let envelope_size = 8;
15611 let bytes_len = max_ordinal as usize * envelope_size;
15612 #[allow(unused_variables)]
15613 let offset = encoder.out_of_line_offset(bytes_len);
15614 let mut _prev_end_offset: usize = 0;
15615 if 1 > max_ordinal {
15616 return Ok(());
15617 }
15618
15619 let cur_offset: usize = (1 - 1) * envelope_size;
15622
15623 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15625
15626 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15631 self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15632 encoder, offset + cur_offset, depth
15633 )?;
15634
15635 _prev_end_offset = cur_offset + envelope_size;
15636
15637 Ok(())
15638 }
15639 }
15640
15641 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15642 for WlanixGetNl80211Request
15643 {
15644 #[inline(always)]
15645 fn new_empty() -> Self {
15646 Self::default()
15647 }
15648
15649 unsafe fn decode(
15650 &mut self,
15651 decoder: &mut fidl::encoding::Decoder<
15652 '_,
15653 fidl::encoding::DefaultFuchsiaResourceDialect,
15654 >,
15655 offset: usize,
15656 mut depth: fidl::encoding::Depth,
15657 ) -> fidl::Result<()> {
15658 decoder.debug_check_bounds::<Self>(offset);
15659 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15660 None => return Err(fidl::Error::NotNullable),
15661 Some(len) => len,
15662 };
15663 if len == 0 {
15665 return Ok(());
15666 };
15667 depth.increment()?;
15668 let envelope_size = 8;
15669 let bytes_len = len * envelope_size;
15670 let offset = decoder.out_of_line_offset(bytes_len)?;
15671 let mut _next_ordinal_to_read = 0;
15673 let mut next_offset = offset;
15674 let end_offset = offset + bytes_len;
15675 _next_ordinal_to_read += 1;
15676 if next_offset >= end_offset {
15677 return Ok(());
15678 }
15679
15680 while _next_ordinal_to_read < 1 {
15682 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15683 _next_ordinal_to_read += 1;
15684 next_offset += envelope_size;
15685 }
15686
15687 let next_out_of_line = decoder.next_out_of_line();
15688 let handles_before = decoder.remaining_handles();
15689 if let Some((inlined, num_bytes, num_handles)) =
15690 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15691 {
15692 let member_inline_size = <fidl::encoding::Endpoint<
15693 fidl::endpoints::ServerEnd<Nl80211Marker>,
15694 > as fidl::encoding::TypeMarker>::inline_size(
15695 decoder.context
15696 );
15697 if inlined != (member_inline_size <= 4) {
15698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15699 }
15700 let inner_offset;
15701 let mut inner_depth = depth.clone();
15702 if inlined {
15703 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15704 inner_offset = next_offset;
15705 } else {
15706 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15707 inner_depth.increment()?;
15708 }
15709 let val_ref = self.nl80211.get_or_insert_with(|| {
15710 fidl::new_empty!(
15711 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
15712 fidl::encoding::DefaultFuchsiaResourceDialect
15713 )
15714 });
15715 fidl::decode!(
15716 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
15717 fidl::encoding::DefaultFuchsiaResourceDialect,
15718 val_ref,
15719 decoder,
15720 inner_offset,
15721 inner_depth
15722 )?;
15723 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15724 {
15725 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15726 }
15727 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15728 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15729 }
15730 }
15731
15732 next_offset += envelope_size;
15733
15734 while next_offset < end_offset {
15736 _next_ordinal_to_read += 1;
15737 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15738 next_offset += envelope_size;
15739 }
15740
15741 Ok(())
15742 }
15743 }
15744
15745 impl WlanixGetSupplicantRequest {
15746 #[inline(always)]
15747 fn max_ordinal_present(&self) -> u64 {
15748 if let Some(_) = self.supplicant {
15749 return 1;
15750 }
15751 0
15752 }
15753 }
15754
15755 impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
15756 type Borrowed<'a> = &'a mut Self;
15757 fn take_or_borrow<'a>(
15758 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15759 ) -> Self::Borrowed<'a> {
15760 value
15761 }
15762 }
15763
15764 unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
15765 type Owned = Self;
15766
15767 #[inline(always)]
15768 fn inline_align(_context: fidl::encoding::Context) -> usize {
15769 8
15770 }
15771
15772 #[inline(always)]
15773 fn inline_size(_context: fidl::encoding::Context) -> usize {
15774 16
15775 }
15776 }
15777
15778 unsafe impl
15779 fidl::encoding::Encode<
15780 WlanixGetSupplicantRequest,
15781 fidl::encoding::DefaultFuchsiaResourceDialect,
15782 > for &mut WlanixGetSupplicantRequest
15783 {
15784 unsafe fn encode(
15785 self,
15786 encoder: &mut fidl::encoding::Encoder<
15787 '_,
15788 fidl::encoding::DefaultFuchsiaResourceDialect,
15789 >,
15790 offset: usize,
15791 mut depth: fidl::encoding::Depth,
15792 ) -> fidl::Result<()> {
15793 encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
15794 let max_ordinal: u64 = self.max_ordinal_present();
15796 encoder.write_num(max_ordinal, offset);
15797 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15798 if max_ordinal == 0 {
15800 return Ok(());
15801 }
15802 depth.increment()?;
15803 let envelope_size = 8;
15804 let bytes_len = max_ordinal as usize * envelope_size;
15805 #[allow(unused_variables)]
15806 let offset = encoder.out_of_line_offset(bytes_len);
15807 let mut _prev_end_offset: usize = 0;
15808 if 1 > max_ordinal {
15809 return Ok(());
15810 }
15811
15812 let cur_offset: usize = (1 - 1) * envelope_size;
15815
15816 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15818
15819 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15824 self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15825 encoder, offset + cur_offset, depth
15826 )?;
15827
15828 _prev_end_offset = cur_offset + envelope_size;
15829
15830 Ok(())
15831 }
15832 }
15833
15834 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15835 for WlanixGetSupplicantRequest
15836 {
15837 #[inline(always)]
15838 fn new_empty() -> Self {
15839 Self::default()
15840 }
15841
15842 unsafe fn decode(
15843 &mut self,
15844 decoder: &mut fidl::encoding::Decoder<
15845 '_,
15846 fidl::encoding::DefaultFuchsiaResourceDialect,
15847 >,
15848 offset: usize,
15849 mut depth: fidl::encoding::Depth,
15850 ) -> fidl::Result<()> {
15851 decoder.debug_check_bounds::<Self>(offset);
15852 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15853 None => return Err(fidl::Error::NotNullable),
15854 Some(len) => len,
15855 };
15856 if len == 0 {
15858 return Ok(());
15859 };
15860 depth.increment()?;
15861 let envelope_size = 8;
15862 let bytes_len = len * envelope_size;
15863 let offset = decoder.out_of_line_offset(bytes_len)?;
15864 let mut _next_ordinal_to_read = 0;
15866 let mut next_offset = offset;
15867 let end_offset = offset + bytes_len;
15868 _next_ordinal_to_read += 1;
15869 if next_offset >= end_offset {
15870 return Ok(());
15871 }
15872
15873 while _next_ordinal_to_read < 1 {
15875 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15876 _next_ordinal_to_read += 1;
15877 next_offset += envelope_size;
15878 }
15879
15880 let next_out_of_line = decoder.next_out_of_line();
15881 let handles_before = decoder.remaining_handles();
15882 if let Some((inlined, num_bytes, num_handles)) =
15883 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15884 {
15885 let member_inline_size = <fidl::encoding::Endpoint<
15886 fidl::endpoints::ServerEnd<SupplicantMarker>,
15887 > as fidl::encoding::TypeMarker>::inline_size(
15888 decoder.context
15889 );
15890 if inlined != (member_inline_size <= 4) {
15891 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15892 }
15893 let inner_offset;
15894 let mut inner_depth = depth.clone();
15895 if inlined {
15896 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15897 inner_offset = next_offset;
15898 } else {
15899 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15900 inner_depth.increment()?;
15901 }
15902 let val_ref = self.supplicant.get_or_insert_with(|| {
15903 fidl::new_empty!(
15904 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
15905 fidl::encoding::DefaultFuchsiaResourceDialect
15906 )
15907 });
15908 fidl::decode!(
15909 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
15910 fidl::encoding::DefaultFuchsiaResourceDialect,
15911 val_ref,
15912 decoder,
15913 inner_offset,
15914 inner_depth
15915 )?;
15916 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15917 {
15918 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15919 }
15920 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15921 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15922 }
15923 }
15924
15925 next_offset += envelope_size;
15926
15927 while next_offset < end_offset {
15929 _next_ordinal_to_read += 1;
15930 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15931 next_offset += envelope_size;
15932 }
15933
15934 Ok(())
15935 }
15936 }
15937
15938 impl WlanixGetWifiLegacyHalRequest {
15939 #[inline(always)]
15940 fn max_ordinal_present(&self) -> u64 {
15941 if let Some(_) = self.legacy_hal {
15942 return 1;
15943 }
15944 0
15945 }
15946 }
15947
15948 impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
15949 type Borrowed<'a> = &'a mut Self;
15950 fn take_or_borrow<'a>(
15951 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15952 ) -> Self::Borrowed<'a> {
15953 value
15954 }
15955 }
15956
15957 unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
15958 type Owned = Self;
15959
15960 #[inline(always)]
15961 fn inline_align(_context: fidl::encoding::Context) -> usize {
15962 8
15963 }
15964
15965 #[inline(always)]
15966 fn inline_size(_context: fidl::encoding::Context) -> usize {
15967 16
15968 }
15969 }
15970
15971 unsafe impl
15972 fidl::encoding::Encode<
15973 WlanixGetWifiLegacyHalRequest,
15974 fidl::encoding::DefaultFuchsiaResourceDialect,
15975 > for &mut WlanixGetWifiLegacyHalRequest
15976 {
15977 unsafe fn encode(
15978 self,
15979 encoder: &mut fidl::encoding::Encoder<
15980 '_,
15981 fidl::encoding::DefaultFuchsiaResourceDialect,
15982 >,
15983 offset: usize,
15984 mut depth: fidl::encoding::Depth,
15985 ) -> fidl::Result<()> {
15986 encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
15987 let max_ordinal: u64 = self.max_ordinal_present();
15989 encoder.write_num(max_ordinal, offset);
15990 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15991 if max_ordinal == 0 {
15993 return Ok(());
15994 }
15995 depth.increment()?;
15996 let envelope_size = 8;
15997 let bytes_len = max_ordinal as usize * envelope_size;
15998 #[allow(unused_variables)]
15999 let offset = encoder.out_of_line_offset(bytes_len);
16000 let mut _prev_end_offset: usize = 0;
16001 if 1 > max_ordinal {
16002 return Ok(());
16003 }
16004
16005 let cur_offset: usize = (1 - 1) * envelope_size;
16008
16009 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16011
16012 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16017 self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16018 encoder, offset + cur_offset, depth
16019 )?;
16020
16021 _prev_end_offset = cur_offset + envelope_size;
16022
16023 Ok(())
16024 }
16025 }
16026
16027 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16028 for WlanixGetWifiLegacyHalRequest
16029 {
16030 #[inline(always)]
16031 fn new_empty() -> Self {
16032 Self::default()
16033 }
16034
16035 unsafe fn decode(
16036 &mut self,
16037 decoder: &mut fidl::encoding::Decoder<
16038 '_,
16039 fidl::encoding::DefaultFuchsiaResourceDialect,
16040 >,
16041 offset: usize,
16042 mut depth: fidl::encoding::Depth,
16043 ) -> fidl::Result<()> {
16044 decoder.debug_check_bounds::<Self>(offset);
16045 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16046 None => return Err(fidl::Error::NotNullable),
16047 Some(len) => len,
16048 };
16049 if len == 0 {
16051 return Ok(());
16052 };
16053 depth.increment()?;
16054 let envelope_size = 8;
16055 let bytes_len = len * envelope_size;
16056 let offset = decoder.out_of_line_offset(bytes_len)?;
16057 let mut _next_ordinal_to_read = 0;
16059 let mut next_offset = offset;
16060 let end_offset = offset + bytes_len;
16061 _next_ordinal_to_read += 1;
16062 if next_offset >= end_offset {
16063 return Ok(());
16064 }
16065
16066 while _next_ordinal_to_read < 1 {
16068 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16069 _next_ordinal_to_read += 1;
16070 next_offset += envelope_size;
16071 }
16072
16073 let next_out_of_line = decoder.next_out_of_line();
16074 let handles_before = decoder.remaining_handles();
16075 if let Some((inlined, num_bytes, num_handles)) =
16076 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16077 {
16078 let member_inline_size = <fidl::encoding::Endpoint<
16079 fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
16080 > as fidl::encoding::TypeMarker>::inline_size(
16081 decoder.context
16082 );
16083 if inlined != (member_inline_size <= 4) {
16084 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16085 }
16086 let inner_offset;
16087 let mut inner_depth = depth.clone();
16088 if inlined {
16089 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16090 inner_offset = next_offset;
16091 } else {
16092 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16093 inner_depth.increment()?;
16094 }
16095 let val_ref = self.legacy_hal.get_or_insert_with(|| {
16096 fidl::new_empty!(
16097 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16098 fidl::encoding::DefaultFuchsiaResourceDialect
16099 )
16100 });
16101 fidl::decode!(
16102 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16103 fidl::encoding::DefaultFuchsiaResourceDialect,
16104 val_ref,
16105 decoder,
16106 inner_offset,
16107 inner_depth
16108 )?;
16109 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16110 {
16111 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16112 }
16113 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16114 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16115 }
16116 }
16117
16118 next_offset += envelope_size;
16119
16120 while next_offset < end_offset {
16122 _next_ordinal_to_read += 1;
16123 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16124 next_offset += envelope_size;
16125 }
16126
16127 Ok(())
16128 }
16129 }
16130
16131 impl WlanixGetWifiRequest {
16132 #[inline(always)]
16133 fn max_ordinal_present(&self) -> u64 {
16134 if let Some(_) = self.wifi {
16135 return 1;
16136 }
16137 0
16138 }
16139 }
16140
16141 impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
16142 type Borrowed<'a> = &'a mut Self;
16143 fn take_or_borrow<'a>(
16144 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16145 ) -> Self::Borrowed<'a> {
16146 value
16147 }
16148 }
16149
16150 unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
16151 type Owned = Self;
16152
16153 #[inline(always)]
16154 fn inline_align(_context: fidl::encoding::Context) -> usize {
16155 8
16156 }
16157
16158 #[inline(always)]
16159 fn inline_size(_context: fidl::encoding::Context) -> usize {
16160 16
16161 }
16162 }
16163
16164 unsafe impl
16165 fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
16166 for &mut WlanixGetWifiRequest
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::<WlanixGetWifiRequest>(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<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16208 self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> 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 WlanixGetWifiRequest
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<WifiMarker>,
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.wifi.get_or_insert_with(|| {
16287 fidl::new_empty!(
16288 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16289 fidl::encoding::DefaultFuchsiaResourceDialect
16290 )
16291 });
16292 fidl::decode!(
16293 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
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}