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_device_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ConnectorConnectRequest {
16 pub request: fidl::endpoints::ServerEnd<PhyMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectorConnectRequest {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct CreateIfaceRequest {
23 pub role: fidl_fuchsia_wlan_common::WlanMacRole,
24 pub mlme_channel: Option<fidl::Channel>,
25 pub init_sta_addr: [u8; 6],
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateIfaceRequest {}
29
30#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct PhyCreateIfaceRequest {
32 pub req: CreateIfaceRequest,
33}
34
35impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PhyCreateIfaceRequest {}
36
37#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
38pub struct ConnectorMarker;
39
40impl fidl::endpoints::ProtocolMarker for ConnectorMarker {
41 type Proxy = ConnectorProxy;
42 type RequestStream = ConnectorRequestStream;
43 #[cfg(target_os = "fuchsia")]
44 type SynchronousProxy = ConnectorSynchronousProxy;
45
46 const DEBUG_NAME: &'static str = "(anonymous) Connector";
47}
48
49pub trait ConnectorProxyInterface: Send + Sync {
50 fn r#connect(&self, request: fidl::endpoints::ServerEnd<PhyMarker>) -> Result<(), fidl::Error>;
51}
52#[derive(Debug)]
53#[cfg(target_os = "fuchsia")]
54pub struct ConnectorSynchronousProxy {
55 client: fidl::client::sync::Client,
56}
57
58#[cfg(target_os = "fuchsia")]
59impl fidl::endpoints::SynchronousProxy for ConnectorSynchronousProxy {
60 type Proxy = ConnectorProxy;
61 type Protocol = ConnectorMarker;
62
63 fn from_channel(inner: fidl::Channel) -> Self {
64 Self::new(inner)
65 }
66
67 fn into_channel(self) -> fidl::Channel {
68 self.client.into_channel()
69 }
70
71 fn as_channel(&self) -> &fidl::Channel {
72 self.client.as_channel()
73 }
74}
75
76#[cfg(target_os = "fuchsia")]
77impl ConnectorSynchronousProxy {
78 pub fn new(channel: fidl::Channel) -> Self {
79 let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
80 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
81 }
82
83 pub fn into_channel(self) -> fidl::Channel {
84 self.client.into_channel()
85 }
86
87 pub fn wait_for_event(
90 &self,
91 deadline: zx::MonotonicInstant,
92 ) -> Result<ConnectorEvent, fidl::Error> {
93 ConnectorEvent::decode(self.client.wait_for_event(deadline)?)
94 }
95
96 pub fn r#connect(
97 &self,
98 mut request: fidl::endpoints::ServerEnd<PhyMarker>,
99 ) -> Result<(), fidl::Error> {
100 self.client.send::<ConnectorConnectRequest>(
101 (request,),
102 0x2dd039e4ba3a4d26,
103 fidl::encoding::DynamicFlags::empty(),
104 )
105 }
106}
107
108#[cfg(target_os = "fuchsia")]
109impl From<ConnectorSynchronousProxy> for zx::Handle {
110 fn from(value: ConnectorSynchronousProxy) -> Self {
111 value.into_channel().into()
112 }
113}
114
115#[cfg(target_os = "fuchsia")]
116impl From<fidl::Channel> for ConnectorSynchronousProxy {
117 fn from(value: fidl::Channel) -> Self {
118 Self::new(value)
119 }
120}
121
122#[derive(Debug, Clone)]
123pub struct ConnectorProxy {
124 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
125}
126
127impl fidl::endpoints::Proxy for ConnectorProxy {
128 type Protocol = ConnectorMarker;
129
130 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
131 Self::new(inner)
132 }
133
134 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
135 self.client.into_channel().map_err(|client| Self { client })
136 }
137
138 fn as_channel(&self) -> &::fidl::AsyncChannel {
139 self.client.as_channel()
140 }
141}
142
143impl ConnectorProxy {
144 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
146 let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
147 Self { client: fidl::client::Client::new(channel, protocol_name) }
148 }
149
150 pub fn take_event_stream(&self) -> ConnectorEventStream {
156 ConnectorEventStream { event_receiver: self.client.take_event_receiver() }
157 }
158
159 pub fn r#connect(
160 &self,
161 mut request: fidl::endpoints::ServerEnd<PhyMarker>,
162 ) -> Result<(), fidl::Error> {
163 ConnectorProxyInterface::r#connect(self, request)
164 }
165}
166
167impl ConnectorProxyInterface for ConnectorProxy {
168 fn r#connect(
169 &self,
170 mut request: fidl::endpoints::ServerEnd<PhyMarker>,
171 ) -> Result<(), fidl::Error> {
172 self.client.send::<ConnectorConnectRequest>(
173 (request,),
174 0x2dd039e4ba3a4d26,
175 fidl::encoding::DynamicFlags::empty(),
176 )
177 }
178}
179
180pub struct ConnectorEventStream {
181 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
182}
183
184impl std::marker::Unpin for ConnectorEventStream {}
185
186impl futures::stream::FusedStream for ConnectorEventStream {
187 fn is_terminated(&self) -> bool {
188 self.event_receiver.is_terminated()
189 }
190}
191
192impl futures::Stream for ConnectorEventStream {
193 type Item = Result<ConnectorEvent, fidl::Error>;
194
195 fn poll_next(
196 mut self: std::pin::Pin<&mut Self>,
197 cx: &mut std::task::Context<'_>,
198 ) -> std::task::Poll<Option<Self::Item>> {
199 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
200 &mut self.event_receiver,
201 cx
202 )?) {
203 Some(buf) => std::task::Poll::Ready(Some(ConnectorEvent::decode(buf))),
204 None => std::task::Poll::Ready(None),
205 }
206 }
207}
208
209#[derive(Debug)]
210pub enum ConnectorEvent {}
211
212impl ConnectorEvent {
213 fn decode(
215 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
216 ) -> Result<ConnectorEvent, fidl::Error> {
217 let (bytes, _handles) = buf.split_mut();
218 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
219 debug_assert_eq!(tx_header.tx_id, 0);
220 match tx_header.ordinal {
221 _ => Err(fidl::Error::UnknownOrdinal {
222 ordinal: tx_header.ordinal,
223 protocol_name: <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
224 }),
225 }
226 }
227}
228
229pub struct ConnectorRequestStream {
231 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
232 is_terminated: bool,
233}
234
235impl std::marker::Unpin for ConnectorRequestStream {}
236
237impl futures::stream::FusedStream for ConnectorRequestStream {
238 fn is_terminated(&self) -> bool {
239 self.is_terminated
240 }
241}
242
243impl fidl::endpoints::RequestStream for ConnectorRequestStream {
244 type Protocol = ConnectorMarker;
245 type ControlHandle = ConnectorControlHandle;
246
247 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
248 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
249 }
250
251 fn control_handle(&self) -> Self::ControlHandle {
252 ConnectorControlHandle { inner: self.inner.clone() }
253 }
254
255 fn into_inner(
256 self,
257 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
258 {
259 (self.inner, self.is_terminated)
260 }
261
262 fn from_inner(
263 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
264 is_terminated: bool,
265 ) -> Self {
266 Self { inner, is_terminated }
267 }
268}
269
270impl futures::Stream for ConnectorRequestStream {
271 type Item = Result<ConnectorRequest, fidl::Error>;
272
273 fn poll_next(
274 mut self: std::pin::Pin<&mut Self>,
275 cx: &mut std::task::Context<'_>,
276 ) -> std::task::Poll<Option<Self::Item>> {
277 let this = &mut *self;
278 if this.inner.check_shutdown(cx) {
279 this.is_terminated = true;
280 return std::task::Poll::Ready(None);
281 }
282 if this.is_terminated {
283 panic!("polled ConnectorRequestStream after completion");
284 }
285 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
286 |bytes, handles| {
287 match this.inner.channel().read_etc(cx, bytes, handles) {
288 std::task::Poll::Ready(Ok(())) => {}
289 std::task::Poll::Pending => return std::task::Poll::Pending,
290 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
291 this.is_terminated = true;
292 return std::task::Poll::Ready(None);
293 }
294 std::task::Poll::Ready(Err(e)) => {
295 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
296 e.into(),
297 ))))
298 }
299 }
300
301 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
303
304 std::task::Poll::Ready(Some(match header.ordinal {
305 0x2dd039e4ba3a4d26 => {
306 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
307 let mut req = fidl::new_empty!(
308 ConnectorConnectRequest,
309 fidl::encoding::DefaultFuchsiaResourceDialect
310 );
311 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
312 let control_handle = ConnectorControlHandle { inner: this.inner.clone() };
313 Ok(ConnectorRequest::Connect { request: req.request, control_handle })
314 }
315 _ => Err(fidl::Error::UnknownOrdinal {
316 ordinal: header.ordinal,
317 protocol_name:
318 <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
319 }),
320 }))
321 },
322 )
323 }
324}
325
326#[derive(Debug)]
328pub enum ConnectorRequest {
329 Connect {
330 request: fidl::endpoints::ServerEnd<PhyMarker>,
331 control_handle: ConnectorControlHandle,
332 },
333}
334
335impl ConnectorRequest {
336 #[allow(irrefutable_let_patterns)]
337 pub fn into_connect(
338 self,
339 ) -> Option<(fidl::endpoints::ServerEnd<PhyMarker>, ConnectorControlHandle)> {
340 if let ConnectorRequest::Connect { request, control_handle } = self {
341 Some((request, control_handle))
342 } else {
343 None
344 }
345 }
346
347 pub fn method_name(&self) -> &'static str {
349 match *self {
350 ConnectorRequest::Connect { .. } => "connect",
351 }
352 }
353}
354
355#[derive(Debug, Clone)]
356pub struct ConnectorControlHandle {
357 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
358}
359
360impl fidl::endpoints::ControlHandle for ConnectorControlHandle {
361 fn shutdown(&self) {
362 self.inner.shutdown()
363 }
364 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
365 self.inner.shutdown_with_epitaph(status)
366 }
367
368 fn is_closed(&self) -> bool {
369 self.inner.channel().is_closed()
370 }
371 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
372 self.inner.channel().on_closed()
373 }
374
375 #[cfg(target_os = "fuchsia")]
376 fn signal_peer(
377 &self,
378 clear_mask: zx::Signals,
379 set_mask: zx::Signals,
380 ) -> Result<(), zx_status::Status> {
381 use fidl::Peered;
382 self.inner.channel().signal_peer(clear_mask, set_mask)
383 }
384}
385
386impl ConnectorControlHandle {}
387
388#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
389pub struct PhyMarker;
390
391impl fidl::endpoints::ProtocolMarker for PhyMarker {
392 type Proxy = PhyProxy;
393 type RequestStream = PhyRequestStream;
394 #[cfg(target_os = "fuchsia")]
395 type SynchronousProxy = PhySynchronousProxy;
396
397 const DEBUG_NAME: &'static str = "(anonymous) Phy";
398}
399pub type PhyGetSupportedMacRolesResult = Result<Vec<fidl_fuchsia_wlan_common::WlanMacRole>, i32>;
400pub type PhyCreateIfaceResult = Result<u16, i32>;
401pub type PhyDestroyIfaceResult = Result<(), i32>;
402pub type PhyGetCountryResult = Result<CountryCode, i32>;
403pub type PhyGetPowerSaveModeResult = Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>;
404
405pub trait PhyProxyInterface: Send + Sync {
406 type GetSupportedMacRolesResponseFut: std::future::Future<Output = Result<PhyGetSupportedMacRolesResult, fidl::Error>>
407 + Send;
408 fn r#get_supported_mac_roles(&self) -> Self::GetSupportedMacRolesResponseFut;
409 type CreateIfaceResponseFut: std::future::Future<Output = Result<PhyCreateIfaceResult, fidl::Error>>
410 + Send;
411 fn r#create_iface(&self, req: CreateIfaceRequest) -> Self::CreateIfaceResponseFut;
412 type DestroyIfaceResponseFut: std::future::Future<Output = Result<PhyDestroyIfaceResult, fidl::Error>>
413 + Send;
414 fn r#destroy_iface(&self, req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut;
415 type SetCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
416 fn r#set_country(&self, req: &CountryCode) -> Self::SetCountryResponseFut;
417 type GetCountryResponseFut: std::future::Future<Output = Result<PhyGetCountryResult, fidl::Error>>
418 + Send;
419 fn r#get_country(&self) -> Self::GetCountryResponseFut;
420 type ClearCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
421 fn r#clear_country(&self) -> Self::ClearCountryResponseFut;
422 type SetPowerSaveModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
423 fn r#set_power_save_mode(
424 &self,
425 req: fidl_fuchsia_wlan_common::PowerSaveType,
426 ) -> Self::SetPowerSaveModeResponseFut;
427 type GetPowerSaveModeResponseFut: std::future::Future<Output = Result<PhyGetPowerSaveModeResult, fidl::Error>>
428 + Send;
429 fn r#get_power_save_mode(&self) -> Self::GetPowerSaveModeResponseFut;
430}
431#[derive(Debug)]
432#[cfg(target_os = "fuchsia")]
433pub struct PhySynchronousProxy {
434 client: fidl::client::sync::Client,
435}
436
437#[cfg(target_os = "fuchsia")]
438impl fidl::endpoints::SynchronousProxy for PhySynchronousProxy {
439 type Proxy = PhyProxy;
440 type Protocol = PhyMarker;
441
442 fn from_channel(inner: fidl::Channel) -> Self {
443 Self::new(inner)
444 }
445
446 fn into_channel(self) -> fidl::Channel {
447 self.client.into_channel()
448 }
449
450 fn as_channel(&self) -> &fidl::Channel {
451 self.client.as_channel()
452 }
453}
454
455#[cfg(target_os = "fuchsia")]
456impl PhySynchronousProxy {
457 pub fn new(channel: fidl::Channel) -> Self {
458 let protocol_name = <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
459 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
460 }
461
462 pub fn into_channel(self) -> fidl::Channel {
463 self.client.into_channel()
464 }
465
466 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<PhyEvent, fidl::Error> {
469 PhyEvent::decode(self.client.wait_for_event(deadline)?)
470 }
471
472 pub fn r#get_supported_mac_roles(
473 &self,
474 ___deadline: zx::MonotonicInstant,
475 ) -> Result<PhyGetSupportedMacRolesResult, fidl::Error> {
476 let _response = self.client.send_query::<
477 fidl::encoding::EmptyPayload,
478 fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>,
479 >(
480 (),
481 0x18f6b9091aa8a44,
482 fidl::encoding::DynamicFlags::empty(),
483 ___deadline,
484 )?;
485 Ok(_response.map(|x| x.supported_mac_roles))
486 }
487
488 pub fn r#create_iface(
489 &self,
490 mut req: CreateIfaceRequest,
491 ___deadline: zx::MonotonicInstant,
492 ) -> Result<PhyCreateIfaceResult, fidl::Error> {
493 let _response = self.client.send_query::<
494 PhyCreateIfaceRequest,
495 fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>,
496 >(
497 (&mut req,),
498 0x665940c7aa4b9785,
499 fidl::encoding::DynamicFlags::empty(),
500 ___deadline,
501 )?;
502 Ok(_response.map(|x| x.iface_id))
503 }
504
505 pub fn r#destroy_iface(
506 &self,
507 mut req: &DestroyIfaceRequest,
508 ___deadline: zx::MonotonicInstant,
509 ) -> Result<PhyDestroyIfaceResult, fidl::Error> {
510 let _response = self.client.send_query::<
511 PhyDestroyIfaceRequest,
512 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
513 >(
514 (req,),
515 0x75a3048ae01942e8,
516 fidl::encoding::DynamicFlags::empty(),
517 ___deadline,
518 )?;
519 Ok(_response.map(|x| x))
520 }
521
522 pub fn r#set_country(
523 &self,
524 mut req: &CountryCode,
525 ___deadline: zx::MonotonicInstant,
526 ) -> Result<i32, fidl::Error> {
527 let _response = self.client.send_query::<PhySetCountryRequest, PhySetCountryResponse>(
528 (req,),
529 0x1367e9997ba00806,
530 fidl::encoding::DynamicFlags::empty(),
531 ___deadline,
532 )?;
533 Ok(_response.status)
534 }
535
536 pub fn r#get_country(
537 &self,
538 ___deadline: zx::MonotonicInstant,
539 ) -> Result<PhyGetCountryResult, fidl::Error> {
540 let _response = self.client.send_query::<
541 fidl::encoding::EmptyPayload,
542 fidl::encoding::ResultType<PhyGetCountryResponse, i32>,
543 >(
544 (),
545 0x3ed3281ce6feab3e,
546 fidl::encoding::DynamicFlags::empty(),
547 ___deadline,
548 )?;
549 Ok(_response.map(|x| x.resp))
550 }
551
552 pub fn r#clear_country(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
553 let _response =
554 self.client.send_query::<fidl::encoding::EmptyPayload, PhyClearCountryResponse>(
555 (),
556 0x4ea9b83a9c494c95,
557 fidl::encoding::DynamicFlags::empty(),
558 ___deadline,
559 )?;
560 Ok(_response.status)
561 }
562
563 pub fn r#set_power_save_mode(
564 &self,
565 mut req: fidl_fuchsia_wlan_common::PowerSaveType,
566 ___deadline: zx::MonotonicInstant,
567 ) -> Result<i32, fidl::Error> {
568 let _response =
569 self.client.send_query::<PhySetPowerSaveModeRequest, PhySetPowerSaveModeResponse>(
570 (req,),
571 0x56be34b2f3abe17f,
572 fidl::encoding::DynamicFlags::empty(),
573 ___deadline,
574 )?;
575 Ok(_response.status)
576 }
577
578 pub fn r#get_power_save_mode(
579 &self,
580 ___deadline: zx::MonotonicInstant,
581 ) -> Result<PhyGetPowerSaveModeResult, fidl::Error> {
582 let _response = self.client.send_query::<
583 fidl::encoding::EmptyPayload,
584 fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>,
585 >(
586 (),
587 0x3f7019c3672bc798,
588 fidl::encoding::DynamicFlags::empty(),
589 ___deadline,
590 )?;
591 Ok(_response.map(|x| x.resp))
592 }
593}
594
595#[cfg(target_os = "fuchsia")]
596impl From<PhySynchronousProxy> for zx::Handle {
597 fn from(value: PhySynchronousProxy) -> Self {
598 value.into_channel().into()
599 }
600}
601
602#[cfg(target_os = "fuchsia")]
603impl From<fidl::Channel> for PhySynchronousProxy {
604 fn from(value: fidl::Channel) -> Self {
605 Self::new(value)
606 }
607}
608
609#[derive(Debug, Clone)]
610pub struct PhyProxy {
611 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
612}
613
614impl fidl::endpoints::Proxy for PhyProxy {
615 type Protocol = PhyMarker;
616
617 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
618 Self::new(inner)
619 }
620
621 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
622 self.client.into_channel().map_err(|client| Self { client })
623 }
624
625 fn as_channel(&self) -> &::fidl::AsyncChannel {
626 self.client.as_channel()
627 }
628}
629
630impl PhyProxy {
631 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
633 let protocol_name = <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
634 Self { client: fidl::client::Client::new(channel, protocol_name) }
635 }
636
637 pub fn take_event_stream(&self) -> PhyEventStream {
643 PhyEventStream { event_receiver: self.client.take_event_receiver() }
644 }
645
646 pub fn r#get_supported_mac_roles(
647 &self,
648 ) -> fidl::client::QueryResponseFut<
649 PhyGetSupportedMacRolesResult,
650 fidl::encoding::DefaultFuchsiaResourceDialect,
651 > {
652 PhyProxyInterface::r#get_supported_mac_roles(self)
653 }
654
655 pub fn r#create_iface(
656 &self,
657 mut req: CreateIfaceRequest,
658 ) -> fidl::client::QueryResponseFut<
659 PhyCreateIfaceResult,
660 fidl::encoding::DefaultFuchsiaResourceDialect,
661 > {
662 PhyProxyInterface::r#create_iface(self, req)
663 }
664
665 pub fn r#destroy_iface(
666 &self,
667 mut req: &DestroyIfaceRequest,
668 ) -> fidl::client::QueryResponseFut<
669 PhyDestroyIfaceResult,
670 fidl::encoding::DefaultFuchsiaResourceDialect,
671 > {
672 PhyProxyInterface::r#destroy_iface(self, req)
673 }
674
675 pub fn r#set_country(
676 &self,
677 mut req: &CountryCode,
678 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
679 PhyProxyInterface::r#set_country(self, req)
680 }
681
682 pub fn r#get_country(
683 &self,
684 ) -> fidl::client::QueryResponseFut<
685 PhyGetCountryResult,
686 fidl::encoding::DefaultFuchsiaResourceDialect,
687 > {
688 PhyProxyInterface::r#get_country(self)
689 }
690
691 pub fn r#clear_country(
692 &self,
693 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
694 PhyProxyInterface::r#clear_country(self)
695 }
696
697 pub fn r#set_power_save_mode(
698 &self,
699 mut req: fidl_fuchsia_wlan_common::PowerSaveType,
700 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
701 PhyProxyInterface::r#set_power_save_mode(self, req)
702 }
703
704 pub fn r#get_power_save_mode(
705 &self,
706 ) -> fidl::client::QueryResponseFut<
707 PhyGetPowerSaveModeResult,
708 fidl::encoding::DefaultFuchsiaResourceDialect,
709 > {
710 PhyProxyInterface::r#get_power_save_mode(self)
711 }
712}
713
714impl PhyProxyInterface for PhyProxy {
715 type GetSupportedMacRolesResponseFut = fidl::client::QueryResponseFut<
716 PhyGetSupportedMacRolesResult,
717 fidl::encoding::DefaultFuchsiaResourceDialect,
718 >;
719 fn r#get_supported_mac_roles(&self) -> Self::GetSupportedMacRolesResponseFut {
720 fn _decode(
721 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
722 ) -> Result<PhyGetSupportedMacRolesResult, fidl::Error> {
723 let _response = fidl::client::decode_transaction_body::<
724 fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>,
725 fidl::encoding::DefaultFuchsiaResourceDialect,
726 0x18f6b9091aa8a44,
727 >(_buf?)?;
728 Ok(_response.map(|x| x.supported_mac_roles))
729 }
730 self.client
731 .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetSupportedMacRolesResult>(
732 (),
733 0x18f6b9091aa8a44,
734 fidl::encoding::DynamicFlags::empty(),
735 _decode,
736 )
737 }
738
739 type CreateIfaceResponseFut = fidl::client::QueryResponseFut<
740 PhyCreateIfaceResult,
741 fidl::encoding::DefaultFuchsiaResourceDialect,
742 >;
743 fn r#create_iface(&self, mut req: CreateIfaceRequest) -> Self::CreateIfaceResponseFut {
744 fn _decode(
745 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
746 ) -> Result<PhyCreateIfaceResult, fidl::Error> {
747 let _response = fidl::client::decode_transaction_body::<
748 fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>,
749 fidl::encoding::DefaultFuchsiaResourceDialect,
750 0x665940c7aa4b9785,
751 >(_buf?)?;
752 Ok(_response.map(|x| x.iface_id))
753 }
754 self.client.send_query_and_decode::<PhyCreateIfaceRequest, PhyCreateIfaceResult>(
755 (&mut req,),
756 0x665940c7aa4b9785,
757 fidl::encoding::DynamicFlags::empty(),
758 _decode,
759 )
760 }
761
762 type DestroyIfaceResponseFut = fidl::client::QueryResponseFut<
763 PhyDestroyIfaceResult,
764 fidl::encoding::DefaultFuchsiaResourceDialect,
765 >;
766 fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
767 fn _decode(
768 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
769 ) -> Result<PhyDestroyIfaceResult, fidl::Error> {
770 let _response = fidl::client::decode_transaction_body::<
771 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
772 fidl::encoding::DefaultFuchsiaResourceDialect,
773 0x75a3048ae01942e8,
774 >(_buf?)?;
775 Ok(_response.map(|x| x))
776 }
777 self.client.send_query_and_decode::<PhyDestroyIfaceRequest, PhyDestroyIfaceResult>(
778 (req,),
779 0x75a3048ae01942e8,
780 fidl::encoding::DynamicFlags::empty(),
781 _decode,
782 )
783 }
784
785 type SetCountryResponseFut =
786 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
787 fn r#set_country(&self, mut req: &CountryCode) -> Self::SetCountryResponseFut {
788 fn _decode(
789 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
790 ) -> Result<i32, fidl::Error> {
791 let _response = fidl::client::decode_transaction_body::<
792 PhySetCountryResponse,
793 fidl::encoding::DefaultFuchsiaResourceDialect,
794 0x1367e9997ba00806,
795 >(_buf?)?;
796 Ok(_response.status)
797 }
798 self.client.send_query_and_decode::<PhySetCountryRequest, i32>(
799 (req,),
800 0x1367e9997ba00806,
801 fidl::encoding::DynamicFlags::empty(),
802 _decode,
803 )
804 }
805
806 type GetCountryResponseFut = fidl::client::QueryResponseFut<
807 PhyGetCountryResult,
808 fidl::encoding::DefaultFuchsiaResourceDialect,
809 >;
810 fn r#get_country(&self) -> Self::GetCountryResponseFut {
811 fn _decode(
812 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
813 ) -> Result<PhyGetCountryResult, fidl::Error> {
814 let _response = fidl::client::decode_transaction_body::<
815 fidl::encoding::ResultType<PhyGetCountryResponse, i32>,
816 fidl::encoding::DefaultFuchsiaResourceDialect,
817 0x3ed3281ce6feab3e,
818 >(_buf?)?;
819 Ok(_response.map(|x| x.resp))
820 }
821 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetCountryResult>(
822 (),
823 0x3ed3281ce6feab3e,
824 fidl::encoding::DynamicFlags::empty(),
825 _decode,
826 )
827 }
828
829 type ClearCountryResponseFut =
830 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
831 fn r#clear_country(&self) -> Self::ClearCountryResponseFut {
832 fn _decode(
833 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
834 ) -> Result<i32, fidl::Error> {
835 let _response = fidl::client::decode_transaction_body::<
836 PhyClearCountryResponse,
837 fidl::encoding::DefaultFuchsiaResourceDialect,
838 0x4ea9b83a9c494c95,
839 >(_buf?)?;
840 Ok(_response.status)
841 }
842 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
843 (),
844 0x4ea9b83a9c494c95,
845 fidl::encoding::DynamicFlags::empty(),
846 _decode,
847 )
848 }
849
850 type SetPowerSaveModeResponseFut =
851 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
852 fn r#set_power_save_mode(
853 &self,
854 mut req: fidl_fuchsia_wlan_common::PowerSaveType,
855 ) -> Self::SetPowerSaveModeResponseFut {
856 fn _decode(
857 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
858 ) -> Result<i32, fidl::Error> {
859 let _response = fidl::client::decode_transaction_body::<
860 PhySetPowerSaveModeResponse,
861 fidl::encoding::DefaultFuchsiaResourceDialect,
862 0x56be34b2f3abe17f,
863 >(_buf?)?;
864 Ok(_response.status)
865 }
866 self.client.send_query_and_decode::<PhySetPowerSaveModeRequest, i32>(
867 (req,),
868 0x56be34b2f3abe17f,
869 fidl::encoding::DynamicFlags::empty(),
870 _decode,
871 )
872 }
873
874 type GetPowerSaveModeResponseFut = fidl::client::QueryResponseFut<
875 PhyGetPowerSaveModeResult,
876 fidl::encoding::DefaultFuchsiaResourceDialect,
877 >;
878 fn r#get_power_save_mode(&self) -> Self::GetPowerSaveModeResponseFut {
879 fn _decode(
880 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
881 ) -> Result<PhyGetPowerSaveModeResult, fidl::Error> {
882 let _response = fidl::client::decode_transaction_body::<
883 fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>,
884 fidl::encoding::DefaultFuchsiaResourceDialect,
885 0x3f7019c3672bc798,
886 >(_buf?)?;
887 Ok(_response.map(|x| x.resp))
888 }
889 self.client
890 .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetPowerSaveModeResult>(
891 (),
892 0x3f7019c3672bc798,
893 fidl::encoding::DynamicFlags::empty(),
894 _decode,
895 )
896 }
897}
898
899pub struct PhyEventStream {
900 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
901}
902
903impl std::marker::Unpin for PhyEventStream {}
904
905impl futures::stream::FusedStream for PhyEventStream {
906 fn is_terminated(&self) -> bool {
907 self.event_receiver.is_terminated()
908 }
909}
910
911impl futures::Stream for PhyEventStream {
912 type Item = Result<PhyEvent, fidl::Error>;
913
914 fn poll_next(
915 mut self: std::pin::Pin<&mut Self>,
916 cx: &mut std::task::Context<'_>,
917 ) -> std::task::Poll<Option<Self::Item>> {
918 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
919 &mut self.event_receiver,
920 cx
921 )?) {
922 Some(buf) => std::task::Poll::Ready(Some(PhyEvent::decode(buf))),
923 None => std::task::Poll::Ready(None),
924 }
925 }
926}
927
928#[derive(Debug)]
929pub enum PhyEvent {}
930
931impl PhyEvent {
932 fn decode(
934 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
935 ) -> Result<PhyEvent, fidl::Error> {
936 let (bytes, _handles) = buf.split_mut();
937 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
938 debug_assert_eq!(tx_header.tx_id, 0);
939 match tx_header.ordinal {
940 _ => Err(fidl::Error::UnknownOrdinal {
941 ordinal: tx_header.ordinal,
942 protocol_name: <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
943 }),
944 }
945 }
946}
947
948pub struct PhyRequestStream {
950 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
951 is_terminated: bool,
952}
953
954impl std::marker::Unpin for PhyRequestStream {}
955
956impl futures::stream::FusedStream for PhyRequestStream {
957 fn is_terminated(&self) -> bool {
958 self.is_terminated
959 }
960}
961
962impl fidl::endpoints::RequestStream for PhyRequestStream {
963 type Protocol = PhyMarker;
964 type ControlHandle = PhyControlHandle;
965
966 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
967 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
968 }
969
970 fn control_handle(&self) -> Self::ControlHandle {
971 PhyControlHandle { inner: self.inner.clone() }
972 }
973
974 fn into_inner(
975 self,
976 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
977 {
978 (self.inner, self.is_terminated)
979 }
980
981 fn from_inner(
982 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
983 is_terminated: bool,
984 ) -> Self {
985 Self { inner, is_terminated }
986 }
987}
988
989impl futures::Stream for PhyRequestStream {
990 type Item = Result<PhyRequest, fidl::Error>;
991
992 fn poll_next(
993 mut self: std::pin::Pin<&mut Self>,
994 cx: &mut std::task::Context<'_>,
995 ) -> std::task::Poll<Option<Self::Item>> {
996 let this = &mut *self;
997 if this.inner.check_shutdown(cx) {
998 this.is_terminated = true;
999 return std::task::Poll::Ready(None);
1000 }
1001 if this.is_terminated {
1002 panic!("polled PhyRequestStream after completion");
1003 }
1004 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1005 |bytes, handles| {
1006 match this.inner.channel().read_etc(cx, bytes, handles) {
1007 std::task::Poll::Ready(Ok(())) => {}
1008 std::task::Poll::Pending => return std::task::Poll::Pending,
1009 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1010 this.is_terminated = true;
1011 return std::task::Poll::Ready(None);
1012 }
1013 std::task::Poll::Ready(Err(e)) => {
1014 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1015 e.into(),
1016 ))))
1017 }
1018 }
1019
1020 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1022
1023 std::task::Poll::Ready(Some(match header.ordinal {
1024 0x18f6b9091aa8a44 => {
1025 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1026 let mut req = fidl::new_empty!(
1027 fidl::encoding::EmptyPayload,
1028 fidl::encoding::DefaultFuchsiaResourceDialect
1029 );
1030 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1031 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1032 Ok(PhyRequest::GetSupportedMacRoles {
1033 responder: PhyGetSupportedMacRolesResponder {
1034 control_handle: std::mem::ManuallyDrop::new(control_handle),
1035 tx_id: header.tx_id,
1036 },
1037 })
1038 }
1039 0x665940c7aa4b9785 => {
1040 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1041 let mut req = fidl::new_empty!(
1042 PhyCreateIfaceRequest,
1043 fidl::encoding::DefaultFuchsiaResourceDialect
1044 );
1045 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyCreateIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1046 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1047 Ok(PhyRequest::CreateIface {
1048 req: req.req,
1049
1050 responder: PhyCreateIfaceResponder {
1051 control_handle: std::mem::ManuallyDrop::new(control_handle),
1052 tx_id: header.tx_id,
1053 },
1054 })
1055 }
1056 0x75a3048ae01942e8 => {
1057 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1058 let mut req = fidl::new_empty!(
1059 PhyDestroyIfaceRequest,
1060 fidl::encoding::DefaultFuchsiaResourceDialect
1061 );
1062 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyDestroyIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1063 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1064 Ok(PhyRequest::DestroyIface {
1065 req: req.req,
1066
1067 responder: PhyDestroyIfaceResponder {
1068 control_handle: std::mem::ManuallyDrop::new(control_handle),
1069 tx_id: header.tx_id,
1070 },
1071 })
1072 }
1073 0x1367e9997ba00806 => {
1074 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1075 let mut req = fidl::new_empty!(
1076 PhySetCountryRequest,
1077 fidl::encoding::DefaultFuchsiaResourceDialect
1078 );
1079 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1080 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1081 Ok(PhyRequest::SetCountry {
1082 req: req.req,
1083
1084 responder: PhySetCountryResponder {
1085 control_handle: std::mem::ManuallyDrop::new(control_handle),
1086 tx_id: header.tx_id,
1087 },
1088 })
1089 }
1090 0x3ed3281ce6feab3e => {
1091 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1092 let mut req = fidl::new_empty!(
1093 fidl::encoding::EmptyPayload,
1094 fidl::encoding::DefaultFuchsiaResourceDialect
1095 );
1096 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1097 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1098 Ok(PhyRequest::GetCountry {
1099 responder: PhyGetCountryResponder {
1100 control_handle: std::mem::ManuallyDrop::new(control_handle),
1101 tx_id: header.tx_id,
1102 },
1103 })
1104 }
1105 0x4ea9b83a9c494c95 => {
1106 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1107 let mut req = fidl::new_empty!(
1108 fidl::encoding::EmptyPayload,
1109 fidl::encoding::DefaultFuchsiaResourceDialect
1110 );
1111 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1112 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1113 Ok(PhyRequest::ClearCountry {
1114 responder: PhyClearCountryResponder {
1115 control_handle: std::mem::ManuallyDrop::new(control_handle),
1116 tx_id: header.tx_id,
1117 },
1118 })
1119 }
1120 0x56be34b2f3abe17f => {
1121 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1122 let mut req = fidl::new_empty!(
1123 PhySetPowerSaveModeRequest,
1124 fidl::encoding::DefaultFuchsiaResourceDialect
1125 );
1126 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1127 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1128 Ok(PhyRequest::SetPowerSaveMode {
1129 req: req.req,
1130
1131 responder: PhySetPowerSaveModeResponder {
1132 control_handle: std::mem::ManuallyDrop::new(control_handle),
1133 tx_id: header.tx_id,
1134 },
1135 })
1136 }
1137 0x3f7019c3672bc798 => {
1138 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1139 let mut req = fidl::new_empty!(
1140 fidl::encoding::EmptyPayload,
1141 fidl::encoding::DefaultFuchsiaResourceDialect
1142 );
1143 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1144 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1145 Ok(PhyRequest::GetPowerSaveMode {
1146 responder: PhyGetPowerSaveModeResponder {
1147 control_handle: std::mem::ManuallyDrop::new(control_handle),
1148 tx_id: header.tx_id,
1149 },
1150 })
1151 }
1152 _ => Err(fidl::Error::UnknownOrdinal {
1153 ordinal: header.ordinal,
1154 protocol_name: <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1155 }),
1156 }))
1157 },
1158 )
1159 }
1160}
1161
1162#[derive(Debug)]
1163pub enum PhyRequest {
1164 GetSupportedMacRoles {
1165 responder: PhyGetSupportedMacRolesResponder,
1166 },
1167 CreateIface {
1168 req: CreateIfaceRequest,
1169 responder: PhyCreateIfaceResponder,
1170 },
1171 DestroyIface {
1172 req: DestroyIfaceRequest,
1173 responder: PhyDestroyIfaceResponder,
1174 },
1175 SetCountry {
1176 req: CountryCode,
1177 responder: PhySetCountryResponder,
1178 },
1179 GetCountry {
1180 responder: PhyGetCountryResponder,
1181 },
1182 ClearCountry {
1183 responder: PhyClearCountryResponder,
1184 },
1185 SetPowerSaveMode {
1186 req: fidl_fuchsia_wlan_common::PowerSaveType,
1187 responder: PhySetPowerSaveModeResponder,
1188 },
1189 GetPowerSaveMode {
1190 responder: PhyGetPowerSaveModeResponder,
1191 },
1192}
1193
1194impl PhyRequest {
1195 #[allow(irrefutable_let_patterns)]
1196 pub fn into_get_supported_mac_roles(self) -> Option<(PhyGetSupportedMacRolesResponder)> {
1197 if let PhyRequest::GetSupportedMacRoles { responder } = self {
1198 Some((responder))
1199 } else {
1200 None
1201 }
1202 }
1203
1204 #[allow(irrefutable_let_patterns)]
1205 pub fn into_create_iface(self) -> Option<(CreateIfaceRequest, PhyCreateIfaceResponder)> {
1206 if let PhyRequest::CreateIface { req, responder } = self {
1207 Some((req, responder))
1208 } else {
1209 None
1210 }
1211 }
1212
1213 #[allow(irrefutable_let_patterns)]
1214 pub fn into_destroy_iface(self) -> Option<(DestroyIfaceRequest, PhyDestroyIfaceResponder)> {
1215 if let PhyRequest::DestroyIface { req, responder } = self {
1216 Some((req, responder))
1217 } else {
1218 None
1219 }
1220 }
1221
1222 #[allow(irrefutable_let_patterns)]
1223 pub fn into_set_country(self) -> Option<(CountryCode, PhySetCountryResponder)> {
1224 if let PhyRequest::SetCountry { req, responder } = self {
1225 Some((req, responder))
1226 } else {
1227 None
1228 }
1229 }
1230
1231 #[allow(irrefutable_let_patterns)]
1232 pub fn into_get_country(self) -> Option<(PhyGetCountryResponder)> {
1233 if let PhyRequest::GetCountry { responder } = self {
1234 Some((responder))
1235 } else {
1236 None
1237 }
1238 }
1239
1240 #[allow(irrefutable_let_patterns)]
1241 pub fn into_clear_country(self) -> Option<(PhyClearCountryResponder)> {
1242 if let PhyRequest::ClearCountry { responder } = self {
1243 Some((responder))
1244 } else {
1245 None
1246 }
1247 }
1248
1249 #[allow(irrefutable_let_patterns)]
1250 pub fn into_set_power_save_mode(
1251 self,
1252 ) -> Option<(fidl_fuchsia_wlan_common::PowerSaveType, PhySetPowerSaveModeResponder)> {
1253 if let PhyRequest::SetPowerSaveMode { req, responder } = self {
1254 Some((req, responder))
1255 } else {
1256 None
1257 }
1258 }
1259
1260 #[allow(irrefutable_let_patterns)]
1261 pub fn into_get_power_save_mode(self) -> Option<(PhyGetPowerSaveModeResponder)> {
1262 if let PhyRequest::GetPowerSaveMode { responder } = self {
1263 Some((responder))
1264 } else {
1265 None
1266 }
1267 }
1268
1269 pub fn method_name(&self) -> &'static str {
1271 match *self {
1272 PhyRequest::GetSupportedMacRoles { .. } => "get_supported_mac_roles",
1273 PhyRequest::CreateIface { .. } => "create_iface",
1274 PhyRequest::DestroyIface { .. } => "destroy_iface",
1275 PhyRequest::SetCountry { .. } => "set_country",
1276 PhyRequest::GetCountry { .. } => "get_country",
1277 PhyRequest::ClearCountry { .. } => "clear_country",
1278 PhyRequest::SetPowerSaveMode { .. } => "set_power_save_mode",
1279 PhyRequest::GetPowerSaveMode { .. } => "get_power_save_mode",
1280 }
1281 }
1282}
1283
1284#[derive(Debug, Clone)]
1285pub struct PhyControlHandle {
1286 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1287}
1288
1289impl fidl::endpoints::ControlHandle for PhyControlHandle {
1290 fn shutdown(&self) {
1291 self.inner.shutdown()
1292 }
1293 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1294 self.inner.shutdown_with_epitaph(status)
1295 }
1296
1297 fn is_closed(&self) -> bool {
1298 self.inner.channel().is_closed()
1299 }
1300 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1301 self.inner.channel().on_closed()
1302 }
1303
1304 #[cfg(target_os = "fuchsia")]
1305 fn signal_peer(
1306 &self,
1307 clear_mask: zx::Signals,
1308 set_mask: zx::Signals,
1309 ) -> Result<(), zx_status::Status> {
1310 use fidl::Peered;
1311 self.inner.channel().signal_peer(clear_mask, set_mask)
1312 }
1313}
1314
1315impl PhyControlHandle {}
1316
1317#[must_use = "FIDL methods require a response to be sent"]
1318#[derive(Debug)]
1319pub struct PhyGetSupportedMacRolesResponder {
1320 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1321 tx_id: u32,
1322}
1323
1324impl std::ops::Drop for PhyGetSupportedMacRolesResponder {
1328 fn drop(&mut self) {
1329 self.control_handle.shutdown();
1330 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1332 }
1333}
1334
1335impl fidl::endpoints::Responder for PhyGetSupportedMacRolesResponder {
1336 type ControlHandle = PhyControlHandle;
1337
1338 fn control_handle(&self) -> &PhyControlHandle {
1339 &self.control_handle
1340 }
1341
1342 fn drop_without_shutdown(mut self) {
1343 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1345 std::mem::forget(self);
1347 }
1348}
1349
1350impl PhyGetSupportedMacRolesResponder {
1351 pub fn send(
1355 self,
1356 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
1357 ) -> Result<(), fidl::Error> {
1358 let _result = self.send_raw(result);
1359 if _result.is_err() {
1360 self.control_handle.shutdown();
1361 }
1362 self.drop_without_shutdown();
1363 _result
1364 }
1365
1366 pub fn send_no_shutdown_on_err(
1368 self,
1369 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
1370 ) -> Result<(), fidl::Error> {
1371 let _result = self.send_raw(result);
1372 self.drop_without_shutdown();
1373 _result
1374 }
1375
1376 fn send_raw(
1377 &self,
1378 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
1379 ) -> Result<(), fidl::Error> {
1380 self.control_handle
1381 .inner
1382 .send::<fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>>(
1383 result.map(|supported_mac_roles| (supported_mac_roles,)),
1384 self.tx_id,
1385 0x18f6b9091aa8a44,
1386 fidl::encoding::DynamicFlags::empty(),
1387 )
1388 }
1389}
1390
1391#[must_use = "FIDL methods require a response to be sent"]
1392#[derive(Debug)]
1393pub struct PhyCreateIfaceResponder {
1394 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1395 tx_id: u32,
1396}
1397
1398impl std::ops::Drop for PhyCreateIfaceResponder {
1402 fn drop(&mut self) {
1403 self.control_handle.shutdown();
1404 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1406 }
1407}
1408
1409impl fidl::endpoints::Responder for PhyCreateIfaceResponder {
1410 type ControlHandle = PhyControlHandle;
1411
1412 fn control_handle(&self) -> &PhyControlHandle {
1413 &self.control_handle
1414 }
1415
1416 fn drop_without_shutdown(mut self) {
1417 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1419 std::mem::forget(self);
1421 }
1422}
1423
1424impl PhyCreateIfaceResponder {
1425 pub fn send(self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
1429 let _result = self.send_raw(result);
1430 if _result.is_err() {
1431 self.control_handle.shutdown();
1432 }
1433 self.drop_without_shutdown();
1434 _result
1435 }
1436
1437 pub fn send_no_shutdown_on_err(self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
1439 let _result = self.send_raw(result);
1440 self.drop_without_shutdown();
1441 _result
1442 }
1443
1444 fn send_raw(&self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
1445 self.control_handle.inner.send::<fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>>(
1446 result.map(|iface_id| (iface_id,)),
1447 self.tx_id,
1448 0x665940c7aa4b9785,
1449 fidl::encoding::DynamicFlags::empty(),
1450 )
1451 }
1452}
1453
1454#[must_use = "FIDL methods require a response to be sent"]
1455#[derive(Debug)]
1456pub struct PhyDestroyIfaceResponder {
1457 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1458 tx_id: u32,
1459}
1460
1461impl std::ops::Drop for PhyDestroyIfaceResponder {
1465 fn drop(&mut self) {
1466 self.control_handle.shutdown();
1467 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1469 }
1470}
1471
1472impl fidl::endpoints::Responder for PhyDestroyIfaceResponder {
1473 type ControlHandle = PhyControlHandle;
1474
1475 fn control_handle(&self) -> &PhyControlHandle {
1476 &self.control_handle
1477 }
1478
1479 fn drop_without_shutdown(mut self) {
1480 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1482 std::mem::forget(self);
1484 }
1485}
1486
1487impl PhyDestroyIfaceResponder {
1488 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1492 let _result = self.send_raw(result);
1493 if _result.is_err() {
1494 self.control_handle.shutdown();
1495 }
1496 self.drop_without_shutdown();
1497 _result
1498 }
1499
1500 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1502 let _result = self.send_raw(result);
1503 self.drop_without_shutdown();
1504 _result
1505 }
1506
1507 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1508 self.control_handle
1509 .inner
1510 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1511 result,
1512 self.tx_id,
1513 0x75a3048ae01942e8,
1514 fidl::encoding::DynamicFlags::empty(),
1515 )
1516 }
1517}
1518
1519#[must_use = "FIDL methods require a response to be sent"]
1520#[derive(Debug)]
1521pub struct PhySetCountryResponder {
1522 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1523 tx_id: u32,
1524}
1525
1526impl std::ops::Drop for PhySetCountryResponder {
1530 fn drop(&mut self) {
1531 self.control_handle.shutdown();
1532 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1534 }
1535}
1536
1537impl fidl::endpoints::Responder for PhySetCountryResponder {
1538 type ControlHandle = PhyControlHandle;
1539
1540 fn control_handle(&self) -> &PhyControlHandle {
1541 &self.control_handle
1542 }
1543
1544 fn drop_without_shutdown(mut self) {
1545 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1547 std::mem::forget(self);
1549 }
1550}
1551
1552impl PhySetCountryResponder {
1553 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1557 let _result = self.send_raw(status);
1558 if _result.is_err() {
1559 self.control_handle.shutdown();
1560 }
1561 self.drop_without_shutdown();
1562 _result
1563 }
1564
1565 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1567 let _result = self.send_raw(status);
1568 self.drop_without_shutdown();
1569 _result
1570 }
1571
1572 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1573 self.control_handle.inner.send::<PhySetCountryResponse>(
1574 (status,),
1575 self.tx_id,
1576 0x1367e9997ba00806,
1577 fidl::encoding::DynamicFlags::empty(),
1578 )
1579 }
1580}
1581
1582#[must_use = "FIDL methods require a response to be sent"]
1583#[derive(Debug)]
1584pub struct PhyGetCountryResponder {
1585 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1586 tx_id: u32,
1587}
1588
1589impl std::ops::Drop for PhyGetCountryResponder {
1593 fn drop(&mut self) {
1594 self.control_handle.shutdown();
1595 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1597 }
1598}
1599
1600impl fidl::endpoints::Responder for PhyGetCountryResponder {
1601 type ControlHandle = PhyControlHandle;
1602
1603 fn control_handle(&self) -> &PhyControlHandle {
1604 &self.control_handle
1605 }
1606
1607 fn drop_without_shutdown(mut self) {
1608 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1610 std::mem::forget(self);
1612 }
1613}
1614
1615impl PhyGetCountryResponder {
1616 pub fn send(self, mut result: Result<&CountryCode, i32>) -> Result<(), fidl::Error> {
1620 let _result = self.send_raw(result);
1621 if _result.is_err() {
1622 self.control_handle.shutdown();
1623 }
1624 self.drop_without_shutdown();
1625 _result
1626 }
1627
1628 pub fn send_no_shutdown_on_err(
1630 self,
1631 mut result: Result<&CountryCode, i32>,
1632 ) -> Result<(), fidl::Error> {
1633 let _result = self.send_raw(result);
1634 self.drop_without_shutdown();
1635 _result
1636 }
1637
1638 fn send_raw(&self, mut result: Result<&CountryCode, i32>) -> Result<(), fidl::Error> {
1639 self.control_handle.inner.send::<fidl::encoding::ResultType<PhyGetCountryResponse, i32>>(
1640 result.map(|resp| (resp,)),
1641 self.tx_id,
1642 0x3ed3281ce6feab3e,
1643 fidl::encoding::DynamicFlags::empty(),
1644 )
1645 }
1646}
1647
1648#[must_use = "FIDL methods require a response to be sent"]
1649#[derive(Debug)]
1650pub struct PhyClearCountryResponder {
1651 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1652 tx_id: u32,
1653}
1654
1655impl std::ops::Drop for PhyClearCountryResponder {
1659 fn drop(&mut self) {
1660 self.control_handle.shutdown();
1661 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1663 }
1664}
1665
1666impl fidl::endpoints::Responder for PhyClearCountryResponder {
1667 type ControlHandle = PhyControlHandle;
1668
1669 fn control_handle(&self) -> &PhyControlHandle {
1670 &self.control_handle
1671 }
1672
1673 fn drop_without_shutdown(mut self) {
1674 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1676 std::mem::forget(self);
1678 }
1679}
1680
1681impl PhyClearCountryResponder {
1682 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1686 let _result = self.send_raw(status);
1687 if _result.is_err() {
1688 self.control_handle.shutdown();
1689 }
1690 self.drop_without_shutdown();
1691 _result
1692 }
1693
1694 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1696 let _result = self.send_raw(status);
1697 self.drop_without_shutdown();
1698 _result
1699 }
1700
1701 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1702 self.control_handle.inner.send::<PhyClearCountryResponse>(
1703 (status,),
1704 self.tx_id,
1705 0x4ea9b83a9c494c95,
1706 fidl::encoding::DynamicFlags::empty(),
1707 )
1708 }
1709}
1710
1711#[must_use = "FIDL methods require a response to be sent"]
1712#[derive(Debug)]
1713pub struct PhySetPowerSaveModeResponder {
1714 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1715 tx_id: u32,
1716}
1717
1718impl std::ops::Drop for PhySetPowerSaveModeResponder {
1722 fn drop(&mut self) {
1723 self.control_handle.shutdown();
1724 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1726 }
1727}
1728
1729impl fidl::endpoints::Responder for PhySetPowerSaveModeResponder {
1730 type ControlHandle = PhyControlHandle;
1731
1732 fn control_handle(&self) -> &PhyControlHandle {
1733 &self.control_handle
1734 }
1735
1736 fn drop_without_shutdown(mut self) {
1737 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1739 std::mem::forget(self);
1741 }
1742}
1743
1744impl PhySetPowerSaveModeResponder {
1745 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1749 let _result = self.send_raw(status);
1750 if _result.is_err() {
1751 self.control_handle.shutdown();
1752 }
1753 self.drop_without_shutdown();
1754 _result
1755 }
1756
1757 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1759 let _result = self.send_raw(status);
1760 self.drop_without_shutdown();
1761 _result
1762 }
1763
1764 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1765 self.control_handle.inner.send::<PhySetPowerSaveModeResponse>(
1766 (status,),
1767 self.tx_id,
1768 0x56be34b2f3abe17f,
1769 fidl::encoding::DynamicFlags::empty(),
1770 )
1771 }
1772}
1773
1774#[must_use = "FIDL methods require a response to be sent"]
1775#[derive(Debug)]
1776pub struct PhyGetPowerSaveModeResponder {
1777 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
1778 tx_id: u32,
1779}
1780
1781impl std::ops::Drop for PhyGetPowerSaveModeResponder {
1785 fn drop(&mut self) {
1786 self.control_handle.shutdown();
1787 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1789 }
1790}
1791
1792impl fidl::endpoints::Responder for PhyGetPowerSaveModeResponder {
1793 type ControlHandle = PhyControlHandle;
1794
1795 fn control_handle(&self) -> &PhyControlHandle {
1796 &self.control_handle
1797 }
1798
1799 fn drop_without_shutdown(mut self) {
1800 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1802 std::mem::forget(self);
1804 }
1805}
1806
1807impl PhyGetPowerSaveModeResponder {
1808 pub fn send(
1812 self,
1813 mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
1814 ) -> Result<(), fidl::Error> {
1815 let _result = self.send_raw(result);
1816 if _result.is_err() {
1817 self.control_handle.shutdown();
1818 }
1819 self.drop_without_shutdown();
1820 _result
1821 }
1822
1823 pub fn send_no_shutdown_on_err(
1825 self,
1826 mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
1827 ) -> Result<(), fidl::Error> {
1828 let _result = self.send_raw(result);
1829 self.drop_without_shutdown();
1830 _result
1831 }
1832
1833 fn send_raw(
1834 &self,
1835 mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
1836 ) -> Result<(), fidl::Error> {
1837 self.control_handle
1838 .inner
1839 .send::<fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>>(
1840 result.map(|resp| (resp,)),
1841 self.tx_id,
1842 0x3f7019c3672bc798,
1843 fidl::encoding::DynamicFlags::empty(),
1844 )
1845 }
1846}
1847
1848#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1849pub struct ServiceMarker;
1850
1851#[cfg(target_os = "fuchsia")]
1852impl fidl::endpoints::ServiceMarker for ServiceMarker {
1853 type Proxy = ServiceProxy;
1854 type Request = ServiceRequest;
1855 const SERVICE_NAME: &'static str = "fuchsia.wlan.device.Service";
1856}
1857
1858#[cfg(target_os = "fuchsia")]
1861pub enum ServiceRequest {
1862 Device(ConnectorRequestStream),
1863}
1864
1865#[cfg(target_os = "fuchsia")]
1866impl fidl::endpoints::ServiceRequest for ServiceRequest {
1867 type Service = ServiceMarker;
1868
1869 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
1870 match name {
1871 "device" => Self::Device(
1872 <ConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
1873 ),
1874 _ => panic!("no such member protocol name for service Service"),
1875 }
1876 }
1877
1878 fn member_names() -> &'static [&'static str] {
1879 &["device"]
1880 }
1881}
1882#[cfg(target_os = "fuchsia")]
1883pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
1884
1885#[cfg(target_os = "fuchsia")]
1886impl fidl::endpoints::ServiceProxy for ServiceProxy {
1887 type Service = ServiceMarker;
1888
1889 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
1890 Self(opener)
1891 }
1892}
1893
1894#[cfg(target_os = "fuchsia")]
1895impl ServiceProxy {
1896 pub fn connect_to_device(&self) -> Result<ConnectorProxy, fidl::Error> {
1897 let (proxy, server_end) = fidl::endpoints::create_proxy::<ConnectorMarker>();
1898 self.connect_channel_to_device(server_end)?;
1899 Ok(proxy)
1900 }
1901
1902 pub fn connect_to_device_sync(&self) -> Result<ConnectorSynchronousProxy, fidl::Error> {
1905 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ConnectorMarker>();
1906 self.connect_channel_to_device(server_end)?;
1907 Ok(proxy)
1908 }
1909
1910 pub fn connect_channel_to_device(
1913 &self,
1914 server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
1915 ) -> Result<(), fidl::Error> {
1916 self.0.open_member("device", server_end.into_channel())
1917 }
1918
1919 pub fn instance_name(&self) -> &str {
1920 self.0.instance_name()
1921 }
1922}
1923
1924mod internal {
1925 use super::*;
1926
1927 impl fidl::encoding::ResourceTypeMarker for ConnectorConnectRequest {
1928 type Borrowed<'a> = &'a mut Self;
1929 fn take_or_borrow<'a>(
1930 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1931 ) -> Self::Borrowed<'a> {
1932 value
1933 }
1934 }
1935
1936 unsafe impl fidl::encoding::TypeMarker for ConnectorConnectRequest {
1937 type Owned = Self;
1938
1939 #[inline(always)]
1940 fn inline_align(_context: fidl::encoding::Context) -> usize {
1941 4
1942 }
1943
1944 #[inline(always)]
1945 fn inline_size(_context: fidl::encoding::Context) -> usize {
1946 4
1947 }
1948 }
1949
1950 unsafe impl
1951 fidl::encoding::Encode<
1952 ConnectorConnectRequest,
1953 fidl::encoding::DefaultFuchsiaResourceDialect,
1954 > for &mut ConnectorConnectRequest
1955 {
1956 #[inline]
1957 unsafe fn encode(
1958 self,
1959 encoder: &mut fidl::encoding::Encoder<
1960 '_,
1961 fidl::encoding::DefaultFuchsiaResourceDialect,
1962 >,
1963 offset: usize,
1964 _depth: fidl::encoding::Depth,
1965 ) -> fidl::Result<()> {
1966 encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
1967 fidl::encoding::Encode::<ConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1969 (
1970 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
1971 ),
1972 encoder, offset, _depth
1973 )
1974 }
1975 }
1976 unsafe impl<
1977 T0: fidl::encoding::Encode<
1978 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
1979 fidl::encoding::DefaultFuchsiaResourceDialect,
1980 >,
1981 >
1982 fidl::encoding::Encode<
1983 ConnectorConnectRequest,
1984 fidl::encoding::DefaultFuchsiaResourceDialect,
1985 > for (T0,)
1986 {
1987 #[inline]
1988 unsafe fn encode(
1989 self,
1990 encoder: &mut fidl::encoding::Encoder<
1991 '_,
1992 fidl::encoding::DefaultFuchsiaResourceDialect,
1993 >,
1994 offset: usize,
1995 depth: fidl::encoding::Depth,
1996 ) -> fidl::Result<()> {
1997 encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
1998 self.0.encode(encoder, offset + 0, depth)?;
2002 Ok(())
2003 }
2004 }
2005
2006 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2007 for ConnectorConnectRequest
2008 {
2009 #[inline(always)]
2010 fn new_empty() -> Self {
2011 Self {
2012 request: fidl::new_empty!(
2013 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
2014 fidl::encoding::DefaultFuchsiaResourceDialect
2015 ),
2016 }
2017 }
2018
2019 #[inline]
2020 unsafe fn decode(
2021 &mut self,
2022 decoder: &mut fidl::encoding::Decoder<
2023 '_,
2024 fidl::encoding::DefaultFuchsiaResourceDialect,
2025 >,
2026 offset: usize,
2027 _depth: fidl::encoding::Depth,
2028 ) -> fidl::Result<()> {
2029 decoder.debug_check_bounds::<Self>(offset);
2030 fidl::decode!(
2032 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
2033 fidl::encoding::DefaultFuchsiaResourceDialect,
2034 &mut self.request,
2035 decoder,
2036 offset + 0,
2037 _depth
2038 )?;
2039 Ok(())
2040 }
2041 }
2042
2043 impl fidl::encoding::ResourceTypeMarker for CreateIfaceRequest {
2044 type Borrowed<'a> = &'a mut Self;
2045 fn take_or_borrow<'a>(
2046 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2047 ) -> Self::Borrowed<'a> {
2048 value
2049 }
2050 }
2051
2052 unsafe impl fidl::encoding::TypeMarker for CreateIfaceRequest {
2053 type Owned = Self;
2054
2055 #[inline(always)]
2056 fn inline_align(_context: fidl::encoding::Context) -> usize {
2057 4
2058 }
2059
2060 #[inline(always)]
2061 fn inline_size(_context: fidl::encoding::Context) -> usize {
2062 16
2063 }
2064 }
2065
2066 unsafe impl
2067 fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2068 for &mut CreateIfaceRequest
2069 {
2070 #[inline]
2071 unsafe fn encode(
2072 self,
2073 encoder: &mut fidl::encoding::Encoder<
2074 '_,
2075 fidl::encoding::DefaultFuchsiaResourceDialect,
2076 >,
2077 offset: usize,
2078 _depth: fidl::encoding::Depth,
2079 ) -> fidl::Result<()> {
2080 encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
2081 fidl::encoding::Encode::<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2083 (
2084 <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
2085 <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.mlme_channel),
2086 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.init_sta_addr),
2087 ),
2088 encoder, offset, _depth
2089 )
2090 }
2091 }
2092 unsafe impl<
2093 T0: fidl::encoding::Encode<
2094 fidl_fuchsia_wlan_common::WlanMacRole,
2095 fidl::encoding::DefaultFuchsiaResourceDialect,
2096 >,
2097 T1: fidl::encoding::Encode<
2098 fidl::encoding::Optional<
2099 fidl::encoding::HandleType<
2100 fidl::Channel,
2101 { fidl::ObjectType::CHANNEL.into_raw() },
2102 2147483648,
2103 >,
2104 >,
2105 fidl::encoding::DefaultFuchsiaResourceDialect,
2106 >,
2107 T2: fidl::encoding::Encode<
2108 fidl::encoding::Array<u8, 6>,
2109 fidl::encoding::DefaultFuchsiaResourceDialect,
2110 >,
2111 >
2112 fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2113 for (T0, T1, T2)
2114 {
2115 #[inline]
2116 unsafe fn encode(
2117 self,
2118 encoder: &mut fidl::encoding::Encoder<
2119 '_,
2120 fidl::encoding::DefaultFuchsiaResourceDialect,
2121 >,
2122 offset: usize,
2123 depth: fidl::encoding::Depth,
2124 ) -> fidl::Result<()> {
2125 encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
2126 unsafe {
2129 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(12);
2130 (ptr as *mut u32).write_unaligned(0);
2131 }
2132 self.0.encode(encoder, offset + 0, depth)?;
2134 self.1.encode(encoder, offset + 4, depth)?;
2135 self.2.encode(encoder, offset + 8, depth)?;
2136 Ok(())
2137 }
2138 }
2139
2140 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2141 for CreateIfaceRequest
2142 {
2143 #[inline(always)]
2144 fn new_empty() -> Self {
2145 Self {
2146 role: fidl::new_empty!(
2147 fidl_fuchsia_wlan_common::WlanMacRole,
2148 fidl::encoding::DefaultFuchsiaResourceDialect
2149 ),
2150 mlme_channel: fidl::new_empty!(
2151 fidl::encoding::Optional<
2152 fidl::encoding::HandleType<
2153 fidl::Channel,
2154 { fidl::ObjectType::CHANNEL.into_raw() },
2155 2147483648,
2156 >,
2157 >,
2158 fidl::encoding::DefaultFuchsiaResourceDialect
2159 ),
2160 init_sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
2161 }
2162 }
2163
2164 #[inline]
2165 unsafe fn decode(
2166 &mut self,
2167 decoder: &mut fidl::encoding::Decoder<
2168 '_,
2169 fidl::encoding::DefaultFuchsiaResourceDialect,
2170 >,
2171 offset: usize,
2172 _depth: fidl::encoding::Depth,
2173 ) -> fidl::Result<()> {
2174 decoder.debug_check_bounds::<Self>(offset);
2175 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(12) };
2177 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2178 let mask = 0xffff0000u32;
2179 let maskedval = padval & mask;
2180 if maskedval != 0 {
2181 return Err(fidl::Error::NonZeroPadding {
2182 padding_start: offset + 12 + ((mask as u64).trailing_zeros() / 8) as usize,
2183 });
2184 }
2185 fidl::decode!(
2186 fidl_fuchsia_wlan_common::WlanMacRole,
2187 fidl::encoding::DefaultFuchsiaResourceDialect,
2188 &mut self.role,
2189 decoder,
2190 offset + 0,
2191 _depth
2192 )?;
2193 fidl::decode!(
2194 fidl::encoding::Optional<
2195 fidl::encoding::HandleType<
2196 fidl::Channel,
2197 { fidl::ObjectType::CHANNEL.into_raw() },
2198 2147483648,
2199 >,
2200 >,
2201 fidl::encoding::DefaultFuchsiaResourceDialect,
2202 &mut self.mlme_channel,
2203 decoder,
2204 offset + 4,
2205 _depth
2206 )?;
2207 fidl::decode!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.init_sta_addr, decoder, offset + 8, _depth)?;
2208 Ok(())
2209 }
2210 }
2211
2212 impl fidl::encoding::ResourceTypeMarker for PhyCreateIfaceRequest {
2213 type Borrowed<'a> = &'a mut Self;
2214 fn take_or_borrow<'a>(
2215 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2216 ) -> Self::Borrowed<'a> {
2217 value
2218 }
2219 }
2220
2221 unsafe impl fidl::encoding::TypeMarker for PhyCreateIfaceRequest {
2222 type Owned = Self;
2223
2224 #[inline(always)]
2225 fn inline_align(_context: fidl::encoding::Context) -> usize {
2226 4
2227 }
2228
2229 #[inline(always)]
2230 fn inline_size(_context: fidl::encoding::Context) -> usize {
2231 16
2232 }
2233 }
2234
2235 unsafe impl
2236 fidl::encoding::Encode<PhyCreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2237 for &mut PhyCreateIfaceRequest
2238 {
2239 #[inline]
2240 unsafe fn encode(
2241 self,
2242 encoder: &mut fidl::encoding::Encoder<
2243 '_,
2244 fidl::encoding::DefaultFuchsiaResourceDialect,
2245 >,
2246 offset: usize,
2247 _depth: fidl::encoding::Depth,
2248 ) -> fidl::Result<()> {
2249 encoder.debug_check_bounds::<PhyCreateIfaceRequest>(offset);
2250 fidl::encoding::Encode::<
2252 PhyCreateIfaceRequest,
2253 fidl::encoding::DefaultFuchsiaResourceDialect,
2254 >::encode(
2255 (<CreateIfaceRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2256 &mut self.req,
2257 ),),
2258 encoder,
2259 offset,
2260 _depth,
2261 )
2262 }
2263 }
2264 unsafe impl<
2265 T0: fidl::encoding::Encode<
2266 CreateIfaceRequest,
2267 fidl::encoding::DefaultFuchsiaResourceDialect,
2268 >,
2269 >
2270 fidl::encoding::Encode<PhyCreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2271 for (T0,)
2272 {
2273 #[inline]
2274 unsafe fn encode(
2275 self,
2276 encoder: &mut fidl::encoding::Encoder<
2277 '_,
2278 fidl::encoding::DefaultFuchsiaResourceDialect,
2279 >,
2280 offset: usize,
2281 depth: fidl::encoding::Depth,
2282 ) -> fidl::Result<()> {
2283 encoder.debug_check_bounds::<PhyCreateIfaceRequest>(offset);
2284 self.0.encode(encoder, offset + 0, depth)?;
2288 Ok(())
2289 }
2290 }
2291
2292 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2293 for PhyCreateIfaceRequest
2294 {
2295 #[inline(always)]
2296 fn new_empty() -> Self {
2297 Self {
2298 req: fidl::new_empty!(
2299 CreateIfaceRequest,
2300 fidl::encoding::DefaultFuchsiaResourceDialect
2301 ),
2302 }
2303 }
2304
2305 #[inline]
2306 unsafe fn decode(
2307 &mut self,
2308 decoder: &mut fidl::encoding::Decoder<
2309 '_,
2310 fidl::encoding::DefaultFuchsiaResourceDialect,
2311 >,
2312 offset: usize,
2313 _depth: fidl::encoding::Depth,
2314 ) -> fidl::Result<()> {
2315 decoder.debug_check_bounds::<Self>(offset);
2316 fidl::decode!(
2318 CreateIfaceRequest,
2319 fidl::encoding::DefaultFuchsiaResourceDialect,
2320 &mut self.req,
2321 decoder,
2322 offset + 0,
2323 _depth
2324 )?;
2325 Ok(())
2326 }
2327 }
2328}