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, Default, PartialEq)]
15pub struct Nl80211GetMulticastRequest {
16 pub group: Option<String>,
17 pub multicast: Option<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
18 #[doc(hidden)]
19 pub __source_breaking: fidl::marker::SourceBreaking,
20}
21
22impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
23 for Nl80211GetMulticastRequest
24{
25}
26
27#[derive(Debug, Default, PartialEq)]
28pub struct Nl80211MessageRequest {
29 pub message: Option<Nl80211Message>,
30 #[doc(hidden)]
31 pub __source_breaking: fidl::marker::SourceBreaking,
32}
33
34impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageRequest {}
35
36#[derive(Debug, Default, PartialEq)]
37pub struct Nl80211MulticastMessageRequest {
38 pub message: Option<Nl80211Message>,
39 #[doc(hidden)]
40 pub __source_breaking: fidl::marker::SourceBreaking,
41}
42
43impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
44 for Nl80211MulticastMessageRequest
45{
46}
47
48#[derive(Debug, Default, PartialEq)]
49pub struct Nl80211MessageResponse {
50 pub responses: Option<Vec<Nl80211Message>>,
51 #[doc(hidden)]
52 pub __source_breaking: fidl::marker::SourceBreaking,
53}
54
55impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageResponse {}
56
57#[derive(Debug, Default, PartialEq)]
58pub struct SupplicantAddStaInterfaceRequest {
59 pub iface: Option<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
60 pub iface_name: Option<String>,
61 #[doc(hidden)]
62 pub __source_breaking: fidl::marker::SourceBreaking,
63}
64
65impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
66 for SupplicantAddStaInterfaceRequest
67{
68}
69
70#[derive(Debug, Default, PartialEq)]
71pub struct SupplicantStaIfaceAddNetworkRequest {
72 pub network: Option<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
73 #[doc(hidden)]
74 pub __source_breaking: fidl::marker::SourceBreaking,
75}
76
77impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
78 for SupplicantStaIfaceAddNetworkRequest
79{
80}
81
82#[derive(Debug, Default, PartialEq)]
83pub struct SupplicantStaIfaceRegisterCallbackRequest {
84 pub callback: Option<fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>>,
85 #[doc(hidden)]
86 pub __source_breaking: fidl::marker::SourceBreaking,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
90 for SupplicantStaIfaceRegisterCallbackRequest
91{
92}
93
94#[derive(Debug, Default, PartialEq)]
95pub struct SupplicantStaIfaceSetPowerSaveRequest {
96 pub enable: Option<bool>,
97 #[doc(hidden)]
98 pub __source_breaking: fidl::marker::SourceBreaking,
99}
100
101impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
102 for SupplicantStaIfaceSetPowerSaveRequest
103{
104}
105
106#[derive(Debug, Default, PartialEq)]
107pub struct SupplicantStaIfaceSetStaCountryCodeRequest {
108 pub code: Option<[u8; 2]>,
109 #[doc(hidden)]
110 pub __source_breaking: fidl::marker::SourceBreaking,
111}
112
113impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
114 for SupplicantStaIfaceSetStaCountryCodeRequest
115{
116}
117
118#[derive(Debug, Default, PartialEq)]
119pub struct SupplicantStaIfaceSetSuspendModeEnabledRequest {
120 pub enable: Option<bool>,
121 #[doc(hidden)]
122 pub __source_breaking: fidl::marker::SourceBreaking,
123}
124
125impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
126 for SupplicantStaIfaceSetSuspendModeEnabledRequest
127{
128}
129
130#[derive(Debug, Default, PartialEq)]
131pub struct WifiChipCreateStaIfaceRequest {
132 pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
133 #[doc(hidden)]
134 pub __source_breaking: fidl::marker::SourceBreaking,
135}
136
137impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
138 for WifiChipCreateStaIfaceRequest
139{
140}
141
142#[derive(Debug, Default, PartialEq)]
143pub struct WifiChipGetStaIfaceRequest {
144 pub iface_name: Option<String>,
145 pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
146 #[doc(hidden)]
147 pub __source_breaking: fidl::marker::SourceBreaking,
148}
149
150impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
151 for WifiChipGetStaIfaceRequest
152{
153}
154
155#[derive(Debug, Default, PartialEq)]
156pub struct WifiChipRemoveStaIfaceRequest {
157 pub iface_name: Option<String>,
158 #[doc(hidden)]
159 pub __source_breaking: fidl::marker::SourceBreaking,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
163 for WifiChipRemoveStaIfaceRequest
164{
165}
166
167#[derive(Debug, Default, PartialEq)]
168pub struct WifiChipSetCountryCodeRequest {
169 pub code: Option<[u8; 2]>,
170 #[doc(hidden)]
171 pub __source_breaking: fidl::marker::SourceBreaking,
172}
173
174impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
175 for WifiChipSetCountryCodeRequest
176{
177}
178
179#[derive(Debug, Default, PartialEq)]
180pub struct WifiGetChipRequest {
181 pub chip_id: Option<u32>,
182 pub chip: Option<fidl::endpoints::ServerEnd<WifiChipMarker>>,
183 #[doc(hidden)]
184 pub __source_breaking: fidl::marker::SourceBreaking,
185}
186
187impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WifiGetChipRequest {}
188
189#[derive(Debug, Default, PartialEq)]
190pub struct WifiRegisterEventCallbackRequest {
191 pub callback: Option<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
192 #[doc(hidden)]
193 pub __source_breaking: fidl::marker::SourceBreaking,
194}
195
196impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
197 for WifiRegisterEventCallbackRequest
198{
199}
200
201#[derive(Debug, Default, PartialEq)]
202pub struct WlanixGetNl80211Request {
203 pub nl80211: Option<fidl::endpoints::ServerEnd<Nl80211Marker>>,
204 #[doc(hidden)]
205 pub __source_breaking: fidl::marker::SourceBreaking,
206}
207
208impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetNl80211Request {}
209
210#[derive(Debug, Default, PartialEq)]
211pub struct WlanixGetSupplicantRequest {
212 pub supplicant: Option<fidl::endpoints::ServerEnd<SupplicantMarker>>,
213 #[doc(hidden)]
214 pub __source_breaking: fidl::marker::SourceBreaking,
215}
216
217impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
218 for WlanixGetSupplicantRequest
219{
220}
221
222#[derive(Debug, Default, PartialEq)]
223pub struct WlanixGetWifiRequest {
224 pub wifi: Option<fidl::endpoints::ServerEnd<WifiMarker>>,
225 #[doc(hidden)]
226 pub __source_breaking: fidl::marker::SourceBreaking,
227}
228
229impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetWifiRequest {}
230
231#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
232pub struct Nl80211Marker;
233
234impl fidl::endpoints::ProtocolMarker for Nl80211Marker {
235 type Proxy = Nl80211Proxy;
236 type RequestStream = Nl80211RequestStream;
237 #[cfg(target_os = "fuchsia")]
238 type SynchronousProxy = Nl80211SynchronousProxy;
239
240 const DEBUG_NAME: &'static str = "(anonymous) Nl80211";
241}
242pub type Nl80211MessageResult = Result<Nl80211MessageResponse, i32>;
243
244pub trait Nl80211ProxyInterface: Send + Sync {
245 fn r#get_multicast(&self, payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error>;
246 type MessageResponseFut: std::future::Future<Output = Result<Nl80211MessageResult, fidl::Error>>
247 + Send;
248 fn r#message(&self, payload: Nl80211MessageRequest) -> Self::MessageResponseFut;
249}
250#[derive(Debug)]
251#[cfg(target_os = "fuchsia")]
252pub struct Nl80211SynchronousProxy {
253 client: fidl::client::sync::Client,
254}
255
256#[cfg(target_os = "fuchsia")]
257impl fidl::endpoints::SynchronousProxy for Nl80211SynchronousProxy {
258 type Proxy = Nl80211Proxy;
259 type Protocol = Nl80211Marker;
260
261 fn from_channel(inner: fidl::Channel) -> Self {
262 Self::new(inner)
263 }
264
265 fn into_channel(self) -> fidl::Channel {
266 self.client.into_channel()
267 }
268
269 fn as_channel(&self) -> &fidl::Channel {
270 self.client.as_channel()
271 }
272}
273
274#[cfg(target_os = "fuchsia")]
275impl Nl80211SynchronousProxy {
276 pub fn new(channel: fidl::Channel) -> Self {
277 let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
278 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
279 }
280
281 pub fn into_channel(self) -> fidl::Channel {
282 self.client.into_channel()
283 }
284
285 pub fn wait_for_event(
288 &self,
289 deadline: zx::MonotonicInstant,
290 ) -> Result<Nl80211Event, fidl::Error> {
291 Nl80211Event::decode(self.client.wait_for_event(deadline)?)
292 }
293
294 pub fn r#get_multicast(
295 &self,
296 mut payload: Nl80211GetMulticastRequest,
297 ) -> Result<(), fidl::Error> {
298 self.client.send::<Nl80211GetMulticastRequest>(
299 &mut payload,
300 0x58b73dd089681dc2,
301 fidl::encoding::DynamicFlags::FLEXIBLE,
302 )
303 }
304
305 pub fn r#message(
306 &self,
307 mut payload: Nl80211MessageRequest,
308 ___deadline: zx::MonotonicInstant,
309 ) -> Result<Nl80211MessageResult, fidl::Error> {
310 let _response = self.client.send_query::<
311 Nl80211MessageRequest,
312 fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
313 >(
314 &mut payload,
315 0x6336259e15bb3795,
316 fidl::encoding::DynamicFlags::FLEXIBLE,
317 ___deadline,
318 )?
319 .into_result::<Nl80211Marker>("message")?;
320 Ok(_response.map(|x| x))
321 }
322}
323
324#[cfg(target_os = "fuchsia")]
325impl From<Nl80211SynchronousProxy> for zx::Handle {
326 fn from(value: Nl80211SynchronousProxy) -> Self {
327 value.into_channel().into()
328 }
329}
330
331#[cfg(target_os = "fuchsia")]
332impl From<fidl::Channel> for Nl80211SynchronousProxy {
333 fn from(value: fidl::Channel) -> Self {
334 Self::new(value)
335 }
336}
337
338#[derive(Debug, Clone)]
339pub struct Nl80211Proxy {
340 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
341}
342
343impl fidl::endpoints::Proxy for Nl80211Proxy {
344 type Protocol = Nl80211Marker;
345
346 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
347 Self::new(inner)
348 }
349
350 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
351 self.client.into_channel().map_err(|client| Self { client })
352 }
353
354 fn as_channel(&self) -> &::fidl::AsyncChannel {
355 self.client.as_channel()
356 }
357}
358
359impl Nl80211Proxy {
360 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
362 let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
363 Self { client: fidl::client::Client::new(channel, protocol_name) }
364 }
365
366 pub fn take_event_stream(&self) -> Nl80211EventStream {
372 Nl80211EventStream { event_receiver: self.client.take_event_receiver() }
373 }
374
375 pub fn r#get_multicast(
376 &self,
377 mut payload: Nl80211GetMulticastRequest,
378 ) -> Result<(), fidl::Error> {
379 Nl80211ProxyInterface::r#get_multicast(self, payload)
380 }
381
382 pub fn r#message(
383 &self,
384 mut payload: Nl80211MessageRequest,
385 ) -> fidl::client::QueryResponseFut<
386 Nl80211MessageResult,
387 fidl::encoding::DefaultFuchsiaResourceDialect,
388 > {
389 Nl80211ProxyInterface::r#message(self, payload)
390 }
391}
392
393impl Nl80211ProxyInterface for Nl80211Proxy {
394 fn r#get_multicast(&self, mut payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error> {
395 self.client.send::<Nl80211GetMulticastRequest>(
396 &mut payload,
397 0x58b73dd089681dc2,
398 fidl::encoding::DynamicFlags::FLEXIBLE,
399 )
400 }
401
402 type MessageResponseFut = fidl::client::QueryResponseFut<
403 Nl80211MessageResult,
404 fidl::encoding::DefaultFuchsiaResourceDialect,
405 >;
406 fn r#message(&self, mut payload: Nl80211MessageRequest) -> Self::MessageResponseFut {
407 fn _decode(
408 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
409 ) -> Result<Nl80211MessageResult, fidl::Error> {
410 let _response = fidl::client::decode_transaction_body::<
411 fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
412 fidl::encoding::DefaultFuchsiaResourceDialect,
413 0x6336259e15bb3795,
414 >(_buf?)?
415 .into_result::<Nl80211Marker>("message")?;
416 Ok(_response.map(|x| x))
417 }
418 self.client.send_query_and_decode::<Nl80211MessageRequest, Nl80211MessageResult>(
419 &mut payload,
420 0x6336259e15bb3795,
421 fidl::encoding::DynamicFlags::FLEXIBLE,
422 _decode,
423 )
424 }
425}
426
427pub struct Nl80211EventStream {
428 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
429}
430
431impl std::marker::Unpin for Nl80211EventStream {}
432
433impl futures::stream::FusedStream for Nl80211EventStream {
434 fn is_terminated(&self) -> bool {
435 self.event_receiver.is_terminated()
436 }
437}
438
439impl futures::Stream for Nl80211EventStream {
440 type Item = Result<Nl80211Event, fidl::Error>;
441
442 fn poll_next(
443 mut self: std::pin::Pin<&mut Self>,
444 cx: &mut std::task::Context<'_>,
445 ) -> std::task::Poll<Option<Self::Item>> {
446 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
447 &mut self.event_receiver,
448 cx
449 )?) {
450 Some(buf) => std::task::Poll::Ready(Some(Nl80211Event::decode(buf))),
451 None => std::task::Poll::Ready(None),
452 }
453 }
454}
455
456#[derive(Debug)]
457pub enum Nl80211Event {
458 #[non_exhaustive]
459 _UnknownEvent {
460 ordinal: u64,
462 },
463}
464
465impl Nl80211Event {
466 fn decode(
468 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
469 ) -> Result<Nl80211Event, fidl::Error> {
470 let (bytes, _handles) = buf.split_mut();
471 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
472 debug_assert_eq!(tx_header.tx_id, 0);
473 match tx_header.ordinal {
474 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
475 Ok(Nl80211Event::_UnknownEvent { ordinal: tx_header.ordinal })
476 }
477 _ => Err(fidl::Error::UnknownOrdinal {
478 ordinal: tx_header.ordinal,
479 protocol_name: <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
480 }),
481 }
482 }
483}
484
485pub struct Nl80211RequestStream {
487 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
488 is_terminated: bool,
489}
490
491impl std::marker::Unpin for Nl80211RequestStream {}
492
493impl futures::stream::FusedStream for Nl80211RequestStream {
494 fn is_terminated(&self) -> bool {
495 self.is_terminated
496 }
497}
498
499impl fidl::endpoints::RequestStream for Nl80211RequestStream {
500 type Protocol = Nl80211Marker;
501 type ControlHandle = Nl80211ControlHandle;
502
503 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
504 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
505 }
506
507 fn control_handle(&self) -> Self::ControlHandle {
508 Nl80211ControlHandle { inner: self.inner.clone() }
509 }
510
511 fn into_inner(
512 self,
513 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
514 {
515 (self.inner, self.is_terminated)
516 }
517
518 fn from_inner(
519 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
520 is_terminated: bool,
521 ) -> Self {
522 Self { inner, is_terminated }
523 }
524}
525
526impl futures::Stream for Nl80211RequestStream {
527 type Item = Result<Nl80211Request, fidl::Error>;
528
529 fn poll_next(
530 mut self: std::pin::Pin<&mut Self>,
531 cx: &mut std::task::Context<'_>,
532 ) -> std::task::Poll<Option<Self::Item>> {
533 let this = &mut *self;
534 if this.inner.check_shutdown(cx) {
535 this.is_terminated = true;
536 return std::task::Poll::Ready(None);
537 }
538 if this.is_terminated {
539 panic!("polled Nl80211RequestStream after completion");
540 }
541 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
542 |bytes, handles| {
543 match this.inner.channel().read_etc(cx, bytes, handles) {
544 std::task::Poll::Ready(Ok(())) => {}
545 std::task::Poll::Pending => return std::task::Poll::Pending,
546 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
547 this.is_terminated = true;
548 return std::task::Poll::Ready(None);
549 }
550 std::task::Poll::Ready(Err(e)) => {
551 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
552 e.into(),
553 ))))
554 }
555 }
556
557 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
559
560 std::task::Poll::Ready(Some(match header.ordinal {
561 0x58b73dd089681dc2 => {
562 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
563 let mut req = fidl::new_empty!(
564 Nl80211GetMulticastRequest,
565 fidl::encoding::DefaultFuchsiaResourceDialect
566 );
567 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211GetMulticastRequest>(&header, _body_bytes, handles, &mut req)?;
568 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
569 Ok(Nl80211Request::GetMulticast { payload: req, control_handle })
570 }
571 0x6336259e15bb3795 => {
572 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
573 let mut req = fidl::new_empty!(
574 Nl80211MessageRequest,
575 fidl::encoding::DefaultFuchsiaResourceDialect
576 );
577 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageRequest>(&header, _body_bytes, handles, &mut req)?;
578 let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
579 Ok(Nl80211Request::Message {
580 payload: req,
581 responder: Nl80211MessageResponder {
582 control_handle: std::mem::ManuallyDrop::new(control_handle),
583 tx_id: header.tx_id,
584 },
585 })
586 }
587 _ if header.tx_id == 0
588 && header
589 .dynamic_flags()
590 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
591 {
592 Ok(Nl80211Request::_UnknownMethod {
593 ordinal: header.ordinal,
594 control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
595 method_type: fidl::MethodType::OneWay,
596 })
597 }
598 _ if header
599 .dynamic_flags()
600 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
601 {
602 this.inner.send_framework_err(
603 fidl::encoding::FrameworkErr::UnknownMethod,
604 header.tx_id,
605 header.ordinal,
606 header.dynamic_flags(),
607 (bytes, handles),
608 )?;
609 Ok(Nl80211Request::_UnknownMethod {
610 ordinal: header.ordinal,
611 control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
612 method_type: fidl::MethodType::TwoWay,
613 })
614 }
615 _ => Err(fidl::Error::UnknownOrdinal {
616 ordinal: header.ordinal,
617 protocol_name:
618 <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
619 }),
620 }))
621 },
622 )
623 }
624}
625
626#[derive(Debug)]
627pub enum Nl80211Request {
628 GetMulticast {
629 payload: Nl80211GetMulticastRequest,
630 control_handle: Nl80211ControlHandle,
631 },
632 Message {
633 payload: Nl80211MessageRequest,
634 responder: Nl80211MessageResponder,
635 },
636 #[non_exhaustive]
638 _UnknownMethod {
639 ordinal: u64,
641 control_handle: Nl80211ControlHandle,
642 method_type: fidl::MethodType,
643 },
644}
645
646impl Nl80211Request {
647 #[allow(irrefutable_let_patterns)]
648 pub fn into_get_multicast(self) -> Option<(Nl80211GetMulticastRequest, Nl80211ControlHandle)> {
649 if let Nl80211Request::GetMulticast { payload, control_handle } = self {
650 Some((payload, control_handle))
651 } else {
652 None
653 }
654 }
655
656 #[allow(irrefutable_let_patterns)]
657 pub fn into_message(self) -> Option<(Nl80211MessageRequest, Nl80211MessageResponder)> {
658 if let Nl80211Request::Message { payload, responder } = self {
659 Some((payload, responder))
660 } else {
661 None
662 }
663 }
664
665 pub fn method_name(&self) -> &'static str {
667 match *self {
668 Nl80211Request::GetMulticast { .. } => "get_multicast",
669 Nl80211Request::Message { .. } => "message",
670 Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
671 "unknown one-way method"
672 }
673 Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
674 "unknown two-way method"
675 }
676 }
677 }
678}
679
680#[derive(Debug, Clone)]
681pub struct Nl80211ControlHandle {
682 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
683}
684
685impl fidl::endpoints::ControlHandle for Nl80211ControlHandle {
686 fn shutdown(&self) {
687 self.inner.shutdown()
688 }
689 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
690 self.inner.shutdown_with_epitaph(status)
691 }
692
693 fn is_closed(&self) -> bool {
694 self.inner.channel().is_closed()
695 }
696 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
697 self.inner.channel().on_closed()
698 }
699
700 #[cfg(target_os = "fuchsia")]
701 fn signal_peer(
702 &self,
703 clear_mask: zx::Signals,
704 set_mask: zx::Signals,
705 ) -> Result<(), zx_status::Status> {
706 use fidl::Peered;
707 self.inner.channel().signal_peer(clear_mask, set_mask)
708 }
709}
710
711impl Nl80211ControlHandle {}
712
713#[must_use = "FIDL methods require a response to be sent"]
714#[derive(Debug)]
715pub struct Nl80211MessageResponder {
716 control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
717 tx_id: u32,
718}
719
720impl std::ops::Drop for Nl80211MessageResponder {
724 fn drop(&mut self) {
725 self.control_handle.shutdown();
726 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
728 }
729}
730
731impl fidl::endpoints::Responder for Nl80211MessageResponder {
732 type ControlHandle = Nl80211ControlHandle;
733
734 fn control_handle(&self) -> &Nl80211ControlHandle {
735 &self.control_handle
736 }
737
738 fn drop_without_shutdown(mut self) {
739 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
741 std::mem::forget(self);
743 }
744}
745
746impl Nl80211MessageResponder {
747 pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
751 let _result = self.send_raw(result);
752 if _result.is_err() {
753 self.control_handle.shutdown();
754 }
755 self.drop_without_shutdown();
756 _result
757 }
758
759 pub fn send_no_shutdown_on_err(
761 self,
762 mut result: Result<Nl80211MessageResponse, i32>,
763 ) -> Result<(), fidl::Error> {
764 let _result = self.send_raw(result);
765 self.drop_without_shutdown();
766 _result
767 }
768
769 fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
770 self.control_handle
771 .inner
772 .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
773 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
774 self.tx_id,
775 0x6336259e15bb3795,
776 fidl::encoding::DynamicFlags::FLEXIBLE,
777 )
778 }
779}
780
781#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
782pub struct Nl80211MulticastMarker;
783
784impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
785 type Proxy = Nl80211MulticastProxy;
786 type RequestStream = Nl80211MulticastRequestStream;
787 #[cfg(target_os = "fuchsia")]
788 type SynchronousProxy = Nl80211MulticastSynchronousProxy;
789
790 const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
791}
792
793pub trait Nl80211MulticastProxyInterface: Send + Sync {
794 fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
795}
796#[derive(Debug)]
797#[cfg(target_os = "fuchsia")]
798pub struct Nl80211MulticastSynchronousProxy {
799 client: fidl::client::sync::Client,
800}
801
802#[cfg(target_os = "fuchsia")]
803impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
804 type Proxy = Nl80211MulticastProxy;
805 type Protocol = Nl80211MulticastMarker;
806
807 fn from_channel(inner: fidl::Channel) -> Self {
808 Self::new(inner)
809 }
810
811 fn into_channel(self) -> fidl::Channel {
812 self.client.into_channel()
813 }
814
815 fn as_channel(&self) -> &fidl::Channel {
816 self.client.as_channel()
817 }
818}
819
820#[cfg(target_os = "fuchsia")]
821impl Nl80211MulticastSynchronousProxy {
822 pub fn new(channel: fidl::Channel) -> Self {
823 let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
824 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
825 }
826
827 pub fn into_channel(self) -> fidl::Channel {
828 self.client.into_channel()
829 }
830
831 pub fn wait_for_event(
834 &self,
835 deadline: zx::MonotonicInstant,
836 ) -> Result<Nl80211MulticastEvent, fidl::Error> {
837 Nl80211MulticastEvent::decode(self.client.wait_for_event(deadline)?)
838 }
839
840 pub fn r#message(
841 &self,
842 mut payload: Nl80211MulticastMessageRequest,
843 ) -> Result<(), fidl::Error> {
844 self.client.send::<Nl80211MulticastMessageRequest>(
845 &mut payload,
846 0x4cc9241f302f16c0,
847 fidl::encoding::DynamicFlags::FLEXIBLE,
848 )
849 }
850}
851
852#[cfg(target_os = "fuchsia")]
853impl From<Nl80211MulticastSynchronousProxy> for zx::Handle {
854 fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
855 value.into_channel().into()
856 }
857}
858
859#[cfg(target_os = "fuchsia")]
860impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
861 fn from(value: fidl::Channel) -> Self {
862 Self::new(value)
863 }
864}
865
866#[derive(Debug, Clone)]
867pub struct Nl80211MulticastProxy {
868 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
869}
870
871impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
872 type Protocol = Nl80211MulticastMarker;
873
874 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
875 Self::new(inner)
876 }
877
878 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
879 self.client.into_channel().map_err(|client| Self { client })
880 }
881
882 fn as_channel(&self) -> &::fidl::AsyncChannel {
883 self.client.as_channel()
884 }
885}
886
887impl Nl80211MulticastProxy {
888 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
890 let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
891 Self { client: fidl::client::Client::new(channel, protocol_name) }
892 }
893
894 pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
900 Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
901 }
902
903 pub fn r#message(
904 &self,
905 mut payload: Nl80211MulticastMessageRequest,
906 ) -> Result<(), fidl::Error> {
907 Nl80211MulticastProxyInterface::r#message(self, payload)
908 }
909}
910
911impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
912 fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
913 self.client.send::<Nl80211MulticastMessageRequest>(
914 &mut payload,
915 0x4cc9241f302f16c0,
916 fidl::encoding::DynamicFlags::FLEXIBLE,
917 )
918 }
919}
920
921pub struct Nl80211MulticastEventStream {
922 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
923}
924
925impl std::marker::Unpin for Nl80211MulticastEventStream {}
926
927impl futures::stream::FusedStream for Nl80211MulticastEventStream {
928 fn is_terminated(&self) -> bool {
929 self.event_receiver.is_terminated()
930 }
931}
932
933impl futures::Stream for Nl80211MulticastEventStream {
934 type Item = Result<Nl80211MulticastEvent, fidl::Error>;
935
936 fn poll_next(
937 mut self: std::pin::Pin<&mut Self>,
938 cx: &mut std::task::Context<'_>,
939 ) -> std::task::Poll<Option<Self::Item>> {
940 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
941 &mut self.event_receiver,
942 cx
943 )?) {
944 Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
945 None => std::task::Poll::Ready(None),
946 }
947 }
948}
949
950#[derive(Debug)]
951pub enum Nl80211MulticastEvent {
952 #[non_exhaustive]
953 _UnknownEvent {
954 ordinal: u64,
956 },
957}
958
959impl Nl80211MulticastEvent {
960 fn decode(
962 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
963 ) -> Result<Nl80211MulticastEvent, fidl::Error> {
964 let (bytes, _handles) = buf.split_mut();
965 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
966 debug_assert_eq!(tx_header.tx_id, 0);
967 match tx_header.ordinal {
968 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
969 Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
970 }
971 _ => Err(fidl::Error::UnknownOrdinal {
972 ordinal: tx_header.ordinal,
973 protocol_name:
974 <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
975 }),
976 }
977 }
978}
979
980pub struct Nl80211MulticastRequestStream {
982 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
983 is_terminated: bool,
984}
985
986impl std::marker::Unpin for Nl80211MulticastRequestStream {}
987
988impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
989 fn is_terminated(&self) -> bool {
990 self.is_terminated
991 }
992}
993
994impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
995 type Protocol = Nl80211MulticastMarker;
996 type ControlHandle = Nl80211MulticastControlHandle;
997
998 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
999 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1000 }
1001
1002 fn control_handle(&self) -> Self::ControlHandle {
1003 Nl80211MulticastControlHandle { inner: self.inner.clone() }
1004 }
1005
1006 fn into_inner(
1007 self,
1008 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1009 {
1010 (self.inner, self.is_terminated)
1011 }
1012
1013 fn from_inner(
1014 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1015 is_terminated: bool,
1016 ) -> Self {
1017 Self { inner, is_terminated }
1018 }
1019}
1020
1021impl futures::Stream for Nl80211MulticastRequestStream {
1022 type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1023
1024 fn poll_next(
1025 mut self: std::pin::Pin<&mut Self>,
1026 cx: &mut std::task::Context<'_>,
1027 ) -> std::task::Poll<Option<Self::Item>> {
1028 let this = &mut *self;
1029 if this.inner.check_shutdown(cx) {
1030 this.is_terminated = true;
1031 return std::task::Poll::Ready(None);
1032 }
1033 if this.is_terminated {
1034 panic!("polled Nl80211MulticastRequestStream after completion");
1035 }
1036 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1037 |bytes, handles| {
1038 match this.inner.channel().read_etc(cx, bytes, handles) {
1039 std::task::Poll::Ready(Ok(())) => {}
1040 std::task::Poll::Pending => return std::task::Poll::Pending,
1041 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1042 this.is_terminated = true;
1043 return std::task::Poll::Ready(None);
1044 }
1045 std::task::Poll::Ready(Err(e)) => {
1046 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1047 e.into(),
1048 ))))
1049 }
1050 }
1051
1052 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1054
1055 std::task::Poll::Ready(Some(match header.ordinal {
1056 0x4cc9241f302f16c0 => {
1057 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1058 let mut req = fidl::new_empty!(
1059 Nl80211MulticastMessageRequest,
1060 fidl::encoding::DefaultFuchsiaResourceDialect
1061 );
1062 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1063 let control_handle =
1064 Nl80211MulticastControlHandle { inner: this.inner.clone() };
1065 Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1066 }
1067 _ if header.tx_id == 0
1068 && header
1069 .dynamic_flags()
1070 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1071 {
1072 Ok(Nl80211MulticastRequest::_UnknownMethod {
1073 ordinal: header.ordinal,
1074 control_handle: Nl80211MulticastControlHandle {
1075 inner: this.inner.clone(),
1076 },
1077 method_type: fidl::MethodType::OneWay,
1078 })
1079 }
1080 _ if header
1081 .dynamic_flags()
1082 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1083 {
1084 this.inner.send_framework_err(
1085 fidl::encoding::FrameworkErr::UnknownMethod,
1086 header.tx_id,
1087 header.ordinal,
1088 header.dynamic_flags(),
1089 (bytes, handles),
1090 )?;
1091 Ok(Nl80211MulticastRequest::_UnknownMethod {
1092 ordinal: header.ordinal,
1093 control_handle: Nl80211MulticastControlHandle {
1094 inner: this.inner.clone(),
1095 },
1096 method_type: fidl::MethodType::TwoWay,
1097 })
1098 }
1099 _ => Err(fidl::Error::UnknownOrdinal {
1100 ordinal: header.ordinal,
1101 protocol_name:
1102 <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1103 }),
1104 }))
1105 },
1106 )
1107 }
1108}
1109
1110#[derive(Debug)]
1111pub enum Nl80211MulticastRequest {
1112 Message {
1113 payload: Nl80211MulticastMessageRequest,
1114 control_handle: Nl80211MulticastControlHandle,
1115 },
1116 #[non_exhaustive]
1118 _UnknownMethod {
1119 ordinal: u64,
1121 control_handle: Nl80211MulticastControlHandle,
1122 method_type: fidl::MethodType,
1123 },
1124}
1125
1126impl Nl80211MulticastRequest {
1127 #[allow(irrefutable_let_patterns)]
1128 pub fn into_message(
1129 self,
1130 ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1131 if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1132 Some((payload, control_handle))
1133 } else {
1134 None
1135 }
1136 }
1137
1138 pub fn method_name(&self) -> &'static str {
1140 match *self {
1141 Nl80211MulticastRequest::Message { .. } => "message",
1142 Nl80211MulticastRequest::_UnknownMethod {
1143 method_type: fidl::MethodType::OneWay,
1144 ..
1145 } => "unknown one-way method",
1146 Nl80211MulticastRequest::_UnknownMethod {
1147 method_type: fidl::MethodType::TwoWay,
1148 ..
1149 } => "unknown two-way method",
1150 }
1151 }
1152}
1153
1154#[derive(Debug, Clone)]
1155pub struct Nl80211MulticastControlHandle {
1156 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1157}
1158
1159impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1160 fn shutdown(&self) {
1161 self.inner.shutdown()
1162 }
1163 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1164 self.inner.shutdown_with_epitaph(status)
1165 }
1166
1167 fn is_closed(&self) -> bool {
1168 self.inner.channel().is_closed()
1169 }
1170 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1171 self.inner.channel().on_closed()
1172 }
1173
1174 #[cfg(target_os = "fuchsia")]
1175 fn signal_peer(
1176 &self,
1177 clear_mask: zx::Signals,
1178 set_mask: zx::Signals,
1179 ) -> Result<(), zx_status::Status> {
1180 use fidl::Peered;
1181 self.inner.channel().signal_peer(clear_mask, set_mask)
1182 }
1183}
1184
1185impl Nl80211MulticastControlHandle {}
1186
1187#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1188pub struct SupplicantMarker;
1189
1190impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1191 type Proxy = SupplicantProxy;
1192 type RequestStream = SupplicantRequestStream;
1193 #[cfg(target_os = "fuchsia")]
1194 type SynchronousProxy = SupplicantSynchronousProxy;
1195
1196 const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1197}
1198
1199pub trait SupplicantProxyInterface: Send + Sync {
1200 fn r#add_sta_interface(
1201 &self,
1202 payload: SupplicantAddStaInterfaceRequest,
1203 ) -> Result<(), fidl::Error>;
1204}
1205#[derive(Debug)]
1206#[cfg(target_os = "fuchsia")]
1207pub struct SupplicantSynchronousProxy {
1208 client: fidl::client::sync::Client,
1209}
1210
1211#[cfg(target_os = "fuchsia")]
1212impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1213 type Proxy = SupplicantProxy;
1214 type Protocol = SupplicantMarker;
1215
1216 fn from_channel(inner: fidl::Channel) -> Self {
1217 Self::new(inner)
1218 }
1219
1220 fn into_channel(self) -> fidl::Channel {
1221 self.client.into_channel()
1222 }
1223
1224 fn as_channel(&self) -> &fidl::Channel {
1225 self.client.as_channel()
1226 }
1227}
1228
1229#[cfg(target_os = "fuchsia")]
1230impl SupplicantSynchronousProxy {
1231 pub fn new(channel: fidl::Channel) -> Self {
1232 let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1233 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1234 }
1235
1236 pub fn into_channel(self) -> fidl::Channel {
1237 self.client.into_channel()
1238 }
1239
1240 pub fn wait_for_event(
1243 &self,
1244 deadline: zx::MonotonicInstant,
1245 ) -> Result<SupplicantEvent, fidl::Error> {
1246 SupplicantEvent::decode(self.client.wait_for_event(deadline)?)
1247 }
1248
1249 pub fn r#add_sta_interface(
1250 &self,
1251 mut payload: SupplicantAddStaInterfaceRequest,
1252 ) -> Result<(), fidl::Error> {
1253 self.client.send::<SupplicantAddStaInterfaceRequest>(
1254 &mut payload,
1255 0x73194b2afe9b367e,
1256 fidl::encoding::DynamicFlags::FLEXIBLE,
1257 )
1258 }
1259}
1260
1261#[cfg(target_os = "fuchsia")]
1262impl From<SupplicantSynchronousProxy> for zx::Handle {
1263 fn from(value: SupplicantSynchronousProxy) -> Self {
1264 value.into_channel().into()
1265 }
1266}
1267
1268#[cfg(target_os = "fuchsia")]
1269impl From<fidl::Channel> for SupplicantSynchronousProxy {
1270 fn from(value: fidl::Channel) -> Self {
1271 Self::new(value)
1272 }
1273}
1274
1275#[derive(Debug, Clone)]
1276pub struct SupplicantProxy {
1277 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1278}
1279
1280impl fidl::endpoints::Proxy for SupplicantProxy {
1281 type Protocol = SupplicantMarker;
1282
1283 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1284 Self::new(inner)
1285 }
1286
1287 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1288 self.client.into_channel().map_err(|client| Self { client })
1289 }
1290
1291 fn as_channel(&self) -> &::fidl::AsyncChannel {
1292 self.client.as_channel()
1293 }
1294}
1295
1296impl SupplicantProxy {
1297 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1299 let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1300 Self { client: fidl::client::Client::new(channel, protocol_name) }
1301 }
1302
1303 pub fn take_event_stream(&self) -> SupplicantEventStream {
1309 SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1310 }
1311
1312 pub fn r#add_sta_interface(
1313 &self,
1314 mut payload: SupplicantAddStaInterfaceRequest,
1315 ) -> Result<(), fidl::Error> {
1316 SupplicantProxyInterface::r#add_sta_interface(self, payload)
1317 }
1318}
1319
1320impl SupplicantProxyInterface for SupplicantProxy {
1321 fn r#add_sta_interface(
1322 &self,
1323 mut payload: SupplicantAddStaInterfaceRequest,
1324 ) -> Result<(), fidl::Error> {
1325 self.client.send::<SupplicantAddStaInterfaceRequest>(
1326 &mut payload,
1327 0x73194b2afe9b367e,
1328 fidl::encoding::DynamicFlags::FLEXIBLE,
1329 )
1330 }
1331}
1332
1333pub struct SupplicantEventStream {
1334 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1335}
1336
1337impl std::marker::Unpin for SupplicantEventStream {}
1338
1339impl futures::stream::FusedStream for SupplicantEventStream {
1340 fn is_terminated(&self) -> bool {
1341 self.event_receiver.is_terminated()
1342 }
1343}
1344
1345impl futures::Stream for SupplicantEventStream {
1346 type Item = Result<SupplicantEvent, fidl::Error>;
1347
1348 fn poll_next(
1349 mut self: std::pin::Pin<&mut Self>,
1350 cx: &mut std::task::Context<'_>,
1351 ) -> std::task::Poll<Option<Self::Item>> {
1352 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1353 &mut self.event_receiver,
1354 cx
1355 )?) {
1356 Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1357 None => std::task::Poll::Ready(None),
1358 }
1359 }
1360}
1361
1362#[derive(Debug)]
1363pub enum SupplicantEvent {
1364 #[non_exhaustive]
1365 _UnknownEvent {
1366 ordinal: u64,
1368 },
1369}
1370
1371impl SupplicantEvent {
1372 fn decode(
1374 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1375 ) -> Result<SupplicantEvent, fidl::Error> {
1376 let (bytes, _handles) = buf.split_mut();
1377 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1378 debug_assert_eq!(tx_header.tx_id, 0);
1379 match tx_header.ordinal {
1380 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1381 Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1382 }
1383 _ => Err(fidl::Error::UnknownOrdinal {
1384 ordinal: tx_header.ordinal,
1385 protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1386 }),
1387 }
1388 }
1389}
1390
1391pub struct SupplicantRequestStream {
1393 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1394 is_terminated: bool,
1395}
1396
1397impl std::marker::Unpin for SupplicantRequestStream {}
1398
1399impl futures::stream::FusedStream for SupplicantRequestStream {
1400 fn is_terminated(&self) -> bool {
1401 self.is_terminated
1402 }
1403}
1404
1405impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1406 type Protocol = SupplicantMarker;
1407 type ControlHandle = SupplicantControlHandle;
1408
1409 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1410 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1411 }
1412
1413 fn control_handle(&self) -> Self::ControlHandle {
1414 SupplicantControlHandle { inner: self.inner.clone() }
1415 }
1416
1417 fn into_inner(
1418 self,
1419 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1420 {
1421 (self.inner, self.is_terminated)
1422 }
1423
1424 fn from_inner(
1425 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1426 is_terminated: bool,
1427 ) -> Self {
1428 Self { inner, is_terminated }
1429 }
1430}
1431
1432impl futures::Stream for SupplicantRequestStream {
1433 type Item = Result<SupplicantRequest, fidl::Error>;
1434
1435 fn poll_next(
1436 mut self: std::pin::Pin<&mut Self>,
1437 cx: &mut std::task::Context<'_>,
1438 ) -> std::task::Poll<Option<Self::Item>> {
1439 let this = &mut *self;
1440 if this.inner.check_shutdown(cx) {
1441 this.is_terminated = true;
1442 return std::task::Poll::Ready(None);
1443 }
1444 if this.is_terminated {
1445 panic!("polled SupplicantRequestStream after completion");
1446 }
1447 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1448 |bytes, handles| {
1449 match this.inner.channel().read_etc(cx, bytes, handles) {
1450 std::task::Poll::Ready(Ok(())) => {}
1451 std::task::Poll::Pending => return std::task::Poll::Pending,
1452 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1453 this.is_terminated = true;
1454 return std::task::Poll::Ready(None);
1455 }
1456 std::task::Poll::Ready(Err(e)) => {
1457 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1458 e.into(),
1459 ))))
1460 }
1461 }
1462
1463 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1465
1466 std::task::Poll::Ready(Some(match header.ordinal {
1467 0x73194b2afe9b367e => {
1468 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1469 let mut req = fidl::new_empty!(
1470 SupplicantAddStaInterfaceRequest,
1471 fidl::encoding::DefaultFuchsiaResourceDialect
1472 );
1473 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1474 let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1475 Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1476 }
1477 _ if header.tx_id == 0
1478 && header
1479 .dynamic_flags()
1480 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1481 {
1482 Ok(SupplicantRequest::_UnknownMethod {
1483 ordinal: header.ordinal,
1484 control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1485 method_type: fidl::MethodType::OneWay,
1486 })
1487 }
1488 _ if header
1489 .dynamic_flags()
1490 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1491 {
1492 this.inner.send_framework_err(
1493 fidl::encoding::FrameworkErr::UnknownMethod,
1494 header.tx_id,
1495 header.ordinal,
1496 header.dynamic_flags(),
1497 (bytes, handles),
1498 )?;
1499 Ok(SupplicantRequest::_UnknownMethod {
1500 ordinal: header.ordinal,
1501 control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1502 method_type: fidl::MethodType::TwoWay,
1503 })
1504 }
1505 _ => Err(fidl::Error::UnknownOrdinal {
1506 ordinal: header.ordinal,
1507 protocol_name:
1508 <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1509 }),
1510 }))
1511 },
1512 )
1513 }
1514}
1515
1516#[derive(Debug)]
1517pub enum SupplicantRequest {
1518 AddStaInterface {
1519 payload: SupplicantAddStaInterfaceRequest,
1520 control_handle: SupplicantControlHandle,
1521 },
1522 #[non_exhaustive]
1524 _UnknownMethod {
1525 ordinal: u64,
1527 control_handle: SupplicantControlHandle,
1528 method_type: fidl::MethodType,
1529 },
1530}
1531
1532impl SupplicantRequest {
1533 #[allow(irrefutable_let_patterns)]
1534 pub fn into_add_sta_interface(
1535 self,
1536 ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1537 if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1538 Some((payload, control_handle))
1539 } else {
1540 None
1541 }
1542 }
1543
1544 pub fn method_name(&self) -> &'static str {
1546 match *self {
1547 SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1548 SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1549 "unknown one-way method"
1550 }
1551 SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1552 "unknown two-way method"
1553 }
1554 }
1555 }
1556}
1557
1558#[derive(Debug, Clone)]
1559pub struct SupplicantControlHandle {
1560 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1561}
1562
1563impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1564 fn shutdown(&self) {
1565 self.inner.shutdown()
1566 }
1567 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1568 self.inner.shutdown_with_epitaph(status)
1569 }
1570
1571 fn is_closed(&self) -> bool {
1572 self.inner.channel().is_closed()
1573 }
1574 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1575 self.inner.channel().on_closed()
1576 }
1577
1578 #[cfg(target_os = "fuchsia")]
1579 fn signal_peer(
1580 &self,
1581 clear_mask: zx::Signals,
1582 set_mask: zx::Signals,
1583 ) -> Result<(), zx_status::Status> {
1584 use fidl::Peered;
1585 self.inner.channel().signal_peer(clear_mask, set_mask)
1586 }
1587}
1588
1589impl SupplicantControlHandle {}
1590
1591#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1592pub struct SupplicantStaIfaceMarker;
1593
1594impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1595 type Proxy = SupplicantStaIfaceProxy;
1596 type RequestStream = SupplicantStaIfaceRequestStream;
1597 #[cfg(target_os = "fuchsia")]
1598 type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1599
1600 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1601}
1602pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1603
1604pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1605 fn r#register_callback(
1606 &self,
1607 payload: SupplicantStaIfaceRegisterCallbackRequest,
1608 ) -> Result<(), fidl::Error>;
1609 fn r#add_network(
1610 &self,
1611 payload: SupplicantStaIfaceAddNetworkRequest,
1612 ) -> Result<(), fidl::Error>;
1613 type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1614 fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1615 type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1616 fn r#set_power_save(
1617 &self,
1618 payload: SupplicantStaIfaceSetPowerSaveRequest,
1619 ) -> Self::SetPowerSaveResponseFut;
1620 type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1621 + Send;
1622 fn r#set_suspend_mode_enabled(
1623 &self,
1624 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1625 ) -> Self::SetSuspendModeEnabledResponseFut;
1626 type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1627 + Send;
1628 fn r#set_sta_country_code(
1629 &self,
1630 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1631 ) -> Self::SetStaCountryCodeResponseFut;
1632}
1633#[derive(Debug)]
1634#[cfg(target_os = "fuchsia")]
1635pub struct SupplicantStaIfaceSynchronousProxy {
1636 client: fidl::client::sync::Client,
1637}
1638
1639#[cfg(target_os = "fuchsia")]
1640impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1641 type Proxy = SupplicantStaIfaceProxy;
1642 type Protocol = SupplicantStaIfaceMarker;
1643
1644 fn from_channel(inner: fidl::Channel) -> Self {
1645 Self::new(inner)
1646 }
1647
1648 fn into_channel(self) -> fidl::Channel {
1649 self.client.into_channel()
1650 }
1651
1652 fn as_channel(&self) -> &fidl::Channel {
1653 self.client.as_channel()
1654 }
1655}
1656
1657#[cfg(target_os = "fuchsia")]
1658impl SupplicantStaIfaceSynchronousProxy {
1659 pub fn new(channel: fidl::Channel) -> Self {
1660 let protocol_name =
1661 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1662 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1663 }
1664
1665 pub fn into_channel(self) -> fidl::Channel {
1666 self.client.into_channel()
1667 }
1668
1669 pub fn wait_for_event(
1672 &self,
1673 deadline: zx::MonotonicInstant,
1674 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
1675 SupplicantStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
1676 }
1677
1678 pub fn r#register_callback(
1679 &self,
1680 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
1681 ) -> Result<(), fidl::Error> {
1682 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
1683 &mut payload,
1684 0x1be680e863a8e71,
1685 fidl::encoding::DynamicFlags::FLEXIBLE,
1686 )
1687 }
1688
1689 pub fn r#add_network(
1690 &self,
1691 mut payload: SupplicantStaIfaceAddNetworkRequest,
1692 ) -> Result<(), fidl::Error> {
1693 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
1694 &mut payload,
1695 0xa77cf60628766dc,
1696 fidl::encoding::DynamicFlags::FLEXIBLE,
1697 )
1698 }
1699
1700 pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
1701 let _response = self.client.send_query::<
1702 fidl::encoding::EmptyPayload,
1703 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1704 >(
1705 (),
1706 0x52a1d38e0b4871fa,
1707 fidl::encoding::DynamicFlags::FLEXIBLE,
1708 ___deadline,
1709 )?
1710 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
1711 Ok(_response)
1712 }
1713
1714 pub fn r#set_power_save(
1715 &self,
1716 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
1717 ___deadline: zx::MonotonicInstant,
1718 ) -> Result<(), fidl::Error> {
1719 let _response = self.client.send_query::<
1720 SupplicantStaIfaceSetPowerSaveRequest,
1721 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1722 >(
1723 &mut payload,
1724 0x5a04c29320085298,
1725 fidl::encoding::DynamicFlags::FLEXIBLE,
1726 ___deadline,
1727 )?
1728 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
1729 Ok(_response)
1730 }
1731
1732 pub fn r#set_suspend_mode_enabled(
1733 &self,
1734 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1735 ___deadline: zx::MonotonicInstant,
1736 ) -> Result<(), fidl::Error> {
1737 let _response = self.client.send_query::<
1738 SupplicantStaIfaceSetSuspendModeEnabledRequest,
1739 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1740 >(
1741 &mut payload,
1742 0xaf10de85bb7023a,
1743 fidl::encoding::DynamicFlags::FLEXIBLE,
1744 ___deadline,
1745 )?
1746 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
1747 Ok(_response)
1748 }
1749
1750 pub fn r#set_sta_country_code(
1751 &self,
1752 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1753 ___deadline: zx::MonotonicInstant,
1754 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
1755 let _response = self.client.send_query::<
1756 SupplicantStaIfaceSetStaCountryCodeRequest,
1757 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1758 >(
1759 &mut payload,
1760 0x977e22f9b79b26e,
1761 fidl::encoding::DynamicFlags::FLEXIBLE,
1762 ___deadline,
1763 )?
1764 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
1765 Ok(_response.map(|x| x))
1766 }
1767}
1768
1769#[cfg(target_os = "fuchsia")]
1770impl From<SupplicantStaIfaceSynchronousProxy> for zx::Handle {
1771 fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
1772 value.into_channel().into()
1773 }
1774}
1775
1776#[cfg(target_os = "fuchsia")]
1777impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
1778 fn from(value: fidl::Channel) -> Self {
1779 Self::new(value)
1780 }
1781}
1782
1783#[derive(Debug, Clone)]
1784pub struct SupplicantStaIfaceProxy {
1785 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1786}
1787
1788impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
1789 type Protocol = SupplicantStaIfaceMarker;
1790
1791 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1792 Self::new(inner)
1793 }
1794
1795 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1796 self.client.into_channel().map_err(|client| Self { client })
1797 }
1798
1799 fn as_channel(&self) -> &::fidl::AsyncChannel {
1800 self.client.as_channel()
1801 }
1802}
1803
1804impl SupplicantStaIfaceProxy {
1805 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1807 let protocol_name =
1808 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1809 Self { client: fidl::client::Client::new(channel, protocol_name) }
1810 }
1811
1812 pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
1818 SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
1819 }
1820
1821 pub fn r#register_callback(
1822 &self,
1823 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
1824 ) -> Result<(), fidl::Error> {
1825 SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
1826 }
1827
1828 pub fn r#add_network(
1829 &self,
1830 mut payload: SupplicantStaIfaceAddNetworkRequest,
1831 ) -> Result<(), fidl::Error> {
1832 SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
1833 }
1834
1835 pub fn r#disconnect(
1836 &self,
1837 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1838 SupplicantStaIfaceProxyInterface::r#disconnect(self)
1839 }
1840
1841 pub fn r#set_power_save(
1842 &self,
1843 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
1844 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1845 SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
1846 }
1847
1848 pub fn r#set_suspend_mode_enabled(
1849 &self,
1850 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1851 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1852 SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
1853 }
1854
1855 pub fn r#set_sta_country_code(
1856 &self,
1857 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1858 ) -> fidl::client::QueryResponseFut<
1859 SupplicantStaIfaceSetStaCountryCodeResult,
1860 fidl::encoding::DefaultFuchsiaResourceDialect,
1861 > {
1862 SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
1863 }
1864}
1865
1866impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
1867 fn r#register_callback(
1868 &self,
1869 mut payload: SupplicantStaIfaceRegisterCallbackRequest,
1870 ) -> Result<(), fidl::Error> {
1871 self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
1872 &mut payload,
1873 0x1be680e863a8e71,
1874 fidl::encoding::DynamicFlags::FLEXIBLE,
1875 )
1876 }
1877
1878 fn r#add_network(
1879 &self,
1880 mut payload: SupplicantStaIfaceAddNetworkRequest,
1881 ) -> Result<(), fidl::Error> {
1882 self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
1883 &mut payload,
1884 0xa77cf60628766dc,
1885 fidl::encoding::DynamicFlags::FLEXIBLE,
1886 )
1887 }
1888
1889 type DisconnectResponseFut =
1890 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1891 fn r#disconnect(&self) -> Self::DisconnectResponseFut {
1892 fn _decode(
1893 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1894 ) -> Result<(), fidl::Error> {
1895 let _response = fidl::client::decode_transaction_body::<
1896 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1897 fidl::encoding::DefaultFuchsiaResourceDialect,
1898 0x52a1d38e0b4871fa,
1899 >(_buf?)?
1900 .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
1901 Ok(_response)
1902 }
1903 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1904 (),
1905 0x52a1d38e0b4871fa,
1906 fidl::encoding::DynamicFlags::FLEXIBLE,
1907 _decode,
1908 )
1909 }
1910
1911 type SetPowerSaveResponseFut =
1912 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1913 fn r#set_power_save(
1914 &self,
1915 mut payload: SupplicantStaIfaceSetPowerSaveRequest,
1916 ) -> Self::SetPowerSaveResponseFut {
1917 fn _decode(
1918 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1919 ) -> Result<(), fidl::Error> {
1920 let _response = fidl::client::decode_transaction_body::<
1921 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1922 fidl::encoding::DefaultFuchsiaResourceDialect,
1923 0x5a04c29320085298,
1924 >(_buf?)?
1925 .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
1926 Ok(_response)
1927 }
1928 self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
1929 &mut payload,
1930 0x5a04c29320085298,
1931 fidl::encoding::DynamicFlags::FLEXIBLE,
1932 _decode,
1933 )
1934 }
1935
1936 type SetSuspendModeEnabledResponseFut =
1937 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1938 fn r#set_suspend_mode_enabled(
1939 &self,
1940 mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1941 ) -> Self::SetSuspendModeEnabledResponseFut {
1942 fn _decode(
1943 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1944 ) -> Result<(), fidl::Error> {
1945 let _response = fidl::client::decode_transaction_body::<
1946 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1947 fidl::encoding::DefaultFuchsiaResourceDialect,
1948 0xaf10de85bb7023a,
1949 >(_buf?)?
1950 .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
1951 Ok(_response)
1952 }
1953 self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
1954 &mut payload,
1955 0xaf10de85bb7023a,
1956 fidl::encoding::DynamicFlags::FLEXIBLE,
1957 _decode,
1958 )
1959 }
1960
1961 type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
1962 SupplicantStaIfaceSetStaCountryCodeResult,
1963 fidl::encoding::DefaultFuchsiaResourceDialect,
1964 >;
1965 fn r#set_sta_country_code(
1966 &self,
1967 mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1968 ) -> Self::SetStaCountryCodeResponseFut {
1969 fn _decode(
1970 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1971 ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
1972 let _response = fidl::client::decode_transaction_body::<
1973 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1974 fidl::encoding::DefaultFuchsiaResourceDialect,
1975 0x977e22f9b79b26e,
1976 >(_buf?)?
1977 .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
1978 Ok(_response.map(|x| x))
1979 }
1980 self.client.send_query_and_decode::<
1981 SupplicantStaIfaceSetStaCountryCodeRequest,
1982 SupplicantStaIfaceSetStaCountryCodeResult,
1983 >(
1984 &mut payload,
1985 0x977e22f9b79b26e,
1986 fidl::encoding::DynamicFlags::FLEXIBLE,
1987 _decode,
1988 )
1989 }
1990}
1991
1992pub struct SupplicantStaIfaceEventStream {
1993 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1994}
1995
1996impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
1997
1998impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
1999 fn is_terminated(&self) -> bool {
2000 self.event_receiver.is_terminated()
2001 }
2002}
2003
2004impl futures::Stream for SupplicantStaIfaceEventStream {
2005 type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2006
2007 fn poll_next(
2008 mut self: std::pin::Pin<&mut Self>,
2009 cx: &mut std::task::Context<'_>,
2010 ) -> std::task::Poll<Option<Self::Item>> {
2011 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2012 &mut self.event_receiver,
2013 cx
2014 )?) {
2015 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2016 None => std::task::Poll::Ready(None),
2017 }
2018 }
2019}
2020
2021#[derive(Debug)]
2022pub enum SupplicantStaIfaceEvent {
2023 #[non_exhaustive]
2024 _UnknownEvent {
2025 ordinal: u64,
2027 },
2028}
2029
2030impl SupplicantStaIfaceEvent {
2031 fn decode(
2033 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2034 ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2035 let (bytes, _handles) = buf.split_mut();
2036 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2037 debug_assert_eq!(tx_header.tx_id, 0);
2038 match tx_header.ordinal {
2039 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2040 Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2041 }
2042 _ => Err(fidl::Error::UnknownOrdinal {
2043 ordinal: tx_header.ordinal,
2044 protocol_name:
2045 <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2046 }),
2047 }
2048 }
2049}
2050
2051pub struct SupplicantStaIfaceRequestStream {
2053 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2054 is_terminated: bool,
2055}
2056
2057impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2058
2059impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2060 fn is_terminated(&self) -> bool {
2061 self.is_terminated
2062 }
2063}
2064
2065impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2066 type Protocol = SupplicantStaIfaceMarker;
2067 type ControlHandle = SupplicantStaIfaceControlHandle;
2068
2069 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2070 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2071 }
2072
2073 fn control_handle(&self) -> Self::ControlHandle {
2074 SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2075 }
2076
2077 fn into_inner(
2078 self,
2079 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2080 {
2081 (self.inner, self.is_terminated)
2082 }
2083
2084 fn from_inner(
2085 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2086 is_terminated: bool,
2087 ) -> Self {
2088 Self { inner, is_terminated }
2089 }
2090}
2091
2092impl futures::Stream for SupplicantStaIfaceRequestStream {
2093 type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2094
2095 fn poll_next(
2096 mut self: std::pin::Pin<&mut Self>,
2097 cx: &mut std::task::Context<'_>,
2098 ) -> std::task::Poll<Option<Self::Item>> {
2099 let this = &mut *self;
2100 if this.inner.check_shutdown(cx) {
2101 this.is_terminated = true;
2102 return std::task::Poll::Ready(None);
2103 }
2104 if this.is_terminated {
2105 panic!("polled SupplicantStaIfaceRequestStream after completion");
2106 }
2107 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2108 |bytes, handles| {
2109 match this.inner.channel().read_etc(cx, bytes, handles) {
2110 std::task::Poll::Ready(Ok(())) => {}
2111 std::task::Poll::Pending => return std::task::Poll::Pending,
2112 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2113 this.is_terminated = true;
2114 return std::task::Poll::Ready(None);
2115 }
2116 std::task::Poll::Ready(Err(e)) => {
2117 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2118 e.into(),
2119 ))))
2120 }
2121 }
2122
2123 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2125
2126 std::task::Poll::Ready(Some(match header.ordinal {
2127 0x1be680e863a8e71 => {
2128 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2129 let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2130 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2131 let control_handle = SupplicantStaIfaceControlHandle {
2132 inner: this.inner.clone(),
2133 };
2134 Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2135 control_handle,
2136 })
2137 }
2138 0xa77cf60628766dc => {
2139 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2140 let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2141 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2142 let control_handle = SupplicantStaIfaceControlHandle {
2143 inner: this.inner.clone(),
2144 };
2145 Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2146 control_handle,
2147 })
2148 }
2149 0x52a1d38e0b4871fa => {
2150 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2151 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2152 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2153 let control_handle = SupplicantStaIfaceControlHandle {
2154 inner: this.inner.clone(),
2155 };
2156 Ok(SupplicantStaIfaceRequest::Disconnect {
2157 responder: SupplicantStaIfaceDisconnectResponder {
2158 control_handle: std::mem::ManuallyDrop::new(control_handle),
2159 tx_id: header.tx_id,
2160 },
2161 })
2162 }
2163 0x5a04c29320085298 => {
2164 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2165 let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2166 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2167 let control_handle = SupplicantStaIfaceControlHandle {
2168 inner: this.inner.clone(),
2169 };
2170 Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2171 responder: SupplicantStaIfaceSetPowerSaveResponder {
2172 control_handle: std::mem::ManuallyDrop::new(control_handle),
2173 tx_id: header.tx_id,
2174 },
2175 })
2176 }
2177 0xaf10de85bb7023a => {
2178 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2179 let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2180 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2181 let control_handle = SupplicantStaIfaceControlHandle {
2182 inner: this.inner.clone(),
2183 };
2184 Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2185 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2186 control_handle: std::mem::ManuallyDrop::new(control_handle),
2187 tx_id: header.tx_id,
2188 },
2189 })
2190 }
2191 0x977e22f9b79b26e => {
2192 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2193 let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2194 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2195 let control_handle = SupplicantStaIfaceControlHandle {
2196 inner: this.inner.clone(),
2197 };
2198 Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2199 responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2200 control_handle: std::mem::ManuallyDrop::new(control_handle),
2201 tx_id: header.tx_id,
2202 },
2203 })
2204 }
2205 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2206 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2207 ordinal: header.ordinal,
2208 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2209 method_type: fidl::MethodType::OneWay,
2210 })
2211 }
2212 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2213 this.inner.send_framework_err(
2214 fidl::encoding::FrameworkErr::UnknownMethod,
2215 header.tx_id,
2216 header.ordinal,
2217 header.dynamic_flags(),
2218 (bytes, handles),
2219 )?;
2220 Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2221 ordinal: header.ordinal,
2222 control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2223 method_type: fidl::MethodType::TwoWay,
2224 })
2225 }
2226 _ => Err(fidl::Error::UnknownOrdinal {
2227 ordinal: header.ordinal,
2228 protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2229 }),
2230 }))
2231 },
2232 )
2233 }
2234}
2235
2236#[derive(Debug)]
2237pub enum SupplicantStaIfaceRequest {
2238 RegisterCallback {
2239 payload: SupplicantStaIfaceRegisterCallbackRequest,
2240 control_handle: SupplicantStaIfaceControlHandle,
2241 },
2242 AddNetwork {
2243 payload: SupplicantStaIfaceAddNetworkRequest,
2244 control_handle: SupplicantStaIfaceControlHandle,
2245 },
2246 Disconnect {
2247 responder: SupplicantStaIfaceDisconnectResponder,
2248 },
2249 SetPowerSave {
2250 payload: SupplicantStaIfaceSetPowerSaveRequest,
2251 responder: SupplicantStaIfaceSetPowerSaveResponder,
2252 },
2253 SetSuspendModeEnabled {
2254 payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2255 responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2256 },
2257 SetStaCountryCode {
2258 payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2259 responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2260 },
2261 #[non_exhaustive]
2263 _UnknownMethod {
2264 ordinal: u64,
2266 control_handle: SupplicantStaIfaceControlHandle,
2267 method_type: fidl::MethodType,
2268 },
2269}
2270
2271impl SupplicantStaIfaceRequest {
2272 #[allow(irrefutable_let_patterns)]
2273 pub fn into_register_callback(
2274 self,
2275 ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2276 if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2277 Some((payload, control_handle))
2278 } else {
2279 None
2280 }
2281 }
2282
2283 #[allow(irrefutable_let_patterns)]
2284 pub fn into_add_network(
2285 self,
2286 ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2287 if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2288 Some((payload, control_handle))
2289 } else {
2290 None
2291 }
2292 }
2293
2294 #[allow(irrefutable_let_patterns)]
2295 pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2296 if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2297 Some((responder))
2298 } else {
2299 None
2300 }
2301 }
2302
2303 #[allow(irrefutable_let_patterns)]
2304 pub fn into_set_power_save(
2305 self,
2306 ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
2307 {
2308 if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
2309 Some((payload, responder))
2310 } else {
2311 None
2312 }
2313 }
2314
2315 #[allow(irrefutable_let_patterns)]
2316 pub fn into_set_suspend_mode_enabled(
2317 self,
2318 ) -> Option<(
2319 SupplicantStaIfaceSetSuspendModeEnabledRequest,
2320 SupplicantStaIfaceSetSuspendModeEnabledResponder,
2321 )> {
2322 if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
2323 Some((payload, responder))
2324 } else {
2325 None
2326 }
2327 }
2328
2329 #[allow(irrefutable_let_patterns)]
2330 pub fn into_set_sta_country_code(
2331 self,
2332 ) -> Option<(
2333 SupplicantStaIfaceSetStaCountryCodeRequest,
2334 SupplicantStaIfaceSetStaCountryCodeResponder,
2335 )> {
2336 if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
2337 Some((payload, responder))
2338 } else {
2339 None
2340 }
2341 }
2342
2343 pub fn method_name(&self) -> &'static str {
2345 match *self {
2346 SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
2347 SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
2348 SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
2349 SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
2350 SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
2351 SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
2352 SupplicantStaIfaceRequest::_UnknownMethod {
2353 method_type: fidl::MethodType::OneWay,
2354 ..
2355 } => "unknown one-way method",
2356 SupplicantStaIfaceRequest::_UnknownMethod {
2357 method_type: fidl::MethodType::TwoWay,
2358 ..
2359 } => "unknown two-way method",
2360 }
2361 }
2362}
2363
2364#[derive(Debug, Clone)]
2365pub struct SupplicantStaIfaceControlHandle {
2366 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2367}
2368
2369impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
2370 fn shutdown(&self) {
2371 self.inner.shutdown()
2372 }
2373 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2374 self.inner.shutdown_with_epitaph(status)
2375 }
2376
2377 fn is_closed(&self) -> bool {
2378 self.inner.channel().is_closed()
2379 }
2380 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2381 self.inner.channel().on_closed()
2382 }
2383
2384 #[cfg(target_os = "fuchsia")]
2385 fn signal_peer(
2386 &self,
2387 clear_mask: zx::Signals,
2388 set_mask: zx::Signals,
2389 ) -> Result<(), zx_status::Status> {
2390 use fidl::Peered;
2391 self.inner.channel().signal_peer(clear_mask, set_mask)
2392 }
2393}
2394
2395impl SupplicantStaIfaceControlHandle {}
2396
2397#[must_use = "FIDL methods require a response to be sent"]
2398#[derive(Debug)]
2399pub struct SupplicantStaIfaceDisconnectResponder {
2400 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2401 tx_id: u32,
2402}
2403
2404impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
2408 fn drop(&mut self) {
2409 self.control_handle.shutdown();
2410 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2412 }
2413}
2414
2415impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
2416 type ControlHandle = SupplicantStaIfaceControlHandle;
2417
2418 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2419 &self.control_handle
2420 }
2421
2422 fn drop_without_shutdown(mut self) {
2423 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2425 std::mem::forget(self);
2427 }
2428}
2429
2430impl SupplicantStaIfaceDisconnectResponder {
2431 pub fn send(self) -> Result<(), fidl::Error> {
2435 let _result = self.send_raw();
2436 if _result.is_err() {
2437 self.control_handle.shutdown();
2438 }
2439 self.drop_without_shutdown();
2440 _result
2441 }
2442
2443 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2445 let _result = self.send_raw();
2446 self.drop_without_shutdown();
2447 _result
2448 }
2449
2450 fn send_raw(&self) -> Result<(), fidl::Error> {
2451 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2452 fidl::encoding::Flexible::new(()),
2453 self.tx_id,
2454 0x52a1d38e0b4871fa,
2455 fidl::encoding::DynamicFlags::FLEXIBLE,
2456 )
2457 }
2458}
2459
2460#[must_use = "FIDL methods require a response to be sent"]
2461#[derive(Debug)]
2462pub struct SupplicantStaIfaceSetPowerSaveResponder {
2463 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2464 tx_id: u32,
2465}
2466
2467impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
2471 fn drop(&mut self) {
2472 self.control_handle.shutdown();
2473 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2475 }
2476}
2477
2478impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
2479 type ControlHandle = SupplicantStaIfaceControlHandle;
2480
2481 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2482 &self.control_handle
2483 }
2484
2485 fn drop_without_shutdown(mut self) {
2486 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2488 std::mem::forget(self);
2490 }
2491}
2492
2493impl SupplicantStaIfaceSetPowerSaveResponder {
2494 pub fn send(self) -> Result<(), fidl::Error> {
2498 let _result = self.send_raw();
2499 if _result.is_err() {
2500 self.control_handle.shutdown();
2501 }
2502 self.drop_without_shutdown();
2503 _result
2504 }
2505
2506 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2508 let _result = self.send_raw();
2509 self.drop_without_shutdown();
2510 _result
2511 }
2512
2513 fn send_raw(&self) -> Result<(), fidl::Error> {
2514 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2515 fidl::encoding::Flexible::new(()),
2516 self.tx_id,
2517 0x5a04c29320085298,
2518 fidl::encoding::DynamicFlags::FLEXIBLE,
2519 )
2520 }
2521}
2522
2523#[must_use = "FIDL methods require a response to be sent"]
2524#[derive(Debug)]
2525pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
2526 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2527 tx_id: u32,
2528}
2529
2530impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
2534 fn drop(&mut self) {
2535 self.control_handle.shutdown();
2536 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2538 }
2539}
2540
2541impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
2542 type ControlHandle = SupplicantStaIfaceControlHandle;
2543
2544 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2545 &self.control_handle
2546 }
2547
2548 fn drop_without_shutdown(mut self) {
2549 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2551 std::mem::forget(self);
2553 }
2554}
2555
2556impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
2557 pub fn send(self) -> Result<(), fidl::Error> {
2561 let _result = self.send_raw();
2562 if _result.is_err() {
2563 self.control_handle.shutdown();
2564 }
2565 self.drop_without_shutdown();
2566 _result
2567 }
2568
2569 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2571 let _result = self.send_raw();
2572 self.drop_without_shutdown();
2573 _result
2574 }
2575
2576 fn send_raw(&self) -> Result<(), fidl::Error> {
2577 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2578 fidl::encoding::Flexible::new(()),
2579 self.tx_id,
2580 0xaf10de85bb7023a,
2581 fidl::encoding::DynamicFlags::FLEXIBLE,
2582 )
2583 }
2584}
2585
2586#[must_use = "FIDL methods require a response to be sent"]
2587#[derive(Debug)]
2588pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
2589 control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2590 tx_id: u32,
2591}
2592
2593impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
2597 fn drop(&mut self) {
2598 self.control_handle.shutdown();
2599 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2601 }
2602}
2603
2604impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
2605 type ControlHandle = SupplicantStaIfaceControlHandle;
2606
2607 fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2608 &self.control_handle
2609 }
2610
2611 fn drop_without_shutdown(mut self) {
2612 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2614 std::mem::forget(self);
2616 }
2617}
2618
2619impl SupplicantStaIfaceSetStaCountryCodeResponder {
2620 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2624 let _result = self.send_raw(result);
2625 if _result.is_err() {
2626 self.control_handle.shutdown();
2627 }
2628 self.drop_without_shutdown();
2629 _result
2630 }
2631
2632 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2634 let _result = self.send_raw(result);
2635 self.drop_without_shutdown();
2636 _result
2637 }
2638
2639 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2640 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2641 fidl::encoding::EmptyStruct,
2642 i32,
2643 >>(
2644 fidl::encoding::FlexibleResult::new(result),
2645 self.tx_id,
2646 0x977e22f9b79b26e,
2647 fidl::encoding::DynamicFlags::FLEXIBLE,
2648 )
2649 }
2650}
2651
2652#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2653pub struct SupplicantStaIfaceCallbackMarker;
2654
2655impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
2656 type Proxy = SupplicantStaIfaceCallbackProxy;
2657 type RequestStream = SupplicantStaIfaceCallbackRequestStream;
2658 #[cfg(target_os = "fuchsia")]
2659 type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
2660
2661 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
2662}
2663
2664pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
2665 fn r#on_state_changed(
2666 &self,
2667 payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
2668 ) -> Result<(), fidl::Error>;
2669 fn r#on_disconnected(
2670 &self,
2671 payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
2672 ) -> Result<(), fidl::Error>;
2673 fn r#on_association_rejected(
2674 &self,
2675 payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
2676 ) -> Result<(), fidl::Error>;
2677}
2678#[derive(Debug)]
2679#[cfg(target_os = "fuchsia")]
2680pub struct SupplicantStaIfaceCallbackSynchronousProxy {
2681 client: fidl::client::sync::Client,
2682}
2683
2684#[cfg(target_os = "fuchsia")]
2685impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
2686 type Proxy = SupplicantStaIfaceCallbackProxy;
2687 type Protocol = SupplicantStaIfaceCallbackMarker;
2688
2689 fn from_channel(inner: fidl::Channel) -> Self {
2690 Self::new(inner)
2691 }
2692
2693 fn into_channel(self) -> fidl::Channel {
2694 self.client.into_channel()
2695 }
2696
2697 fn as_channel(&self) -> &fidl::Channel {
2698 self.client.as_channel()
2699 }
2700}
2701
2702#[cfg(target_os = "fuchsia")]
2703impl SupplicantStaIfaceCallbackSynchronousProxy {
2704 pub fn new(channel: fidl::Channel) -> Self {
2705 let protocol_name =
2706 <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2707 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2708 }
2709
2710 pub fn into_channel(self) -> fidl::Channel {
2711 self.client.into_channel()
2712 }
2713
2714 pub fn wait_for_event(
2717 &self,
2718 deadline: zx::MonotonicInstant,
2719 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
2720 SupplicantStaIfaceCallbackEvent::decode(self.client.wait_for_event(deadline)?)
2721 }
2722
2723 pub fn r#on_state_changed(
2724 &self,
2725 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
2726 ) -> Result<(), fidl::Error> {
2727 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
2728 payload,
2729 0x27e086d26c49eb6c,
2730 fidl::encoding::DynamicFlags::FLEXIBLE,
2731 )
2732 }
2733
2734 pub fn r#on_disconnected(
2735 &self,
2736 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
2737 ) -> Result<(), fidl::Error> {
2738 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
2739 payload,
2740 0x69546475f4dee0cc,
2741 fidl::encoding::DynamicFlags::FLEXIBLE,
2742 )
2743 }
2744
2745 pub fn r#on_association_rejected(
2746 &self,
2747 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
2748 ) -> Result<(), fidl::Error> {
2749 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
2750 payload,
2751 0x7ef3961518bed988,
2752 fidl::encoding::DynamicFlags::FLEXIBLE,
2753 )
2754 }
2755}
2756
2757#[cfg(target_os = "fuchsia")]
2758impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::Handle {
2759 fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
2760 value.into_channel().into()
2761 }
2762}
2763
2764#[cfg(target_os = "fuchsia")]
2765impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
2766 fn from(value: fidl::Channel) -> Self {
2767 Self::new(value)
2768 }
2769}
2770
2771#[derive(Debug, Clone)]
2772pub struct SupplicantStaIfaceCallbackProxy {
2773 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2774}
2775
2776impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
2777 type Protocol = SupplicantStaIfaceCallbackMarker;
2778
2779 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2780 Self::new(inner)
2781 }
2782
2783 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2784 self.client.into_channel().map_err(|client| Self { client })
2785 }
2786
2787 fn as_channel(&self) -> &::fidl::AsyncChannel {
2788 self.client.as_channel()
2789 }
2790}
2791
2792impl SupplicantStaIfaceCallbackProxy {
2793 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2795 let protocol_name =
2796 <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2797 Self { client: fidl::client::Client::new(channel, protocol_name) }
2798 }
2799
2800 pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
2806 SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
2807 }
2808
2809 pub fn r#on_state_changed(
2810 &self,
2811 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
2812 ) -> Result<(), fidl::Error> {
2813 SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
2814 }
2815
2816 pub fn r#on_disconnected(
2817 &self,
2818 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
2819 ) -> Result<(), fidl::Error> {
2820 SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
2821 }
2822
2823 pub fn r#on_association_rejected(
2824 &self,
2825 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
2826 ) -> Result<(), fidl::Error> {
2827 SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
2828 }
2829}
2830
2831impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
2832 fn r#on_state_changed(
2833 &self,
2834 mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
2835 ) -> Result<(), fidl::Error> {
2836 self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
2837 payload,
2838 0x27e086d26c49eb6c,
2839 fidl::encoding::DynamicFlags::FLEXIBLE,
2840 )
2841 }
2842
2843 fn r#on_disconnected(
2844 &self,
2845 mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
2846 ) -> Result<(), fidl::Error> {
2847 self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
2848 payload,
2849 0x69546475f4dee0cc,
2850 fidl::encoding::DynamicFlags::FLEXIBLE,
2851 )
2852 }
2853
2854 fn r#on_association_rejected(
2855 &self,
2856 mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
2857 ) -> Result<(), fidl::Error> {
2858 self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
2859 payload,
2860 0x7ef3961518bed988,
2861 fidl::encoding::DynamicFlags::FLEXIBLE,
2862 )
2863 }
2864}
2865
2866pub struct SupplicantStaIfaceCallbackEventStream {
2867 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2868}
2869
2870impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
2871
2872impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
2873 fn is_terminated(&self) -> bool {
2874 self.event_receiver.is_terminated()
2875 }
2876}
2877
2878impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
2879 type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
2880
2881 fn poll_next(
2882 mut self: std::pin::Pin<&mut Self>,
2883 cx: &mut std::task::Context<'_>,
2884 ) -> std::task::Poll<Option<Self::Item>> {
2885 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2886 &mut self.event_receiver,
2887 cx
2888 )?) {
2889 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
2890 None => std::task::Poll::Ready(None),
2891 }
2892 }
2893}
2894
2895#[derive(Debug)]
2896pub enum SupplicantStaIfaceCallbackEvent {
2897 #[non_exhaustive]
2898 _UnknownEvent {
2899 ordinal: u64,
2901 },
2902}
2903
2904impl SupplicantStaIfaceCallbackEvent {
2905 fn decode(
2907 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2908 ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
2909 let (bytes, _handles) = buf.split_mut();
2910 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2911 debug_assert_eq!(tx_header.tx_id, 0);
2912 match tx_header.ordinal {
2913 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2914 Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
2915 ordinal: tx_header.ordinal,
2916 })
2917 }
2918 _ => Err(fidl::Error::UnknownOrdinal {
2919 ordinal: tx_header.ordinal,
2920 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2921 })
2922 }
2923 }
2924}
2925
2926pub struct SupplicantStaIfaceCallbackRequestStream {
2928 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2929 is_terminated: bool,
2930}
2931
2932impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
2933
2934impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
2935 fn is_terminated(&self) -> bool {
2936 self.is_terminated
2937 }
2938}
2939
2940impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
2941 type Protocol = SupplicantStaIfaceCallbackMarker;
2942 type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
2943
2944 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2945 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2946 }
2947
2948 fn control_handle(&self) -> Self::ControlHandle {
2949 SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
2950 }
2951
2952 fn into_inner(
2953 self,
2954 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2955 {
2956 (self.inner, self.is_terminated)
2957 }
2958
2959 fn from_inner(
2960 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2961 is_terminated: bool,
2962 ) -> Self {
2963 Self { inner, is_terminated }
2964 }
2965}
2966
2967impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
2968 type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
2969
2970 fn poll_next(
2971 mut self: std::pin::Pin<&mut Self>,
2972 cx: &mut std::task::Context<'_>,
2973 ) -> std::task::Poll<Option<Self::Item>> {
2974 let this = &mut *self;
2975 if this.inner.check_shutdown(cx) {
2976 this.is_terminated = true;
2977 return std::task::Poll::Ready(None);
2978 }
2979 if this.is_terminated {
2980 panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
2981 }
2982 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2983 |bytes, handles| {
2984 match this.inner.channel().read_etc(cx, bytes, handles) {
2985 std::task::Poll::Ready(Ok(())) => {}
2986 std::task::Poll::Pending => return std::task::Poll::Pending,
2987 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2988 this.is_terminated = true;
2989 return std::task::Poll::Ready(None);
2990 }
2991 std::task::Poll::Ready(Err(e)) => {
2992 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2993 e.into(),
2994 ))))
2995 }
2996 }
2997
2998 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3000
3001 std::task::Poll::Ready(Some(match header.ordinal {
3002 0x27e086d26c49eb6c => {
3003 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3004 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3005 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
3006 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3007 inner: this.inner.clone(),
3008 };
3009 Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
3010 control_handle,
3011 })
3012 }
3013 0x69546475f4dee0cc => {
3014 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3015 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3016 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
3017 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3018 inner: this.inner.clone(),
3019 };
3020 Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
3021 control_handle,
3022 })
3023 }
3024 0x7ef3961518bed988 => {
3025 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3026 let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3027 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
3028 let control_handle = SupplicantStaIfaceCallbackControlHandle {
3029 inner: this.inner.clone(),
3030 };
3031 Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
3032 control_handle,
3033 })
3034 }
3035 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3036 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3037 ordinal: header.ordinal,
3038 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3039 method_type: fidl::MethodType::OneWay,
3040 })
3041 }
3042 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3043 this.inner.send_framework_err(
3044 fidl::encoding::FrameworkErr::UnknownMethod,
3045 header.tx_id,
3046 header.ordinal,
3047 header.dynamic_flags(),
3048 (bytes, handles),
3049 )?;
3050 Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3051 ordinal: header.ordinal,
3052 control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3053 method_type: fidl::MethodType::TwoWay,
3054 })
3055 }
3056 _ => Err(fidl::Error::UnknownOrdinal {
3057 ordinal: header.ordinal,
3058 protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3059 }),
3060 }))
3061 },
3062 )
3063 }
3064}
3065
3066#[derive(Debug)]
3067pub enum SupplicantStaIfaceCallbackRequest {
3068 OnStateChanged {
3069 payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
3070 control_handle: SupplicantStaIfaceCallbackControlHandle,
3071 },
3072 OnDisconnected {
3073 payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
3074 control_handle: SupplicantStaIfaceCallbackControlHandle,
3075 },
3076 OnAssociationRejected {
3077 payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3078 control_handle: SupplicantStaIfaceCallbackControlHandle,
3079 },
3080 #[non_exhaustive]
3082 _UnknownMethod {
3083 ordinal: u64,
3085 control_handle: SupplicantStaIfaceCallbackControlHandle,
3086 method_type: fidl::MethodType,
3087 },
3088}
3089
3090impl SupplicantStaIfaceCallbackRequest {
3091 #[allow(irrefutable_let_patterns)]
3092 pub fn into_on_state_changed(
3093 self,
3094 ) -> Option<(
3095 SupplicantStaIfaceCallbackOnStateChangedRequest,
3096 SupplicantStaIfaceCallbackControlHandle,
3097 )> {
3098 if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
3099 {
3100 Some((payload, control_handle))
3101 } else {
3102 None
3103 }
3104 }
3105
3106 #[allow(irrefutable_let_patterns)]
3107 pub fn into_on_disconnected(
3108 self,
3109 ) -> Option<(
3110 SupplicantStaIfaceCallbackOnDisconnectedRequest,
3111 SupplicantStaIfaceCallbackControlHandle,
3112 )> {
3113 if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
3114 {
3115 Some((payload, control_handle))
3116 } else {
3117 None
3118 }
3119 }
3120
3121 #[allow(irrefutable_let_patterns)]
3122 pub fn into_on_association_rejected(
3123 self,
3124 ) -> Option<(
3125 SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3126 SupplicantStaIfaceCallbackControlHandle,
3127 )> {
3128 if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
3129 payload,
3130 control_handle,
3131 } = self
3132 {
3133 Some((payload, control_handle))
3134 } else {
3135 None
3136 }
3137 }
3138
3139 pub fn method_name(&self) -> &'static str {
3141 match *self {
3142 SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
3143 SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
3144 SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
3145 "on_association_rejected"
3146 }
3147 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3148 method_type: fidl::MethodType::OneWay,
3149 ..
3150 } => "unknown one-way method",
3151 SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3152 method_type: fidl::MethodType::TwoWay,
3153 ..
3154 } => "unknown two-way method",
3155 }
3156 }
3157}
3158
3159#[derive(Debug, Clone)]
3160pub struct SupplicantStaIfaceCallbackControlHandle {
3161 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3162}
3163
3164impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
3165 fn shutdown(&self) {
3166 self.inner.shutdown()
3167 }
3168 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3169 self.inner.shutdown_with_epitaph(status)
3170 }
3171
3172 fn is_closed(&self) -> bool {
3173 self.inner.channel().is_closed()
3174 }
3175 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3176 self.inner.channel().on_closed()
3177 }
3178
3179 #[cfg(target_os = "fuchsia")]
3180 fn signal_peer(
3181 &self,
3182 clear_mask: zx::Signals,
3183 set_mask: zx::Signals,
3184 ) -> Result<(), zx_status::Status> {
3185 use fidl::Peered;
3186 self.inner.channel().signal_peer(clear_mask, set_mask)
3187 }
3188}
3189
3190impl SupplicantStaIfaceCallbackControlHandle {}
3191
3192#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3193pub struct SupplicantStaNetworkMarker;
3194
3195impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
3196 type Proxy = SupplicantStaNetworkProxy;
3197 type RequestStream = SupplicantStaNetworkRequestStream;
3198 #[cfg(target_os = "fuchsia")]
3199 type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
3200
3201 const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
3202}
3203pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
3204
3205pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
3206 fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
3207 -> Result<(), fidl::Error>;
3208 fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
3209 fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
3210 fn r#set_psk_passphrase(
3211 &self,
3212 payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3213 ) -> Result<(), fidl::Error>;
3214 type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
3215 + Send;
3216 fn r#select(&self) -> Self::SelectResponseFut;
3217}
3218#[derive(Debug)]
3219#[cfg(target_os = "fuchsia")]
3220pub struct SupplicantStaNetworkSynchronousProxy {
3221 client: fidl::client::sync::Client,
3222}
3223
3224#[cfg(target_os = "fuchsia")]
3225impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
3226 type Proxy = SupplicantStaNetworkProxy;
3227 type Protocol = SupplicantStaNetworkMarker;
3228
3229 fn from_channel(inner: fidl::Channel) -> Self {
3230 Self::new(inner)
3231 }
3232
3233 fn into_channel(self) -> fidl::Channel {
3234 self.client.into_channel()
3235 }
3236
3237 fn as_channel(&self) -> &fidl::Channel {
3238 self.client.as_channel()
3239 }
3240}
3241
3242#[cfg(target_os = "fuchsia")]
3243impl SupplicantStaNetworkSynchronousProxy {
3244 pub fn new(channel: fidl::Channel) -> Self {
3245 let protocol_name =
3246 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3247 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3248 }
3249
3250 pub fn into_channel(self) -> fidl::Channel {
3251 self.client.into_channel()
3252 }
3253
3254 pub fn wait_for_event(
3257 &self,
3258 deadline: zx::MonotonicInstant,
3259 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
3260 SupplicantStaNetworkEvent::decode(self.client.wait_for_event(deadline)?)
3261 }
3262
3263 pub fn r#set_bssid(
3264 &self,
3265 mut payload: &SupplicantStaNetworkSetBssidRequest,
3266 ) -> Result<(), fidl::Error> {
3267 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3268 payload,
3269 0x10a91d044ee6374d,
3270 fidl::encoding::DynamicFlags::FLEXIBLE,
3271 )
3272 }
3273
3274 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3275 self.client.send::<fidl::encoding::EmptyPayload>(
3276 (),
3277 0xbc7ad82f541b267,
3278 fidl::encoding::DynamicFlags::FLEXIBLE,
3279 )
3280 }
3281
3282 pub fn r#set_ssid(
3283 &self,
3284 mut payload: &SupplicantStaNetworkSetSsidRequest,
3285 ) -> Result<(), fidl::Error> {
3286 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3287 payload,
3288 0x6b598a7a802e3083,
3289 fidl::encoding::DynamicFlags::FLEXIBLE,
3290 )
3291 }
3292
3293 pub fn r#set_psk_passphrase(
3294 &self,
3295 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3296 ) -> Result<(), fidl::Error> {
3297 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3298 payload,
3299 0xf6d438225979307,
3300 fidl::encoding::DynamicFlags::FLEXIBLE,
3301 )
3302 }
3303
3304 pub fn r#select(
3305 &self,
3306 ___deadline: zx::MonotonicInstant,
3307 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
3308 let _response = self.client.send_query::<
3309 fidl::encoding::EmptyPayload,
3310 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
3311 >(
3312 (),
3313 0x354bc361a0c77b45,
3314 fidl::encoding::DynamicFlags::FLEXIBLE,
3315 ___deadline,
3316 )?
3317 .into_result::<SupplicantStaNetworkMarker>("select")?;
3318 Ok(_response.map(|x| x))
3319 }
3320}
3321
3322#[cfg(target_os = "fuchsia")]
3323impl From<SupplicantStaNetworkSynchronousProxy> for zx::Handle {
3324 fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
3325 value.into_channel().into()
3326 }
3327}
3328
3329#[cfg(target_os = "fuchsia")]
3330impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
3331 fn from(value: fidl::Channel) -> Self {
3332 Self::new(value)
3333 }
3334}
3335
3336#[derive(Debug, Clone)]
3337pub struct SupplicantStaNetworkProxy {
3338 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3339}
3340
3341impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
3342 type Protocol = SupplicantStaNetworkMarker;
3343
3344 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3345 Self::new(inner)
3346 }
3347
3348 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3349 self.client.into_channel().map_err(|client| Self { client })
3350 }
3351
3352 fn as_channel(&self) -> &::fidl::AsyncChannel {
3353 self.client.as_channel()
3354 }
3355}
3356
3357impl SupplicantStaNetworkProxy {
3358 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3360 let protocol_name =
3361 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3362 Self { client: fidl::client::Client::new(channel, protocol_name) }
3363 }
3364
3365 pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
3371 SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
3372 }
3373
3374 pub fn r#set_bssid(
3375 &self,
3376 mut payload: &SupplicantStaNetworkSetBssidRequest,
3377 ) -> Result<(), fidl::Error> {
3378 SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
3379 }
3380
3381 pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3382 SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
3383 }
3384
3385 pub fn r#set_ssid(
3386 &self,
3387 mut payload: &SupplicantStaNetworkSetSsidRequest,
3388 ) -> Result<(), fidl::Error> {
3389 SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
3390 }
3391
3392 pub fn r#set_psk_passphrase(
3393 &self,
3394 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3395 ) -> Result<(), fidl::Error> {
3396 SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
3397 }
3398
3399 pub fn r#select(
3400 &self,
3401 ) -> fidl::client::QueryResponseFut<
3402 SupplicantStaNetworkSelectResult,
3403 fidl::encoding::DefaultFuchsiaResourceDialect,
3404 > {
3405 SupplicantStaNetworkProxyInterface::r#select(self)
3406 }
3407}
3408
3409impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
3410 fn r#set_bssid(
3411 &self,
3412 mut payload: &SupplicantStaNetworkSetBssidRequest,
3413 ) -> Result<(), fidl::Error> {
3414 self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3415 payload,
3416 0x10a91d044ee6374d,
3417 fidl::encoding::DynamicFlags::FLEXIBLE,
3418 )
3419 }
3420
3421 fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3422 self.client.send::<fidl::encoding::EmptyPayload>(
3423 (),
3424 0xbc7ad82f541b267,
3425 fidl::encoding::DynamicFlags::FLEXIBLE,
3426 )
3427 }
3428
3429 fn r#set_ssid(
3430 &self,
3431 mut payload: &SupplicantStaNetworkSetSsidRequest,
3432 ) -> Result<(), fidl::Error> {
3433 self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3434 payload,
3435 0x6b598a7a802e3083,
3436 fidl::encoding::DynamicFlags::FLEXIBLE,
3437 )
3438 }
3439
3440 fn r#set_psk_passphrase(
3441 &self,
3442 mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3443 ) -> Result<(), fidl::Error> {
3444 self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3445 payload,
3446 0xf6d438225979307,
3447 fidl::encoding::DynamicFlags::FLEXIBLE,
3448 )
3449 }
3450
3451 type SelectResponseFut = fidl::client::QueryResponseFut<
3452 SupplicantStaNetworkSelectResult,
3453 fidl::encoding::DefaultFuchsiaResourceDialect,
3454 >;
3455 fn r#select(&self) -> Self::SelectResponseFut {
3456 fn _decode(
3457 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3458 ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
3459 let _response = fidl::client::decode_transaction_body::<
3460 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
3461 fidl::encoding::DefaultFuchsiaResourceDialect,
3462 0x354bc361a0c77b45,
3463 >(_buf?)?
3464 .into_result::<SupplicantStaNetworkMarker>("select")?;
3465 Ok(_response.map(|x| x))
3466 }
3467 self.client.send_query_and_decode::<
3468 fidl::encoding::EmptyPayload,
3469 SupplicantStaNetworkSelectResult,
3470 >(
3471 (),
3472 0x354bc361a0c77b45,
3473 fidl::encoding::DynamicFlags::FLEXIBLE,
3474 _decode,
3475 )
3476 }
3477}
3478
3479pub struct SupplicantStaNetworkEventStream {
3480 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3481}
3482
3483impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
3484
3485impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
3486 fn is_terminated(&self) -> bool {
3487 self.event_receiver.is_terminated()
3488 }
3489}
3490
3491impl futures::Stream for SupplicantStaNetworkEventStream {
3492 type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
3493
3494 fn poll_next(
3495 mut self: std::pin::Pin<&mut Self>,
3496 cx: &mut std::task::Context<'_>,
3497 ) -> std::task::Poll<Option<Self::Item>> {
3498 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3499 &mut self.event_receiver,
3500 cx
3501 )?) {
3502 Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
3503 None => std::task::Poll::Ready(None),
3504 }
3505 }
3506}
3507
3508#[derive(Debug)]
3509pub enum SupplicantStaNetworkEvent {
3510 #[non_exhaustive]
3511 _UnknownEvent {
3512 ordinal: u64,
3514 },
3515}
3516
3517impl SupplicantStaNetworkEvent {
3518 fn decode(
3520 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3521 ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
3522 let (bytes, _handles) = buf.split_mut();
3523 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3524 debug_assert_eq!(tx_header.tx_id, 0);
3525 match tx_header.ordinal {
3526 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3527 Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3528 }
3529 _ => Err(fidl::Error::UnknownOrdinal {
3530 ordinal: tx_header.ordinal,
3531 protocol_name:
3532 <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3533 }),
3534 }
3535 }
3536}
3537
3538pub struct SupplicantStaNetworkRequestStream {
3540 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3541 is_terminated: bool,
3542}
3543
3544impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
3545
3546impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
3547 fn is_terminated(&self) -> bool {
3548 self.is_terminated
3549 }
3550}
3551
3552impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
3553 type Protocol = SupplicantStaNetworkMarker;
3554 type ControlHandle = SupplicantStaNetworkControlHandle;
3555
3556 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3557 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3558 }
3559
3560 fn control_handle(&self) -> Self::ControlHandle {
3561 SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
3562 }
3563
3564 fn into_inner(
3565 self,
3566 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3567 {
3568 (self.inner, self.is_terminated)
3569 }
3570
3571 fn from_inner(
3572 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3573 is_terminated: bool,
3574 ) -> Self {
3575 Self { inner, is_terminated }
3576 }
3577}
3578
3579impl futures::Stream for SupplicantStaNetworkRequestStream {
3580 type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
3581
3582 fn poll_next(
3583 mut self: std::pin::Pin<&mut Self>,
3584 cx: &mut std::task::Context<'_>,
3585 ) -> std::task::Poll<Option<Self::Item>> {
3586 let this = &mut *self;
3587 if this.inner.check_shutdown(cx) {
3588 this.is_terminated = true;
3589 return std::task::Poll::Ready(None);
3590 }
3591 if this.is_terminated {
3592 panic!("polled SupplicantStaNetworkRequestStream after completion");
3593 }
3594 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3595 |bytes, handles| {
3596 match this.inner.channel().read_etc(cx, bytes, handles) {
3597 std::task::Poll::Ready(Ok(())) => {}
3598 std::task::Poll::Pending => return std::task::Poll::Pending,
3599 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3600 this.is_terminated = true;
3601 return std::task::Poll::Ready(None);
3602 }
3603 std::task::Poll::Ready(Err(e)) => {
3604 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3605 e.into(),
3606 ))))
3607 }
3608 }
3609
3610 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3612
3613 std::task::Poll::Ready(Some(match header.ordinal {
3614 0x10a91d044ee6374d => {
3615 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3616 let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3617 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
3618 let control_handle = SupplicantStaNetworkControlHandle {
3619 inner: this.inner.clone(),
3620 };
3621 Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
3622 control_handle,
3623 })
3624 }
3625 0xbc7ad82f541b267 => {
3626 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3627 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3628 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3629 let control_handle = SupplicantStaNetworkControlHandle {
3630 inner: this.inner.clone(),
3631 };
3632 Ok(SupplicantStaNetworkRequest::ClearBssid {
3633 control_handle,
3634 })
3635 }
3636 0x6b598a7a802e3083 => {
3637 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3638 let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3639 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
3640 let control_handle = SupplicantStaNetworkControlHandle {
3641 inner: this.inner.clone(),
3642 };
3643 Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
3644 control_handle,
3645 })
3646 }
3647 0xf6d438225979307 => {
3648 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3649 let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3650 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
3651 let control_handle = SupplicantStaNetworkControlHandle {
3652 inner: this.inner.clone(),
3653 };
3654 Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
3655 control_handle,
3656 })
3657 }
3658 0x354bc361a0c77b45 => {
3659 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3660 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3661 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3662 let control_handle = SupplicantStaNetworkControlHandle {
3663 inner: this.inner.clone(),
3664 };
3665 Ok(SupplicantStaNetworkRequest::Select {
3666 responder: SupplicantStaNetworkSelectResponder {
3667 control_handle: std::mem::ManuallyDrop::new(control_handle),
3668 tx_id: header.tx_id,
3669 },
3670 })
3671 }
3672 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3673 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
3674 ordinal: header.ordinal,
3675 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
3676 method_type: fidl::MethodType::OneWay,
3677 })
3678 }
3679 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3680 this.inner.send_framework_err(
3681 fidl::encoding::FrameworkErr::UnknownMethod,
3682 header.tx_id,
3683 header.ordinal,
3684 header.dynamic_flags(),
3685 (bytes, handles),
3686 )?;
3687 Ok(SupplicantStaNetworkRequest::_UnknownMethod {
3688 ordinal: header.ordinal,
3689 control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
3690 method_type: fidl::MethodType::TwoWay,
3691 })
3692 }
3693 _ => Err(fidl::Error::UnknownOrdinal {
3694 ordinal: header.ordinal,
3695 protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3696 }),
3697 }))
3698 },
3699 )
3700 }
3701}
3702
3703#[derive(Debug)]
3704pub enum SupplicantStaNetworkRequest {
3705 SetBssid {
3706 payload: SupplicantStaNetworkSetBssidRequest,
3707 control_handle: SupplicantStaNetworkControlHandle,
3708 },
3709 ClearBssid {
3710 control_handle: SupplicantStaNetworkControlHandle,
3711 },
3712 SetSsid {
3713 payload: SupplicantStaNetworkSetSsidRequest,
3714 control_handle: SupplicantStaNetworkControlHandle,
3715 },
3716 SetPskPassphrase {
3717 payload: SupplicantStaNetworkSetPskPassphraseRequest,
3718 control_handle: SupplicantStaNetworkControlHandle,
3719 },
3720 Select {
3721 responder: SupplicantStaNetworkSelectResponder,
3722 },
3723 #[non_exhaustive]
3725 _UnknownMethod {
3726 ordinal: u64,
3728 control_handle: SupplicantStaNetworkControlHandle,
3729 method_type: fidl::MethodType,
3730 },
3731}
3732
3733impl SupplicantStaNetworkRequest {
3734 #[allow(irrefutable_let_patterns)]
3735 pub fn into_set_bssid(
3736 self,
3737 ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
3738 if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
3739 Some((payload, control_handle))
3740 } else {
3741 None
3742 }
3743 }
3744
3745 #[allow(irrefutable_let_patterns)]
3746 pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
3747 if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
3748 Some((control_handle))
3749 } else {
3750 None
3751 }
3752 }
3753
3754 #[allow(irrefutable_let_patterns)]
3755 pub fn into_set_ssid(
3756 self,
3757 ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
3758 if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
3759 Some((payload, control_handle))
3760 } else {
3761 None
3762 }
3763 }
3764
3765 #[allow(irrefutable_let_patterns)]
3766 pub fn into_set_psk_passphrase(
3767 self,
3768 ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
3769 {
3770 if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
3771 Some((payload, control_handle))
3772 } else {
3773 None
3774 }
3775 }
3776
3777 #[allow(irrefutable_let_patterns)]
3778 pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
3779 if let SupplicantStaNetworkRequest::Select { responder } = self {
3780 Some((responder))
3781 } else {
3782 None
3783 }
3784 }
3785
3786 pub fn method_name(&self) -> &'static str {
3788 match *self {
3789 SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
3790 SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
3791 SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
3792 SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
3793 SupplicantStaNetworkRequest::Select { .. } => "select",
3794 SupplicantStaNetworkRequest::_UnknownMethod {
3795 method_type: fidl::MethodType::OneWay,
3796 ..
3797 } => "unknown one-way method",
3798 SupplicantStaNetworkRequest::_UnknownMethod {
3799 method_type: fidl::MethodType::TwoWay,
3800 ..
3801 } => "unknown two-way method",
3802 }
3803 }
3804}
3805
3806#[derive(Debug, Clone)]
3807pub struct SupplicantStaNetworkControlHandle {
3808 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3809}
3810
3811impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
3812 fn shutdown(&self) {
3813 self.inner.shutdown()
3814 }
3815 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3816 self.inner.shutdown_with_epitaph(status)
3817 }
3818
3819 fn is_closed(&self) -> bool {
3820 self.inner.channel().is_closed()
3821 }
3822 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3823 self.inner.channel().on_closed()
3824 }
3825
3826 #[cfg(target_os = "fuchsia")]
3827 fn signal_peer(
3828 &self,
3829 clear_mask: zx::Signals,
3830 set_mask: zx::Signals,
3831 ) -> Result<(), zx_status::Status> {
3832 use fidl::Peered;
3833 self.inner.channel().signal_peer(clear_mask, set_mask)
3834 }
3835}
3836
3837impl SupplicantStaNetworkControlHandle {}
3838
3839#[must_use = "FIDL methods require a response to be sent"]
3840#[derive(Debug)]
3841pub struct SupplicantStaNetworkSelectResponder {
3842 control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
3843 tx_id: u32,
3844}
3845
3846impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
3850 fn drop(&mut self) {
3851 self.control_handle.shutdown();
3852 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3854 }
3855}
3856
3857impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
3858 type ControlHandle = SupplicantStaNetworkControlHandle;
3859
3860 fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
3861 &self.control_handle
3862 }
3863
3864 fn drop_without_shutdown(mut self) {
3865 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3867 std::mem::forget(self);
3869 }
3870}
3871
3872impl SupplicantStaNetworkSelectResponder {
3873 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3877 let _result = self.send_raw(result);
3878 if _result.is_err() {
3879 self.control_handle.shutdown();
3880 }
3881 self.drop_without_shutdown();
3882 _result
3883 }
3884
3885 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3887 let _result = self.send_raw(result);
3888 self.drop_without_shutdown();
3889 _result
3890 }
3891
3892 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3893 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3894 fidl::encoding::EmptyStruct,
3895 i32,
3896 >>(
3897 fidl::encoding::FlexibleResult::new(result),
3898 self.tx_id,
3899 0x354bc361a0c77b45,
3900 fidl::encoding::DynamicFlags::FLEXIBLE,
3901 )
3902 }
3903}
3904
3905#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3906pub struct WifiMarker;
3907
3908impl fidl::endpoints::ProtocolMarker for WifiMarker {
3909 type Proxy = WifiProxy;
3910 type RequestStream = WifiRequestStream;
3911 #[cfg(target_os = "fuchsia")]
3912 type SynchronousProxy = WifiSynchronousProxy;
3913
3914 const DEBUG_NAME: &'static str = "(anonymous) Wifi";
3915}
3916pub type WifiStartResult = Result<(), i32>;
3917pub type WifiStopResult = Result<(), i32>;
3918pub type WifiGetChipResult = Result<(), i32>;
3919
3920pub trait WifiProxyInterface: Send + Sync {
3921 fn r#register_event_callback(
3922 &self,
3923 payload: WifiRegisterEventCallbackRequest,
3924 ) -> Result<(), fidl::Error>;
3925 type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
3926 fn r#start(&self) -> Self::StartResponseFut;
3927 type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
3928 fn r#stop(&self) -> Self::StopResponseFut;
3929 type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
3930 + Send;
3931 fn r#get_state(&self) -> Self::GetStateResponseFut;
3932 type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
3933 + Send;
3934 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
3935 type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
3936 + Send;
3937 fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
3938}
3939#[derive(Debug)]
3940#[cfg(target_os = "fuchsia")]
3941pub struct WifiSynchronousProxy {
3942 client: fidl::client::sync::Client,
3943}
3944
3945#[cfg(target_os = "fuchsia")]
3946impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
3947 type Proxy = WifiProxy;
3948 type Protocol = WifiMarker;
3949
3950 fn from_channel(inner: fidl::Channel) -> Self {
3951 Self::new(inner)
3952 }
3953
3954 fn into_channel(self) -> fidl::Channel {
3955 self.client.into_channel()
3956 }
3957
3958 fn as_channel(&self) -> &fidl::Channel {
3959 self.client.as_channel()
3960 }
3961}
3962
3963#[cfg(target_os = "fuchsia")]
3964impl WifiSynchronousProxy {
3965 pub fn new(channel: fidl::Channel) -> Self {
3966 let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3967 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3968 }
3969
3970 pub fn into_channel(self) -> fidl::Channel {
3971 self.client.into_channel()
3972 }
3973
3974 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
3977 WifiEvent::decode(self.client.wait_for_event(deadline)?)
3978 }
3979
3980 pub fn r#register_event_callback(
3983 &self,
3984 mut payload: WifiRegisterEventCallbackRequest,
3985 ) -> Result<(), fidl::Error> {
3986 self.client.send::<WifiRegisterEventCallbackRequest>(
3987 &mut payload,
3988 0x12abbdea948dd67b,
3989 fidl::encoding::DynamicFlags::FLEXIBLE,
3990 )
3991 }
3992
3993 pub fn r#start(
3997 &self,
3998 ___deadline: zx::MonotonicInstant,
3999 ) -> Result<WifiStartResult, fidl::Error> {
4000 let _response = self.client.send_query::<
4001 fidl::encoding::EmptyPayload,
4002 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4003 >(
4004 (),
4005 0x427030e4dc6ec07a,
4006 fidl::encoding::DynamicFlags::FLEXIBLE,
4007 ___deadline,
4008 )?
4009 .into_result::<WifiMarker>("start")?;
4010 Ok(_response.map(|x| x))
4011 }
4012
4013 pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
4017 let _response = self.client.send_query::<
4018 fidl::encoding::EmptyPayload,
4019 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4020 >(
4021 (),
4022 0x67c9bdf61b2888d,
4023 fidl::encoding::DynamicFlags::FLEXIBLE,
4024 ___deadline,
4025 )?
4026 .into_result::<WifiMarker>("stop")?;
4027 Ok(_response.map(|x| x))
4028 }
4029
4030 pub fn r#get_state(
4032 &self,
4033 ___deadline: zx::MonotonicInstant,
4034 ) -> Result<WifiGetStateResponse, fidl::Error> {
4035 let _response = self.client.send_query::<
4036 fidl::encoding::EmptyPayload,
4037 fidl::encoding::FlexibleType<WifiGetStateResponse>,
4038 >(
4039 (),
4040 0x4616114a937d1fb0,
4041 fidl::encoding::DynamicFlags::FLEXIBLE,
4042 ___deadline,
4043 )?
4044 .into_result::<WifiMarker>("get_state")?;
4045 Ok(_response)
4046 }
4047
4048 pub fn r#get_chip_ids(
4050 &self,
4051 ___deadline: zx::MonotonicInstant,
4052 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4053 let _response = self.client.send_query::<
4054 fidl::encoding::EmptyPayload,
4055 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4056 >(
4057 (),
4058 0x2fb4f92351d802b5,
4059 fidl::encoding::DynamicFlags::FLEXIBLE,
4060 ___deadline,
4061 )?
4062 .into_result::<WifiMarker>("get_chip_ids")?;
4063 Ok(_response)
4064 }
4065
4066 pub fn r#get_chip(
4069 &self,
4070 mut payload: WifiGetChipRequest,
4071 ___deadline: zx::MonotonicInstant,
4072 ) -> Result<WifiGetChipResult, fidl::Error> {
4073 let _response = self.client.send_query::<
4074 WifiGetChipRequest,
4075 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4076 >(
4077 &mut payload,
4078 0xef95d8246612540,
4079 fidl::encoding::DynamicFlags::FLEXIBLE,
4080 ___deadline,
4081 )?
4082 .into_result::<WifiMarker>("get_chip")?;
4083 Ok(_response.map(|x| x))
4084 }
4085}
4086
4087#[cfg(target_os = "fuchsia")]
4088impl From<WifiSynchronousProxy> for zx::Handle {
4089 fn from(value: WifiSynchronousProxy) -> Self {
4090 value.into_channel().into()
4091 }
4092}
4093
4094#[cfg(target_os = "fuchsia")]
4095impl From<fidl::Channel> for WifiSynchronousProxy {
4096 fn from(value: fidl::Channel) -> Self {
4097 Self::new(value)
4098 }
4099}
4100
4101#[derive(Debug, Clone)]
4102pub struct WifiProxy {
4103 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4104}
4105
4106impl fidl::endpoints::Proxy for WifiProxy {
4107 type Protocol = WifiMarker;
4108
4109 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4110 Self::new(inner)
4111 }
4112
4113 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4114 self.client.into_channel().map_err(|client| Self { client })
4115 }
4116
4117 fn as_channel(&self) -> &::fidl::AsyncChannel {
4118 self.client.as_channel()
4119 }
4120}
4121
4122impl WifiProxy {
4123 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4125 let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4126 Self { client: fidl::client::Client::new(channel, protocol_name) }
4127 }
4128
4129 pub fn take_event_stream(&self) -> WifiEventStream {
4135 WifiEventStream { event_receiver: self.client.take_event_receiver() }
4136 }
4137
4138 pub fn r#register_event_callback(
4141 &self,
4142 mut payload: WifiRegisterEventCallbackRequest,
4143 ) -> Result<(), fidl::Error> {
4144 WifiProxyInterface::r#register_event_callback(self, payload)
4145 }
4146
4147 pub fn r#start(
4151 &self,
4152 ) -> fidl::client::QueryResponseFut<
4153 WifiStartResult,
4154 fidl::encoding::DefaultFuchsiaResourceDialect,
4155 > {
4156 WifiProxyInterface::r#start(self)
4157 }
4158
4159 pub fn r#stop(
4163 &self,
4164 ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
4165 {
4166 WifiProxyInterface::r#stop(self)
4167 }
4168
4169 pub fn r#get_state(
4171 &self,
4172 ) -> fidl::client::QueryResponseFut<
4173 WifiGetStateResponse,
4174 fidl::encoding::DefaultFuchsiaResourceDialect,
4175 > {
4176 WifiProxyInterface::r#get_state(self)
4177 }
4178
4179 pub fn r#get_chip_ids(
4181 &self,
4182 ) -> fidl::client::QueryResponseFut<
4183 WifiGetChipIdsResponse,
4184 fidl::encoding::DefaultFuchsiaResourceDialect,
4185 > {
4186 WifiProxyInterface::r#get_chip_ids(self)
4187 }
4188
4189 pub fn r#get_chip(
4192 &self,
4193 mut payload: WifiGetChipRequest,
4194 ) -> fidl::client::QueryResponseFut<
4195 WifiGetChipResult,
4196 fidl::encoding::DefaultFuchsiaResourceDialect,
4197 > {
4198 WifiProxyInterface::r#get_chip(self, payload)
4199 }
4200}
4201
4202impl WifiProxyInterface for WifiProxy {
4203 fn r#register_event_callback(
4204 &self,
4205 mut payload: WifiRegisterEventCallbackRequest,
4206 ) -> Result<(), fidl::Error> {
4207 self.client.send::<WifiRegisterEventCallbackRequest>(
4208 &mut payload,
4209 0x12abbdea948dd67b,
4210 fidl::encoding::DynamicFlags::FLEXIBLE,
4211 )
4212 }
4213
4214 type StartResponseFut = fidl::client::QueryResponseFut<
4215 WifiStartResult,
4216 fidl::encoding::DefaultFuchsiaResourceDialect,
4217 >;
4218 fn r#start(&self) -> Self::StartResponseFut {
4219 fn _decode(
4220 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4221 ) -> Result<WifiStartResult, fidl::Error> {
4222 let _response = fidl::client::decode_transaction_body::<
4223 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4224 fidl::encoding::DefaultFuchsiaResourceDialect,
4225 0x427030e4dc6ec07a,
4226 >(_buf?)?
4227 .into_result::<WifiMarker>("start")?;
4228 Ok(_response.map(|x| x))
4229 }
4230 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
4231 (),
4232 0x427030e4dc6ec07a,
4233 fidl::encoding::DynamicFlags::FLEXIBLE,
4234 _decode,
4235 )
4236 }
4237
4238 type StopResponseFut = fidl::client::QueryResponseFut<
4239 WifiStopResult,
4240 fidl::encoding::DefaultFuchsiaResourceDialect,
4241 >;
4242 fn r#stop(&self) -> Self::StopResponseFut {
4243 fn _decode(
4244 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4245 ) -> Result<WifiStopResult, fidl::Error> {
4246 let _response = fidl::client::decode_transaction_body::<
4247 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4248 fidl::encoding::DefaultFuchsiaResourceDialect,
4249 0x67c9bdf61b2888d,
4250 >(_buf?)?
4251 .into_result::<WifiMarker>("stop")?;
4252 Ok(_response.map(|x| x))
4253 }
4254 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
4255 (),
4256 0x67c9bdf61b2888d,
4257 fidl::encoding::DynamicFlags::FLEXIBLE,
4258 _decode,
4259 )
4260 }
4261
4262 type GetStateResponseFut = fidl::client::QueryResponseFut<
4263 WifiGetStateResponse,
4264 fidl::encoding::DefaultFuchsiaResourceDialect,
4265 >;
4266 fn r#get_state(&self) -> Self::GetStateResponseFut {
4267 fn _decode(
4268 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4269 ) -> Result<WifiGetStateResponse, fidl::Error> {
4270 let _response = fidl::client::decode_transaction_body::<
4271 fidl::encoding::FlexibleType<WifiGetStateResponse>,
4272 fidl::encoding::DefaultFuchsiaResourceDialect,
4273 0x4616114a937d1fb0,
4274 >(_buf?)?
4275 .into_result::<WifiMarker>("get_state")?;
4276 Ok(_response)
4277 }
4278 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
4279 (),
4280 0x4616114a937d1fb0,
4281 fidl::encoding::DynamicFlags::FLEXIBLE,
4282 _decode,
4283 )
4284 }
4285
4286 type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
4287 WifiGetChipIdsResponse,
4288 fidl::encoding::DefaultFuchsiaResourceDialect,
4289 >;
4290 fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
4291 fn _decode(
4292 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4293 ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4294 let _response = fidl::client::decode_transaction_body::<
4295 fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4296 fidl::encoding::DefaultFuchsiaResourceDialect,
4297 0x2fb4f92351d802b5,
4298 >(_buf?)?
4299 .into_result::<WifiMarker>("get_chip_ids")?;
4300 Ok(_response)
4301 }
4302 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
4303 (),
4304 0x2fb4f92351d802b5,
4305 fidl::encoding::DynamicFlags::FLEXIBLE,
4306 _decode,
4307 )
4308 }
4309
4310 type GetChipResponseFut = fidl::client::QueryResponseFut<
4311 WifiGetChipResult,
4312 fidl::encoding::DefaultFuchsiaResourceDialect,
4313 >;
4314 fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
4315 fn _decode(
4316 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4317 ) -> Result<WifiGetChipResult, fidl::Error> {
4318 let _response = fidl::client::decode_transaction_body::<
4319 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4320 fidl::encoding::DefaultFuchsiaResourceDialect,
4321 0xef95d8246612540,
4322 >(_buf?)?
4323 .into_result::<WifiMarker>("get_chip")?;
4324 Ok(_response.map(|x| x))
4325 }
4326 self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
4327 &mut payload,
4328 0xef95d8246612540,
4329 fidl::encoding::DynamicFlags::FLEXIBLE,
4330 _decode,
4331 )
4332 }
4333}
4334
4335pub struct WifiEventStream {
4336 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4337}
4338
4339impl std::marker::Unpin for WifiEventStream {}
4340
4341impl futures::stream::FusedStream for WifiEventStream {
4342 fn is_terminated(&self) -> bool {
4343 self.event_receiver.is_terminated()
4344 }
4345}
4346
4347impl futures::Stream for WifiEventStream {
4348 type Item = Result<WifiEvent, fidl::Error>;
4349
4350 fn poll_next(
4351 mut self: std::pin::Pin<&mut Self>,
4352 cx: &mut std::task::Context<'_>,
4353 ) -> std::task::Poll<Option<Self::Item>> {
4354 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4355 &mut self.event_receiver,
4356 cx
4357 )?) {
4358 Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
4359 None => std::task::Poll::Ready(None),
4360 }
4361 }
4362}
4363
4364#[derive(Debug)]
4365pub enum WifiEvent {
4366 #[non_exhaustive]
4367 _UnknownEvent {
4368 ordinal: u64,
4370 },
4371}
4372
4373impl WifiEvent {
4374 fn decode(
4376 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4377 ) -> Result<WifiEvent, fidl::Error> {
4378 let (bytes, _handles) = buf.split_mut();
4379 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4380 debug_assert_eq!(tx_header.tx_id, 0);
4381 match tx_header.ordinal {
4382 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4383 Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4384 }
4385 _ => Err(fidl::Error::UnknownOrdinal {
4386 ordinal: tx_header.ordinal,
4387 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4388 }),
4389 }
4390 }
4391}
4392
4393pub struct WifiRequestStream {
4395 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4396 is_terminated: bool,
4397}
4398
4399impl std::marker::Unpin for WifiRequestStream {}
4400
4401impl futures::stream::FusedStream for WifiRequestStream {
4402 fn is_terminated(&self) -> bool {
4403 self.is_terminated
4404 }
4405}
4406
4407impl fidl::endpoints::RequestStream for WifiRequestStream {
4408 type Protocol = WifiMarker;
4409 type ControlHandle = WifiControlHandle;
4410
4411 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4412 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4413 }
4414
4415 fn control_handle(&self) -> Self::ControlHandle {
4416 WifiControlHandle { inner: self.inner.clone() }
4417 }
4418
4419 fn into_inner(
4420 self,
4421 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4422 {
4423 (self.inner, self.is_terminated)
4424 }
4425
4426 fn from_inner(
4427 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4428 is_terminated: bool,
4429 ) -> Self {
4430 Self { inner, is_terminated }
4431 }
4432}
4433
4434impl futures::Stream for WifiRequestStream {
4435 type Item = Result<WifiRequest, fidl::Error>;
4436
4437 fn poll_next(
4438 mut self: std::pin::Pin<&mut Self>,
4439 cx: &mut std::task::Context<'_>,
4440 ) -> std::task::Poll<Option<Self::Item>> {
4441 let this = &mut *self;
4442 if this.inner.check_shutdown(cx) {
4443 this.is_terminated = true;
4444 return std::task::Poll::Ready(None);
4445 }
4446 if this.is_terminated {
4447 panic!("polled WifiRequestStream after completion");
4448 }
4449 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4450 |bytes, handles| {
4451 match this.inner.channel().read_etc(cx, bytes, handles) {
4452 std::task::Poll::Ready(Ok(())) => {}
4453 std::task::Poll::Pending => return std::task::Poll::Pending,
4454 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4455 this.is_terminated = true;
4456 return std::task::Poll::Ready(None);
4457 }
4458 std::task::Poll::Ready(Err(e)) => {
4459 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4460 e.into(),
4461 ))))
4462 }
4463 }
4464
4465 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4467
4468 std::task::Poll::Ready(Some(match header.ordinal {
4469 0x12abbdea948dd67b => {
4470 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4471 let mut req = fidl::new_empty!(
4472 WifiRegisterEventCallbackRequest,
4473 fidl::encoding::DefaultFuchsiaResourceDialect
4474 );
4475 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
4476 let control_handle = WifiControlHandle { inner: this.inner.clone() };
4477 Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
4478 }
4479 0x427030e4dc6ec07a => {
4480 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4481 let mut req = fidl::new_empty!(
4482 fidl::encoding::EmptyPayload,
4483 fidl::encoding::DefaultFuchsiaResourceDialect
4484 );
4485 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4486 let control_handle = WifiControlHandle { inner: this.inner.clone() };
4487 Ok(WifiRequest::Start {
4488 responder: WifiStartResponder {
4489 control_handle: std::mem::ManuallyDrop::new(control_handle),
4490 tx_id: header.tx_id,
4491 },
4492 })
4493 }
4494 0x67c9bdf61b2888d => {
4495 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4496 let mut req = fidl::new_empty!(
4497 fidl::encoding::EmptyPayload,
4498 fidl::encoding::DefaultFuchsiaResourceDialect
4499 );
4500 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4501 let control_handle = WifiControlHandle { inner: this.inner.clone() };
4502 Ok(WifiRequest::Stop {
4503 responder: WifiStopResponder {
4504 control_handle: std::mem::ManuallyDrop::new(control_handle),
4505 tx_id: header.tx_id,
4506 },
4507 })
4508 }
4509 0x4616114a937d1fb0 => {
4510 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4511 let mut req = fidl::new_empty!(
4512 fidl::encoding::EmptyPayload,
4513 fidl::encoding::DefaultFuchsiaResourceDialect
4514 );
4515 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4516 let control_handle = WifiControlHandle { inner: this.inner.clone() };
4517 Ok(WifiRequest::GetState {
4518 responder: WifiGetStateResponder {
4519 control_handle: std::mem::ManuallyDrop::new(control_handle),
4520 tx_id: header.tx_id,
4521 },
4522 })
4523 }
4524 0x2fb4f92351d802b5 => {
4525 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4526 let mut req = fidl::new_empty!(
4527 fidl::encoding::EmptyPayload,
4528 fidl::encoding::DefaultFuchsiaResourceDialect
4529 );
4530 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4531 let control_handle = WifiControlHandle { inner: this.inner.clone() };
4532 Ok(WifiRequest::GetChipIds {
4533 responder: WifiGetChipIdsResponder {
4534 control_handle: std::mem::ManuallyDrop::new(control_handle),
4535 tx_id: header.tx_id,
4536 },
4537 })
4538 }
4539 0xef95d8246612540 => {
4540 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4541 let mut req = fidl::new_empty!(
4542 WifiGetChipRequest,
4543 fidl::encoding::DefaultFuchsiaResourceDialect
4544 );
4545 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
4546 let control_handle = WifiControlHandle { inner: this.inner.clone() };
4547 Ok(WifiRequest::GetChip {
4548 payload: req,
4549 responder: WifiGetChipResponder {
4550 control_handle: std::mem::ManuallyDrop::new(control_handle),
4551 tx_id: header.tx_id,
4552 },
4553 })
4554 }
4555 _ if header.tx_id == 0
4556 && header
4557 .dynamic_flags()
4558 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4559 {
4560 Ok(WifiRequest::_UnknownMethod {
4561 ordinal: header.ordinal,
4562 control_handle: WifiControlHandle { inner: this.inner.clone() },
4563 method_type: fidl::MethodType::OneWay,
4564 })
4565 }
4566 _ if header
4567 .dynamic_flags()
4568 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4569 {
4570 this.inner.send_framework_err(
4571 fidl::encoding::FrameworkErr::UnknownMethod,
4572 header.tx_id,
4573 header.ordinal,
4574 header.dynamic_flags(),
4575 (bytes, handles),
4576 )?;
4577 Ok(WifiRequest::_UnknownMethod {
4578 ordinal: header.ordinal,
4579 control_handle: WifiControlHandle { inner: this.inner.clone() },
4580 method_type: fidl::MethodType::TwoWay,
4581 })
4582 }
4583 _ => Err(fidl::Error::UnknownOrdinal {
4584 ordinal: header.ordinal,
4585 protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4586 }),
4587 }))
4588 },
4589 )
4590 }
4591}
4592
4593#[derive(Debug)]
4594pub enum WifiRequest {
4595 RegisterEventCallback {
4598 payload: WifiRegisterEventCallbackRequest,
4599 control_handle: WifiControlHandle,
4600 },
4601 Start { responder: WifiStartResponder },
4605 Stop { responder: WifiStopResponder },
4609 GetState { responder: WifiGetStateResponder },
4611 GetChipIds { responder: WifiGetChipIdsResponder },
4613 GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
4616 #[non_exhaustive]
4618 _UnknownMethod {
4619 ordinal: u64,
4621 control_handle: WifiControlHandle,
4622 method_type: fidl::MethodType,
4623 },
4624}
4625
4626impl WifiRequest {
4627 #[allow(irrefutable_let_patterns)]
4628 pub fn into_register_event_callback(
4629 self,
4630 ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
4631 if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
4632 Some((payload, control_handle))
4633 } else {
4634 None
4635 }
4636 }
4637
4638 #[allow(irrefutable_let_patterns)]
4639 pub fn into_start(self) -> Option<(WifiStartResponder)> {
4640 if let WifiRequest::Start { responder } = self {
4641 Some((responder))
4642 } else {
4643 None
4644 }
4645 }
4646
4647 #[allow(irrefutable_let_patterns)]
4648 pub fn into_stop(self) -> Option<(WifiStopResponder)> {
4649 if let WifiRequest::Stop { responder } = self {
4650 Some((responder))
4651 } else {
4652 None
4653 }
4654 }
4655
4656 #[allow(irrefutable_let_patterns)]
4657 pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
4658 if let WifiRequest::GetState { responder } = self {
4659 Some((responder))
4660 } else {
4661 None
4662 }
4663 }
4664
4665 #[allow(irrefutable_let_patterns)]
4666 pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
4667 if let WifiRequest::GetChipIds { responder } = self {
4668 Some((responder))
4669 } else {
4670 None
4671 }
4672 }
4673
4674 #[allow(irrefutable_let_patterns)]
4675 pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
4676 if let WifiRequest::GetChip { payload, responder } = self {
4677 Some((payload, responder))
4678 } else {
4679 None
4680 }
4681 }
4682
4683 pub fn method_name(&self) -> &'static str {
4685 match *self {
4686 WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
4687 WifiRequest::Start { .. } => "start",
4688 WifiRequest::Stop { .. } => "stop",
4689 WifiRequest::GetState { .. } => "get_state",
4690 WifiRequest::GetChipIds { .. } => "get_chip_ids",
4691 WifiRequest::GetChip { .. } => "get_chip",
4692 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4693 "unknown one-way method"
4694 }
4695 WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4696 "unknown two-way method"
4697 }
4698 }
4699 }
4700}
4701
4702#[derive(Debug, Clone)]
4703pub struct WifiControlHandle {
4704 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4705}
4706
4707impl fidl::endpoints::ControlHandle for WifiControlHandle {
4708 fn shutdown(&self) {
4709 self.inner.shutdown()
4710 }
4711 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4712 self.inner.shutdown_with_epitaph(status)
4713 }
4714
4715 fn is_closed(&self) -> bool {
4716 self.inner.channel().is_closed()
4717 }
4718 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4719 self.inner.channel().on_closed()
4720 }
4721
4722 #[cfg(target_os = "fuchsia")]
4723 fn signal_peer(
4724 &self,
4725 clear_mask: zx::Signals,
4726 set_mask: zx::Signals,
4727 ) -> Result<(), zx_status::Status> {
4728 use fidl::Peered;
4729 self.inner.channel().signal_peer(clear_mask, set_mask)
4730 }
4731}
4732
4733impl WifiControlHandle {}
4734
4735#[must_use = "FIDL methods require a response to be sent"]
4736#[derive(Debug)]
4737pub struct WifiStartResponder {
4738 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
4739 tx_id: u32,
4740}
4741
4742impl std::ops::Drop for WifiStartResponder {
4746 fn drop(&mut self) {
4747 self.control_handle.shutdown();
4748 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4750 }
4751}
4752
4753impl fidl::endpoints::Responder for WifiStartResponder {
4754 type ControlHandle = WifiControlHandle;
4755
4756 fn control_handle(&self) -> &WifiControlHandle {
4757 &self.control_handle
4758 }
4759
4760 fn drop_without_shutdown(mut self) {
4761 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4763 std::mem::forget(self);
4765 }
4766}
4767
4768impl WifiStartResponder {
4769 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4773 let _result = self.send_raw(result);
4774 if _result.is_err() {
4775 self.control_handle.shutdown();
4776 }
4777 self.drop_without_shutdown();
4778 _result
4779 }
4780
4781 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4783 let _result = self.send_raw(result);
4784 self.drop_without_shutdown();
4785 _result
4786 }
4787
4788 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4789 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4790 fidl::encoding::EmptyStruct,
4791 i32,
4792 >>(
4793 fidl::encoding::FlexibleResult::new(result),
4794 self.tx_id,
4795 0x427030e4dc6ec07a,
4796 fidl::encoding::DynamicFlags::FLEXIBLE,
4797 )
4798 }
4799}
4800
4801#[must_use = "FIDL methods require a response to be sent"]
4802#[derive(Debug)]
4803pub struct WifiStopResponder {
4804 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
4805 tx_id: u32,
4806}
4807
4808impl std::ops::Drop for WifiStopResponder {
4812 fn drop(&mut self) {
4813 self.control_handle.shutdown();
4814 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4816 }
4817}
4818
4819impl fidl::endpoints::Responder for WifiStopResponder {
4820 type ControlHandle = WifiControlHandle;
4821
4822 fn control_handle(&self) -> &WifiControlHandle {
4823 &self.control_handle
4824 }
4825
4826 fn drop_without_shutdown(mut self) {
4827 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4829 std::mem::forget(self);
4831 }
4832}
4833
4834impl WifiStopResponder {
4835 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4839 let _result = self.send_raw(result);
4840 if _result.is_err() {
4841 self.control_handle.shutdown();
4842 }
4843 self.drop_without_shutdown();
4844 _result
4845 }
4846
4847 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4849 let _result = self.send_raw(result);
4850 self.drop_without_shutdown();
4851 _result
4852 }
4853
4854 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4855 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4856 fidl::encoding::EmptyStruct,
4857 i32,
4858 >>(
4859 fidl::encoding::FlexibleResult::new(result),
4860 self.tx_id,
4861 0x67c9bdf61b2888d,
4862 fidl::encoding::DynamicFlags::FLEXIBLE,
4863 )
4864 }
4865}
4866
4867#[must_use = "FIDL methods require a response to be sent"]
4868#[derive(Debug)]
4869pub struct WifiGetStateResponder {
4870 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
4871 tx_id: u32,
4872}
4873
4874impl std::ops::Drop for WifiGetStateResponder {
4878 fn drop(&mut self) {
4879 self.control_handle.shutdown();
4880 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4882 }
4883}
4884
4885impl fidl::endpoints::Responder for WifiGetStateResponder {
4886 type ControlHandle = WifiControlHandle;
4887
4888 fn control_handle(&self) -> &WifiControlHandle {
4889 &self.control_handle
4890 }
4891
4892 fn drop_without_shutdown(mut self) {
4893 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4895 std::mem::forget(self);
4897 }
4898}
4899
4900impl WifiGetStateResponder {
4901 pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
4905 let _result = self.send_raw(payload);
4906 if _result.is_err() {
4907 self.control_handle.shutdown();
4908 }
4909 self.drop_without_shutdown();
4910 _result
4911 }
4912
4913 pub fn send_no_shutdown_on_err(
4915 self,
4916 mut payload: &WifiGetStateResponse,
4917 ) -> Result<(), fidl::Error> {
4918 let _result = self.send_raw(payload);
4919 self.drop_without_shutdown();
4920 _result
4921 }
4922
4923 fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
4924 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
4925 fidl::encoding::Flexible::new(payload),
4926 self.tx_id,
4927 0x4616114a937d1fb0,
4928 fidl::encoding::DynamicFlags::FLEXIBLE,
4929 )
4930 }
4931}
4932
4933#[must_use = "FIDL methods require a response to be sent"]
4934#[derive(Debug)]
4935pub struct WifiGetChipIdsResponder {
4936 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
4937 tx_id: u32,
4938}
4939
4940impl std::ops::Drop for WifiGetChipIdsResponder {
4944 fn drop(&mut self) {
4945 self.control_handle.shutdown();
4946 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4948 }
4949}
4950
4951impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
4952 type ControlHandle = WifiControlHandle;
4953
4954 fn control_handle(&self) -> &WifiControlHandle {
4955 &self.control_handle
4956 }
4957
4958 fn drop_without_shutdown(mut self) {
4959 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4961 std::mem::forget(self);
4963 }
4964}
4965
4966impl WifiGetChipIdsResponder {
4967 pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
4971 let _result = self.send_raw(payload);
4972 if _result.is_err() {
4973 self.control_handle.shutdown();
4974 }
4975 self.drop_without_shutdown();
4976 _result
4977 }
4978
4979 pub fn send_no_shutdown_on_err(
4981 self,
4982 mut payload: &WifiGetChipIdsResponse,
4983 ) -> Result<(), fidl::Error> {
4984 let _result = self.send_raw(payload);
4985 self.drop_without_shutdown();
4986 _result
4987 }
4988
4989 fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
4990 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
4991 fidl::encoding::Flexible::new(payload),
4992 self.tx_id,
4993 0x2fb4f92351d802b5,
4994 fidl::encoding::DynamicFlags::FLEXIBLE,
4995 )
4996 }
4997}
4998
4999#[must_use = "FIDL methods require a response to be sent"]
5000#[derive(Debug)]
5001pub struct WifiGetChipResponder {
5002 control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5003 tx_id: u32,
5004}
5005
5006impl std::ops::Drop for WifiGetChipResponder {
5010 fn drop(&mut self) {
5011 self.control_handle.shutdown();
5012 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5014 }
5015}
5016
5017impl fidl::endpoints::Responder for WifiGetChipResponder {
5018 type ControlHandle = WifiControlHandle;
5019
5020 fn control_handle(&self) -> &WifiControlHandle {
5021 &self.control_handle
5022 }
5023
5024 fn drop_without_shutdown(mut self) {
5025 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5027 std::mem::forget(self);
5029 }
5030}
5031
5032impl WifiGetChipResponder {
5033 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5037 let _result = self.send_raw(result);
5038 if _result.is_err() {
5039 self.control_handle.shutdown();
5040 }
5041 self.drop_without_shutdown();
5042 _result
5043 }
5044
5045 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5047 let _result = self.send_raw(result);
5048 self.drop_without_shutdown();
5049 _result
5050 }
5051
5052 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5053 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5054 fidl::encoding::EmptyStruct,
5055 i32,
5056 >>(
5057 fidl::encoding::FlexibleResult::new(result),
5058 self.tx_id,
5059 0xef95d8246612540,
5060 fidl::encoding::DynamicFlags::FLEXIBLE,
5061 )
5062 }
5063}
5064
5065#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5066pub struct WifiChipMarker;
5067
5068impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
5069 type Proxy = WifiChipProxy;
5070 type RequestStream = WifiChipRequestStream;
5071 #[cfg(target_os = "fuchsia")]
5072 type SynchronousProxy = WifiChipSynchronousProxy;
5073
5074 const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
5075}
5076pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
5077pub type WifiChipGetStaIfaceResult = Result<(), i32>;
5078pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
5079pub type WifiChipSetCountryCodeResult = Result<(), i32>;
5080
5081pub trait WifiChipProxyInterface: Send + Sync {
5082 type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
5083 + Send;
5084 fn r#create_sta_iface(
5085 &self,
5086 payload: WifiChipCreateStaIfaceRequest,
5087 ) -> Self::CreateStaIfaceResponseFut;
5088 type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
5089 + Send;
5090 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
5091 type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
5092 + Send;
5093 fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
5094 type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
5095 + Send;
5096 fn r#remove_sta_iface(
5097 &self,
5098 payload: WifiChipRemoveStaIfaceRequest,
5099 ) -> Self::RemoveStaIfaceResponseFut;
5100 type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
5101 + Send;
5102 fn r#set_country_code(
5103 &self,
5104 payload: WifiChipSetCountryCodeRequest,
5105 ) -> Self::SetCountryCodeResponseFut;
5106 type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
5107 + Send;
5108 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
5109 type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
5110 + Send;
5111 fn r#get_id(&self) -> Self::GetIdResponseFut;
5112 type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
5113 + Send;
5114 fn r#get_mode(&self) -> Self::GetModeResponseFut;
5115 type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
5116 + Send;
5117 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
5118}
5119#[derive(Debug)]
5120#[cfg(target_os = "fuchsia")]
5121pub struct WifiChipSynchronousProxy {
5122 client: fidl::client::sync::Client,
5123}
5124
5125#[cfg(target_os = "fuchsia")]
5126impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
5127 type Proxy = WifiChipProxy;
5128 type Protocol = WifiChipMarker;
5129
5130 fn from_channel(inner: fidl::Channel) -> Self {
5131 Self::new(inner)
5132 }
5133
5134 fn into_channel(self) -> fidl::Channel {
5135 self.client.into_channel()
5136 }
5137
5138 fn as_channel(&self) -> &fidl::Channel {
5139 self.client.as_channel()
5140 }
5141}
5142
5143#[cfg(target_os = "fuchsia")]
5144impl WifiChipSynchronousProxy {
5145 pub fn new(channel: fidl::Channel) -> Self {
5146 let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5147 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5148 }
5149
5150 pub fn into_channel(self) -> fidl::Channel {
5151 self.client.into_channel()
5152 }
5153
5154 pub fn wait_for_event(
5157 &self,
5158 deadline: zx::MonotonicInstant,
5159 ) -> Result<WifiChipEvent, fidl::Error> {
5160 WifiChipEvent::decode(self.client.wait_for_event(deadline)?)
5161 }
5162
5163 pub fn r#create_sta_iface(
5165 &self,
5166 mut payload: WifiChipCreateStaIfaceRequest,
5167 ___deadline: zx::MonotonicInstant,
5168 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
5169 let _response = self.client.send_query::<
5170 WifiChipCreateStaIfaceRequest,
5171 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5172 >(
5173 &mut payload,
5174 0x6fb2d5892face7af,
5175 fidl::encoding::DynamicFlags::FLEXIBLE,
5176 ___deadline,
5177 )?
5178 .into_result::<WifiChipMarker>("create_sta_iface")?;
5179 Ok(_response.map(|x| x))
5180 }
5181
5182 pub fn r#get_sta_iface_names(
5184 &self,
5185 ___deadline: zx::MonotonicInstant,
5186 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
5187 let _response = self.client.send_query::<
5188 fidl::encoding::EmptyPayload,
5189 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
5190 >(
5191 (),
5192 0x349257482df6a000,
5193 fidl::encoding::DynamicFlags::FLEXIBLE,
5194 ___deadline,
5195 )?
5196 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
5197 Ok(_response)
5198 }
5199
5200 pub fn r#get_sta_iface(
5202 &self,
5203 mut payload: WifiChipGetStaIfaceRequest,
5204 ___deadline: zx::MonotonicInstant,
5205 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
5206 let _response = self.client.send_query::<
5207 WifiChipGetStaIfaceRequest,
5208 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5209 >(
5210 &mut payload,
5211 0x6d9704eeb36f28a2,
5212 fidl::encoding::DynamicFlags::FLEXIBLE,
5213 ___deadline,
5214 )?
5215 .into_result::<WifiChipMarker>("get_sta_iface")?;
5216 Ok(_response.map(|x| x))
5217 }
5218
5219 pub fn r#remove_sta_iface(
5221 &self,
5222 mut payload: WifiChipRemoveStaIfaceRequest,
5223 ___deadline: zx::MonotonicInstant,
5224 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
5225 let _response = self.client.send_query::<
5226 WifiChipRemoveStaIfaceRequest,
5227 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5228 >(
5229 &mut payload,
5230 0x4cd8eee466f8b04c,
5231 fidl::encoding::DynamicFlags::FLEXIBLE,
5232 ___deadline,
5233 )?
5234 .into_result::<WifiChipMarker>("remove_sta_iface")?;
5235 Ok(_response.map(|x| x))
5236 }
5237
5238 pub fn r#set_country_code(
5239 &self,
5240 mut payload: WifiChipSetCountryCodeRequest,
5241 ___deadline: zx::MonotonicInstant,
5242 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
5243 let _response = self.client.send_query::<
5244 WifiChipSetCountryCodeRequest,
5245 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5246 >(
5247 &mut payload,
5248 0x1dfe372d1d61a490,
5249 fidl::encoding::DynamicFlags::FLEXIBLE,
5250 ___deadline,
5251 )?
5252 .into_result::<WifiChipMarker>("set_country_code")?;
5253 Ok(_response.map(|x| x))
5254 }
5255
5256 pub fn r#get_available_modes(
5260 &self,
5261 ___deadline: zx::MonotonicInstant,
5262 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
5263 let _response = self.client.send_query::<
5264 fidl::encoding::EmptyPayload,
5265 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
5266 >(
5267 (),
5268 0x1701095b452a3acd,
5269 fidl::encoding::DynamicFlags::FLEXIBLE,
5270 ___deadline,
5271 )?
5272 .into_result::<WifiChipMarker>("get_available_modes")?;
5273 Ok(_response)
5274 }
5275
5276 pub fn r#get_id(
5278 &self,
5279 ___deadline: zx::MonotonicInstant,
5280 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
5281 let _response = self.client.send_query::<
5282 fidl::encoding::EmptyPayload,
5283 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
5284 >(
5285 (),
5286 0x37d5197325bb3370,
5287 fidl::encoding::DynamicFlags::FLEXIBLE,
5288 ___deadline,
5289 )?
5290 .into_result::<WifiChipMarker>("get_id")?;
5291 Ok(_response)
5292 }
5293
5294 pub fn r#get_mode(
5296 &self,
5297 ___deadline: zx::MonotonicInstant,
5298 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
5299 let _response = self.client.send_query::<
5300 fidl::encoding::EmptyPayload,
5301 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
5302 >(
5303 (),
5304 0x4d209e0f3ac84d6f,
5305 fidl::encoding::DynamicFlags::FLEXIBLE,
5306 ___deadline,
5307 )?
5308 .into_result::<WifiChipMarker>("get_mode")?;
5309 Ok(_response)
5310 }
5311
5312 pub fn r#get_capabilities(
5314 &self,
5315 ___deadline: zx::MonotonicInstant,
5316 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
5317 let _response = self.client.send_query::<
5318 fidl::encoding::EmptyPayload,
5319 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
5320 >(
5321 (),
5322 0x1b253f396dcaa2e0,
5323 fidl::encoding::DynamicFlags::FLEXIBLE,
5324 ___deadline,
5325 )?
5326 .into_result::<WifiChipMarker>("get_capabilities")?;
5327 Ok(_response)
5328 }
5329}
5330
5331#[cfg(target_os = "fuchsia")]
5332impl From<WifiChipSynchronousProxy> for zx::Handle {
5333 fn from(value: WifiChipSynchronousProxy) -> Self {
5334 value.into_channel().into()
5335 }
5336}
5337
5338#[cfg(target_os = "fuchsia")]
5339impl From<fidl::Channel> for WifiChipSynchronousProxy {
5340 fn from(value: fidl::Channel) -> Self {
5341 Self::new(value)
5342 }
5343}
5344
5345#[derive(Debug, Clone)]
5346pub struct WifiChipProxy {
5347 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5348}
5349
5350impl fidl::endpoints::Proxy for WifiChipProxy {
5351 type Protocol = WifiChipMarker;
5352
5353 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5354 Self::new(inner)
5355 }
5356
5357 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5358 self.client.into_channel().map_err(|client| Self { client })
5359 }
5360
5361 fn as_channel(&self) -> &::fidl::AsyncChannel {
5362 self.client.as_channel()
5363 }
5364}
5365
5366impl WifiChipProxy {
5367 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5369 let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5370 Self { client: fidl::client::Client::new(channel, protocol_name) }
5371 }
5372
5373 pub fn take_event_stream(&self) -> WifiChipEventStream {
5379 WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
5380 }
5381
5382 pub fn r#create_sta_iface(
5384 &self,
5385 mut payload: WifiChipCreateStaIfaceRequest,
5386 ) -> fidl::client::QueryResponseFut<
5387 WifiChipCreateStaIfaceResult,
5388 fidl::encoding::DefaultFuchsiaResourceDialect,
5389 > {
5390 WifiChipProxyInterface::r#create_sta_iface(self, payload)
5391 }
5392
5393 pub fn r#get_sta_iface_names(
5395 &self,
5396 ) -> fidl::client::QueryResponseFut<
5397 WifiChipGetStaIfaceNamesResponse,
5398 fidl::encoding::DefaultFuchsiaResourceDialect,
5399 > {
5400 WifiChipProxyInterface::r#get_sta_iface_names(self)
5401 }
5402
5403 pub fn r#get_sta_iface(
5405 &self,
5406 mut payload: WifiChipGetStaIfaceRequest,
5407 ) -> fidl::client::QueryResponseFut<
5408 WifiChipGetStaIfaceResult,
5409 fidl::encoding::DefaultFuchsiaResourceDialect,
5410 > {
5411 WifiChipProxyInterface::r#get_sta_iface(self, payload)
5412 }
5413
5414 pub fn r#remove_sta_iface(
5416 &self,
5417 mut payload: WifiChipRemoveStaIfaceRequest,
5418 ) -> fidl::client::QueryResponseFut<
5419 WifiChipRemoveStaIfaceResult,
5420 fidl::encoding::DefaultFuchsiaResourceDialect,
5421 > {
5422 WifiChipProxyInterface::r#remove_sta_iface(self, payload)
5423 }
5424
5425 pub fn r#set_country_code(
5426 &self,
5427 mut payload: WifiChipSetCountryCodeRequest,
5428 ) -> fidl::client::QueryResponseFut<
5429 WifiChipSetCountryCodeResult,
5430 fidl::encoding::DefaultFuchsiaResourceDialect,
5431 > {
5432 WifiChipProxyInterface::r#set_country_code(self, payload)
5433 }
5434
5435 pub fn r#get_available_modes(
5439 &self,
5440 ) -> fidl::client::QueryResponseFut<
5441 WifiChipGetAvailableModesResponse,
5442 fidl::encoding::DefaultFuchsiaResourceDialect,
5443 > {
5444 WifiChipProxyInterface::r#get_available_modes(self)
5445 }
5446
5447 pub fn r#get_id(
5449 &self,
5450 ) -> fidl::client::QueryResponseFut<
5451 WifiChipGetIdResponse,
5452 fidl::encoding::DefaultFuchsiaResourceDialect,
5453 > {
5454 WifiChipProxyInterface::r#get_id(self)
5455 }
5456
5457 pub fn r#get_mode(
5459 &self,
5460 ) -> fidl::client::QueryResponseFut<
5461 WifiChipGetModeResponse,
5462 fidl::encoding::DefaultFuchsiaResourceDialect,
5463 > {
5464 WifiChipProxyInterface::r#get_mode(self)
5465 }
5466
5467 pub fn r#get_capabilities(
5469 &self,
5470 ) -> fidl::client::QueryResponseFut<
5471 WifiChipGetCapabilitiesResponse,
5472 fidl::encoding::DefaultFuchsiaResourceDialect,
5473 > {
5474 WifiChipProxyInterface::r#get_capabilities(self)
5475 }
5476}
5477
5478impl WifiChipProxyInterface for WifiChipProxy {
5479 type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
5480 WifiChipCreateStaIfaceResult,
5481 fidl::encoding::DefaultFuchsiaResourceDialect,
5482 >;
5483 fn r#create_sta_iface(
5484 &self,
5485 mut payload: WifiChipCreateStaIfaceRequest,
5486 ) -> Self::CreateStaIfaceResponseFut {
5487 fn _decode(
5488 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5489 ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
5490 let _response = fidl::client::decode_transaction_body::<
5491 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5492 fidl::encoding::DefaultFuchsiaResourceDialect,
5493 0x6fb2d5892face7af,
5494 >(_buf?)?
5495 .into_result::<WifiChipMarker>("create_sta_iface")?;
5496 Ok(_response.map(|x| x))
5497 }
5498 self.client
5499 .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
5500 &mut payload,
5501 0x6fb2d5892face7af,
5502 fidl::encoding::DynamicFlags::FLEXIBLE,
5503 _decode,
5504 )
5505 }
5506
5507 type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
5508 WifiChipGetStaIfaceNamesResponse,
5509 fidl::encoding::DefaultFuchsiaResourceDialect,
5510 >;
5511 fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
5512 fn _decode(
5513 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5514 ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
5515 let _response = fidl::client::decode_transaction_body::<
5516 fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
5517 fidl::encoding::DefaultFuchsiaResourceDialect,
5518 0x349257482df6a000,
5519 >(_buf?)?
5520 .into_result::<WifiChipMarker>("get_sta_iface_names")?;
5521 Ok(_response)
5522 }
5523 self.client.send_query_and_decode::<
5524 fidl::encoding::EmptyPayload,
5525 WifiChipGetStaIfaceNamesResponse,
5526 >(
5527 (),
5528 0x349257482df6a000,
5529 fidl::encoding::DynamicFlags::FLEXIBLE,
5530 _decode,
5531 )
5532 }
5533
5534 type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
5535 WifiChipGetStaIfaceResult,
5536 fidl::encoding::DefaultFuchsiaResourceDialect,
5537 >;
5538 fn r#get_sta_iface(
5539 &self,
5540 mut payload: WifiChipGetStaIfaceRequest,
5541 ) -> Self::GetStaIfaceResponseFut {
5542 fn _decode(
5543 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5544 ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
5545 let _response = fidl::client::decode_transaction_body::<
5546 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5547 fidl::encoding::DefaultFuchsiaResourceDialect,
5548 0x6d9704eeb36f28a2,
5549 >(_buf?)?
5550 .into_result::<WifiChipMarker>("get_sta_iface")?;
5551 Ok(_response.map(|x| x))
5552 }
5553 self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
5554 &mut payload,
5555 0x6d9704eeb36f28a2,
5556 fidl::encoding::DynamicFlags::FLEXIBLE,
5557 _decode,
5558 )
5559 }
5560
5561 type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
5562 WifiChipRemoveStaIfaceResult,
5563 fidl::encoding::DefaultFuchsiaResourceDialect,
5564 >;
5565 fn r#remove_sta_iface(
5566 &self,
5567 mut payload: WifiChipRemoveStaIfaceRequest,
5568 ) -> Self::RemoveStaIfaceResponseFut {
5569 fn _decode(
5570 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5571 ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
5572 let _response = fidl::client::decode_transaction_body::<
5573 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5574 fidl::encoding::DefaultFuchsiaResourceDialect,
5575 0x4cd8eee466f8b04c,
5576 >(_buf?)?
5577 .into_result::<WifiChipMarker>("remove_sta_iface")?;
5578 Ok(_response.map(|x| x))
5579 }
5580 self.client
5581 .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
5582 &mut payload,
5583 0x4cd8eee466f8b04c,
5584 fidl::encoding::DynamicFlags::FLEXIBLE,
5585 _decode,
5586 )
5587 }
5588
5589 type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
5590 WifiChipSetCountryCodeResult,
5591 fidl::encoding::DefaultFuchsiaResourceDialect,
5592 >;
5593 fn r#set_country_code(
5594 &self,
5595 mut payload: WifiChipSetCountryCodeRequest,
5596 ) -> Self::SetCountryCodeResponseFut {
5597 fn _decode(
5598 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5599 ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
5600 let _response = fidl::client::decode_transaction_body::<
5601 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5602 fidl::encoding::DefaultFuchsiaResourceDialect,
5603 0x1dfe372d1d61a490,
5604 >(_buf?)?
5605 .into_result::<WifiChipMarker>("set_country_code")?;
5606 Ok(_response.map(|x| x))
5607 }
5608 self.client
5609 .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
5610 &mut payload,
5611 0x1dfe372d1d61a490,
5612 fidl::encoding::DynamicFlags::FLEXIBLE,
5613 _decode,
5614 )
5615 }
5616
5617 type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
5618 WifiChipGetAvailableModesResponse,
5619 fidl::encoding::DefaultFuchsiaResourceDialect,
5620 >;
5621 fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
5622 fn _decode(
5623 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5624 ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
5625 let _response = fidl::client::decode_transaction_body::<
5626 fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
5627 fidl::encoding::DefaultFuchsiaResourceDialect,
5628 0x1701095b452a3acd,
5629 >(_buf?)?
5630 .into_result::<WifiChipMarker>("get_available_modes")?;
5631 Ok(_response)
5632 }
5633 self.client.send_query_and_decode::<
5634 fidl::encoding::EmptyPayload,
5635 WifiChipGetAvailableModesResponse,
5636 >(
5637 (),
5638 0x1701095b452a3acd,
5639 fidl::encoding::DynamicFlags::FLEXIBLE,
5640 _decode,
5641 )
5642 }
5643
5644 type GetIdResponseFut = fidl::client::QueryResponseFut<
5645 WifiChipGetIdResponse,
5646 fidl::encoding::DefaultFuchsiaResourceDialect,
5647 >;
5648 fn r#get_id(&self) -> Self::GetIdResponseFut {
5649 fn _decode(
5650 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5651 ) -> Result<WifiChipGetIdResponse, fidl::Error> {
5652 let _response = fidl::client::decode_transaction_body::<
5653 fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
5654 fidl::encoding::DefaultFuchsiaResourceDialect,
5655 0x37d5197325bb3370,
5656 >(_buf?)?
5657 .into_result::<WifiChipMarker>("get_id")?;
5658 Ok(_response)
5659 }
5660 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
5661 (),
5662 0x37d5197325bb3370,
5663 fidl::encoding::DynamicFlags::FLEXIBLE,
5664 _decode,
5665 )
5666 }
5667
5668 type GetModeResponseFut = fidl::client::QueryResponseFut<
5669 WifiChipGetModeResponse,
5670 fidl::encoding::DefaultFuchsiaResourceDialect,
5671 >;
5672 fn r#get_mode(&self) -> Self::GetModeResponseFut {
5673 fn _decode(
5674 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5675 ) -> Result<WifiChipGetModeResponse, fidl::Error> {
5676 let _response = fidl::client::decode_transaction_body::<
5677 fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
5678 fidl::encoding::DefaultFuchsiaResourceDialect,
5679 0x4d209e0f3ac84d6f,
5680 >(_buf?)?
5681 .into_result::<WifiChipMarker>("get_mode")?;
5682 Ok(_response)
5683 }
5684 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
5685 (),
5686 0x4d209e0f3ac84d6f,
5687 fidl::encoding::DynamicFlags::FLEXIBLE,
5688 _decode,
5689 )
5690 }
5691
5692 type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
5693 WifiChipGetCapabilitiesResponse,
5694 fidl::encoding::DefaultFuchsiaResourceDialect,
5695 >;
5696 fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
5697 fn _decode(
5698 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5699 ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
5700 let _response = fidl::client::decode_transaction_body::<
5701 fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
5702 fidl::encoding::DefaultFuchsiaResourceDialect,
5703 0x1b253f396dcaa2e0,
5704 >(_buf?)?
5705 .into_result::<WifiChipMarker>("get_capabilities")?;
5706 Ok(_response)
5707 }
5708 self.client
5709 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
5710 (),
5711 0x1b253f396dcaa2e0,
5712 fidl::encoding::DynamicFlags::FLEXIBLE,
5713 _decode,
5714 )
5715 }
5716}
5717
5718pub struct WifiChipEventStream {
5719 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5720}
5721
5722impl std::marker::Unpin for WifiChipEventStream {}
5723
5724impl futures::stream::FusedStream for WifiChipEventStream {
5725 fn is_terminated(&self) -> bool {
5726 self.event_receiver.is_terminated()
5727 }
5728}
5729
5730impl futures::Stream for WifiChipEventStream {
5731 type Item = Result<WifiChipEvent, fidl::Error>;
5732
5733 fn poll_next(
5734 mut self: std::pin::Pin<&mut Self>,
5735 cx: &mut std::task::Context<'_>,
5736 ) -> std::task::Poll<Option<Self::Item>> {
5737 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5738 &mut self.event_receiver,
5739 cx
5740 )?) {
5741 Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
5742 None => std::task::Poll::Ready(None),
5743 }
5744 }
5745}
5746
5747#[derive(Debug)]
5748pub enum WifiChipEvent {
5749 #[non_exhaustive]
5750 _UnknownEvent {
5751 ordinal: u64,
5753 },
5754}
5755
5756impl WifiChipEvent {
5757 fn decode(
5759 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5760 ) -> Result<WifiChipEvent, fidl::Error> {
5761 let (bytes, _handles) = buf.split_mut();
5762 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5763 debug_assert_eq!(tx_header.tx_id, 0);
5764 match tx_header.ordinal {
5765 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5766 Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5767 }
5768 _ => Err(fidl::Error::UnknownOrdinal {
5769 ordinal: tx_header.ordinal,
5770 protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5771 }),
5772 }
5773 }
5774}
5775
5776pub struct WifiChipRequestStream {
5778 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5779 is_terminated: bool,
5780}
5781
5782impl std::marker::Unpin for WifiChipRequestStream {}
5783
5784impl futures::stream::FusedStream for WifiChipRequestStream {
5785 fn is_terminated(&self) -> bool {
5786 self.is_terminated
5787 }
5788}
5789
5790impl fidl::endpoints::RequestStream for WifiChipRequestStream {
5791 type Protocol = WifiChipMarker;
5792 type ControlHandle = WifiChipControlHandle;
5793
5794 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5795 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5796 }
5797
5798 fn control_handle(&self) -> Self::ControlHandle {
5799 WifiChipControlHandle { inner: self.inner.clone() }
5800 }
5801
5802 fn into_inner(
5803 self,
5804 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5805 {
5806 (self.inner, self.is_terminated)
5807 }
5808
5809 fn from_inner(
5810 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5811 is_terminated: bool,
5812 ) -> Self {
5813 Self { inner, is_terminated }
5814 }
5815}
5816
5817impl futures::Stream for WifiChipRequestStream {
5818 type Item = Result<WifiChipRequest, fidl::Error>;
5819
5820 fn poll_next(
5821 mut self: std::pin::Pin<&mut Self>,
5822 cx: &mut std::task::Context<'_>,
5823 ) -> std::task::Poll<Option<Self::Item>> {
5824 let this = &mut *self;
5825 if this.inner.check_shutdown(cx) {
5826 this.is_terminated = true;
5827 return std::task::Poll::Ready(None);
5828 }
5829 if this.is_terminated {
5830 panic!("polled WifiChipRequestStream after completion");
5831 }
5832 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5833 |bytes, handles| {
5834 match this.inner.channel().read_etc(cx, bytes, handles) {
5835 std::task::Poll::Ready(Ok(())) => {}
5836 std::task::Poll::Pending => return std::task::Poll::Pending,
5837 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5838 this.is_terminated = true;
5839 return std::task::Poll::Ready(None);
5840 }
5841 std::task::Poll::Ready(Err(e)) => {
5842 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5843 e.into(),
5844 ))))
5845 }
5846 }
5847
5848 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5850
5851 std::task::Poll::Ready(Some(match header.ordinal {
5852 0x6fb2d5892face7af => {
5853 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5854 let mut req = fidl::new_empty!(
5855 WifiChipCreateStaIfaceRequest,
5856 fidl::encoding::DefaultFuchsiaResourceDialect
5857 );
5858 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
5859 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5860 Ok(WifiChipRequest::CreateStaIface {
5861 payload: req,
5862 responder: WifiChipCreateStaIfaceResponder {
5863 control_handle: std::mem::ManuallyDrop::new(control_handle),
5864 tx_id: header.tx_id,
5865 },
5866 })
5867 }
5868 0x349257482df6a000 => {
5869 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5870 let mut req = fidl::new_empty!(
5871 fidl::encoding::EmptyPayload,
5872 fidl::encoding::DefaultFuchsiaResourceDialect
5873 );
5874 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5875 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5876 Ok(WifiChipRequest::GetStaIfaceNames {
5877 responder: WifiChipGetStaIfaceNamesResponder {
5878 control_handle: std::mem::ManuallyDrop::new(control_handle),
5879 tx_id: header.tx_id,
5880 },
5881 })
5882 }
5883 0x6d9704eeb36f28a2 => {
5884 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5885 let mut req = fidl::new_empty!(
5886 WifiChipGetStaIfaceRequest,
5887 fidl::encoding::DefaultFuchsiaResourceDialect
5888 );
5889 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
5890 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5891 Ok(WifiChipRequest::GetStaIface {
5892 payload: req,
5893 responder: WifiChipGetStaIfaceResponder {
5894 control_handle: std::mem::ManuallyDrop::new(control_handle),
5895 tx_id: header.tx_id,
5896 },
5897 })
5898 }
5899 0x4cd8eee466f8b04c => {
5900 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5901 let mut req = fidl::new_empty!(
5902 WifiChipRemoveStaIfaceRequest,
5903 fidl::encoding::DefaultFuchsiaResourceDialect
5904 );
5905 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
5906 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5907 Ok(WifiChipRequest::RemoveStaIface {
5908 payload: req,
5909 responder: WifiChipRemoveStaIfaceResponder {
5910 control_handle: std::mem::ManuallyDrop::new(control_handle),
5911 tx_id: header.tx_id,
5912 },
5913 })
5914 }
5915 0x1dfe372d1d61a490 => {
5916 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5917 let mut req = fidl::new_empty!(
5918 WifiChipSetCountryCodeRequest,
5919 fidl::encoding::DefaultFuchsiaResourceDialect
5920 );
5921 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
5922 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5923 Ok(WifiChipRequest::SetCountryCode {
5924 payload: req,
5925 responder: WifiChipSetCountryCodeResponder {
5926 control_handle: std::mem::ManuallyDrop::new(control_handle),
5927 tx_id: header.tx_id,
5928 },
5929 })
5930 }
5931 0x1701095b452a3acd => {
5932 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5933 let mut req = fidl::new_empty!(
5934 fidl::encoding::EmptyPayload,
5935 fidl::encoding::DefaultFuchsiaResourceDialect
5936 );
5937 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5938 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5939 Ok(WifiChipRequest::GetAvailableModes {
5940 responder: WifiChipGetAvailableModesResponder {
5941 control_handle: std::mem::ManuallyDrop::new(control_handle),
5942 tx_id: header.tx_id,
5943 },
5944 })
5945 }
5946 0x37d5197325bb3370 => {
5947 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5948 let mut req = fidl::new_empty!(
5949 fidl::encoding::EmptyPayload,
5950 fidl::encoding::DefaultFuchsiaResourceDialect
5951 );
5952 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5953 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5954 Ok(WifiChipRequest::GetId {
5955 responder: WifiChipGetIdResponder {
5956 control_handle: std::mem::ManuallyDrop::new(control_handle),
5957 tx_id: header.tx_id,
5958 },
5959 })
5960 }
5961 0x4d209e0f3ac84d6f => {
5962 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5963 let mut req = fidl::new_empty!(
5964 fidl::encoding::EmptyPayload,
5965 fidl::encoding::DefaultFuchsiaResourceDialect
5966 );
5967 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5968 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5969 Ok(WifiChipRequest::GetMode {
5970 responder: WifiChipGetModeResponder {
5971 control_handle: std::mem::ManuallyDrop::new(control_handle),
5972 tx_id: header.tx_id,
5973 },
5974 })
5975 }
5976 0x1b253f396dcaa2e0 => {
5977 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5978 let mut req = fidl::new_empty!(
5979 fidl::encoding::EmptyPayload,
5980 fidl::encoding::DefaultFuchsiaResourceDialect
5981 );
5982 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5983 let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
5984 Ok(WifiChipRequest::GetCapabilities {
5985 responder: WifiChipGetCapabilitiesResponder {
5986 control_handle: std::mem::ManuallyDrop::new(control_handle),
5987 tx_id: header.tx_id,
5988 },
5989 })
5990 }
5991 _ if header.tx_id == 0
5992 && header
5993 .dynamic_flags()
5994 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5995 {
5996 Ok(WifiChipRequest::_UnknownMethod {
5997 ordinal: header.ordinal,
5998 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
5999 method_type: fidl::MethodType::OneWay,
6000 })
6001 }
6002 _ if header
6003 .dynamic_flags()
6004 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6005 {
6006 this.inner.send_framework_err(
6007 fidl::encoding::FrameworkErr::UnknownMethod,
6008 header.tx_id,
6009 header.ordinal,
6010 header.dynamic_flags(),
6011 (bytes, handles),
6012 )?;
6013 Ok(WifiChipRequest::_UnknownMethod {
6014 ordinal: header.ordinal,
6015 control_handle: WifiChipControlHandle { inner: this.inner.clone() },
6016 method_type: fidl::MethodType::TwoWay,
6017 })
6018 }
6019 _ => Err(fidl::Error::UnknownOrdinal {
6020 ordinal: header.ordinal,
6021 protocol_name:
6022 <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6023 }),
6024 }))
6025 },
6026 )
6027 }
6028}
6029
6030#[derive(Debug)]
6031pub enum WifiChipRequest {
6032 CreateStaIface {
6034 payload: WifiChipCreateStaIfaceRequest,
6035 responder: WifiChipCreateStaIfaceResponder,
6036 },
6037 GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
6039 GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
6041 RemoveStaIface {
6043 payload: WifiChipRemoveStaIfaceRequest,
6044 responder: WifiChipRemoveStaIfaceResponder,
6045 },
6046 SetCountryCode {
6047 payload: WifiChipSetCountryCodeRequest,
6048 responder: WifiChipSetCountryCodeResponder,
6049 },
6050 GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
6054 GetId { responder: WifiChipGetIdResponder },
6056 GetMode { responder: WifiChipGetModeResponder },
6058 GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
6060 #[non_exhaustive]
6062 _UnknownMethod {
6063 ordinal: u64,
6065 control_handle: WifiChipControlHandle,
6066 method_type: fidl::MethodType,
6067 },
6068}
6069
6070impl WifiChipRequest {
6071 #[allow(irrefutable_let_patterns)]
6072 pub fn into_create_sta_iface(
6073 self,
6074 ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
6075 if let WifiChipRequest::CreateStaIface { payload, responder } = self {
6076 Some((payload, responder))
6077 } else {
6078 None
6079 }
6080 }
6081
6082 #[allow(irrefutable_let_patterns)]
6083 pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
6084 if let WifiChipRequest::GetStaIfaceNames { responder } = self {
6085 Some((responder))
6086 } else {
6087 None
6088 }
6089 }
6090
6091 #[allow(irrefutable_let_patterns)]
6092 pub fn into_get_sta_iface(
6093 self,
6094 ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
6095 if let WifiChipRequest::GetStaIface { payload, responder } = self {
6096 Some((payload, responder))
6097 } else {
6098 None
6099 }
6100 }
6101
6102 #[allow(irrefutable_let_patterns)]
6103 pub fn into_remove_sta_iface(
6104 self,
6105 ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
6106 if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
6107 Some((payload, responder))
6108 } else {
6109 None
6110 }
6111 }
6112
6113 #[allow(irrefutable_let_patterns)]
6114 pub fn into_set_country_code(
6115 self,
6116 ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
6117 if let WifiChipRequest::SetCountryCode { payload, responder } = self {
6118 Some((payload, responder))
6119 } else {
6120 None
6121 }
6122 }
6123
6124 #[allow(irrefutable_let_patterns)]
6125 pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
6126 if let WifiChipRequest::GetAvailableModes { responder } = self {
6127 Some((responder))
6128 } else {
6129 None
6130 }
6131 }
6132
6133 #[allow(irrefutable_let_patterns)]
6134 pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
6135 if let WifiChipRequest::GetId { responder } = self {
6136 Some((responder))
6137 } else {
6138 None
6139 }
6140 }
6141
6142 #[allow(irrefutable_let_patterns)]
6143 pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
6144 if let WifiChipRequest::GetMode { responder } = self {
6145 Some((responder))
6146 } else {
6147 None
6148 }
6149 }
6150
6151 #[allow(irrefutable_let_patterns)]
6152 pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
6153 if let WifiChipRequest::GetCapabilities { responder } = self {
6154 Some((responder))
6155 } else {
6156 None
6157 }
6158 }
6159
6160 pub fn method_name(&self) -> &'static str {
6162 match *self {
6163 WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
6164 WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
6165 WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
6166 WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
6167 WifiChipRequest::SetCountryCode { .. } => "set_country_code",
6168 WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
6169 WifiChipRequest::GetId { .. } => "get_id",
6170 WifiChipRequest::GetMode { .. } => "get_mode",
6171 WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
6172 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6173 "unknown one-way method"
6174 }
6175 WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6176 "unknown two-way method"
6177 }
6178 }
6179 }
6180}
6181
6182#[derive(Debug, Clone)]
6183pub struct WifiChipControlHandle {
6184 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6185}
6186
6187impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
6188 fn shutdown(&self) {
6189 self.inner.shutdown()
6190 }
6191 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6192 self.inner.shutdown_with_epitaph(status)
6193 }
6194
6195 fn is_closed(&self) -> bool {
6196 self.inner.channel().is_closed()
6197 }
6198 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6199 self.inner.channel().on_closed()
6200 }
6201
6202 #[cfg(target_os = "fuchsia")]
6203 fn signal_peer(
6204 &self,
6205 clear_mask: zx::Signals,
6206 set_mask: zx::Signals,
6207 ) -> Result<(), zx_status::Status> {
6208 use fidl::Peered;
6209 self.inner.channel().signal_peer(clear_mask, set_mask)
6210 }
6211}
6212
6213impl WifiChipControlHandle {}
6214
6215#[must_use = "FIDL methods require a response to be sent"]
6216#[derive(Debug)]
6217pub struct WifiChipCreateStaIfaceResponder {
6218 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6219 tx_id: u32,
6220}
6221
6222impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
6226 fn drop(&mut self) {
6227 self.control_handle.shutdown();
6228 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6230 }
6231}
6232
6233impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
6234 type ControlHandle = WifiChipControlHandle;
6235
6236 fn control_handle(&self) -> &WifiChipControlHandle {
6237 &self.control_handle
6238 }
6239
6240 fn drop_without_shutdown(mut self) {
6241 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6243 std::mem::forget(self);
6245 }
6246}
6247
6248impl WifiChipCreateStaIfaceResponder {
6249 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6253 let _result = self.send_raw(result);
6254 if _result.is_err() {
6255 self.control_handle.shutdown();
6256 }
6257 self.drop_without_shutdown();
6258 _result
6259 }
6260
6261 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6263 let _result = self.send_raw(result);
6264 self.drop_without_shutdown();
6265 _result
6266 }
6267
6268 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6269 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6270 fidl::encoding::EmptyStruct,
6271 i32,
6272 >>(
6273 fidl::encoding::FlexibleResult::new(result),
6274 self.tx_id,
6275 0x6fb2d5892face7af,
6276 fidl::encoding::DynamicFlags::FLEXIBLE,
6277 )
6278 }
6279}
6280
6281#[must_use = "FIDL methods require a response to be sent"]
6282#[derive(Debug)]
6283pub struct WifiChipGetStaIfaceNamesResponder {
6284 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6285 tx_id: u32,
6286}
6287
6288impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
6292 fn drop(&mut self) {
6293 self.control_handle.shutdown();
6294 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6296 }
6297}
6298
6299impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
6300 type ControlHandle = WifiChipControlHandle;
6301
6302 fn control_handle(&self) -> &WifiChipControlHandle {
6303 &self.control_handle
6304 }
6305
6306 fn drop_without_shutdown(mut self) {
6307 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6309 std::mem::forget(self);
6311 }
6312}
6313
6314impl WifiChipGetStaIfaceNamesResponder {
6315 pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
6319 let _result = self.send_raw(payload);
6320 if _result.is_err() {
6321 self.control_handle.shutdown();
6322 }
6323 self.drop_without_shutdown();
6324 _result
6325 }
6326
6327 pub fn send_no_shutdown_on_err(
6329 self,
6330 mut payload: &WifiChipGetStaIfaceNamesResponse,
6331 ) -> Result<(), fidl::Error> {
6332 let _result = self.send_raw(payload);
6333 self.drop_without_shutdown();
6334 _result
6335 }
6336
6337 fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
6338 self.control_handle
6339 .inner
6340 .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
6341 fidl::encoding::Flexible::new(payload),
6342 self.tx_id,
6343 0x349257482df6a000,
6344 fidl::encoding::DynamicFlags::FLEXIBLE,
6345 )
6346 }
6347}
6348
6349#[must_use = "FIDL methods require a response to be sent"]
6350#[derive(Debug)]
6351pub struct WifiChipGetStaIfaceResponder {
6352 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6353 tx_id: u32,
6354}
6355
6356impl std::ops::Drop for WifiChipGetStaIfaceResponder {
6360 fn drop(&mut self) {
6361 self.control_handle.shutdown();
6362 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6364 }
6365}
6366
6367impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
6368 type ControlHandle = WifiChipControlHandle;
6369
6370 fn control_handle(&self) -> &WifiChipControlHandle {
6371 &self.control_handle
6372 }
6373
6374 fn drop_without_shutdown(mut self) {
6375 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6377 std::mem::forget(self);
6379 }
6380}
6381
6382impl WifiChipGetStaIfaceResponder {
6383 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6387 let _result = self.send_raw(result);
6388 if _result.is_err() {
6389 self.control_handle.shutdown();
6390 }
6391 self.drop_without_shutdown();
6392 _result
6393 }
6394
6395 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6397 let _result = self.send_raw(result);
6398 self.drop_without_shutdown();
6399 _result
6400 }
6401
6402 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6403 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6404 fidl::encoding::EmptyStruct,
6405 i32,
6406 >>(
6407 fidl::encoding::FlexibleResult::new(result),
6408 self.tx_id,
6409 0x6d9704eeb36f28a2,
6410 fidl::encoding::DynamicFlags::FLEXIBLE,
6411 )
6412 }
6413}
6414
6415#[must_use = "FIDL methods require a response to be sent"]
6416#[derive(Debug)]
6417pub struct WifiChipRemoveStaIfaceResponder {
6418 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6419 tx_id: u32,
6420}
6421
6422impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
6426 fn drop(&mut self) {
6427 self.control_handle.shutdown();
6428 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6430 }
6431}
6432
6433impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
6434 type ControlHandle = WifiChipControlHandle;
6435
6436 fn control_handle(&self) -> &WifiChipControlHandle {
6437 &self.control_handle
6438 }
6439
6440 fn drop_without_shutdown(mut self) {
6441 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6443 std::mem::forget(self);
6445 }
6446}
6447
6448impl WifiChipRemoveStaIfaceResponder {
6449 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6453 let _result = self.send_raw(result);
6454 if _result.is_err() {
6455 self.control_handle.shutdown();
6456 }
6457 self.drop_without_shutdown();
6458 _result
6459 }
6460
6461 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6463 let _result = self.send_raw(result);
6464 self.drop_without_shutdown();
6465 _result
6466 }
6467
6468 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6469 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6470 fidl::encoding::EmptyStruct,
6471 i32,
6472 >>(
6473 fidl::encoding::FlexibleResult::new(result),
6474 self.tx_id,
6475 0x4cd8eee466f8b04c,
6476 fidl::encoding::DynamicFlags::FLEXIBLE,
6477 )
6478 }
6479}
6480
6481#[must_use = "FIDL methods require a response to be sent"]
6482#[derive(Debug)]
6483pub struct WifiChipSetCountryCodeResponder {
6484 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6485 tx_id: u32,
6486}
6487
6488impl std::ops::Drop for WifiChipSetCountryCodeResponder {
6492 fn drop(&mut self) {
6493 self.control_handle.shutdown();
6494 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6496 }
6497}
6498
6499impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
6500 type ControlHandle = WifiChipControlHandle;
6501
6502 fn control_handle(&self) -> &WifiChipControlHandle {
6503 &self.control_handle
6504 }
6505
6506 fn drop_without_shutdown(mut self) {
6507 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6509 std::mem::forget(self);
6511 }
6512}
6513
6514impl WifiChipSetCountryCodeResponder {
6515 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6519 let _result = self.send_raw(result);
6520 if _result.is_err() {
6521 self.control_handle.shutdown();
6522 }
6523 self.drop_without_shutdown();
6524 _result
6525 }
6526
6527 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6529 let _result = self.send_raw(result);
6530 self.drop_without_shutdown();
6531 _result
6532 }
6533
6534 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6535 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6536 fidl::encoding::EmptyStruct,
6537 i32,
6538 >>(
6539 fidl::encoding::FlexibleResult::new(result),
6540 self.tx_id,
6541 0x1dfe372d1d61a490,
6542 fidl::encoding::DynamicFlags::FLEXIBLE,
6543 )
6544 }
6545}
6546
6547#[must_use = "FIDL methods require a response to be sent"]
6548#[derive(Debug)]
6549pub struct WifiChipGetAvailableModesResponder {
6550 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6551 tx_id: u32,
6552}
6553
6554impl std::ops::Drop for WifiChipGetAvailableModesResponder {
6558 fn drop(&mut self) {
6559 self.control_handle.shutdown();
6560 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6562 }
6563}
6564
6565impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
6566 type ControlHandle = WifiChipControlHandle;
6567
6568 fn control_handle(&self) -> &WifiChipControlHandle {
6569 &self.control_handle
6570 }
6571
6572 fn drop_without_shutdown(mut self) {
6573 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6575 std::mem::forget(self);
6577 }
6578}
6579
6580impl WifiChipGetAvailableModesResponder {
6581 pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
6585 let _result = self.send_raw(payload);
6586 if _result.is_err() {
6587 self.control_handle.shutdown();
6588 }
6589 self.drop_without_shutdown();
6590 _result
6591 }
6592
6593 pub fn send_no_shutdown_on_err(
6595 self,
6596 mut payload: &WifiChipGetAvailableModesResponse,
6597 ) -> Result<(), fidl::Error> {
6598 let _result = self.send_raw(payload);
6599 self.drop_without_shutdown();
6600 _result
6601 }
6602
6603 fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
6604 self.control_handle
6605 .inner
6606 .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
6607 fidl::encoding::Flexible::new(payload),
6608 self.tx_id,
6609 0x1701095b452a3acd,
6610 fidl::encoding::DynamicFlags::FLEXIBLE,
6611 )
6612 }
6613}
6614
6615#[must_use = "FIDL methods require a response to be sent"]
6616#[derive(Debug)]
6617pub struct WifiChipGetIdResponder {
6618 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6619 tx_id: u32,
6620}
6621
6622impl std::ops::Drop for WifiChipGetIdResponder {
6626 fn drop(&mut self) {
6627 self.control_handle.shutdown();
6628 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6630 }
6631}
6632
6633impl fidl::endpoints::Responder for WifiChipGetIdResponder {
6634 type ControlHandle = WifiChipControlHandle;
6635
6636 fn control_handle(&self) -> &WifiChipControlHandle {
6637 &self.control_handle
6638 }
6639
6640 fn drop_without_shutdown(mut self) {
6641 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6643 std::mem::forget(self);
6645 }
6646}
6647
6648impl WifiChipGetIdResponder {
6649 pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
6653 let _result = self.send_raw(payload);
6654 if _result.is_err() {
6655 self.control_handle.shutdown();
6656 }
6657 self.drop_without_shutdown();
6658 _result
6659 }
6660
6661 pub fn send_no_shutdown_on_err(
6663 self,
6664 mut payload: &WifiChipGetIdResponse,
6665 ) -> Result<(), fidl::Error> {
6666 let _result = self.send_raw(payload);
6667 self.drop_without_shutdown();
6668 _result
6669 }
6670
6671 fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
6672 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
6673 fidl::encoding::Flexible::new(payload),
6674 self.tx_id,
6675 0x37d5197325bb3370,
6676 fidl::encoding::DynamicFlags::FLEXIBLE,
6677 )
6678 }
6679}
6680
6681#[must_use = "FIDL methods require a response to be sent"]
6682#[derive(Debug)]
6683pub struct WifiChipGetModeResponder {
6684 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6685 tx_id: u32,
6686}
6687
6688impl std::ops::Drop for WifiChipGetModeResponder {
6692 fn drop(&mut self) {
6693 self.control_handle.shutdown();
6694 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6696 }
6697}
6698
6699impl fidl::endpoints::Responder for WifiChipGetModeResponder {
6700 type ControlHandle = WifiChipControlHandle;
6701
6702 fn control_handle(&self) -> &WifiChipControlHandle {
6703 &self.control_handle
6704 }
6705
6706 fn drop_without_shutdown(mut self) {
6707 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6709 std::mem::forget(self);
6711 }
6712}
6713
6714impl WifiChipGetModeResponder {
6715 pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
6719 let _result = self.send_raw(payload);
6720 if _result.is_err() {
6721 self.control_handle.shutdown();
6722 }
6723 self.drop_without_shutdown();
6724 _result
6725 }
6726
6727 pub fn send_no_shutdown_on_err(
6729 self,
6730 mut payload: &WifiChipGetModeResponse,
6731 ) -> Result<(), fidl::Error> {
6732 let _result = self.send_raw(payload);
6733 self.drop_without_shutdown();
6734 _result
6735 }
6736
6737 fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
6738 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
6739 fidl::encoding::Flexible::new(payload),
6740 self.tx_id,
6741 0x4d209e0f3ac84d6f,
6742 fidl::encoding::DynamicFlags::FLEXIBLE,
6743 )
6744 }
6745}
6746
6747#[must_use = "FIDL methods require a response to be sent"]
6748#[derive(Debug)]
6749pub struct WifiChipGetCapabilitiesResponder {
6750 control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6751 tx_id: u32,
6752}
6753
6754impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
6758 fn drop(&mut self) {
6759 self.control_handle.shutdown();
6760 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6762 }
6763}
6764
6765impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
6766 type ControlHandle = WifiChipControlHandle;
6767
6768 fn control_handle(&self) -> &WifiChipControlHandle {
6769 &self.control_handle
6770 }
6771
6772 fn drop_without_shutdown(mut self) {
6773 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6775 std::mem::forget(self);
6777 }
6778}
6779
6780impl WifiChipGetCapabilitiesResponder {
6781 pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
6785 let _result = self.send_raw(payload);
6786 if _result.is_err() {
6787 self.control_handle.shutdown();
6788 }
6789 self.drop_without_shutdown();
6790 _result
6791 }
6792
6793 pub fn send_no_shutdown_on_err(
6795 self,
6796 mut payload: &WifiChipGetCapabilitiesResponse,
6797 ) -> Result<(), fidl::Error> {
6798 let _result = self.send_raw(payload);
6799 self.drop_without_shutdown();
6800 _result
6801 }
6802
6803 fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
6804 self.control_handle
6805 .inner
6806 .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
6807 fidl::encoding::Flexible::new(payload),
6808 self.tx_id,
6809 0x1b253f396dcaa2e0,
6810 fidl::encoding::DynamicFlags::FLEXIBLE,
6811 )
6812 }
6813}
6814
6815#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6816pub struct WifiEventCallbackMarker;
6817
6818impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
6819 type Proxy = WifiEventCallbackProxy;
6820 type RequestStream = WifiEventCallbackRequestStream;
6821 #[cfg(target_os = "fuchsia")]
6822 type SynchronousProxy = WifiEventCallbackSynchronousProxy;
6823
6824 const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
6825}
6826
6827pub trait WifiEventCallbackProxyInterface: Send + Sync {
6828 fn r#on_start(&self) -> Result<(), fidl::Error>;
6829 fn r#on_stop(&self) -> Result<(), fidl::Error>;
6830}
6831#[derive(Debug)]
6832#[cfg(target_os = "fuchsia")]
6833pub struct WifiEventCallbackSynchronousProxy {
6834 client: fidl::client::sync::Client,
6835}
6836
6837#[cfg(target_os = "fuchsia")]
6838impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
6839 type Proxy = WifiEventCallbackProxy;
6840 type Protocol = WifiEventCallbackMarker;
6841
6842 fn from_channel(inner: fidl::Channel) -> Self {
6843 Self::new(inner)
6844 }
6845
6846 fn into_channel(self) -> fidl::Channel {
6847 self.client.into_channel()
6848 }
6849
6850 fn as_channel(&self) -> &fidl::Channel {
6851 self.client.as_channel()
6852 }
6853}
6854
6855#[cfg(target_os = "fuchsia")]
6856impl WifiEventCallbackSynchronousProxy {
6857 pub fn new(channel: fidl::Channel) -> Self {
6858 let protocol_name =
6859 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6860 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6861 }
6862
6863 pub fn into_channel(self) -> fidl::Channel {
6864 self.client.into_channel()
6865 }
6866
6867 pub fn wait_for_event(
6870 &self,
6871 deadline: zx::MonotonicInstant,
6872 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
6873 WifiEventCallbackEvent::decode(self.client.wait_for_event(deadline)?)
6874 }
6875
6876 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
6877 self.client.send::<fidl::encoding::EmptyPayload>(
6878 (),
6879 0x61189ff44f9d35f3,
6880 fidl::encoding::DynamicFlags::FLEXIBLE,
6881 )
6882 }
6883
6884 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
6885 self.client.send::<fidl::encoding::EmptyPayload>(
6886 (),
6887 0x58b697bcd475e0f9,
6888 fidl::encoding::DynamicFlags::FLEXIBLE,
6889 )
6890 }
6891}
6892
6893#[cfg(target_os = "fuchsia")]
6894impl From<WifiEventCallbackSynchronousProxy> for zx::Handle {
6895 fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
6896 value.into_channel().into()
6897 }
6898}
6899
6900#[cfg(target_os = "fuchsia")]
6901impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
6902 fn from(value: fidl::Channel) -> Self {
6903 Self::new(value)
6904 }
6905}
6906
6907#[derive(Debug, Clone)]
6908pub struct WifiEventCallbackProxy {
6909 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6910}
6911
6912impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
6913 type Protocol = WifiEventCallbackMarker;
6914
6915 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6916 Self::new(inner)
6917 }
6918
6919 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6920 self.client.into_channel().map_err(|client| Self { client })
6921 }
6922
6923 fn as_channel(&self) -> &::fidl::AsyncChannel {
6924 self.client.as_channel()
6925 }
6926}
6927
6928impl WifiEventCallbackProxy {
6929 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6931 let protocol_name =
6932 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6933 Self { client: fidl::client::Client::new(channel, protocol_name) }
6934 }
6935
6936 pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
6942 WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
6943 }
6944
6945 pub fn r#on_start(&self) -> Result<(), fidl::Error> {
6946 WifiEventCallbackProxyInterface::r#on_start(self)
6947 }
6948
6949 pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
6950 WifiEventCallbackProxyInterface::r#on_stop(self)
6951 }
6952}
6953
6954impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
6955 fn r#on_start(&self) -> Result<(), fidl::Error> {
6956 self.client.send::<fidl::encoding::EmptyPayload>(
6957 (),
6958 0x61189ff44f9d35f3,
6959 fidl::encoding::DynamicFlags::FLEXIBLE,
6960 )
6961 }
6962
6963 fn r#on_stop(&self) -> Result<(), fidl::Error> {
6964 self.client.send::<fidl::encoding::EmptyPayload>(
6965 (),
6966 0x58b697bcd475e0f9,
6967 fidl::encoding::DynamicFlags::FLEXIBLE,
6968 )
6969 }
6970}
6971
6972pub struct WifiEventCallbackEventStream {
6973 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6974}
6975
6976impl std::marker::Unpin for WifiEventCallbackEventStream {}
6977
6978impl futures::stream::FusedStream for WifiEventCallbackEventStream {
6979 fn is_terminated(&self) -> bool {
6980 self.event_receiver.is_terminated()
6981 }
6982}
6983
6984impl futures::Stream for WifiEventCallbackEventStream {
6985 type Item = Result<WifiEventCallbackEvent, fidl::Error>;
6986
6987 fn poll_next(
6988 mut self: std::pin::Pin<&mut Self>,
6989 cx: &mut std::task::Context<'_>,
6990 ) -> std::task::Poll<Option<Self::Item>> {
6991 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6992 &mut self.event_receiver,
6993 cx
6994 )?) {
6995 Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
6996 None => std::task::Poll::Ready(None),
6997 }
6998 }
6999}
7000
7001#[derive(Debug)]
7002pub enum WifiEventCallbackEvent {
7003 #[non_exhaustive]
7004 _UnknownEvent {
7005 ordinal: u64,
7007 },
7008}
7009
7010impl WifiEventCallbackEvent {
7011 fn decode(
7013 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7014 ) -> Result<WifiEventCallbackEvent, fidl::Error> {
7015 let (bytes, _handles) = buf.split_mut();
7016 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7017 debug_assert_eq!(tx_header.tx_id, 0);
7018 match tx_header.ordinal {
7019 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7020 Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7021 }
7022 _ => Err(fidl::Error::UnknownOrdinal {
7023 ordinal: tx_header.ordinal,
7024 protocol_name:
7025 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7026 }),
7027 }
7028 }
7029}
7030
7031pub struct WifiEventCallbackRequestStream {
7033 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7034 is_terminated: bool,
7035}
7036
7037impl std::marker::Unpin for WifiEventCallbackRequestStream {}
7038
7039impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
7040 fn is_terminated(&self) -> bool {
7041 self.is_terminated
7042 }
7043}
7044
7045impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
7046 type Protocol = WifiEventCallbackMarker;
7047 type ControlHandle = WifiEventCallbackControlHandle;
7048
7049 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7050 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7051 }
7052
7053 fn control_handle(&self) -> Self::ControlHandle {
7054 WifiEventCallbackControlHandle { inner: self.inner.clone() }
7055 }
7056
7057 fn into_inner(
7058 self,
7059 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7060 {
7061 (self.inner, self.is_terminated)
7062 }
7063
7064 fn from_inner(
7065 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7066 is_terminated: bool,
7067 ) -> Self {
7068 Self { inner, is_terminated }
7069 }
7070}
7071
7072impl futures::Stream for WifiEventCallbackRequestStream {
7073 type Item = Result<WifiEventCallbackRequest, fidl::Error>;
7074
7075 fn poll_next(
7076 mut self: std::pin::Pin<&mut Self>,
7077 cx: &mut std::task::Context<'_>,
7078 ) -> std::task::Poll<Option<Self::Item>> {
7079 let this = &mut *self;
7080 if this.inner.check_shutdown(cx) {
7081 this.is_terminated = true;
7082 return std::task::Poll::Ready(None);
7083 }
7084 if this.is_terminated {
7085 panic!("polled WifiEventCallbackRequestStream after completion");
7086 }
7087 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7088 |bytes, handles| {
7089 match this.inner.channel().read_etc(cx, bytes, handles) {
7090 std::task::Poll::Ready(Ok(())) => {}
7091 std::task::Poll::Pending => return std::task::Poll::Pending,
7092 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7093 this.is_terminated = true;
7094 return std::task::Poll::Ready(None);
7095 }
7096 std::task::Poll::Ready(Err(e)) => {
7097 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7098 e.into(),
7099 ))))
7100 }
7101 }
7102
7103 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7105
7106 std::task::Poll::Ready(Some(match header.ordinal {
7107 0x61189ff44f9d35f3 => {
7108 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7109 let mut req = fidl::new_empty!(
7110 fidl::encoding::EmptyPayload,
7111 fidl::encoding::DefaultFuchsiaResourceDialect
7112 );
7113 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7114 let control_handle =
7115 WifiEventCallbackControlHandle { inner: this.inner.clone() };
7116 Ok(WifiEventCallbackRequest::OnStart { control_handle })
7117 }
7118 0x58b697bcd475e0f9 => {
7119 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7120 let mut req = fidl::new_empty!(
7121 fidl::encoding::EmptyPayload,
7122 fidl::encoding::DefaultFuchsiaResourceDialect
7123 );
7124 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7125 let control_handle =
7126 WifiEventCallbackControlHandle { inner: this.inner.clone() };
7127 Ok(WifiEventCallbackRequest::OnStop { control_handle })
7128 }
7129 _ if header.tx_id == 0
7130 && header
7131 .dynamic_flags()
7132 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7133 {
7134 Ok(WifiEventCallbackRequest::_UnknownMethod {
7135 ordinal: header.ordinal,
7136 control_handle: WifiEventCallbackControlHandle {
7137 inner: this.inner.clone(),
7138 },
7139 method_type: fidl::MethodType::OneWay,
7140 })
7141 }
7142 _ if header
7143 .dynamic_flags()
7144 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7145 {
7146 this.inner.send_framework_err(
7147 fidl::encoding::FrameworkErr::UnknownMethod,
7148 header.tx_id,
7149 header.ordinal,
7150 header.dynamic_flags(),
7151 (bytes, handles),
7152 )?;
7153 Ok(WifiEventCallbackRequest::_UnknownMethod {
7154 ordinal: header.ordinal,
7155 control_handle: WifiEventCallbackControlHandle {
7156 inner: this.inner.clone(),
7157 },
7158 method_type: fidl::MethodType::TwoWay,
7159 })
7160 }
7161 _ => Err(fidl::Error::UnknownOrdinal {
7162 ordinal: header.ordinal,
7163 protocol_name:
7164 <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7165 }),
7166 }))
7167 },
7168 )
7169 }
7170}
7171
7172#[derive(Debug)]
7173pub enum WifiEventCallbackRequest {
7174 OnStart {
7175 control_handle: WifiEventCallbackControlHandle,
7176 },
7177 OnStop {
7178 control_handle: WifiEventCallbackControlHandle,
7179 },
7180 #[non_exhaustive]
7182 _UnknownMethod {
7183 ordinal: u64,
7185 control_handle: WifiEventCallbackControlHandle,
7186 method_type: fidl::MethodType,
7187 },
7188}
7189
7190impl WifiEventCallbackRequest {
7191 #[allow(irrefutable_let_patterns)]
7192 pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
7193 if let WifiEventCallbackRequest::OnStart { control_handle } = self {
7194 Some((control_handle))
7195 } else {
7196 None
7197 }
7198 }
7199
7200 #[allow(irrefutable_let_patterns)]
7201 pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
7202 if let WifiEventCallbackRequest::OnStop { control_handle } = self {
7203 Some((control_handle))
7204 } else {
7205 None
7206 }
7207 }
7208
7209 pub fn method_name(&self) -> &'static str {
7211 match *self {
7212 WifiEventCallbackRequest::OnStart { .. } => "on_start",
7213 WifiEventCallbackRequest::OnStop { .. } => "on_stop",
7214 WifiEventCallbackRequest::_UnknownMethod {
7215 method_type: fidl::MethodType::OneWay,
7216 ..
7217 } => "unknown one-way method",
7218 WifiEventCallbackRequest::_UnknownMethod {
7219 method_type: fidl::MethodType::TwoWay,
7220 ..
7221 } => "unknown two-way method",
7222 }
7223 }
7224}
7225
7226#[derive(Debug, Clone)]
7227pub struct WifiEventCallbackControlHandle {
7228 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7229}
7230
7231impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
7232 fn shutdown(&self) {
7233 self.inner.shutdown()
7234 }
7235 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7236 self.inner.shutdown_with_epitaph(status)
7237 }
7238
7239 fn is_closed(&self) -> bool {
7240 self.inner.channel().is_closed()
7241 }
7242 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7243 self.inner.channel().on_closed()
7244 }
7245
7246 #[cfg(target_os = "fuchsia")]
7247 fn signal_peer(
7248 &self,
7249 clear_mask: zx::Signals,
7250 set_mask: zx::Signals,
7251 ) -> Result<(), zx_status::Status> {
7252 use fidl::Peered;
7253 self.inner.channel().signal_peer(clear_mask, set_mask)
7254 }
7255}
7256
7257impl WifiEventCallbackControlHandle {}
7258
7259#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7260pub struct WifiStaIfaceMarker;
7261
7262impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
7263 type Proxy = WifiStaIfaceProxy;
7264 type RequestStream = WifiStaIfaceRequestStream;
7265 #[cfg(target_os = "fuchsia")]
7266 type SynchronousProxy = WifiStaIfaceSynchronousProxy;
7267
7268 const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
7269}
7270
7271pub trait WifiStaIfaceProxyInterface: Send + Sync {
7272 type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
7273 + Send;
7274 fn r#get_name(&self) -> Self::GetNameResponseFut;
7275}
7276#[derive(Debug)]
7277#[cfg(target_os = "fuchsia")]
7278pub struct WifiStaIfaceSynchronousProxy {
7279 client: fidl::client::sync::Client,
7280}
7281
7282#[cfg(target_os = "fuchsia")]
7283impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
7284 type Proxy = WifiStaIfaceProxy;
7285 type Protocol = WifiStaIfaceMarker;
7286
7287 fn from_channel(inner: fidl::Channel) -> Self {
7288 Self::new(inner)
7289 }
7290
7291 fn into_channel(self) -> fidl::Channel {
7292 self.client.into_channel()
7293 }
7294
7295 fn as_channel(&self) -> &fidl::Channel {
7296 self.client.as_channel()
7297 }
7298}
7299
7300#[cfg(target_os = "fuchsia")]
7301impl WifiStaIfaceSynchronousProxy {
7302 pub fn new(channel: fidl::Channel) -> Self {
7303 let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7304 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7305 }
7306
7307 pub fn into_channel(self) -> fidl::Channel {
7308 self.client.into_channel()
7309 }
7310
7311 pub fn wait_for_event(
7314 &self,
7315 deadline: zx::MonotonicInstant,
7316 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
7317 WifiStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
7318 }
7319
7320 pub fn r#get_name(
7322 &self,
7323 ___deadline: zx::MonotonicInstant,
7324 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
7325 let _response = self.client.send_query::<
7326 fidl::encoding::EmptyPayload,
7327 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
7328 >(
7329 (),
7330 0x5c150b91c80c5789,
7331 fidl::encoding::DynamicFlags::FLEXIBLE,
7332 ___deadline,
7333 )?
7334 .into_result::<WifiStaIfaceMarker>("get_name")?;
7335 Ok(_response)
7336 }
7337}
7338
7339#[cfg(target_os = "fuchsia")]
7340impl From<WifiStaIfaceSynchronousProxy> for zx::Handle {
7341 fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
7342 value.into_channel().into()
7343 }
7344}
7345
7346#[cfg(target_os = "fuchsia")]
7347impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
7348 fn from(value: fidl::Channel) -> Self {
7349 Self::new(value)
7350 }
7351}
7352
7353#[derive(Debug, Clone)]
7354pub struct WifiStaIfaceProxy {
7355 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7356}
7357
7358impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
7359 type Protocol = WifiStaIfaceMarker;
7360
7361 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7362 Self::new(inner)
7363 }
7364
7365 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7366 self.client.into_channel().map_err(|client| Self { client })
7367 }
7368
7369 fn as_channel(&self) -> &::fidl::AsyncChannel {
7370 self.client.as_channel()
7371 }
7372}
7373
7374impl WifiStaIfaceProxy {
7375 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7377 let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7378 Self { client: fidl::client::Client::new(channel, protocol_name) }
7379 }
7380
7381 pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
7387 WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
7388 }
7389
7390 pub fn r#get_name(
7392 &self,
7393 ) -> fidl::client::QueryResponseFut<
7394 WifiStaIfaceGetNameResponse,
7395 fidl::encoding::DefaultFuchsiaResourceDialect,
7396 > {
7397 WifiStaIfaceProxyInterface::r#get_name(self)
7398 }
7399}
7400
7401impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
7402 type GetNameResponseFut = fidl::client::QueryResponseFut<
7403 WifiStaIfaceGetNameResponse,
7404 fidl::encoding::DefaultFuchsiaResourceDialect,
7405 >;
7406 fn r#get_name(&self) -> Self::GetNameResponseFut {
7407 fn _decode(
7408 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7409 ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
7410 let _response = fidl::client::decode_transaction_body::<
7411 fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
7412 fidl::encoding::DefaultFuchsiaResourceDialect,
7413 0x5c150b91c80c5789,
7414 >(_buf?)?
7415 .into_result::<WifiStaIfaceMarker>("get_name")?;
7416 Ok(_response)
7417 }
7418 self.client
7419 .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
7420 (),
7421 0x5c150b91c80c5789,
7422 fidl::encoding::DynamicFlags::FLEXIBLE,
7423 _decode,
7424 )
7425 }
7426}
7427
7428pub struct WifiStaIfaceEventStream {
7429 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7430}
7431
7432impl std::marker::Unpin for WifiStaIfaceEventStream {}
7433
7434impl futures::stream::FusedStream for WifiStaIfaceEventStream {
7435 fn is_terminated(&self) -> bool {
7436 self.event_receiver.is_terminated()
7437 }
7438}
7439
7440impl futures::Stream for WifiStaIfaceEventStream {
7441 type Item = Result<WifiStaIfaceEvent, fidl::Error>;
7442
7443 fn poll_next(
7444 mut self: std::pin::Pin<&mut Self>,
7445 cx: &mut std::task::Context<'_>,
7446 ) -> std::task::Poll<Option<Self::Item>> {
7447 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7448 &mut self.event_receiver,
7449 cx
7450 )?) {
7451 Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
7452 None => std::task::Poll::Ready(None),
7453 }
7454 }
7455}
7456
7457#[derive(Debug)]
7458pub enum WifiStaIfaceEvent {
7459 #[non_exhaustive]
7460 _UnknownEvent {
7461 ordinal: u64,
7463 },
7464}
7465
7466impl WifiStaIfaceEvent {
7467 fn decode(
7469 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7470 ) -> Result<WifiStaIfaceEvent, fidl::Error> {
7471 let (bytes, _handles) = buf.split_mut();
7472 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7473 debug_assert_eq!(tx_header.tx_id, 0);
7474 match tx_header.ordinal {
7475 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7476 Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7477 }
7478 _ => Err(fidl::Error::UnknownOrdinal {
7479 ordinal: tx_header.ordinal,
7480 protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7481 }),
7482 }
7483 }
7484}
7485
7486pub struct WifiStaIfaceRequestStream {
7488 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7489 is_terminated: bool,
7490}
7491
7492impl std::marker::Unpin for WifiStaIfaceRequestStream {}
7493
7494impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
7495 fn is_terminated(&self) -> bool {
7496 self.is_terminated
7497 }
7498}
7499
7500impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
7501 type Protocol = WifiStaIfaceMarker;
7502 type ControlHandle = WifiStaIfaceControlHandle;
7503
7504 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7505 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7506 }
7507
7508 fn control_handle(&self) -> Self::ControlHandle {
7509 WifiStaIfaceControlHandle { inner: self.inner.clone() }
7510 }
7511
7512 fn into_inner(
7513 self,
7514 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7515 {
7516 (self.inner, self.is_terminated)
7517 }
7518
7519 fn from_inner(
7520 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7521 is_terminated: bool,
7522 ) -> Self {
7523 Self { inner, is_terminated }
7524 }
7525}
7526
7527impl futures::Stream for WifiStaIfaceRequestStream {
7528 type Item = Result<WifiStaIfaceRequest, fidl::Error>;
7529
7530 fn poll_next(
7531 mut self: std::pin::Pin<&mut Self>,
7532 cx: &mut std::task::Context<'_>,
7533 ) -> std::task::Poll<Option<Self::Item>> {
7534 let this = &mut *self;
7535 if this.inner.check_shutdown(cx) {
7536 this.is_terminated = true;
7537 return std::task::Poll::Ready(None);
7538 }
7539 if this.is_terminated {
7540 panic!("polled WifiStaIfaceRequestStream after completion");
7541 }
7542 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7543 |bytes, handles| {
7544 match this.inner.channel().read_etc(cx, bytes, handles) {
7545 std::task::Poll::Ready(Ok(())) => {}
7546 std::task::Poll::Pending => return std::task::Poll::Pending,
7547 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7548 this.is_terminated = true;
7549 return std::task::Poll::Ready(None);
7550 }
7551 std::task::Poll::Ready(Err(e)) => {
7552 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7553 e.into(),
7554 ))))
7555 }
7556 }
7557
7558 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7560
7561 std::task::Poll::Ready(Some(match header.ordinal {
7562 0x5c150b91c80c5789 => {
7563 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7564 let mut req = fidl::new_empty!(
7565 fidl::encoding::EmptyPayload,
7566 fidl::encoding::DefaultFuchsiaResourceDialect
7567 );
7568 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7569 let control_handle =
7570 WifiStaIfaceControlHandle { inner: this.inner.clone() };
7571 Ok(WifiStaIfaceRequest::GetName {
7572 responder: WifiStaIfaceGetNameResponder {
7573 control_handle: std::mem::ManuallyDrop::new(control_handle),
7574 tx_id: header.tx_id,
7575 },
7576 })
7577 }
7578 _ if header.tx_id == 0
7579 && header
7580 .dynamic_flags()
7581 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7582 {
7583 Ok(WifiStaIfaceRequest::_UnknownMethod {
7584 ordinal: header.ordinal,
7585 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
7586 method_type: fidl::MethodType::OneWay,
7587 })
7588 }
7589 _ if header
7590 .dynamic_flags()
7591 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7592 {
7593 this.inner.send_framework_err(
7594 fidl::encoding::FrameworkErr::UnknownMethod,
7595 header.tx_id,
7596 header.ordinal,
7597 header.dynamic_flags(),
7598 (bytes, handles),
7599 )?;
7600 Ok(WifiStaIfaceRequest::_UnknownMethod {
7601 ordinal: header.ordinal,
7602 control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
7603 method_type: fidl::MethodType::TwoWay,
7604 })
7605 }
7606 _ => Err(fidl::Error::UnknownOrdinal {
7607 ordinal: header.ordinal,
7608 protocol_name:
7609 <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7610 }),
7611 }))
7612 },
7613 )
7614 }
7615}
7616
7617#[derive(Debug)]
7618pub enum WifiStaIfaceRequest {
7619 GetName { responder: WifiStaIfaceGetNameResponder },
7621 #[non_exhaustive]
7623 _UnknownMethod {
7624 ordinal: u64,
7626 control_handle: WifiStaIfaceControlHandle,
7627 method_type: fidl::MethodType,
7628 },
7629}
7630
7631impl WifiStaIfaceRequest {
7632 #[allow(irrefutable_let_patterns)]
7633 pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
7634 if let WifiStaIfaceRequest::GetName { responder } = self {
7635 Some((responder))
7636 } else {
7637 None
7638 }
7639 }
7640
7641 pub fn method_name(&self) -> &'static str {
7643 match *self {
7644 WifiStaIfaceRequest::GetName { .. } => "get_name",
7645 WifiStaIfaceRequest::_UnknownMethod {
7646 method_type: fidl::MethodType::OneWay, ..
7647 } => "unknown one-way method",
7648 WifiStaIfaceRequest::_UnknownMethod {
7649 method_type: fidl::MethodType::TwoWay, ..
7650 } => "unknown two-way method",
7651 }
7652 }
7653}
7654
7655#[derive(Debug, Clone)]
7656pub struct WifiStaIfaceControlHandle {
7657 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7658}
7659
7660impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
7661 fn shutdown(&self) {
7662 self.inner.shutdown()
7663 }
7664 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7665 self.inner.shutdown_with_epitaph(status)
7666 }
7667
7668 fn is_closed(&self) -> bool {
7669 self.inner.channel().is_closed()
7670 }
7671 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7672 self.inner.channel().on_closed()
7673 }
7674
7675 #[cfg(target_os = "fuchsia")]
7676 fn signal_peer(
7677 &self,
7678 clear_mask: zx::Signals,
7679 set_mask: zx::Signals,
7680 ) -> Result<(), zx_status::Status> {
7681 use fidl::Peered;
7682 self.inner.channel().signal_peer(clear_mask, set_mask)
7683 }
7684}
7685
7686impl WifiStaIfaceControlHandle {}
7687
7688#[must_use = "FIDL methods require a response to be sent"]
7689#[derive(Debug)]
7690pub struct WifiStaIfaceGetNameResponder {
7691 control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
7692 tx_id: u32,
7693}
7694
7695impl std::ops::Drop for WifiStaIfaceGetNameResponder {
7699 fn drop(&mut self) {
7700 self.control_handle.shutdown();
7701 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7703 }
7704}
7705
7706impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
7707 type ControlHandle = WifiStaIfaceControlHandle;
7708
7709 fn control_handle(&self) -> &WifiStaIfaceControlHandle {
7710 &self.control_handle
7711 }
7712
7713 fn drop_without_shutdown(mut self) {
7714 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7716 std::mem::forget(self);
7718 }
7719}
7720
7721impl WifiStaIfaceGetNameResponder {
7722 pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
7726 let _result = self.send_raw(payload);
7727 if _result.is_err() {
7728 self.control_handle.shutdown();
7729 }
7730 self.drop_without_shutdown();
7731 _result
7732 }
7733
7734 pub fn send_no_shutdown_on_err(
7736 self,
7737 mut payload: &WifiStaIfaceGetNameResponse,
7738 ) -> Result<(), fidl::Error> {
7739 let _result = self.send_raw(payload);
7740 self.drop_without_shutdown();
7741 _result
7742 }
7743
7744 fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
7745 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
7746 fidl::encoding::Flexible::new(payload),
7747 self.tx_id,
7748 0x5c150b91c80c5789,
7749 fidl::encoding::DynamicFlags::FLEXIBLE,
7750 )
7751 }
7752}
7753
7754#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7755pub struct WlanixMarker;
7756
7757impl fidl::endpoints::ProtocolMarker for WlanixMarker {
7758 type Proxy = WlanixProxy;
7759 type RequestStream = WlanixRequestStream;
7760 #[cfg(target_os = "fuchsia")]
7761 type SynchronousProxy = WlanixSynchronousProxy;
7762
7763 const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
7764}
7765impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
7766
7767pub trait WlanixProxyInterface: Send + Sync {
7768 fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
7769 fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
7770 fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
7771}
7772#[derive(Debug)]
7773#[cfg(target_os = "fuchsia")]
7774pub struct WlanixSynchronousProxy {
7775 client: fidl::client::sync::Client,
7776}
7777
7778#[cfg(target_os = "fuchsia")]
7779impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
7780 type Proxy = WlanixProxy;
7781 type Protocol = WlanixMarker;
7782
7783 fn from_channel(inner: fidl::Channel) -> Self {
7784 Self::new(inner)
7785 }
7786
7787 fn into_channel(self) -> fidl::Channel {
7788 self.client.into_channel()
7789 }
7790
7791 fn as_channel(&self) -> &fidl::Channel {
7792 self.client.as_channel()
7793 }
7794}
7795
7796#[cfg(target_os = "fuchsia")]
7797impl WlanixSynchronousProxy {
7798 pub fn new(channel: fidl::Channel) -> Self {
7799 let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7800 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7801 }
7802
7803 pub fn into_channel(self) -> fidl::Channel {
7804 self.client.into_channel()
7805 }
7806
7807 pub fn wait_for_event(
7810 &self,
7811 deadline: zx::MonotonicInstant,
7812 ) -> Result<WlanixEvent, fidl::Error> {
7813 WlanixEvent::decode(self.client.wait_for_event(deadline)?)
7814 }
7815
7816 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
7818 self.client.send::<WlanixGetWifiRequest>(
7819 &mut payload,
7820 0x142511f44b2c338c,
7821 fidl::encoding::DynamicFlags::FLEXIBLE,
7822 )
7823 }
7824
7825 pub fn r#get_supplicant(
7826 &self,
7827 mut payload: WlanixGetSupplicantRequest,
7828 ) -> Result<(), fidl::Error> {
7829 self.client.send::<WlanixGetSupplicantRequest>(
7830 &mut payload,
7831 0x55554b37c4021d3d,
7832 fidl::encoding::DynamicFlags::FLEXIBLE,
7833 )
7834 }
7835
7836 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
7837 self.client.send::<WlanixGetNl80211Request>(
7838 &mut payload,
7839 0x48028a25bd855ef9,
7840 fidl::encoding::DynamicFlags::FLEXIBLE,
7841 )
7842 }
7843}
7844
7845#[cfg(target_os = "fuchsia")]
7846impl From<WlanixSynchronousProxy> for zx::Handle {
7847 fn from(value: WlanixSynchronousProxy) -> Self {
7848 value.into_channel().into()
7849 }
7850}
7851
7852#[cfg(target_os = "fuchsia")]
7853impl From<fidl::Channel> for WlanixSynchronousProxy {
7854 fn from(value: fidl::Channel) -> Self {
7855 Self::new(value)
7856 }
7857}
7858
7859#[derive(Debug, Clone)]
7860pub struct WlanixProxy {
7861 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7862}
7863
7864impl fidl::endpoints::Proxy for WlanixProxy {
7865 type Protocol = WlanixMarker;
7866
7867 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7868 Self::new(inner)
7869 }
7870
7871 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7872 self.client.into_channel().map_err(|client| Self { client })
7873 }
7874
7875 fn as_channel(&self) -> &::fidl::AsyncChannel {
7876 self.client.as_channel()
7877 }
7878}
7879
7880impl WlanixProxy {
7881 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7883 let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7884 Self { client: fidl::client::Client::new(channel, protocol_name) }
7885 }
7886
7887 pub fn take_event_stream(&self) -> WlanixEventStream {
7893 WlanixEventStream { event_receiver: self.client.take_event_receiver() }
7894 }
7895
7896 pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
7898 WlanixProxyInterface::r#get_wifi(self, payload)
7899 }
7900
7901 pub fn r#get_supplicant(
7902 &self,
7903 mut payload: WlanixGetSupplicantRequest,
7904 ) -> Result<(), fidl::Error> {
7905 WlanixProxyInterface::r#get_supplicant(self, payload)
7906 }
7907
7908 pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
7909 WlanixProxyInterface::r#get_nl80211(self, payload)
7910 }
7911}
7912
7913impl WlanixProxyInterface for WlanixProxy {
7914 fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
7915 self.client.send::<WlanixGetWifiRequest>(
7916 &mut payload,
7917 0x142511f44b2c338c,
7918 fidl::encoding::DynamicFlags::FLEXIBLE,
7919 )
7920 }
7921
7922 fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
7923 self.client.send::<WlanixGetSupplicantRequest>(
7924 &mut payload,
7925 0x55554b37c4021d3d,
7926 fidl::encoding::DynamicFlags::FLEXIBLE,
7927 )
7928 }
7929
7930 fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
7931 self.client.send::<WlanixGetNl80211Request>(
7932 &mut payload,
7933 0x48028a25bd855ef9,
7934 fidl::encoding::DynamicFlags::FLEXIBLE,
7935 )
7936 }
7937}
7938
7939pub struct WlanixEventStream {
7940 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7941}
7942
7943impl std::marker::Unpin for WlanixEventStream {}
7944
7945impl futures::stream::FusedStream for WlanixEventStream {
7946 fn is_terminated(&self) -> bool {
7947 self.event_receiver.is_terminated()
7948 }
7949}
7950
7951impl futures::Stream for WlanixEventStream {
7952 type Item = Result<WlanixEvent, fidl::Error>;
7953
7954 fn poll_next(
7955 mut self: std::pin::Pin<&mut Self>,
7956 cx: &mut std::task::Context<'_>,
7957 ) -> std::task::Poll<Option<Self::Item>> {
7958 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7959 &mut self.event_receiver,
7960 cx
7961 )?) {
7962 Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
7963 None => std::task::Poll::Ready(None),
7964 }
7965 }
7966}
7967
7968#[derive(Debug)]
7969pub enum WlanixEvent {
7970 #[non_exhaustive]
7971 _UnknownEvent {
7972 ordinal: u64,
7974 },
7975}
7976
7977impl WlanixEvent {
7978 fn decode(
7980 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7981 ) -> Result<WlanixEvent, fidl::Error> {
7982 let (bytes, _handles) = buf.split_mut();
7983 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7984 debug_assert_eq!(tx_header.tx_id, 0);
7985 match tx_header.ordinal {
7986 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7987 Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7988 }
7989 _ => Err(fidl::Error::UnknownOrdinal {
7990 ordinal: tx_header.ordinal,
7991 protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7992 }),
7993 }
7994 }
7995}
7996
7997pub struct WlanixRequestStream {
7999 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8000 is_terminated: bool,
8001}
8002
8003impl std::marker::Unpin for WlanixRequestStream {}
8004
8005impl futures::stream::FusedStream for WlanixRequestStream {
8006 fn is_terminated(&self) -> bool {
8007 self.is_terminated
8008 }
8009}
8010
8011impl fidl::endpoints::RequestStream for WlanixRequestStream {
8012 type Protocol = WlanixMarker;
8013 type ControlHandle = WlanixControlHandle;
8014
8015 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8016 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8017 }
8018
8019 fn control_handle(&self) -> Self::ControlHandle {
8020 WlanixControlHandle { inner: self.inner.clone() }
8021 }
8022
8023 fn into_inner(
8024 self,
8025 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8026 {
8027 (self.inner, self.is_terminated)
8028 }
8029
8030 fn from_inner(
8031 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8032 is_terminated: bool,
8033 ) -> Self {
8034 Self { inner, is_terminated }
8035 }
8036}
8037
8038impl futures::Stream for WlanixRequestStream {
8039 type Item = Result<WlanixRequest, fidl::Error>;
8040
8041 fn poll_next(
8042 mut self: std::pin::Pin<&mut Self>,
8043 cx: &mut std::task::Context<'_>,
8044 ) -> std::task::Poll<Option<Self::Item>> {
8045 let this = &mut *self;
8046 if this.inner.check_shutdown(cx) {
8047 this.is_terminated = true;
8048 return std::task::Poll::Ready(None);
8049 }
8050 if this.is_terminated {
8051 panic!("polled WlanixRequestStream after completion");
8052 }
8053 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8054 |bytes, handles| {
8055 match this.inner.channel().read_etc(cx, bytes, handles) {
8056 std::task::Poll::Ready(Ok(())) => {}
8057 std::task::Poll::Pending => return std::task::Poll::Pending,
8058 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8059 this.is_terminated = true;
8060 return std::task::Poll::Ready(None);
8061 }
8062 std::task::Poll::Ready(Err(e)) => {
8063 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8064 e.into(),
8065 ))))
8066 }
8067 }
8068
8069 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8071
8072 std::task::Poll::Ready(Some(match header.ordinal {
8073 0x142511f44b2c338c => {
8074 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8075 let mut req = fidl::new_empty!(
8076 WlanixGetWifiRequest,
8077 fidl::encoding::DefaultFuchsiaResourceDialect
8078 );
8079 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
8080 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8081 Ok(WlanixRequest::GetWifi { payload: req, control_handle })
8082 }
8083 0x55554b37c4021d3d => {
8084 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8085 let mut req = fidl::new_empty!(
8086 WlanixGetSupplicantRequest,
8087 fidl::encoding::DefaultFuchsiaResourceDialect
8088 );
8089 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
8090 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8091 Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
8092 }
8093 0x48028a25bd855ef9 => {
8094 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8095 let mut req = fidl::new_empty!(
8096 WlanixGetNl80211Request,
8097 fidl::encoding::DefaultFuchsiaResourceDialect
8098 );
8099 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
8100 let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8101 Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
8102 }
8103 _ if header.tx_id == 0
8104 && header
8105 .dynamic_flags()
8106 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8107 {
8108 Ok(WlanixRequest::_UnknownMethod {
8109 ordinal: header.ordinal,
8110 control_handle: WlanixControlHandle { inner: this.inner.clone() },
8111 method_type: fidl::MethodType::OneWay,
8112 })
8113 }
8114 _ if header
8115 .dynamic_flags()
8116 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8117 {
8118 this.inner.send_framework_err(
8119 fidl::encoding::FrameworkErr::UnknownMethod,
8120 header.tx_id,
8121 header.ordinal,
8122 header.dynamic_flags(),
8123 (bytes, handles),
8124 )?;
8125 Ok(WlanixRequest::_UnknownMethod {
8126 ordinal: header.ordinal,
8127 control_handle: WlanixControlHandle { inner: this.inner.clone() },
8128 method_type: fidl::MethodType::TwoWay,
8129 })
8130 }
8131 _ => Err(fidl::Error::UnknownOrdinal {
8132 ordinal: header.ordinal,
8133 protocol_name:
8134 <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8135 }),
8136 }))
8137 },
8138 )
8139 }
8140}
8141
8142#[derive(Debug)]
8144pub enum WlanixRequest {
8145 GetWifi {
8147 payload: WlanixGetWifiRequest,
8148 control_handle: WlanixControlHandle,
8149 },
8150 GetSupplicant {
8151 payload: WlanixGetSupplicantRequest,
8152 control_handle: WlanixControlHandle,
8153 },
8154 GetNl80211 {
8155 payload: WlanixGetNl80211Request,
8156 control_handle: WlanixControlHandle,
8157 },
8158 #[non_exhaustive]
8160 _UnknownMethod {
8161 ordinal: u64,
8163 control_handle: WlanixControlHandle,
8164 method_type: fidl::MethodType,
8165 },
8166}
8167
8168impl WlanixRequest {
8169 #[allow(irrefutable_let_patterns)]
8170 pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
8171 if let WlanixRequest::GetWifi { payload, control_handle } = self {
8172 Some((payload, control_handle))
8173 } else {
8174 None
8175 }
8176 }
8177
8178 #[allow(irrefutable_let_patterns)]
8179 pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
8180 if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
8181 Some((payload, control_handle))
8182 } else {
8183 None
8184 }
8185 }
8186
8187 #[allow(irrefutable_let_patterns)]
8188 pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
8189 if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
8190 Some((payload, control_handle))
8191 } else {
8192 None
8193 }
8194 }
8195
8196 pub fn method_name(&self) -> &'static str {
8198 match *self {
8199 WlanixRequest::GetWifi { .. } => "get_wifi",
8200 WlanixRequest::GetSupplicant { .. } => "get_supplicant",
8201 WlanixRequest::GetNl80211 { .. } => "get_nl80211",
8202 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8203 "unknown one-way method"
8204 }
8205 WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8206 "unknown two-way method"
8207 }
8208 }
8209 }
8210}
8211
8212#[derive(Debug, Clone)]
8213pub struct WlanixControlHandle {
8214 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8215}
8216
8217impl fidl::endpoints::ControlHandle for WlanixControlHandle {
8218 fn shutdown(&self) {
8219 self.inner.shutdown()
8220 }
8221 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8222 self.inner.shutdown_with_epitaph(status)
8223 }
8224
8225 fn is_closed(&self) -> bool {
8226 self.inner.channel().is_closed()
8227 }
8228 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8229 self.inner.channel().on_closed()
8230 }
8231
8232 #[cfg(target_os = "fuchsia")]
8233 fn signal_peer(
8234 &self,
8235 clear_mask: zx::Signals,
8236 set_mask: zx::Signals,
8237 ) -> Result<(), zx_status::Status> {
8238 use fidl::Peered;
8239 self.inner.channel().signal_peer(clear_mask, set_mask)
8240 }
8241}
8242
8243impl WlanixControlHandle {}
8244
8245mod internal {
8246 use super::*;
8247
8248 impl Nl80211GetMulticastRequest {
8249 #[inline(always)]
8250 fn max_ordinal_present(&self) -> u64 {
8251 if let Some(_) = self.multicast {
8252 return 2;
8253 }
8254 if let Some(_) = self.group {
8255 return 1;
8256 }
8257 0
8258 }
8259 }
8260
8261 impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
8262 type Borrowed<'a> = &'a mut Self;
8263 fn take_or_borrow<'a>(
8264 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8265 ) -> Self::Borrowed<'a> {
8266 value
8267 }
8268 }
8269
8270 unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
8271 type Owned = Self;
8272
8273 #[inline(always)]
8274 fn inline_align(_context: fidl::encoding::Context) -> usize {
8275 8
8276 }
8277
8278 #[inline(always)]
8279 fn inline_size(_context: fidl::encoding::Context) -> usize {
8280 16
8281 }
8282 }
8283
8284 unsafe impl
8285 fidl::encoding::Encode<
8286 Nl80211GetMulticastRequest,
8287 fidl::encoding::DefaultFuchsiaResourceDialect,
8288 > for &mut Nl80211GetMulticastRequest
8289 {
8290 unsafe fn encode(
8291 self,
8292 encoder: &mut fidl::encoding::Encoder<
8293 '_,
8294 fidl::encoding::DefaultFuchsiaResourceDialect,
8295 >,
8296 offset: usize,
8297 mut depth: fidl::encoding::Depth,
8298 ) -> fidl::Result<()> {
8299 encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
8300 let max_ordinal: u64 = self.max_ordinal_present();
8302 encoder.write_num(max_ordinal, offset);
8303 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8304 if max_ordinal == 0 {
8306 return Ok(());
8307 }
8308 depth.increment()?;
8309 let envelope_size = 8;
8310 let bytes_len = max_ordinal as usize * envelope_size;
8311 #[allow(unused_variables)]
8312 let offset = encoder.out_of_line_offset(bytes_len);
8313 let mut _prev_end_offset: usize = 0;
8314 if 1 > max_ordinal {
8315 return Ok(());
8316 }
8317
8318 let cur_offset: usize = (1 - 1) * envelope_size;
8321
8322 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8324
8325 fidl::encoding::encode_in_envelope_optional::<
8330 fidl::encoding::BoundedString<32>,
8331 fidl::encoding::DefaultFuchsiaResourceDialect,
8332 >(
8333 self.group.as_ref().map(
8334 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
8335 ),
8336 encoder,
8337 offset + cur_offset,
8338 depth,
8339 )?;
8340
8341 _prev_end_offset = cur_offset + envelope_size;
8342 if 2 > max_ordinal {
8343 return Ok(());
8344 }
8345
8346 let cur_offset: usize = (2 - 1) * envelope_size;
8349
8350 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8352
8353 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
8358 self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8359 encoder, offset + cur_offset, depth
8360 )?;
8361
8362 _prev_end_offset = cur_offset + envelope_size;
8363
8364 Ok(())
8365 }
8366 }
8367
8368 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8369 for Nl80211GetMulticastRequest
8370 {
8371 #[inline(always)]
8372 fn new_empty() -> Self {
8373 Self::default()
8374 }
8375
8376 unsafe fn decode(
8377 &mut self,
8378 decoder: &mut fidl::encoding::Decoder<
8379 '_,
8380 fidl::encoding::DefaultFuchsiaResourceDialect,
8381 >,
8382 offset: usize,
8383 mut depth: fidl::encoding::Depth,
8384 ) -> fidl::Result<()> {
8385 decoder.debug_check_bounds::<Self>(offset);
8386 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8387 None => return Err(fidl::Error::NotNullable),
8388 Some(len) => len,
8389 };
8390 if len == 0 {
8392 return Ok(());
8393 };
8394 depth.increment()?;
8395 let envelope_size = 8;
8396 let bytes_len = len * envelope_size;
8397 let offset = decoder.out_of_line_offset(bytes_len)?;
8398 let mut _next_ordinal_to_read = 0;
8400 let mut next_offset = offset;
8401 let end_offset = offset + bytes_len;
8402 _next_ordinal_to_read += 1;
8403 if next_offset >= end_offset {
8404 return Ok(());
8405 }
8406
8407 while _next_ordinal_to_read < 1 {
8409 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8410 _next_ordinal_to_read += 1;
8411 next_offset += envelope_size;
8412 }
8413
8414 let next_out_of_line = decoder.next_out_of_line();
8415 let handles_before = decoder.remaining_handles();
8416 if let Some((inlined, num_bytes, num_handles)) =
8417 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8418 {
8419 let member_inline_size =
8420 <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
8421 decoder.context,
8422 );
8423 if inlined != (member_inline_size <= 4) {
8424 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8425 }
8426 let inner_offset;
8427 let mut inner_depth = depth.clone();
8428 if inlined {
8429 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8430 inner_offset = next_offset;
8431 } else {
8432 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8433 inner_depth.increment()?;
8434 }
8435 let val_ref = self.group.get_or_insert_with(|| {
8436 fidl::new_empty!(
8437 fidl::encoding::BoundedString<32>,
8438 fidl::encoding::DefaultFuchsiaResourceDialect
8439 )
8440 });
8441 fidl::decode!(
8442 fidl::encoding::BoundedString<32>,
8443 fidl::encoding::DefaultFuchsiaResourceDialect,
8444 val_ref,
8445 decoder,
8446 inner_offset,
8447 inner_depth
8448 )?;
8449 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8450 {
8451 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8452 }
8453 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8454 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8455 }
8456 }
8457
8458 next_offset += envelope_size;
8459 _next_ordinal_to_read += 1;
8460 if next_offset >= end_offset {
8461 return Ok(());
8462 }
8463
8464 while _next_ordinal_to_read < 2 {
8466 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8467 _next_ordinal_to_read += 1;
8468 next_offset += envelope_size;
8469 }
8470
8471 let next_out_of_line = decoder.next_out_of_line();
8472 let handles_before = decoder.remaining_handles();
8473 if let Some((inlined, num_bytes, num_handles)) =
8474 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8475 {
8476 let member_inline_size = <fidl::encoding::Endpoint<
8477 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
8478 > as fidl::encoding::TypeMarker>::inline_size(
8479 decoder.context
8480 );
8481 if inlined != (member_inline_size <= 4) {
8482 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8483 }
8484 let inner_offset;
8485 let mut inner_depth = depth.clone();
8486 if inlined {
8487 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8488 inner_offset = next_offset;
8489 } else {
8490 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8491 inner_depth.increment()?;
8492 }
8493 let val_ref = self.multicast.get_or_insert_with(|| {
8494 fidl::new_empty!(
8495 fidl::encoding::Endpoint<
8496 fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
8497 >,
8498 fidl::encoding::DefaultFuchsiaResourceDialect
8499 )
8500 });
8501 fidl::decode!(
8502 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
8503 fidl::encoding::DefaultFuchsiaResourceDialect,
8504 val_ref,
8505 decoder,
8506 inner_offset,
8507 inner_depth
8508 )?;
8509 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8510 {
8511 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8512 }
8513 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8514 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8515 }
8516 }
8517
8518 next_offset += envelope_size;
8519
8520 while next_offset < end_offset {
8522 _next_ordinal_to_read += 1;
8523 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8524 next_offset += envelope_size;
8525 }
8526
8527 Ok(())
8528 }
8529 }
8530
8531 impl Nl80211MessageRequest {
8532 #[inline(always)]
8533 fn max_ordinal_present(&self) -> u64 {
8534 if let Some(_) = self.message {
8535 return 1;
8536 }
8537 0
8538 }
8539 }
8540
8541 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
8542 type Borrowed<'a> = &'a mut Self;
8543 fn take_or_borrow<'a>(
8544 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8545 ) -> Self::Borrowed<'a> {
8546 value
8547 }
8548 }
8549
8550 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
8551 type Owned = Self;
8552
8553 #[inline(always)]
8554 fn inline_align(_context: fidl::encoding::Context) -> usize {
8555 8
8556 }
8557
8558 #[inline(always)]
8559 fn inline_size(_context: fidl::encoding::Context) -> usize {
8560 16
8561 }
8562 }
8563
8564 unsafe impl
8565 fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
8566 for &mut Nl80211MessageRequest
8567 {
8568 unsafe fn encode(
8569 self,
8570 encoder: &mut fidl::encoding::Encoder<
8571 '_,
8572 fidl::encoding::DefaultFuchsiaResourceDialect,
8573 >,
8574 offset: usize,
8575 mut depth: fidl::encoding::Depth,
8576 ) -> fidl::Result<()> {
8577 encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
8578 let max_ordinal: u64 = self.max_ordinal_present();
8580 encoder.write_num(max_ordinal, offset);
8581 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8582 if max_ordinal == 0 {
8584 return Ok(());
8585 }
8586 depth.increment()?;
8587 let envelope_size = 8;
8588 let bytes_len = max_ordinal as usize * envelope_size;
8589 #[allow(unused_variables)]
8590 let offset = encoder.out_of_line_offset(bytes_len);
8591 let mut _prev_end_offset: usize = 0;
8592 if 1 > max_ordinal {
8593 return Ok(());
8594 }
8595
8596 let cur_offset: usize = (1 - 1) * envelope_size;
8599
8600 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8602
8603 fidl::encoding::encode_in_envelope_optional::<
8608 Nl80211Message,
8609 fidl::encoding::DefaultFuchsiaResourceDialect,
8610 >(
8611 self.message
8612 .as_ref()
8613 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
8614 encoder,
8615 offset + cur_offset,
8616 depth,
8617 )?;
8618
8619 _prev_end_offset = cur_offset + envelope_size;
8620
8621 Ok(())
8622 }
8623 }
8624
8625 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8626 for Nl80211MessageRequest
8627 {
8628 #[inline(always)]
8629 fn new_empty() -> Self {
8630 Self::default()
8631 }
8632
8633 unsafe fn decode(
8634 &mut self,
8635 decoder: &mut fidl::encoding::Decoder<
8636 '_,
8637 fidl::encoding::DefaultFuchsiaResourceDialect,
8638 >,
8639 offset: usize,
8640 mut depth: fidl::encoding::Depth,
8641 ) -> fidl::Result<()> {
8642 decoder.debug_check_bounds::<Self>(offset);
8643 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8644 None => return Err(fidl::Error::NotNullable),
8645 Some(len) => len,
8646 };
8647 if len == 0 {
8649 return Ok(());
8650 };
8651 depth.increment()?;
8652 let envelope_size = 8;
8653 let bytes_len = len * envelope_size;
8654 let offset = decoder.out_of_line_offset(bytes_len)?;
8655 let mut _next_ordinal_to_read = 0;
8657 let mut next_offset = offset;
8658 let end_offset = offset + bytes_len;
8659 _next_ordinal_to_read += 1;
8660 if next_offset >= end_offset {
8661 return Ok(());
8662 }
8663
8664 while _next_ordinal_to_read < 1 {
8666 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8667 _next_ordinal_to_read += 1;
8668 next_offset += envelope_size;
8669 }
8670
8671 let next_out_of_line = decoder.next_out_of_line();
8672 let handles_before = decoder.remaining_handles();
8673 if let Some((inlined, num_bytes, num_handles)) =
8674 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8675 {
8676 let member_inline_size =
8677 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8678 if inlined != (member_inline_size <= 4) {
8679 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8680 }
8681 let inner_offset;
8682 let mut inner_depth = depth.clone();
8683 if inlined {
8684 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8685 inner_offset = next_offset;
8686 } else {
8687 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8688 inner_depth.increment()?;
8689 }
8690 let val_ref = self.message.get_or_insert_with(|| {
8691 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
8692 });
8693 fidl::decode!(
8694 Nl80211Message,
8695 fidl::encoding::DefaultFuchsiaResourceDialect,
8696 val_ref,
8697 decoder,
8698 inner_offset,
8699 inner_depth
8700 )?;
8701 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8702 {
8703 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8704 }
8705 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8706 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8707 }
8708 }
8709
8710 next_offset += envelope_size;
8711
8712 while next_offset < end_offset {
8714 _next_ordinal_to_read += 1;
8715 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8716 next_offset += envelope_size;
8717 }
8718
8719 Ok(())
8720 }
8721 }
8722
8723 impl Nl80211MulticastMessageRequest {
8724 #[inline(always)]
8725 fn max_ordinal_present(&self) -> u64 {
8726 if let Some(_) = self.message {
8727 return 1;
8728 }
8729 0
8730 }
8731 }
8732
8733 impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
8734 type Borrowed<'a> = &'a mut Self;
8735 fn take_or_borrow<'a>(
8736 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8737 ) -> Self::Borrowed<'a> {
8738 value
8739 }
8740 }
8741
8742 unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
8743 type Owned = Self;
8744
8745 #[inline(always)]
8746 fn inline_align(_context: fidl::encoding::Context) -> usize {
8747 8
8748 }
8749
8750 #[inline(always)]
8751 fn inline_size(_context: fidl::encoding::Context) -> usize {
8752 16
8753 }
8754 }
8755
8756 unsafe impl
8757 fidl::encoding::Encode<
8758 Nl80211MulticastMessageRequest,
8759 fidl::encoding::DefaultFuchsiaResourceDialect,
8760 > for &mut Nl80211MulticastMessageRequest
8761 {
8762 unsafe fn encode(
8763 self,
8764 encoder: &mut fidl::encoding::Encoder<
8765 '_,
8766 fidl::encoding::DefaultFuchsiaResourceDialect,
8767 >,
8768 offset: usize,
8769 mut depth: fidl::encoding::Depth,
8770 ) -> fidl::Result<()> {
8771 encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
8772 let max_ordinal: u64 = self.max_ordinal_present();
8774 encoder.write_num(max_ordinal, offset);
8775 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8776 if max_ordinal == 0 {
8778 return Ok(());
8779 }
8780 depth.increment()?;
8781 let envelope_size = 8;
8782 let bytes_len = max_ordinal as usize * envelope_size;
8783 #[allow(unused_variables)]
8784 let offset = encoder.out_of_line_offset(bytes_len);
8785 let mut _prev_end_offset: usize = 0;
8786 if 1 > max_ordinal {
8787 return Ok(());
8788 }
8789
8790 let cur_offset: usize = (1 - 1) * envelope_size;
8793
8794 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8796
8797 fidl::encoding::encode_in_envelope_optional::<
8802 Nl80211Message,
8803 fidl::encoding::DefaultFuchsiaResourceDialect,
8804 >(
8805 self.message
8806 .as_ref()
8807 .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
8808 encoder,
8809 offset + cur_offset,
8810 depth,
8811 )?;
8812
8813 _prev_end_offset = cur_offset + envelope_size;
8814
8815 Ok(())
8816 }
8817 }
8818
8819 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8820 for Nl80211MulticastMessageRequest
8821 {
8822 #[inline(always)]
8823 fn new_empty() -> Self {
8824 Self::default()
8825 }
8826
8827 unsafe fn decode(
8828 &mut self,
8829 decoder: &mut fidl::encoding::Decoder<
8830 '_,
8831 fidl::encoding::DefaultFuchsiaResourceDialect,
8832 >,
8833 offset: usize,
8834 mut depth: fidl::encoding::Depth,
8835 ) -> fidl::Result<()> {
8836 decoder.debug_check_bounds::<Self>(offset);
8837 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8838 None => return Err(fidl::Error::NotNullable),
8839 Some(len) => len,
8840 };
8841 if len == 0 {
8843 return Ok(());
8844 };
8845 depth.increment()?;
8846 let envelope_size = 8;
8847 let bytes_len = len * envelope_size;
8848 let offset = decoder.out_of_line_offset(bytes_len)?;
8849 let mut _next_ordinal_to_read = 0;
8851 let mut next_offset = offset;
8852 let end_offset = offset + bytes_len;
8853 _next_ordinal_to_read += 1;
8854 if next_offset >= end_offset {
8855 return Ok(());
8856 }
8857
8858 while _next_ordinal_to_read < 1 {
8860 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8861 _next_ordinal_to_read += 1;
8862 next_offset += envelope_size;
8863 }
8864
8865 let next_out_of_line = decoder.next_out_of_line();
8866 let handles_before = decoder.remaining_handles();
8867 if let Some((inlined, num_bytes, num_handles)) =
8868 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8869 {
8870 let member_inline_size =
8871 <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8872 if inlined != (member_inline_size <= 4) {
8873 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8874 }
8875 let inner_offset;
8876 let mut inner_depth = depth.clone();
8877 if inlined {
8878 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8879 inner_offset = next_offset;
8880 } else {
8881 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8882 inner_depth.increment()?;
8883 }
8884 let val_ref = self.message.get_or_insert_with(|| {
8885 fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
8886 });
8887 fidl::decode!(
8888 Nl80211Message,
8889 fidl::encoding::DefaultFuchsiaResourceDialect,
8890 val_ref,
8891 decoder,
8892 inner_offset,
8893 inner_depth
8894 )?;
8895 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8896 {
8897 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8898 }
8899 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8900 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8901 }
8902 }
8903
8904 next_offset += envelope_size;
8905
8906 while next_offset < end_offset {
8908 _next_ordinal_to_read += 1;
8909 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8910 next_offset += envelope_size;
8911 }
8912
8913 Ok(())
8914 }
8915 }
8916
8917 impl Nl80211MessageResponse {
8918 #[inline(always)]
8919 fn max_ordinal_present(&self) -> u64 {
8920 if let Some(_) = self.responses {
8921 return 1;
8922 }
8923 0
8924 }
8925 }
8926
8927 impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
8928 type Borrowed<'a> = &'a mut Self;
8929 fn take_or_borrow<'a>(
8930 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8931 ) -> Self::Borrowed<'a> {
8932 value
8933 }
8934 }
8935
8936 unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
8937 type Owned = Self;
8938
8939 #[inline(always)]
8940 fn inline_align(_context: fidl::encoding::Context) -> usize {
8941 8
8942 }
8943
8944 #[inline(always)]
8945 fn inline_size(_context: fidl::encoding::Context) -> usize {
8946 16
8947 }
8948 }
8949
8950 unsafe impl
8951 fidl::encoding::Encode<
8952 Nl80211MessageResponse,
8953 fidl::encoding::DefaultFuchsiaResourceDialect,
8954 > for &mut Nl80211MessageResponse
8955 {
8956 unsafe fn encode(
8957 self,
8958 encoder: &mut fidl::encoding::Encoder<
8959 '_,
8960 fidl::encoding::DefaultFuchsiaResourceDialect,
8961 >,
8962 offset: usize,
8963 mut depth: fidl::encoding::Depth,
8964 ) -> fidl::Result<()> {
8965 encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
8966 let max_ordinal: u64 = self.max_ordinal_present();
8968 encoder.write_num(max_ordinal, offset);
8969 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8970 if max_ordinal == 0 {
8972 return Ok(());
8973 }
8974 depth.increment()?;
8975 let envelope_size = 8;
8976 let bytes_len = max_ordinal as usize * envelope_size;
8977 #[allow(unused_variables)]
8978 let offset = encoder.out_of_line_offset(bytes_len);
8979 let mut _prev_end_offset: usize = 0;
8980 if 1 > max_ordinal {
8981 return Ok(());
8982 }
8983
8984 let cur_offset: usize = (1 - 1) * envelope_size;
8987
8988 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8990
8991 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
8996 self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
8997 encoder, offset + cur_offset, depth
8998 )?;
8999
9000 _prev_end_offset = cur_offset + envelope_size;
9001
9002 Ok(())
9003 }
9004 }
9005
9006 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9007 for Nl80211MessageResponse
9008 {
9009 #[inline(always)]
9010 fn new_empty() -> Self {
9011 Self::default()
9012 }
9013
9014 unsafe fn decode(
9015 &mut self,
9016 decoder: &mut fidl::encoding::Decoder<
9017 '_,
9018 fidl::encoding::DefaultFuchsiaResourceDialect,
9019 >,
9020 offset: usize,
9021 mut depth: fidl::encoding::Depth,
9022 ) -> fidl::Result<()> {
9023 decoder.debug_check_bounds::<Self>(offset);
9024 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9025 None => return Err(fidl::Error::NotNullable),
9026 Some(len) => len,
9027 };
9028 if len == 0 {
9030 return Ok(());
9031 };
9032 depth.increment()?;
9033 let envelope_size = 8;
9034 let bytes_len = len * envelope_size;
9035 let offset = decoder.out_of_line_offset(bytes_len)?;
9036 let mut _next_ordinal_to_read = 0;
9038 let mut next_offset = offset;
9039 let end_offset = offset + bytes_len;
9040 _next_ordinal_to_read += 1;
9041 if next_offset >= end_offset {
9042 return Ok(());
9043 }
9044
9045 while _next_ordinal_to_read < 1 {
9047 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9048 _next_ordinal_to_read += 1;
9049 next_offset += envelope_size;
9050 }
9051
9052 let next_out_of_line = decoder.next_out_of_line();
9053 let handles_before = decoder.remaining_handles();
9054 if let Some((inlined, num_bytes, num_handles)) =
9055 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9056 {
9057 let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9058 if inlined != (member_inline_size <= 4) {
9059 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9060 }
9061 let inner_offset;
9062 let mut inner_depth = depth.clone();
9063 if inlined {
9064 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9065 inner_offset = next_offset;
9066 } else {
9067 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9068 inner_depth.increment()?;
9069 }
9070 let val_ref = self.responses.get_or_insert_with(|| {
9071 fidl::new_empty!(
9072 fidl::encoding::UnboundedVector<Nl80211Message>,
9073 fidl::encoding::DefaultFuchsiaResourceDialect
9074 )
9075 });
9076 fidl::decode!(
9077 fidl::encoding::UnboundedVector<Nl80211Message>,
9078 fidl::encoding::DefaultFuchsiaResourceDialect,
9079 val_ref,
9080 decoder,
9081 inner_offset,
9082 inner_depth
9083 )?;
9084 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9085 {
9086 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9087 }
9088 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9089 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9090 }
9091 }
9092
9093 next_offset += envelope_size;
9094
9095 while next_offset < end_offset {
9097 _next_ordinal_to_read += 1;
9098 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9099 next_offset += envelope_size;
9100 }
9101
9102 Ok(())
9103 }
9104 }
9105
9106 impl SupplicantAddStaInterfaceRequest {
9107 #[inline(always)]
9108 fn max_ordinal_present(&self) -> u64 {
9109 if let Some(_) = self.iface_name {
9110 return 2;
9111 }
9112 if let Some(_) = self.iface {
9113 return 1;
9114 }
9115 0
9116 }
9117 }
9118
9119 impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
9120 type Borrowed<'a> = &'a mut Self;
9121 fn take_or_borrow<'a>(
9122 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9123 ) -> Self::Borrowed<'a> {
9124 value
9125 }
9126 }
9127
9128 unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
9129 type Owned = Self;
9130
9131 #[inline(always)]
9132 fn inline_align(_context: fidl::encoding::Context) -> usize {
9133 8
9134 }
9135
9136 #[inline(always)]
9137 fn inline_size(_context: fidl::encoding::Context) -> usize {
9138 16
9139 }
9140 }
9141
9142 unsafe impl
9143 fidl::encoding::Encode<
9144 SupplicantAddStaInterfaceRequest,
9145 fidl::encoding::DefaultFuchsiaResourceDialect,
9146 > for &mut SupplicantAddStaInterfaceRequest
9147 {
9148 unsafe fn encode(
9149 self,
9150 encoder: &mut fidl::encoding::Encoder<
9151 '_,
9152 fidl::encoding::DefaultFuchsiaResourceDialect,
9153 >,
9154 offset: usize,
9155 mut depth: fidl::encoding::Depth,
9156 ) -> fidl::Result<()> {
9157 encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
9158 let max_ordinal: u64 = self.max_ordinal_present();
9160 encoder.write_num(max_ordinal, offset);
9161 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9162 if max_ordinal == 0 {
9164 return Ok(());
9165 }
9166 depth.increment()?;
9167 let envelope_size = 8;
9168 let bytes_len = max_ordinal as usize * envelope_size;
9169 #[allow(unused_variables)]
9170 let offset = encoder.out_of_line_offset(bytes_len);
9171 let mut _prev_end_offset: usize = 0;
9172 if 1 > max_ordinal {
9173 return Ok(());
9174 }
9175
9176 let cur_offset: usize = (1 - 1) * envelope_size;
9179
9180 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9182
9183 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9188 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9189 encoder, offset + cur_offset, depth
9190 )?;
9191
9192 _prev_end_offset = cur_offset + envelope_size;
9193 if 2 > max_ordinal {
9194 return Ok(());
9195 }
9196
9197 let cur_offset: usize = (2 - 1) * envelope_size;
9200
9201 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9203
9204 fidl::encoding::encode_in_envelope_optional::<
9209 fidl::encoding::BoundedString<16>,
9210 fidl::encoding::DefaultFuchsiaResourceDialect,
9211 >(
9212 self.iface_name.as_ref().map(
9213 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
9214 ),
9215 encoder,
9216 offset + cur_offset,
9217 depth,
9218 )?;
9219
9220 _prev_end_offset = cur_offset + envelope_size;
9221
9222 Ok(())
9223 }
9224 }
9225
9226 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9227 for SupplicantAddStaInterfaceRequest
9228 {
9229 #[inline(always)]
9230 fn new_empty() -> Self {
9231 Self::default()
9232 }
9233
9234 unsafe fn decode(
9235 &mut self,
9236 decoder: &mut fidl::encoding::Decoder<
9237 '_,
9238 fidl::encoding::DefaultFuchsiaResourceDialect,
9239 >,
9240 offset: usize,
9241 mut depth: fidl::encoding::Depth,
9242 ) -> fidl::Result<()> {
9243 decoder.debug_check_bounds::<Self>(offset);
9244 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9245 None => return Err(fidl::Error::NotNullable),
9246 Some(len) => len,
9247 };
9248 if len == 0 {
9250 return Ok(());
9251 };
9252 depth.increment()?;
9253 let envelope_size = 8;
9254 let bytes_len = len * envelope_size;
9255 let offset = decoder.out_of_line_offset(bytes_len)?;
9256 let mut _next_ordinal_to_read = 0;
9258 let mut next_offset = offset;
9259 let end_offset = offset + bytes_len;
9260 _next_ordinal_to_read += 1;
9261 if next_offset >= end_offset {
9262 return Ok(());
9263 }
9264
9265 while _next_ordinal_to_read < 1 {
9267 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9268 _next_ordinal_to_read += 1;
9269 next_offset += envelope_size;
9270 }
9271
9272 let next_out_of_line = decoder.next_out_of_line();
9273 let handles_before = decoder.remaining_handles();
9274 if let Some((inlined, num_bytes, num_handles)) =
9275 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9276 {
9277 let member_inline_size = <fidl::encoding::Endpoint<
9278 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
9279 > as fidl::encoding::TypeMarker>::inline_size(
9280 decoder.context
9281 );
9282 if inlined != (member_inline_size <= 4) {
9283 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9284 }
9285 let inner_offset;
9286 let mut inner_depth = depth.clone();
9287 if inlined {
9288 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9289 inner_offset = next_offset;
9290 } else {
9291 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9292 inner_depth.increment()?;
9293 }
9294 let val_ref = self.iface.get_or_insert_with(|| {
9295 fidl::new_empty!(
9296 fidl::encoding::Endpoint<
9297 fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
9298 >,
9299 fidl::encoding::DefaultFuchsiaResourceDialect
9300 )
9301 });
9302 fidl::decode!(
9303 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
9304 fidl::encoding::DefaultFuchsiaResourceDialect,
9305 val_ref,
9306 decoder,
9307 inner_offset,
9308 inner_depth
9309 )?;
9310 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9311 {
9312 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9313 }
9314 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9315 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9316 }
9317 }
9318
9319 next_offset += envelope_size;
9320 _next_ordinal_to_read += 1;
9321 if next_offset >= end_offset {
9322 return Ok(());
9323 }
9324
9325 while _next_ordinal_to_read < 2 {
9327 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9328 _next_ordinal_to_read += 1;
9329 next_offset += envelope_size;
9330 }
9331
9332 let next_out_of_line = decoder.next_out_of_line();
9333 let handles_before = decoder.remaining_handles();
9334 if let Some((inlined, num_bytes, num_handles)) =
9335 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9336 {
9337 let member_inline_size =
9338 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
9339 decoder.context,
9340 );
9341 if inlined != (member_inline_size <= 4) {
9342 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9343 }
9344 let inner_offset;
9345 let mut inner_depth = depth.clone();
9346 if inlined {
9347 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9348 inner_offset = next_offset;
9349 } else {
9350 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9351 inner_depth.increment()?;
9352 }
9353 let val_ref = self.iface_name.get_or_insert_with(|| {
9354 fidl::new_empty!(
9355 fidl::encoding::BoundedString<16>,
9356 fidl::encoding::DefaultFuchsiaResourceDialect
9357 )
9358 });
9359 fidl::decode!(
9360 fidl::encoding::BoundedString<16>,
9361 fidl::encoding::DefaultFuchsiaResourceDialect,
9362 val_ref,
9363 decoder,
9364 inner_offset,
9365 inner_depth
9366 )?;
9367 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9368 {
9369 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9370 }
9371 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9372 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9373 }
9374 }
9375
9376 next_offset += envelope_size;
9377
9378 while next_offset < end_offset {
9380 _next_ordinal_to_read += 1;
9381 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9382 next_offset += envelope_size;
9383 }
9384
9385 Ok(())
9386 }
9387 }
9388
9389 impl SupplicantStaIfaceAddNetworkRequest {
9390 #[inline(always)]
9391 fn max_ordinal_present(&self) -> u64 {
9392 if let Some(_) = self.network {
9393 return 1;
9394 }
9395 0
9396 }
9397 }
9398
9399 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
9400 type Borrowed<'a> = &'a mut Self;
9401 fn take_or_borrow<'a>(
9402 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9403 ) -> Self::Borrowed<'a> {
9404 value
9405 }
9406 }
9407
9408 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
9409 type Owned = Self;
9410
9411 #[inline(always)]
9412 fn inline_align(_context: fidl::encoding::Context) -> usize {
9413 8
9414 }
9415
9416 #[inline(always)]
9417 fn inline_size(_context: fidl::encoding::Context) -> usize {
9418 16
9419 }
9420 }
9421
9422 unsafe impl
9423 fidl::encoding::Encode<
9424 SupplicantStaIfaceAddNetworkRequest,
9425 fidl::encoding::DefaultFuchsiaResourceDialect,
9426 > for &mut SupplicantStaIfaceAddNetworkRequest
9427 {
9428 unsafe fn encode(
9429 self,
9430 encoder: &mut fidl::encoding::Encoder<
9431 '_,
9432 fidl::encoding::DefaultFuchsiaResourceDialect,
9433 >,
9434 offset: usize,
9435 mut depth: fidl::encoding::Depth,
9436 ) -> fidl::Result<()> {
9437 encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
9438 let max_ordinal: u64 = self.max_ordinal_present();
9440 encoder.write_num(max_ordinal, offset);
9441 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9442 if max_ordinal == 0 {
9444 return Ok(());
9445 }
9446 depth.increment()?;
9447 let envelope_size = 8;
9448 let bytes_len = max_ordinal as usize * envelope_size;
9449 #[allow(unused_variables)]
9450 let offset = encoder.out_of_line_offset(bytes_len);
9451 let mut _prev_end_offset: usize = 0;
9452 if 1 > max_ordinal {
9453 return Ok(());
9454 }
9455
9456 let cur_offset: usize = (1 - 1) * envelope_size;
9459
9460 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9462
9463 fidl::encoding::encode_in_envelope_optional::<
9468 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
9469 fidl::encoding::DefaultFuchsiaResourceDialect,
9470 >(
9471 self.network.as_mut().map(
9472 <fidl::encoding::Endpoint<
9473 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
9474 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9475 ),
9476 encoder,
9477 offset + cur_offset,
9478 depth,
9479 )?;
9480
9481 _prev_end_offset = cur_offset + envelope_size;
9482
9483 Ok(())
9484 }
9485 }
9486
9487 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9488 for SupplicantStaIfaceAddNetworkRequest
9489 {
9490 #[inline(always)]
9491 fn new_empty() -> Self {
9492 Self::default()
9493 }
9494
9495 unsafe fn decode(
9496 &mut self,
9497 decoder: &mut fidl::encoding::Decoder<
9498 '_,
9499 fidl::encoding::DefaultFuchsiaResourceDialect,
9500 >,
9501 offset: usize,
9502 mut depth: fidl::encoding::Depth,
9503 ) -> fidl::Result<()> {
9504 decoder.debug_check_bounds::<Self>(offset);
9505 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9506 None => return Err(fidl::Error::NotNullable),
9507 Some(len) => len,
9508 };
9509 if len == 0 {
9511 return Ok(());
9512 };
9513 depth.increment()?;
9514 let envelope_size = 8;
9515 let bytes_len = len * envelope_size;
9516 let offset = decoder.out_of_line_offset(bytes_len)?;
9517 let mut _next_ordinal_to_read = 0;
9519 let mut next_offset = offset;
9520 let end_offset = offset + bytes_len;
9521 _next_ordinal_to_read += 1;
9522 if next_offset >= end_offset {
9523 return Ok(());
9524 }
9525
9526 while _next_ordinal_to_read < 1 {
9528 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9529 _next_ordinal_to_read += 1;
9530 next_offset += envelope_size;
9531 }
9532
9533 let next_out_of_line = decoder.next_out_of_line();
9534 let handles_before = decoder.remaining_handles();
9535 if let Some((inlined, num_bytes, num_handles)) =
9536 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9537 {
9538 let member_inline_size = <fidl::encoding::Endpoint<
9539 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
9540 > as fidl::encoding::TypeMarker>::inline_size(
9541 decoder.context
9542 );
9543 if inlined != (member_inline_size <= 4) {
9544 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9545 }
9546 let inner_offset;
9547 let mut inner_depth = depth.clone();
9548 if inlined {
9549 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9550 inner_offset = next_offset;
9551 } else {
9552 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9553 inner_depth.increment()?;
9554 }
9555 let val_ref = self.network.get_or_insert_with(|| {
9556 fidl::new_empty!(
9557 fidl::encoding::Endpoint<
9558 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
9559 >,
9560 fidl::encoding::DefaultFuchsiaResourceDialect
9561 )
9562 });
9563 fidl::decode!(
9564 fidl::encoding::Endpoint<
9565 fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
9566 >,
9567 fidl::encoding::DefaultFuchsiaResourceDialect,
9568 val_ref,
9569 decoder,
9570 inner_offset,
9571 inner_depth
9572 )?;
9573 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9574 {
9575 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9576 }
9577 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9578 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9579 }
9580 }
9581
9582 next_offset += envelope_size;
9583
9584 while next_offset < end_offset {
9586 _next_ordinal_to_read += 1;
9587 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9588 next_offset += envelope_size;
9589 }
9590
9591 Ok(())
9592 }
9593 }
9594
9595 impl SupplicantStaIfaceRegisterCallbackRequest {
9596 #[inline(always)]
9597 fn max_ordinal_present(&self) -> u64 {
9598 if let Some(_) = self.callback {
9599 return 1;
9600 }
9601 0
9602 }
9603 }
9604
9605 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
9606 type Borrowed<'a> = &'a mut Self;
9607 fn take_or_borrow<'a>(
9608 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9609 ) -> Self::Borrowed<'a> {
9610 value
9611 }
9612 }
9613
9614 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
9615 type Owned = Self;
9616
9617 #[inline(always)]
9618 fn inline_align(_context: fidl::encoding::Context) -> usize {
9619 8
9620 }
9621
9622 #[inline(always)]
9623 fn inline_size(_context: fidl::encoding::Context) -> usize {
9624 16
9625 }
9626 }
9627
9628 unsafe impl
9629 fidl::encoding::Encode<
9630 SupplicantStaIfaceRegisterCallbackRequest,
9631 fidl::encoding::DefaultFuchsiaResourceDialect,
9632 > for &mut SupplicantStaIfaceRegisterCallbackRequest
9633 {
9634 unsafe fn encode(
9635 self,
9636 encoder: &mut fidl::encoding::Encoder<
9637 '_,
9638 fidl::encoding::DefaultFuchsiaResourceDialect,
9639 >,
9640 offset: usize,
9641 mut depth: fidl::encoding::Depth,
9642 ) -> fidl::Result<()> {
9643 encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
9644 let max_ordinal: u64 = self.max_ordinal_present();
9646 encoder.write_num(max_ordinal, offset);
9647 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9648 if max_ordinal == 0 {
9650 return Ok(());
9651 }
9652 depth.increment()?;
9653 let envelope_size = 8;
9654 let bytes_len = max_ordinal as usize * envelope_size;
9655 #[allow(unused_variables)]
9656 let offset = encoder.out_of_line_offset(bytes_len);
9657 let mut _prev_end_offset: usize = 0;
9658 if 1 > max_ordinal {
9659 return Ok(());
9660 }
9661
9662 let cur_offset: usize = (1 - 1) * envelope_size;
9665
9666 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9668
9669 fidl::encoding::encode_in_envelope_optional::<
9674 fidl::encoding::Endpoint<
9675 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
9676 >,
9677 fidl::encoding::DefaultFuchsiaResourceDialect,
9678 >(
9679 self.callback.as_mut().map(
9680 <fidl::encoding::Endpoint<
9681 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
9682 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9683 ),
9684 encoder,
9685 offset + cur_offset,
9686 depth,
9687 )?;
9688
9689 _prev_end_offset = cur_offset + envelope_size;
9690
9691 Ok(())
9692 }
9693 }
9694
9695 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9696 for SupplicantStaIfaceRegisterCallbackRequest
9697 {
9698 #[inline(always)]
9699 fn new_empty() -> Self {
9700 Self::default()
9701 }
9702
9703 unsafe fn decode(
9704 &mut self,
9705 decoder: &mut fidl::encoding::Decoder<
9706 '_,
9707 fidl::encoding::DefaultFuchsiaResourceDialect,
9708 >,
9709 offset: usize,
9710 mut depth: fidl::encoding::Depth,
9711 ) -> fidl::Result<()> {
9712 decoder.debug_check_bounds::<Self>(offset);
9713 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9714 None => return Err(fidl::Error::NotNullable),
9715 Some(len) => len,
9716 };
9717 if len == 0 {
9719 return Ok(());
9720 };
9721 depth.increment()?;
9722 let envelope_size = 8;
9723 let bytes_len = len * envelope_size;
9724 let offset = decoder.out_of_line_offset(bytes_len)?;
9725 let mut _next_ordinal_to_read = 0;
9727 let mut next_offset = offset;
9728 let end_offset = offset + bytes_len;
9729 _next_ordinal_to_read += 1;
9730 if next_offset >= end_offset {
9731 return Ok(());
9732 }
9733
9734 while _next_ordinal_to_read < 1 {
9736 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9737 _next_ordinal_to_read += 1;
9738 next_offset += envelope_size;
9739 }
9740
9741 let next_out_of_line = decoder.next_out_of_line();
9742 let handles_before = decoder.remaining_handles();
9743 if let Some((inlined, num_bytes, num_handles)) =
9744 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9745 {
9746 let member_inline_size = <fidl::encoding::Endpoint<
9747 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
9748 > as fidl::encoding::TypeMarker>::inline_size(
9749 decoder.context
9750 );
9751 if inlined != (member_inline_size <= 4) {
9752 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9753 }
9754 let inner_offset;
9755 let mut inner_depth = depth.clone();
9756 if inlined {
9757 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9758 inner_offset = next_offset;
9759 } else {
9760 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9761 inner_depth.increment()?;
9762 }
9763 let val_ref = self.callback.get_or_insert_with(|| {
9764 fidl::new_empty!(
9765 fidl::encoding::Endpoint<
9766 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
9767 >,
9768 fidl::encoding::DefaultFuchsiaResourceDialect
9769 )
9770 });
9771 fidl::decode!(
9772 fidl::encoding::Endpoint<
9773 fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
9774 >,
9775 fidl::encoding::DefaultFuchsiaResourceDialect,
9776 val_ref,
9777 decoder,
9778 inner_offset,
9779 inner_depth
9780 )?;
9781 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9782 {
9783 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9784 }
9785 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9786 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9787 }
9788 }
9789
9790 next_offset += envelope_size;
9791
9792 while next_offset < end_offset {
9794 _next_ordinal_to_read += 1;
9795 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9796 next_offset += envelope_size;
9797 }
9798
9799 Ok(())
9800 }
9801 }
9802
9803 impl SupplicantStaIfaceSetPowerSaveRequest {
9804 #[inline(always)]
9805 fn max_ordinal_present(&self) -> u64 {
9806 if let Some(_) = self.enable {
9807 return 1;
9808 }
9809 0
9810 }
9811 }
9812
9813 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
9814 type Borrowed<'a> = &'a mut Self;
9815 fn take_or_borrow<'a>(
9816 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9817 ) -> Self::Borrowed<'a> {
9818 value
9819 }
9820 }
9821
9822 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
9823 type Owned = Self;
9824
9825 #[inline(always)]
9826 fn inline_align(_context: fidl::encoding::Context) -> usize {
9827 8
9828 }
9829
9830 #[inline(always)]
9831 fn inline_size(_context: fidl::encoding::Context) -> usize {
9832 16
9833 }
9834 }
9835
9836 unsafe impl
9837 fidl::encoding::Encode<
9838 SupplicantStaIfaceSetPowerSaveRequest,
9839 fidl::encoding::DefaultFuchsiaResourceDialect,
9840 > for &mut SupplicantStaIfaceSetPowerSaveRequest
9841 {
9842 unsafe fn encode(
9843 self,
9844 encoder: &mut fidl::encoding::Encoder<
9845 '_,
9846 fidl::encoding::DefaultFuchsiaResourceDialect,
9847 >,
9848 offset: usize,
9849 mut depth: fidl::encoding::Depth,
9850 ) -> fidl::Result<()> {
9851 encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
9852 let max_ordinal: u64 = self.max_ordinal_present();
9854 encoder.write_num(max_ordinal, offset);
9855 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9856 if max_ordinal == 0 {
9858 return Ok(());
9859 }
9860 depth.increment()?;
9861 let envelope_size = 8;
9862 let bytes_len = max_ordinal as usize * envelope_size;
9863 #[allow(unused_variables)]
9864 let offset = encoder.out_of_line_offset(bytes_len);
9865 let mut _prev_end_offset: usize = 0;
9866 if 1 > max_ordinal {
9867 return Ok(());
9868 }
9869
9870 let cur_offset: usize = (1 - 1) * envelope_size;
9873
9874 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9876
9877 fidl::encoding::encode_in_envelope_optional::<
9882 bool,
9883 fidl::encoding::DefaultFuchsiaResourceDialect,
9884 >(
9885 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9886 encoder,
9887 offset + cur_offset,
9888 depth,
9889 )?;
9890
9891 _prev_end_offset = cur_offset + envelope_size;
9892
9893 Ok(())
9894 }
9895 }
9896
9897 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9898 for SupplicantStaIfaceSetPowerSaveRequest
9899 {
9900 #[inline(always)]
9901 fn new_empty() -> Self {
9902 Self::default()
9903 }
9904
9905 unsafe fn decode(
9906 &mut self,
9907 decoder: &mut fidl::encoding::Decoder<
9908 '_,
9909 fidl::encoding::DefaultFuchsiaResourceDialect,
9910 >,
9911 offset: usize,
9912 mut depth: fidl::encoding::Depth,
9913 ) -> fidl::Result<()> {
9914 decoder.debug_check_bounds::<Self>(offset);
9915 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9916 None => return Err(fidl::Error::NotNullable),
9917 Some(len) => len,
9918 };
9919 if len == 0 {
9921 return Ok(());
9922 };
9923 depth.increment()?;
9924 let envelope_size = 8;
9925 let bytes_len = len * envelope_size;
9926 let offset = decoder.out_of_line_offset(bytes_len)?;
9927 let mut _next_ordinal_to_read = 0;
9929 let mut next_offset = offset;
9930 let end_offset = offset + bytes_len;
9931 _next_ordinal_to_read += 1;
9932 if next_offset >= end_offset {
9933 return Ok(());
9934 }
9935
9936 while _next_ordinal_to_read < 1 {
9938 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9939 _next_ordinal_to_read += 1;
9940 next_offset += envelope_size;
9941 }
9942
9943 let next_out_of_line = decoder.next_out_of_line();
9944 let handles_before = decoder.remaining_handles();
9945 if let Some((inlined, num_bytes, num_handles)) =
9946 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9947 {
9948 let member_inline_size =
9949 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9950 if inlined != (member_inline_size <= 4) {
9951 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9952 }
9953 let inner_offset;
9954 let mut inner_depth = depth.clone();
9955 if inlined {
9956 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9957 inner_offset = next_offset;
9958 } else {
9959 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9960 inner_depth.increment()?;
9961 }
9962 let val_ref = self.enable.get_or_insert_with(|| {
9963 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
9964 });
9965 fidl::decode!(
9966 bool,
9967 fidl::encoding::DefaultFuchsiaResourceDialect,
9968 val_ref,
9969 decoder,
9970 inner_offset,
9971 inner_depth
9972 )?;
9973 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9974 {
9975 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9976 }
9977 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9978 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9979 }
9980 }
9981
9982 next_offset += envelope_size;
9983
9984 while next_offset < end_offset {
9986 _next_ordinal_to_read += 1;
9987 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9988 next_offset += envelope_size;
9989 }
9990
9991 Ok(())
9992 }
9993 }
9994
9995 impl SupplicantStaIfaceSetStaCountryCodeRequest {
9996 #[inline(always)]
9997 fn max_ordinal_present(&self) -> u64 {
9998 if let Some(_) = self.code {
9999 return 1;
10000 }
10001 0
10002 }
10003 }
10004
10005 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
10006 type Borrowed<'a> = &'a mut Self;
10007 fn take_or_borrow<'a>(
10008 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10009 ) -> Self::Borrowed<'a> {
10010 value
10011 }
10012 }
10013
10014 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
10015 type Owned = Self;
10016
10017 #[inline(always)]
10018 fn inline_align(_context: fidl::encoding::Context) -> usize {
10019 8
10020 }
10021
10022 #[inline(always)]
10023 fn inline_size(_context: fidl::encoding::Context) -> usize {
10024 16
10025 }
10026 }
10027
10028 unsafe impl
10029 fidl::encoding::Encode<
10030 SupplicantStaIfaceSetStaCountryCodeRequest,
10031 fidl::encoding::DefaultFuchsiaResourceDialect,
10032 > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
10033 {
10034 unsafe fn encode(
10035 self,
10036 encoder: &mut fidl::encoding::Encoder<
10037 '_,
10038 fidl::encoding::DefaultFuchsiaResourceDialect,
10039 >,
10040 offset: usize,
10041 mut depth: fidl::encoding::Depth,
10042 ) -> fidl::Result<()> {
10043 encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
10044 let max_ordinal: u64 = self.max_ordinal_present();
10046 encoder.write_num(max_ordinal, offset);
10047 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10048 if max_ordinal == 0 {
10050 return Ok(());
10051 }
10052 depth.increment()?;
10053 let envelope_size = 8;
10054 let bytes_len = max_ordinal as usize * envelope_size;
10055 #[allow(unused_variables)]
10056 let offset = encoder.out_of_line_offset(bytes_len);
10057 let mut _prev_end_offset: usize = 0;
10058 if 1 > max_ordinal {
10059 return Ok(());
10060 }
10061
10062 let cur_offset: usize = (1 - 1) * envelope_size;
10065
10066 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10068
10069 fidl::encoding::encode_in_envelope_optional::<
10074 fidl::encoding::Array<u8, 2>,
10075 fidl::encoding::DefaultFuchsiaResourceDialect,
10076 >(
10077 self.code
10078 .as_ref()
10079 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
10080 encoder,
10081 offset + cur_offset,
10082 depth,
10083 )?;
10084
10085 _prev_end_offset = cur_offset + envelope_size;
10086
10087 Ok(())
10088 }
10089 }
10090
10091 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10092 for SupplicantStaIfaceSetStaCountryCodeRequest
10093 {
10094 #[inline(always)]
10095 fn new_empty() -> Self {
10096 Self::default()
10097 }
10098
10099 unsafe fn decode(
10100 &mut self,
10101 decoder: &mut fidl::encoding::Decoder<
10102 '_,
10103 fidl::encoding::DefaultFuchsiaResourceDialect,
10104 >,
10105 offset: usize,
10106 mut depth: fidl::encoding::Depth,
10107 ) -> fidl::Result<()> {
10108 decoder.debug_check_bounds::<Self>(offset);
10109 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10110 None => return Err(fidl::Error::NotNullable),
10111 Some(len) => len,
10112 };
10113 if len == 0 {
10115 return Ok(());
10116 };
10117 depth.increment()?;
10118 let envelope_size = 8;
10119 let bytes_len = len * envelope_size;
10120 let offset = decoder.out_of_line_offset(bytes_len)?;
10121 let mut _next_ordinal_to_read = 0;
10123 let mut next_offset = offset;
10124 let end_offset = offset + bytes_len;
10125 _next_ordinal_to_read += 1;
10126 if next_offset >= end_offset {
10127 return Ok(());
10128 }
10129
10130 while _next_ordinal_to_read < 1 {
10132 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10133 _next_ordinal_to_read += 1;
10134 next_offset += envelope_size;
10135 }
10136
10137 let next_out_of_line = decoder.next_out_of_line();
10138 let handles_before = decoder.remaining_handles();
10139 if let Some((inlined, num_bytes, num_handles)) =
10140 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10141 {
10142 let member_inline_size =
10143 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
10144 decoder.context,
10145 );
10146 if inlined != (member_inline_size <= 4) {
10147 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10148 }
10149 let inner_offset;
10150 let mut inner_depth = depth.clone();
10151 if inlined {
10152 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10153 inner_offset = next_offset;
10154 } else {
10155 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10156 inner_depth.increment()?;
10157 }
10158 let val_ref =
10159 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
10160 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10161 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10162 {
10163 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10164 }
10165 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10166 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10167 }
10168 }
10169
10170 next_offset += envelope_size;
10171
10172 while next_offset < end_offset {
10174 _next_ordinal_to_read += 1;
10175 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10176 next_offset += envelope_size;
10177 }
10178
10179 Ok(())
10180 }
10181 }
10182
10183 impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
10184 #[inline(always)]
10185 fn max_ordinal_present(&self) -> u64 {
10186 if let Some(_) = self.enable {
10187 return 1;
10188 }
10189 0
10190 }
10191 }
10192
10193 impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
10194 type Borrowed<'a> = &'a mut Self;
10195 fn take_or_borrow<'a>(
10196 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10197 ) -> Self::Borrowed<'a> {
10198 value
10199 }
10200 }
10201
10202 unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
10203 type Owned = Self;
10204
10205 #[inline(always)]
10206 fn inline_align(_context: fidl::encoding::Context) -> usize {
10207 8
10208 }
10209
10210 #[inline(always)]
10211 fn inline_size(_context: fidl::encoding::Context) -> usize {
10212 16
10213 }
10214 }
10215
10216 unsafe impl
10217 fidl::encoding::Encode<
10218 SupplicantStaIfaceSetSuspendModeEnabledRequest,
10219 fidl::encoding::DefaultFuchsiaResourceDialect,
10220 > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
10221 {
10222 unsafe fn encode(
10223 self,
10224 encoder: &mut fidl::encoding::Encoder<
10225 '_,
10226 fidl::encoding::DefaultFuchsiaResourceDialect,
10227 >,
10228 offset: usize,
10229 mut depth: fidl::encoding::Depth,
10230 ) -> fidl::Result<()> {
10231 encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
10232 let max_ordinal: u64 = self.max_ordinal_present();
10234 encoder.write_num(max_ordinal, offset);
10235 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10236 if max_ordinal == 0 {
10238 return Ok(());
10239 }
10240 depth.increment()?;
10241 let envelope_size = 8;
10242 let bytes_len = max_ordinal as usize * envelope_size;
10243 #[allow(unused_variables)]
10244 let offset = encoder.out_of_line_offset(bytes_len);
10245 let mut _prev_end_offset: usize = 0;
10246 if 1 > max_ordinal {
10247 return Ok(());
10248 }
10249
10250 let cur_offset: usize = (1 - 1) * envelope_size;
10253
10254 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10256
10257 fidl::encoding::encode_in_envelope_optional::<
10262 bool,
10263 fidl::encoding::DefaultFuchsiaResourceDialect,
10264 >(
10265 self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10266 encoder,
10267 offset + cur_offset,
10268 depth,
10269 )?;
10270
10271 _prev_end_offset = cur_offset + envelope_size;
10272
10273 Ok(())
10274 }
10275 }
10276
10277 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10278 for SupplicantStaIfaceSetSuspendModeEnabledRequest
10279 {
10280 #[inline(always)]
10281 fn new_empty() -> Self {
10282 Self::default()
10283 }
10284
10285 unsafe fn decode(
10286 &mut self,
10287 decoder: &mut fidl::encoding::Decoder<
10288 '_,
10289 fidl::encoding::DefaultFuchsiaResourceDialect,
10290 >,
10291 offset: usize,
10292 mut depth: fidl::encoding::Depth,
10293 ) -> fidl::Result<()> {
10294 decoder.debug_check_bounds::<Self>(offset);
10295 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10296 None => return Err(fidl::Error::NotNullable),
10297 Some(len) => len,
10298 };
10299 if len == 0 {
10301 return Ok(());
10302 };
10303 depth.increment()?;
10304 let envelope_size = 8;
10305 let bytes_len = len * envelope_size;
10306 let offset = decoder.out_of_line_offset(bytes_len)?;
10307 let mut _next_ordinal_to_read = 0;
10309 let mut next_offset = offset;
10310 let end_offset = offset + bytes_len;
10311 _next_ordinal_to_read += 1;
10312 if next_offset >= end_offset {
10313 return Ok(());
10314 }
10315
10316 while _next_ordinal_to_read < 1 {
10318 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10319 _next_ordinal_to_read += 1;
10320 next_offset += envelope_size;
10321 }
10322
10323 let next_out_of_line = decoder.next_out_of_line();
10324 let handles_before = decoder.remaining_handles();
10325 if let Some((inlined, num_bytes, num_handles)) =
10326 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10327 {
10328 let member_inline_size =
10329 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10330 if inlined != (member_inline_size <= 4) {
10331 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10332 }
10333 let inner_offset;
10334 let mut inner_depth = depth.clone();
10335 if inlined {
10336 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10337 inner_offset = next_offset;
10338 } else {
10339 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10340 inner_depth.increment()?;
10341 }
10342 let val_ref = self.enable.get_or_insert_with(|| {
10343 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
10344 });
10345 fidl::decode!(
10346 bool,
10347 fidl::encoding::DefaultFuchsiaResourceDialect,
10348 val_ref,
10349 decoder,
10350 inner_offset,
10351 inner_depth
10352 )?;
10353 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10354 {
10355 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10356 }
10357 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10358 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10359 }
10360 }
10361
10362 next_offset += envelope_size;
10363
10364 while next_offset < end_offset {
10366 _next_ordinal_to_read += 1;
10367 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10368 next_offset += envelope_size;
10369 }
10370
10371 Ok(())
10372 }
10373 }
10374
10375 impl WifiChipCreateStaIfaceRequest {
10376 #[inline(always)]
10377 fn max_ordinal_present(&self) -> u64 {
10378 if let Some(_) = self.iface {
10379 return 1;
10380 }
10381 0
10382 }
10383 }
10384
10385 impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
10386 type Borrowed<'a> = &'a mut Self;
10387 fn take_or_borrow<'a>(
10388 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10389 ) -> Self::Borrowed<'a> {
10390 value
10391 }
10392 }
10393
10394 unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
10395 type Owned = Self;
10396
10397 #[inline(always)]
10398 fn inline_align(_context: fidl::encoding::Context) -> usize {
10399 8
10400 }
10401
10402 #[inline(always)]
10403 fn inline_size(_context: fidl::encoding::Context) -> usize {
10404 16
10405 }
10406 }
10407
10408 unsafe impl
10409 fidl::encoding::Encode<
10410 WifiChipCreateStaIfaceRequest,
10411 fidl::encoding::DefaultFuchsiaResourceDialect,
10412 > for &mut WifiChipCreateStaIfaceRequest
10413 {
10414 unsafe fn encode(
10415 self,
10416 encoder: &mut fidl::encoding::Encoder<
10417 '_,
10418 fidl::encoding::DefaultFuchsiaResourceDialect,
10419 >,
10420 offset: usize,
10421 mut depth: fidl::encoding::Depth,
10422 ) -> fidl::Result<()> {
10423 encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
10424 let max_ordinal: u64 = self.max_ordinal_present();
10426 encoder.write_num(max_ordinal, offset);
10427 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10428 if max_ordinal == 0 {
10430 return Ok(());
10431 }
10432 depth.increment()?;
10433 let envelope_size = 8;
10434 let bytes_len = max_ordinal as usize * envelope_size;
10435 #[allow(unused_variables)]
10436 let offset = encoder.out_of_line_offset(bytes_len);
10437 let mut _prev_end_offset: usize = 0;
10438 if 1 > max_ordinal {
10439 return Ok(());
10440 }
10441
10442 let cur_offset: usize = (1 - 1) * envelope_size;
10445
10446 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10448
10449 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10454 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10455 encoder, offset + cur_offset, depth
10456 )?;
10457
10458 _prev_end_offset = cur_offset + envelope_size;
10459
10460 Ok(())
10461 }
10462 }
10463
10464 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10465 for WifiChipCreateStaIfaceRequest
10466 {
10467 #[inline(always)]
10468 fn new_empty() -> Self {
10469 Self::default()
10470 }
10471
10472 unsafe fn decode(
10473 &mut self,
10474 decoder: &mut fidl::encoding::Decoder<
10475 '_,
10476 fidl::encoding::DefaultFuchsiaResourceDialect,
10477 >,
10478 offset: usize,
10479 mut depth: fidl::encoding::Depth,
10480 ) -> fidl::Result<()> {
10481 decoder.debug_check_bounds::<Self>(offset);
10482 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10483 None => return Err(fidl::Error::NotNullable),
10484 Some(len) => len,
10485 };
10486 if len == 0 {
10488 return Ok(());
10489 };
10490 depth.increment()?;
10491 let envelope_size = 8;
10492 let bytes_len = len * envelope_size;
10493 let offset = decoder.out_of_line_offset(bytes_len)?;
10494 let mut _next_ordinal_to_read = 0;
10496 let mut next_offset = offset;
10497 let end_offset = offset + bytes_len;
10498 _next_ordinal_to_read += 1;
10499 if next_offset >= end_offset {
10500 return Ok(());
10501 }
10502
10503 while _next_ordinal_to_read < 1 {
10505 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10506 _next_ordinal_to_read += 1;
10507 next_offset += envelope_size;
10508 }
10509
10510 let next_out_of_line = decoder.next_out_of_line();
10511 let handles_before = decoder.remaining_handles();
10512 if let Some((inlined, num_bytes, num_handles)) =
10513 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10514 {
10515 let member_inline_size = <fidl::encoding::Endpoint<
10516 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
10517 > as fidl::encoding::TypeMarker>::inline_size(
10518 decoder.context
10519 );
10520 if inlined != (member_inline_size <= 4) {
10521 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10522 }
10523 let inner_offset;
10524 let mut inner_depth = depth.clone();
10525 if inlined {
10526 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10527 inner_offset = next_offset;
10528 } else {
10529 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10530 inner_depth.increment()?;
10531 }
10532 let val_ref = self.iface.get_or_insert_with(|| {
10533 fidl::new_empty!(
10534 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
10535 fidl::encoding::DefaultFuchsiaResourceDialect
10536 )
10537 });
10538 fidl::decode!(
10539 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
10540 fidl::encoding::DefaultFuchsiaResourceDialect,
10541 val_ref,
10542 decoder,
10543 inner_offset,
10544 inner_depth
10545 )?;
10546 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10547 {
10548 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10549 }
10550 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10551 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10552 }
10553 }
10554
10555 next_offset += envelope_size;
10556
10557 while next_offset < end_offset {
10559 _next_ordinal_to_read += 1;
10560 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10561 next_offset += envelope_size;
10562 }
10563
10564 Ok(())
10565 }
10566 }
10567
10568 impl WifiChipGetStaIfaceRequest {
10569 #[inline(always)]
10570 fn max_ordinal_present(&self) -> u64 {
10571 if let Some(_) = self.iface {
10572 return 2;
10573 }
10574 if let Some(_) = self.iface_name {
10575 return 1;
10576 }
10577 0
10578 }
10579 }
10580
10581 impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
10582 type Borrowed<'a> = &'a mut Self;
10583 fn take_or_borrow<'a>(
10584 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10585 ) -> Self::Borrowed<'a> {
10586 value
10587 }
10588 }
10589
10590 unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
10591 type Owned = Self;
10592
10593 #[inline(always)]
10594 fn inline_align(_context: fidl::encoding::Context) -> usize {
10595 8
10596 }
10597
10598 #[inline(always)]
10599 fn inline_size(_context: fidl::encoding::Context) -> usize {
10600 16
10601 }
10602 }
10603
10604 unsafe impl
10605 fidl::encoding::Encode<
10606 WifiChipGetStaIfaceRequest,
10607 fidl::encoding::DefaultFuchsiaResourceDialect,
10608 > for &mut WifiChipGetStaIfaceRequest
10609 {
10610 unsafe fn encode(
10611 self,
10612 encoder: &mut fidl::encoding::Encoder<
10613 '_,
10614 fidl::encoding::DefaultFuchsiaResourceDialect,
10615 >,
10616 offset: usize,
10617 mut depth: fidl::encoding::Depth,
10618 ) -> fidl::Result<()> {
10619 encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
10620 let max_ordinal: u64 = self.max_ordinal_present();
10622 encoder.write_num(max_ordinal, offset);
10623 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10624 if max_ordinal == 0 {
10626 return Ok(());
10627 }
10628 depth.increment()?;
10629 let envelope_size = 8;
10630 let bytes_len = max_ordinal as usize * envelope_size;
10631 #[allow(unused_variables)]
10632 let offset = encoder.out_of_line_offset(bytes_len);
10633 let mut _prev_end_offset: usize = 0;
10634 if 1 > max_ordinal {
10635 return Ok(());
10636 }
10637
10638 let cur_offset: usize = (1 - 1) * envelope_size;
10641
10642 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10644
10645 fidl::encoding::encode_in_envelope_optional::<
10650 fidl::encoding::BoundedString<16>,
10651 fidl::encoding::DefaultFuchsiaResourceDialect,
10652 >(
10653 self.iface_name.as_ref().map(
10654 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
10655 ),
10656 encoder,
10657 offset + cur_offset,
10658 depth,
10659 )?;
10660
10661 _prev_end_offset = cur_offset + envelope_size;
10662 if 2 > max_ordinal {
10663 return Ok(());
10664 }
10665
10666 let cur_offset: usize = (2 - 1) * envelope_size;
10669
10670 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10672
10673 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10678 self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10679 encoder, offset + cur_offset, depth
10680 )?;
10681
10682 _prev_end_offset = cur_offset + envelope_size;
10683
10684 Ok(())
10685 }
10686 }
10687
10688 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10689 for WifiChipGetStaIfaceRequest
10690 {
10691 #[inline(always)]
10692 fn new_empty() -> Self {
10693 Self::default()
10694 }
10695
10696 unsafe fn decode(
10697 &mut self,
10698 decoder: &mut fidl::encoding::Decoder<
10699 '_,
10700 fidl::encoding::DefaultFuchsiaResourceDialect,
10701 >,
10702 offset: usize,
10703 mut depth: fidl::encoding::Depth,
10704 ) -> fidl::Result<()> {
10705 decoder.debug_check_bounds::<Self>(offset);
10706 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10707 None => return Err(fidl::Error::NotNullable),
10708 Some(len) => len,
10709 };
10710 if len == 0 {
10712 return Ok(());
10713 };
10714 depth.increment()?;
10715 let envelope_size = 8;
10716 let bytes_len = len * envelope_size;
10717 let offset = decoder.out_of_line_offset(bytes_len)?;
10718 let mut _next_ordinal_to_read = 0;
10720 let mut next_offset = offset;
10721 let end_offset = offset + bytes_len;
10722 _next_ordinal_to_read += 1;
10723 if next_offset >= end_offset {
10724 return Ok(());
10725 }
10726
10727 while _next_ordinal_to_read < 1 {
10729 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10730 _next_ordinal_to_read += 1;
10731 next_offset += envelope_size;
10732 }
10733
10734 let next_out_of_line = decoder.next_out_of_line();
10735 let handles_before = decoder.remaining_handles();
10736 if let Some((inlined, num_bytes, num_handles)) =
10737 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10738 {
10739 let member_inline_size =
10740 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
10741 decoder.context,
10742 );
10743 if inlined != (member_inline_size <= 4) {
10744 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10745 }
10746 let inner_offset;
10747 let mut inner_depth = depth.clone();
10748 if inlined {
10749 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10750 inner_offset = next_offset;
10751 } else {
10752 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10753 inner_depth.increment()?;
10754 }
10755 let val_ref = self.iface_name.get_or_insert_with(|| {
10756 fidl::new_empty!(
10757 fidl::encoding::BoundedString<16>,
10758 fidl::encoding::DefaultFuchsiaResourceDialect
10759 )
10760 });
10761 fidl::decode!(
10762 fidl::encoding::BoundedString<16>,
10763 fidl::encoding::DefaultFuchsiaResourceDialect,
10764 val_ref,
10765 decoder,
10766 inner_offset,
10767 inner_depth
10768 )?;
10769 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10770 {
10771 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10772 }
10773 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10774 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10775 }
10776 }
10777
10778 next_offset += envelope_size;
10779 _next_ordinal_to_read += 1;
10780 if next_offset >= end_offset {
10781 return Ok(());
10782 }
10783
10784 while _next_ordinal_to_read < 2 {
10786 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10787 _next_ordinal_to_read += 1;
10788 next_offset += envelope_size;
10789 }
10790
10791 let next_out_of_line = decoder.next_out_of_line();
10792 let handles_before = decoder.remaining_handles();
10793 if let Some((inlined, num_bytes, num_handles)) =
10794 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10795 {
10796 let member_inline_size = <fidl::encoding::Endpoint<
10797 fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
10798 > as fidl::encoding::TypeMarker>::inline_size(
10799 decoder.context
10800 );
10801 if inlined != (member_inline_size <= 4) {
10802 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10803 }
10804 let inner_offset;
10805 let mut inner_depth = depth.clone();
10806 if inlined {
10807 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10808 inner_offset = next_offset;
10809 } else {
10810 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10811 inner_depth.increment()?;
10812 }
10813 let val_ref = self.iface.get_or_insert_with(|| {
10814 fidl::new_empty!(
10815 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
10816 fidl::encoding::DefaultFuchsiaResourceDialect
10817 )
10818 });
10819 fidl::decode!(
10820 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
10821 fidl::encoding::DefaultFuchsiaResourceDialect,
10822 val_ref,
10823 decoder,
10824 inner_offset,
10825 inner_depth
10826 )?;
10827 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10828 {
10829 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10830 }
10831 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10832 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10833 }
10834 }
10835
10836 next_offset += envelope_size;
10837
10838 while next_offset < end_offset {
10840 _next_ordinal_to_read += 1;
10841 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10842 next_offset += envelope_size;
10843 }
10844
10845 Ok(())
10846 }
10847 }
10848
10849 impl WifiChipRemoveStaIfaceRequest {
10850 #[inline(always)]
10851 fn max_ordinal_present(&self) -> u64 {
10852 if let Some(_) = self.iface_name {
10853 return 1;
10854 }
10855 0
10856 }
10857 }
10858
10859 impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
10860 type Borrowed<'a> = &'a mut Self;
10861 fn take_or_borrow<'a>(
10862 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10863 ) -> Self::Borrowed<'a> {
10864 value
10865 }
10866 }
10867
10868 unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
10869 type Owned = Self;
10870
10871 #[inline(always)]
10872 fn inline_align(_context: fidl::encoding::Context) -> usize {
10873 8
10874 }
10875
10876 #[inline(always)]
10877 fn inline_size(_context: fidl::encoding::Context) -> usize {
10878 16
10879 }
10880 }
10881
10882 unsafe impl
10883 fidl::encoding::Encode<
10884 WifiChipRemoveStaIfaceRequest,
10885 fidl::encoding::DefaultFuchsiaResourceDialect,
10886 > for &mut WifiChipRemoveStaIfaceRequest
10887 {
10888 unsafe fn encode(
10889 self,
10890 encoder: &mut fidl::encoding::Encoder<
10891 '_,
10892 fidl::encoding::DefaultFuchsiaResourceDialect,
10893 >,
10894 offset: usize,
10895 mut depth: fidl::encoding::Depth,
10896 ) -> fidl::Result<()> {
10897 encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
10898 let max_ordinal: u64 = self.max_ordinal_present();
10900 encoder.write_num(max_ordinal, offset);
10901 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10902 if max_ordinal == 0 {
10904 return Ok(());
10905 }
10906 depth.increment()?;
10907 let envelope_size = 8;
10908 let bytes_len = max_ordinal as usize * envelope_size;
10909 #[allow(unused_variables)]
10910 let offset = encoder.out_of_line_offset(bytes_len);
10911 let mut _prev_end_offset: usize = 0;
10912 if 1 > max_ordinal {
10913 return Ok(());
10914 }
10915
10916 let cur_offset: usize = (1 - 1) * envelope_size;
10919
10920 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10922
10923 fidl::encoding::encode_in_envelope_optional::<
10928 fidl::encoding::BoundedString<16>,
10929 fidl::encoding::DefaultFuchsiaResourceDialect,
10930 >(
10931 self.iface_name.as_ref().map(
10932 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
10933 ),
10934 encoder,
10935 offset + cur_offset,
10936 depth,
10937 )?;
10938
10939 _prev_end_offset = cur_offset + envelope_size;
10940
10941 Ok(())
10942 }
10943 }
10944
10945 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10946 for WifiChipRemoveStaIfaceRequest
10947 {
10948 #[inline(always)]
10949 fn new_empty() -> Self {
10950 Self::default()
10951 }
10952
10953 unsafe fn decode(
10954 &mut self,
10955 decoder: &mut fidl::encoding::Decoder<
10956 '_,
10957 fidl::encoding::DefaultFuchsiaResourceDialect,
10958 >,
10959 offset: usize,
10960 mut depth: fidl::encoding::Depth,
10961 ) -> fidl::Result<()> {
10962 decoder.debug_check_bounds::<Self>(offset);
10963 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10964 None => return Err(fidl::Error::NotNullable),
10965 Some(len) => len,
10966 };
10967 if len == 0 {
10969 return Ok(());
10970 };
10971 depth.increment()?;
10972 let envelope_size = 8;
10973 let bytes_len = len * envelope_size;
10974 let offset = decoder.out_of_line_offset(bytes_len)?;
10975 let mut _next_ordinal_to_read = 0;
10977 let mut next_offset = offset;
10978 let end_offset = offset + bytes_len;
10979 _next_ordinal_to_read += 1;
10980 if next_offset >= end_offset {
10981 return Ok(());
10982 }
10983
10984 while _next_ordinal_to_read < 1 {
10986 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10987 _next_ordinal_to_read += 1;
10988 next_offset += envelope_size;
10989 }
10990
10991 let next_out_of_line = decoder.next_out_of_line();
10992 let handles_before = decoder.remaining_handles();
10993 if let Some((inlined, num_bytes, num_handles)) =
10994 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10995 {
10996 let member_inline_size =
10997 <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
10998 decoder.context,
10999 );
11000 if inlined != (member_inline_size <= 4) {
11001 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11002 }
11003 let inner_offset;
11004 let mut inner_depth = depth.clone();
11005 if inlined {
11006 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11007 inner_offset = next_offset;
11008 } else {
11009 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11010 inner_depth.increment()?;
11011 }
11012 let val_ref = self.iface_name.get_or_insert_with(|| {
11013 fidl::new_empty!(
11014 fidl::encoding::BoundedString<16>,
11015 fidl::encoding::DefaultFuchsiaResourceDialect
11016 )
11017 });
11018 fidl::decode!(
11019 fidl::encoding::BoundedString<16>,
11020 fidl::encoding::DefaultFuchsiaResourceDialect,
11021 val_ref,
11022 decoder,
11023 inner_offset,
11024 inner_depth
11025 )?;
11026 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11027 {
11028 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11029 }
11030 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11031 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11032 }
11033 }
11034
11035 next_offset += envelope_size;
11036
11037 while next_offset < end_offset {
11039 _next_ordinal_to_read += 1;
11040 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11041 next_offset += envelope_size;
11042 }
11043
11044 Ok(())
11045 }
11046 }
11047
11048 impl WifiChipSetCountryCodeRequest {
11049 #[inline(always)]
11050 fn max_ordinal_present(&self) -> u64 {
11051 if let Some(_) = self.code {
11052 return 1;
11053 }
11054 0
11055 }
11056 }
11057
11058 impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
11059 type Borrowed<'a> = &'a mut Self;
11060 fn take_or_borrow<'a>(
11061 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11062 ) -> Self::Borrowed<'a> {
11063 value
11064 }
11065 }
11066
11067 unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
11068 type Owned = Self;
11069
11070 #[inline(always)]
11071 fn inline_align(_context: fidl::encoding::Context) -> usize {
11072 8
11073 }
11074
11075 #[inline(always)]
11076 fn inline_size(_context: fidl::encoding::Context) -> usize {
11077 16
11078 }
11079 }
11080
11081 unsafe impl
11082 fidl::encoding::Encode<
11083 WifiChipSetCountryCodeRequest,
11084 fidl::encoding::DefaultFuchsiaResourceDialect,
11085 > for &mut WifiChipSetCountryCodeRequest
11086 {
11087 unsafe fn encode(
11088 self,
11089 encoder: &mut fidl::encoding::Encoder<
11090 '_,
11091 fidl::encoding::DefaultFuchsiaResourceDialect,
11092 >,
11093 offset: usize,
11094 mut depth: fidl::encoding::Depth,
11095 ) -> fidl::Result<()> {
11096 encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
11097 let max_ordinal: u64 = self.max_ordinal_present();
11099 encoder.write_num(max_ordinal, offset);
11100 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11101 if max_ordinal == 0 {
11103 return Ok(());
11104 }
11105 depth.increment()?;
11106 let envelope_size = 8;
11107 let bytes_len = max_ordinal as usize * envelope_size;
11108 #[allow(unused_variables)]
11109 let offset = encoder.out_of_line_offset(bytes_len);
11110 let mut _prev_end_offset: usize = 0;
11111 if 1 > max_ordinal {
11112 return Ok(());
11113 }
11114
11115 let cur_offset: usize = (1 - 1) * envelope_size;
11118
11119 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11121
11122 fidl::encoding::encode_in_envelope_optional::<
11127 fidl::encoding::Array<u8, 2>,
11128 fidl::encoding::DefaultFuchsiaResourceDialect,
11129 >(
11130 self.code
11131 .as_ref()
11132 .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
11133 encoder,
11134 offset + cur_offset,
11135 depth,
11136 )?;
11137
11138 _prev_end_offset = cur_offset + envelope_size;
11139
11140 Ok(())
11141 }
11142 }
11143
11144 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11145 for WifiChipSetCountryCodeRequest
11146 {
11147 #[inline(always)]
11148 fn new_empty() -> Self {
11149 Self::default()
11150 }
11151
11152 unsafe fn decode(
11153 &mut self,
11154 decoder: &mut fidl::encoding::Decoder<
11155 '_,
11156 fidl::encoding::DefaultFuchsiaResourceDialect,
11157 >,
11158 offset: usize,
11159 mut depth: fidl::encoding::Depth,
11160 ) -> fidl::Result<()> {
11161 decoder.debug_check_bounds::<Self>(offset);
11162 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11163 None => return Err(fidl::Error::NotNullable),
11164 Some(len) => len,
11165 };
11166 if len == 0 {
11168 return Ok(());
11169 };
11170 depth.increment()?;
11171 let envelope_size = 8;
11172 let bytes_len = len * envelope_size;
11173 let offset = decoder.out_of_line_offset(bytes_len)?;
11174 let mut _next_ordinal_to_read = 0;
11176 let mut next_offset = offset;
11177 let end_offset = offset + bytes_len;
11178 _next_ordinal_to_read += 1;
11179 if next_offset >= end_offset {
11180 return Ok(());
11181 }
11182
11183 while _next_ordinal_to_read < 1 {
11185 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11186 _next_ordinal_to_read += 1;
11187 next_offset += envelope_size;
11188 }
11189
11190 let next_out_of_line = decoder.next_out_of_line();
11191 let handles_before = decoder.remaining_handles();
11192 if let Some((inlined, num_bytes, num_handles)) =
11193 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11194 {
11195 let member_inline_size =
11196 <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
11197 decoder.context,
11198 );
11199 if inlined != (member_inline_size <= 4) {
11200 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11201 }
11202 let inner_offset;
11203 let mut inner_depth = depth.clone();
11204 if inlined {
11205 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11206 inner_offset = next_offset;
11207 } else {
11208 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11209 inner_depth.increment()?;
11210 }
11211 let val_ref =
11212 self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
11213 fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11214 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11215 {
11216 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11217 }
11218 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11219 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11220 }
11221 }
11222
11223 next_offset += envelope_size;
11224
11225 while next_offset < end_offset {
11227 _next_ordinal_to_read += 1;
11228 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11229 next_offset += envelope_size;
11230 }
11231
11232 Ok(())
11233 }
11234 }
11235
11236 impl WifiGetChipRequest {
11237 #[inline(always)]
11238 fn max_ordinal_present(&self) -> u64 {
11239 if let Some(_) = self.chip {
11240 return 2;
11241 }
11242 if let Some(_) = self.chip_id {
11243 return 1;
11244 }
11245 0
11246 }
11247 }
11248
11249 impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
11250 type Borrowed<'a> = &'a mut Self;
11251 fn take_or_borrow<'a>(
11252 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11253 ) -> Self::Borrowed<'a> {
11254 value
11255 }
11256 }
11257
11258 unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
11259 type Owned = Self;
11260
11261 #[inline(always)]
11262 fn inline_align(_context: fidl::encoding::Context) -> usize {
11263 8
11264 }
11265
11266 #[inline(always)]
11267 fn inline_size(_context: fidl::encoding::Context) -> usize {
11268 16
11269 }
11270 }
11271
11272 unsafe impl
11273 fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
11274 for &mut WifiGetChipRequest
11275 {
11276 unsafe fn encode(
11277 self,
11278 encoder: &mut fidl::encoding::Encoder<
11279 '_,
11280 fidl::encoding::DefaultFuchsiaResourceDialect,
11281 >,
11282 offset: usize,
11283 mut depth: fidl::encoding::Depth,
11284 ) -> fidl::Result<()> {
11285 encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
11286 let max_ordinal: u64 = self.max_ordinal_present();
11288 encoder.write_num(max_ordinal, offset);
11289 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11290 if max_ordinal == 0 {
11292 return Ok(());
11293 }
11294 depth.increment()?;
11295 let envelope_size = 8;
11296 let bytes_len = max_ordinal as usize * envelope_size;
11297 #[allow(unused_variables)]
11298 let offset = encoder.out_of_line_offset(bytes_len);
11299 let mut _prev_end_offset: usize = 0;
11300 if 1 > max_ordinal {
11301 return Ok(());
11302 }
11303
11304 let cur_offset: usize = (1 - 1) * envelope_size;
11307
11308 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11310
11311 fidl::encoding::encode_in_envelope_optional::<
11316 u32,
11317 fidl::encoding::DefaultFuchsiaResourceDialect,
11318 >(
11319 self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
11320 encoder,
11321 offset + cur_offset,
11322 depth,
11323 )?;
11324
11325 _prev_end_offset = cur_offset + envelope_size;
11326 if 2 > max_ordinal {
11327 return Ok(());
11328 }
11329
11330 let cur_offset: usize = (2 - 1) * envelope_size;
11333
11334 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11336
11337 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11342 self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11343 encoder, offset + cur_offset, depth
11344 )?;
11345
11346 _prev_end_offset = cur_offset + envelope_size;
11347
11348 Ok(())
11349 }
11350 }
11351
11352 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11353 for WifiGetChipRequest
11354 {
11355 #[inline(always)]
11356 fn new_empty() -> Self {
11357 Self::default()
11358 }
11359
11360 unsafe fn decode(
11361 &mut self,
11362 decoder: &mut fidl::encoding::Decoder<
11363 '_,
11364 fidl::encoding::DefaultFuchsiaResourceDialect,
11365 >,
11366 offset: usize,
11367 mut depth: fidl::encoding::Depth,
11368 ) -> fidl::Result<()> {
11369 decoder.debug_check_bounds::<Self>(offset);
11370 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11371 None => return Err(fidl::Error::NotNullable),
11372 Some(len) => len,
11373 };
11374 if len == 0 {
11376 return Ok(());
11377 };
11378 depth.increment()?;
11379 let envelope_size = 8;
11380 let bytes_len = len * envelope_size;
11381 let offset = decoder.out_of_line_offset(bytes_len)?;
11382 let mut _next_ordinal_to_read = 0;
11384 let mut next_offset = offset;
11385 let end_offset = offset + bytes_len;
11386 _next_ordinal_to_read += 1;
11387 if next_offset >= end_offset {
11388 return Ok(());
11389 }
11390
11391 while _next_ordinal_to_read < 1 {
11393 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11394 _next_ordinal_to_read += 1;
11395 next_offset += envelope_size;
11396 }
11397
11398 let next_out_of_line = decoder.next_out_of_line();
11399 let handles_before = decoder.remaining_handles();
11400 if let Some((inlined, num_bytes, num_handles)) =
11401 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11402 {
11403 let member_inline_size =
11404 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11405 if inlined != (member_inline_size <= 4) {
11406 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11407 }
11408 let inner_offset;
11409 let mut inner_depth = depth.clone();
11410 if inlined {
11411 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11412 inner_offset = next_offset;
11413 } else {
11414 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11415 inner_depth.increment()?;
11416 }
11417 let val_ref = self.chip_id.get_or_insert_with(|| {
11418 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
11419 });
11420 fidl::decode!(
11421 u32,
11422 fidl::encoding::DefaultFuchsiaResourceDialect,
11423 val_ref,
11424 decoder,
11425 inner_offset,
11426 inner_depth
11427 )?;
11428 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11429 {
11430 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11431 }
11432 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11433 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11434 }
11435 }
11436
11437 next_offset += envelope_size;
11438 _next_ordinal_to_read += 1;
11439 if next_offset >= end_offset {
11440 return Ok(());
11441 }
11442
11443 while _next_ordinal_to_read < 2 {
11445 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11446 _next_ordinal_to_read += 1;
11447 next_offset += envelope_size;
11448 }
11449
11450 let next_out_of_line = decoder.next_out_of_line();
11451 let handles_before = decoder.remaining_handles();
11452 if let Some((inlined, num_bytes, num_handles)) =
11453 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11454 {
11455 let member_inline_size = <fidl::encoding::Endpoint<
11456 fidl::endpoints::ServerEnd<WifiChipMarker>,
11457 > as fidl::encoding::TypeMarker>::inline_size(
11458 decoder.context
11459 );
11460 if inlined != (member_inline_size <= 4) {
11461 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11462 }
11463 let inner_offset;
11464 let mut inner_depth = depth.clone();
11465 if inlined {
11466 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11467 inner_offset = next_offset;
11468 } else {
11469 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11470 inner_depth.increment()?;
11471 }
11472 let val_ref = self.chip.get_or_insert_with(|| {
11473 fidl::new_empty!(
11474 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
11475 fidl::encoding::DefaultFuchsiaResourceDialect
11476 )
11477 });
11478 fidl::decode!(
11479 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
11480 fidl::encoding::DefaultFuchsiaResourceDialect,
11481 val_ref,
11482 decoder,
11483 inner_offset,
11484 inner_depth
11485 )?;
11486 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11487 {
11488 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11489 }
11490 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11491 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11492 }
11493 }
11494
11495 next_offset += envelope_size;
11496
11497 while next_offset < end_offset {
11499 _next_ordinal_to_read += 1;
11500 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11501 next_offset += envelope_size;
11502 }
11503
11504 Ok(())
11505 }
11506 }
11507
11508 impl WifiRegisterEventCallbackRequest {
11509 #[inline(always)]
11510 fn max_ordinal_present(&self) -> u64 {
11511 if let Some(_) = self.callback {
11512 return 1;
11513 }
11514 0
11515 }
11516 }
11517
11518 impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
11519 type Borrowed<'a> = &'a mut Self;
11520 fn take_or_borrow<'a>(
11521 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11522 ) -> Self::Borrowed<'a> {
11523 value
11524 }
11525 }
11526
11527 unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
11528 type Owned = Self;
11529
11530 #[inline(always)]
11531 fn inline_align(_context: fidl::encoding::Context) -> usize {
11532 8
11533 }
11534
11535 #[inline(always)]
11536 fn inline_size(_context: fidl::encoding::Context) -> usize {
11537 16
11538 }
11539 }
11540
11541 unsafe impl
11542 fidl::encoding::Encode<
11543 WifiRegisterEventCallbackRequest,
11544 fidl::encoding::DefaultFuchsiaResourceDialect,
11545 > for &mut WifiRegisterEventCallbackRequest
11546 {
11547 unsafe fn encode(
11548 self,
11549 encoder: &mut fidl::encoding::Encoder<
11550 '_,
11551 fidl::encoding::DefaultFuchsiaResourceDialect,
11552 >,
11553 offset: usize,
11554 mut depth: fidl::encoding::Depth,
11555 ) -> fidl::Result<()> {
11556 encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
11557 let max_ordinal: u64 = self.max_ordinal_present();
11559 encoder.write_num(max_ordinal, offset);
11560 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11561 if max_ordinal == 0 {
11563 return Ok(());
11564 }
11565 depth.increment()?;
11566 let envelope_size = 8;
11567 let bytes_len = max_ordinal as usize * envelope_size;
11568 #[allow(unused_variables)]
11569 let offset = encoder.out_of_line_offset(bytes_len);
11570 let mut _prev_end_offset: usize = 0;
11571 if 1 > max_ordinal {
11572 return Ok(());
11573 }
11574
11575 let cur_offset: usize = (1 - 1) * envelope_size;
11578
11579 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11581
11582 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11587 self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11588 encoder, offset + cur_offset, depth
11589 )?;
11590
11591 _prev_end_offset = cur_offset + envelope_size;
11592
11593 Ok(())
11594 }
11595 }
11596
11597 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11598 for WifiRegisterEventCallbackRequest
11599 {
11600 #[inline(always)]
11601 fn new_empty() -> Self {
11602 Self::default()
11603 }
11604
11605 unsafe fn decode(
11606 &mut self,
11607 decoder: &mut fidl::encoding::Decoder<
11608 '_,
11609 fidl::encoding::DefaultFuchsiaResourceDialect,
11610 >,
11611 offset: usize,
11612 mut depth: fidl::encoding::Depth,
11613 ) -> fidl::Result<()> {
11614 decoder.debug_check_bounds::<Self>(offset);
11615 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11616 None => return Err(fidl::Error::NotNullable),
11617 Some(len) => len,
11618 };
11619 if len == 0 {
11621 return Ok(());
11622 };
11623 depth.increment()?;
11624 let envelope_size = 8;
11625 let bytes_len = len * envelope_size;
11626 let offset = decoder.out_of_line_offset(bytes_len)?;
11627 let mut _next_ordinal_to_read = 0;
11629 let mut next_offset = offset;
11630 let end_offset = offset + bytes_len;
11631 _next_ordinal_to_read += 1;
11632 if next_offset >= end_offset {
11633 return Ok(());
11634 }
11635
11636 while _next_ordinal_to_read < 1 {
11638 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11639 _next_ordinal_to_read += 1;
11640 next_offset += envelope_size;
11641 }
11642
11643 let next_out_of_line = decoder.next_out_of_line();
11644 let handles_before = decoder.remaining_handles();
11645 if let Some((inlined, num_bytes, num_handles)) =
11646 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11647 {
11648 let member_inline_size = <fidl::encoding::Endpoint<
11649 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
11650 > as fidl::encoding::TypeMarker>::inline_size(
11651 decoder.context
11652 );
11653 if inlined != (member_inline_size <= 4) {
11654 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11655 }
11656 let inner_offset;
11657 let mut inner_depth = depth.clone();
11658 if inlined {
11659 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11660 inner_offset = next_offset;
11661 } else {
11662 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11663 inner_depth.increment()?;
11664 }
11665 let val_ref = self.callback.get_or_insert_with(|| {
11666 fidl::new_empty!(
11667 fidl::encoding::Endpoint<
11668 fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
11669 >,
11670 fidl::encoding::DefaultFuchsiaResourceDialect
11671 )
11672 });
11673 fidl::decode!(
11674 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
11675 fidl::encoding::DefaultFuchsiaResourceDialect,
11676 val_ref,
11677 decoder,
11678 inner_offset,
11679 inner_depth
11680 )?;
11681 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11682 {
11683 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11684 }
11685 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11686 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11687 }
11688 }
11689
11690 next_offset += envelope_size;
11691
11692 while next_offset < end_offset {
11694 _next_ordinal_to_read += 1;
11695 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11696 next_offset += envelope_size;
11697 }
11698
11699 Ok(())
11700 }
11701 }
11702
11703 impl WlanixGetNl80211Request {
11704 #[inline(always)]
11705 fn max_ordinal_present(&self) -> u64 {
11706 if let Some(_) = self.nl80211 {
11707 return 1;
11708 }
11709 0
11710 }
11711 }
11712
11713 impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
11714 type Borrowed<'a> = &'a mut Self;
11715 fn take_or_borrow<'a>(
11716 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11717 ) -> Self::Borrowed<'a> {
11718 value
11719 }
11720 }
11721
11722 unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
11723 type Owned = Self;
11724
11725 #[inline(always)]
11726 fn inline_align(_context: fidl::encoding::Context) -> usize {
11727 8
11728 }
11729
11730 #[inline(always)]
11731 fn inline_size(_context: fidl::encoding::Context) -> usize {
11732 16
11733 }
11734 }
11735
11736 unsafe impl
11737 fidl::encoding::Encode<
11738 WlanixGetNl80211Request,
11739 fidl::encoding::DefaultFuchsiaResourceDialect,
11740 > for &mut WlanixGetNl80211Request
11741 {
11742 unsafe fn encode(
11743 self,
11744 encoder: &mut fidl::encoding::Encoder<
11745 '_,
11746 fidl::encoding::DefaultFuchsiaResourceDialect,
11747 >,
11748 offset: usize,
11749 mut depth: fidl::encoding::Depth,
11750 ) -> fidl::Result<()> {
11751 encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
11752 let max_ordinal: u64 = self.max_ordinal_present();
11754 encoder.write_num(max_ordinal, offset);
11755 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11756 if max_ordinal == 0 {
11758 return Ok(());
11759 }
11760 depth.increment()?;
11761 let envelope_size = 8;
11762 let bytes_len = max_ordinal as usize * envelope_size;
11763 #[allow(unused_variables)]
11764 let offset = encoder.out_of_line_offset(bytes_len);
11765 let mut _prev_end_offset: usize = 0;
11766 if 1 > max_ordinal {
11767 return Ok(());
11768 }
11769
11770 let cur_offset: usize = (1 - 1) * envelope_size;
11773
11774 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11776
11777 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11782 self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11783 encoder, offset + cur_offset, depth
11784 )?;
11785
11786 _prev_end_offset = cur_offset + envelope_size;
11787
11788 Ok(())
11789 }
11790 }
11791
11792 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11793 for WlanixGetNl80211Request
11794 {
11795 #[inline(always)]
11796 fn new_empty() -> Self {
11797 Self::default()
11798 }
11799
11800 unsafe fn decode(
11801 &mut self,
11802 decoder: &mut fidl::encoding::Decoder<
11803 '_,
11804 fidl::encoding::DefaultFuchsiaResourceDialect,
11805 >,
11806 offset: usize,
11807 mut depth: fidl::encoding::Depth,
11808 ) -> fidl::Result<()> {
11809 decoder.debug_check_bounds::<Self>(offset);
11810 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11811 None => return Err(fidl::Error::NotNullable),
11812 Some(len) => len,
11813 };
11814 if len == 0 {
11816 return Ok(());
11817 };
11818 depth.increment()?;
11819 let envelope_size = 8;
11820 let bytes_len = len * envelope_size;
11821 let offset = decoder.out_of_line_offset(bytes_len)?;
11822 let mut _next_ordinal_to_read = 0;
11824 let mut next_offset = offset;
11825 let end_offset = offset + bytes_len;
11826 _next_ordinal_to_read += 1;
11827 if next_offset >= end_offset {
11828 return Ok(());
11829 }
11830
11831 while _next_ordinal_to_read < 1 {
11833 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11834 _next_ordinal_to_read += 1;
11835 next_offset += envelope_size;
11836 }
11837
11838 let next_out_of_line = decoder.next_out_of_line();
11839 let handles_before = decoder.remaining_handles();
11840 if let Some((inlined, num_bytes, num_handles)) =
11841 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11842 {
11843 let member_inline_size = <fidl::encoding::Endpoint<
11844 fidl::endpoints::ServerEnd<Nl80211Marker>,
11845 > as fidl::encoding::TypeMarker>::inline_size(
11846 decoder.context
11847 );
11848 if inlined != (member_inline_size <= 4) {
11849 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11850 }
11851 let inner_offset;
11852 let mut inner_depth = depth.clone();
11853 if inlined {
11854 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11855 inner_offset = next_offset;
11856 } else {
11857 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11858 inner_depth.increment()?;
11859 }
11860 let val_ref = self.nl80211.get_or_insert_with(|| {
11861 fidl::new_empty!(
11862 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
11863 fidl::encoding::DefaultFuchsiaResourceDialect
11864 )
11865 });
11866 fidl::decode!(
11867 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
11868 fidl::encoding::DefaultFuchsiaResourceDialect,
11869 val_ref,
11870 decoder,
11871 inner_offset,
11872 inner_depth
11873 )?;
11874 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11875 {
11876 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11877 }
11878 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11879 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11880 }
11881 }
11882
11883 next_offset += envelope_size;
11884
11885 while next_offset < end_offset {
11887 _next_ordinal_to_read += 1;
11888 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11889 next_offset += envelope_size;
11890 }
11891
11892 Ok(())
11893 }
11894 }
11895
11896 impl WlanixGetSupplicantRequest {
11897 #[inline(always)]
11898 fn max_ordinal_present(&self) -> u64 {
11899 if let Some(_) = self.supplicant {
11900 return 1;
11901 }
11902 0
11903 }
11904 }
11905
11906 impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
11907 type Borrowed<'a> = &'a mut Self;
11908 fn take_or_borrow<'a>(
11909 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11910 ) -> Self::Borrowed<'a> {
11911 value
11912 }
11913 }
11914
11915 unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
11916 type Owned = Self;
11917
11918 #[inline(always)]
11919 fn inline_align(_context: fidl::encoding::Context) -> usize {
11920 8
11921 }
11922
11923 #[inline(always)]
11924 fn inline_size(_context: fidl::encoding::Context) -> usize {
11925 16
11926 }
11927 }
11928
11929 unsafe impl
11930 fidl::encoding::Encode<
11931 WlanixGetSupplicantRequest,
11932 fidl::encoding::DefaultFuchsiaResourceDialect,
11933 > for &mut WlanixGetSupplicantRequest
11934 {
11935 unsafe fn encode(
11936 self,
11937 encoder: &mut fidl::encoding::Encoder<
11938 '_,
11939 fidl::encoding::DefaultFuchsiaResourceDialect,
11940 >,
11941 offset: usize,
11942 mut depth: fidl::encoding::Depth,
11943 ) -> fidl::Result<()> {
11944 encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
11945 let max_ordinal: u64 = self.max_ordinal_present();
11947 encoder.write_num(max_ordinal, offset);
11948 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11949 if max_ordinal == 0 {
11951 return Ok(());
11952 }
11953 depth.increment()?;
11954 let envelope_size = 8;
11955 let bytes_len = max_ordinal as usize * envelope_size;
11956 #[allow(unused_variables)]
11957 let offset = encoder.out_of_line_offset(bytes_len);
11958 let mut _prev_end_offset: usize = 0;
11959 if 1 > max_ordinal {
11960 return Ok(());
11961 }
11962
11963 let cur_offset: usize = (1 - 1) * envelope_size;
11966
11967 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11969
11970 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11975 self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11976 encoder, offset + cur_offset, depth
11977 )?;
11978
11979 _prev_end_offset = cur_offset + envelope_size;
11980
11981 Ok(())
11982 }
11983 }
11984
11985 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11986 for WlanixGetSupplicantRequest
11987 {
11988 #[inline(always)]
11989 fn new_empty() -> Self {
11990 Self::default()
11991 }
11992
11993 unsafe fn decode(
11994 &mut self,
11995 decoder: &mut fidl::encoding::Decoder<
11996 '_,
11997 fidl::encoding::DefaultFuchsiaResourceDialect,
11998 >,
11999 offset: usize,
12000 mut depth: fidl::encoding::Depth,
12001 ) -> fidl::Result<()> {
12002 decoder.debug_check_bounds::<Self>(offset);
12003 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12004 None => return Err(fidl::Error::NotNullable),
12005 Some(len) => len,
12006 };
12007 if len == 0 {
12009 return Ok(());
12010 };
12011 depth.increment()?;
12012 let envelope_size = 8;
12013 let bytes_len = len * envelope_size;
12014 let offset = decoder.out_of_line_offset(bytes_len)?;
12015 let mut _next_ordinal_to_read = 0;
12017 let mut next_offset = offset;
12018 let end_offset = offset + bytes_len;
12019 _next_ordinal_to_read += 1;
12020 if next_offset >= end_offset {
12021 return Ok(());
12022 }
12023
12024 while _next_ordinal_to_read < 1 {
12026 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12027 _next_ordinal_to_read += 1;
12028 next_offset += envelope_size;
12029 }
12030
12031 let next_out_of_line = decoder.next_out_of_line();
12032 let handles_before = decoder.remaining_handles();
12033 if let Some((inlined, num_bytes, num_handles)) =
12034 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12035 {
12036 let member_inline_size = <fidl::encoding::Endpoint<
12037 fidl::endpoints::ServerEnd<SupplicantMarker>,
12038 > as fidl::encoding::TypeMarker>::inline_size(
12039 decoder.context
12040 );
12041 if inlined != (member_inline_size <= 4) {
12042 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12043 }
12044 let inner_offset;
12045 let mut inner_depth = depth.clone();
12046 if inlined {
12047 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12048 inner_offset = next_offset;
12049 } else {
12050 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12051 inner_depth.increment()?;
12052 }
12053 let val_ref = self.supplicant.get_or_insert_with(|| {
12054 fidl::new_empty!(
12055 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
12056 fidl::encoding::DefaultFuchsiaResourceDialect
12057 )
12058 });
12059 fidl::decode!(
12060 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
12061 fidl::encoding::DefaultFuchsiaResourceDialect,
12062 val_ref,
12063 decoder,
12064 inner_offset,
12065 inner_depth
12066 )?;
12067 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12068 {
12069 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12070 }
12071 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12072 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12073 }
12074 }
12075
12076 next_offset += envelope_size;
12077
12078 while next_offset < end_offset {
12080 _next_ordinal_to_read += 1;
12081 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12082 next_offset += envelope_size;
12083 }
12084
12085 Ok(())
12086 }
12087 }
12088
12089 impl WlanixGetWifiRequest {
12090 #[inline(always)]
12091 fn max_ordinal_present(&self) -> u64 {
12092 if let Some(_) = self.wifi {
12093 return 1;
12094 }
12095 0
12096 }
12097 }
12098
12099 impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
12100 type Borrowed<'a> = &'a mut Self;
12101 fn take_or_borrow<'a>(
12102 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12103 ) -> Self::Borrowed<'a> {
12104 value
12105 }
12106 }
12107
12108 unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
12109 type Owned = Self;
12110
12111 #[inline(always)]
12112 fn inline_align(_context: fidl::encoding::Context) -> usize {
12113 8
12114 }
12115
12116 #[inline(always)]
12117 fn inline_size(_context: fidl::encoding::Context) -> usize {
12118 16
12119 }
12120 }
12121
12122 unsafe impl
12123 fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12124 for &mut WlanixGetWifiRequest
12125 {
12126 unsafe fn encode(
12127 self,
12128 encoder: &mut fidl::encoding::Encoder<
12129 '_,
12130 fidl::encoding::DefaultFuchsiaResourceDialect,
12131 >,
12132 offset: usize,
12133 mut depth: fidl::encoding::Depth,
12134 ) -> fidl::Result<()> {
12135 encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
12136 let max_ordinal: u64 = self.max_ordinal_present();
12138 encoder.write_num(max_ordinal, offset);
12139 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12140 if max_ordinal == 0 {
12142 return Ok(());
12143 }
12144 depth.increment()?;
12145 let envelope_size = 8;
12146 let bytes_len = max_ordinal as usize * envelope_size;
12147 #[allow(unused_variables)]
12148 let offset = encoder.out_of_line_offset(bytes_len);
12149 let mut _prev_end_offset: usize = 0;
12150 if 1 > max_ordinal {
12151 return Ok(());
12152 }
12153
12154 let cur_offset: usize = (1 - 1) * envelope_size;
12157
12158 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12160
12161 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12166 self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12167 encoder, offset + cur_offset, depth
12168 )?;
12169
12170 _prev_end_offset = cur_offset + envelope_size;
12171
12172 Ok(())
12173 }
12174 }
12175
12176 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12177 for WlanixGetWifiRequest
12178 {
12179 #[inline(always)]
12180 fn new_empty() -> Self {
12181 Self::default()
12182 }
12183
12184 unsafe fn decode(
12185 &mut self,
12186 decoder: &mut fidl::encoding::Decoder<
12187 '_,
12188 fidl::encoding::DefaultFuchsiaResourceDialect,
12189 >,
12190 offset: usize,
12191 mut depth: fidl::encoding::Depth,
12192 ) -> fidl::Result<()> {
12193 decoder.debug_check_bounds::<Self>(offset);
12194 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12195 None => return Err(fidl::Error::NotNullable),
12196 Some(len) => len,
12197 };
12198 if len == 0 {
12200 return Ok(());
12201 };
12202 depth.increment()?;
12203 let envelope_size = 8;
12204 let bytes_len = len * envelope_size;
12205 let offset = decoder.out_of_line_offset(bytes_len)?;
12206 let mut _next_ordinal_to_read = 0;
12208 let mut next_offset = offset;
12209 let end_offset = offset + bytes_len;
12210 _next_ordinal_to_read += 1;
12211 if next_offset >= end_offset {
12212 return Ok(());
12213 }
12214
12215 while _next_ordinal_to_read < 1 {
12217 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12218 _next_ordinal_to_read += 1;
12219 next_offset += envelope_size;
12220 }
12221
12222 let next_out_of_line = decoder.next_out_of_line();
12223 let handles_before = decoder.remaining_handles();
12224 if let Some((inlined, num_bytes, num_handles)) =
12225 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12226 {
12227 let member_inline_size = <fidl::encoding::Endpoint<
12228 fidl::endpoints::ServerEnd<WifiMarker>,
12229 > as fidl::encoding::TypeMarker>::inline_size(
12230 decoder.context
12231 );
12232 if inlined != (member_inline_size <= 4) {
12233 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12234 }
12235 let inner_offset;
12236 let mut inner_depth = depth.clone();
12237 if inlined {
12238 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12239 inner_offset = next_offset;
12240 } else {
12241 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12242 inner_depth.increment()?;
12243 }
12244 let val_ref = self.wifi.get_or_insert_with(|| {
12245 fidl::new_empty!(
12246 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
12247 fidl::encoding::DefaultFuchsiaResourceDialect
12248 )
12249 });
12250 fidl::decode!(
12251 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
12252 fidl::encoding::DefaultFuchsiaResourceDialect,
12253 val_ref,
12254 decoder,
12255 inner_offset,
12256 inner_depth
12257 )?;
12258 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12259 {
12260 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12261 }
12262 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12263 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12264 }
12265 }
12266
12267 next_offset += envelope_size;
12268
12269 while next_offset < end_offset {
12271 _next_ordinal_to_read += 1;
12272 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12273 next_offset += envelope_size;
12274 }
12275
12276 Ok(())
12277 }
12278 }
12279}