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