1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
12pub enum DeviceMonitorError {
13 #[doc(hidden)]
14 __SourceBreaking { unknown_ordinal: u32 },
15}
16
17#[macro_export]
19macro_rules! DeviceMonitorErrorUnknown {
20 () => {
21 _
22 };
23}
24
25impl DeviceMonitorError {
26 #[inline]
27 pub fn from_primitive(prim: u32) -> Option<Self> {
28 match prim {
29 _ => None,
30 }
31 }
32
33 #[inline]
34 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
35 match prim {
36 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
37 }
38 }
39
40 #[inline]
41 pub fn unknown() -> Self {
42 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
43 }
44
45 #[inline]
46 pub const fn into_primitive(self) -> u32 {
47 match self {
48 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
49 }
50 }
51
52 #[inline]
53 pub fn is_unknown(&self) -> bool {
54 match self {
55 Self::__SourceBreaking { unknown_ordinal: _ } => true,
56 }
57 }
58}
59
60#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61#[repr(C)]
62pub struct ClearCountryRequest {
63 pub phy_id: u16,
64}
65
66impl fidl::Persistable for ClearCountryRequest {}
67
68#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
69#[repr(C)]
70pub struct DestroyIfaceRequest {
71 pub iface_id: u16,
72}
73
74impl fidl::Persistable for DestroyIfaceRequest {}
75
76#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
77#[repr(C)]
78pub struct DeviceMonitorClearCountryRequest {
79 pub req: ClearCountryRequest,
80}
81
82impl fidl::Persistable for DeviceMonitorClearCountryRequest {}
83
84#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85#[repr(C)]
86pub struct DeviceMonitorClearCountryResponse {
87 pub status: i32,
88}
89
90impl fidl::Persistable for DeviceMonitorClearCountryResponse {}
91
92#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
93#[repr(C)]
94pub struct DeviceMonitorDestroyIfaceRequest {
95 pub req: DestroyIfaceRequest,
96}
97
98impl fidl::Persistable for DeviceMonitorDestroyIfaceRequest {}
99
100#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
101#[repr(C)]
102pub struct DeviceMonitorDestroyIfaceResponse {
103 pub status: i32,
104}
105
106impl fidl::Persistable for DeviceMonitorDestroyIfaceResponse {}
107
108#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
109#[repr(C)]
110pub struct DeviceMonitorGetCountryRequest {
111 pub phy_id: u16,
112}
113
114impl fidl::Persistable for DeviceMonitorGetCountryRequest {}
115
116#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117#[repr(C)]
118pub struct DeviceMonitorGetDevPathRequest {
119 pub phy_id: u16,
120}
121
122impl fidl::Persistable for DeviceMonitorGetDevPathRequest {}
123
124#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125pub struct DeviceMonitorGetDevPathResponse {
126 pub dev_path: Option<String>,
127}
128
129impl fidl::Persistable for DeviceMonitorGetDevPathResponse {}
130
131#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
132#[repr(C)]
133pub struct DeviceMonitorGetPowerSaveModeRequest {
134 pub phy_id: u16,
135}
136
137impl fidl::Persistable for DeviceMonitorGetPowerSaveModeRequest {}
138
139#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
140#[repr(C)]
141pub struct DeviceMonitorGetSupportedMacRolesRequest {
142 pub phy_id: u16,
143}
144
145impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesRequest {}
146
147#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
148pub struct DeviceMonitorListIfacesResponse {
149 pub iface_list: Vec<u16>,
150}
151
152impl fidl::Persistable for DeviceMonitorListIfacesResponse {}
153
154#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct DeviceMonitorListPhysResponse {
156 pub phy_list: Vec<u16>,
157}
158
159impl fidl::Persistable for DeviceMonitorListPhysResponse {}
160
161#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
162#[repr(C)]
163pub struct DeviceMonitorQueryIfaceRequest {
164 pub iface_id: u16,
165}
166
167impl fidl::Persistable for DeviceMonitorQueryIfaceRequest {}
168
169#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
170#[repr(C)]
171pub struct DeviceMonitorSetCountryRequest {
172 pub req: SetCountryRequest,
173}
174
175impl fidl::Persistable for DeviceMonitorSetCountryRequest {}
176
177#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
178#[repr(C)]
179pub struct DeviceMonitorSetCountryResponse {
180 pub status: i32,
181}
182
183impl fidl::Persistable for DeviceMonitorSetCountryResponse {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct DeviceMonitorSetPowerSaveModeRequest {
187 pub req: SetPowerSaveModeRequest,
188}
189
190impl fidl::Persistable for DeviceMonitorSetPowerSaveModeRequest {}
191
192#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
193#[repr(C)]
194pub struct DeviceMonitorSetPowerSaveModeResponse {
195 pub status: i32,
196}
197
198impl fidl::Persistable for DeviceMonitorSetPowerSaveModeResponse {}
199
200#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
201#[repr(C)]
202pub struct DeviceMonitorGetCountryResponse {
203 pub resp: GetCountryResponse,
204}
205
206impl fidl::Persistable for DeviceMonitorGetCountryResponse {}
207
208#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
209pub struct DeviceMonitorGetPowerSaveModeResponse {
210 pub resp: GetPowerSaveModeResponse,
211}
212
213impl fidl::Persistable for DeviceMonitorGetPowerSaveModeResponse {}
214
215#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216pub struct DeviceMonitorGetSupportedMacRolesResponse {
217 pub supported_mac_roles: Vec<fidl_fuchsia_wlan_common::WlanMacRole>,
218}
219
220impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesResponse {}
221
222#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
223pub struct DeviceMonitorQueryIfaceResponse {
224 pub resp: QueryIfaceResponse,
225}
226
227impl fidl::Persistable for DeviceMonitorQueryIfaceResponse {}
228
229#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
230#[repr(C)]
231pub struct DeviceWatcherOnIfaceAddedRequest {
232 pub iface_id: u16,
233}
234
235impl fidl::Persistable for DeviceWatcherOnIfaceAddedRequest {}
236
237#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
238#[repr(C)]
239pub struct DeviceWatcherOnIfaceRemovedRequest {
240 pub iface_id: u16,
241}
242
243impl fidl::Persistable for DeviceWatcherOnIfaceRemovedRequest {}
244
245#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
246#[repr(C)]
247pub struct DeviceWatcherOnPhyAddedRequest {
248 pub phy_id: u16,
249}
250
251impl fidl::Persistable for DeviceWatcherOnPhyAddedRequest {}
252
253#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
254#[repr(C)]
255pub struct DeviceWatcherOnPhyRemovedRequest {
256 pub phy_id: u16,
257}
258
259impl fidl::Persistable for DeviceWatcherOnPhyRemovedRequest {}
260
261#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
262#[repr(C)]
263pub struct GetCountryResponse {
264 pub alpha2: [u8; 2],
265}
266
267impl fidl::Persistable for GetCountryResponse {}
268
269#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
270pub struct GetPowerSaveModeResponse {
271 pub ps_mode: fidl_fuchsia_wlan_common::PowerSaveType,
273}
274
275impl fidl::Persistable for GetPowerSaveModeResponse {}
276
277#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
278pub struct QueryIfaceResponse {
279 pub role: fidl_fuchsia_wlan_common::WlanMacRole,
281 pub id: u16,
283 pub phy_id: u16,
285 pub phy_assigned_id: u16,
287 pub sta_addr: [u8; 6],
289}
290
291impl fidl::Persistable for QueryIfaceResponse {}
292
293#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
294#[repr(C)]
295pub struct SetCountryRequest {
296 pub phy_id: u16,
297 pub alpha2: [u8; 2],
298}
299
300impl fidl::Persistable for SetCountryRequest {}
301
302#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
303pub struct SetPowerSaveModeRequest {
304 pub phy_id: u16,
306 pub ps_mode: fidl_fuchsia_wlan_common::PowerSaveType,
308}
309
310impl fidl::Persistable for SetPowerSaveModeRequest {}
311
312#[derive(Clone, Debug, Default, PartialEq)]
313pub struct DeviceMonitorCreateIfaceRequest {
314 pub phy_id: Option<u16>,
315 pub role: Option<fidl_fuchsia_wlan_common::WlanMacRole>,
316 pub sta_address: Option<[u8; 6]>,
317 #[doc(hidden)]
318 pub __source_breaking: fidl::marker::SourceBreaking,
319}
320
321impl fidl::Persistable for DeviceMonitorCreateIfaceRequest {}
322
323#[derive(Clone, Debug, Default, PartialEq)]
324pub struct DeviceMonitorCreateIfaceResponse {
325 pub iface_id: Option<u16>,
326 #[doc(hidden)]
327 pub __source_breaking: fidl::marker::SourceBreaking,
328}
329
330impl fidl::Persistable for DeviceMonitorCreateIfaceResponse {}
331
332#[derive(Clone, Debug, PartialEq)]
333pub enum GetIfaceHistogramStatsResponse {
334 Stats(fidl_fuchsia_wlan_stats::IfaceHistogramStats),
335 ErrorStatus(i32),
336}
337
338impl GetIfaceHistogramStatsResponse {
339 #[inline]
340 pub fn ordinal(&self) -> u64 {
341 match *self {
342 Self::Stats(_) => 1,
343 Self::ErrorStatus(_) => 2,
344 }
345 }
346
347 #[deprecated = "Strict unions should not use `is_unknown`"]
348 #[inline]
349 pub fn is_unknown(&self) -> bool {
350 false
351 }
352}
353
354impl fidl::Persistable for GetIfaceHistogramStatsResponse {}
355
356mod internal {
357 use super::*;
358 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorError {
359 type Owned = Self;
360
361 #[inline(always)]
362 fn inline_align(_context: fidl::encoding::Context) -> usize {
363 std::mem::align_of::<u32>()
364 }
365
366 #[inline(always)]
367 fn inline_size(_context: fidl::encoding::Context) -> usize {
368 std::mem::size_of::<u32>()
369 }
370
371 #[inline(always)]
372 fn encode_is_copy() -> bool {
373 false
374 }
375
376 #[inline(always)]
377 fn decode_is_copy() -> bool {
378 false
379 }
380 }
381
382 impl fidl::encoding::ValueTypeMarker for DeviceMonitorError {
383 type Borrowed<'a> = Self;
384 #[inline(always)]
385 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
386 *value
387 }
388 }
389
390 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
391 for DeviceMonitorError
392 {
393 #[inline]
394 unsafe fn encode(
395 self,
396 encoder: &mut fidl::encoding::Encoder<'_, D>,
397 offset: usize,
398 _depth: fidl::encoding::Depth,
399 ) -> fidl::Result<()> {
400 encoder.debug_check_bounds::<Self>(offset);
401 encoder.write_num(self.into_primitive(), offset);
402 Ok(())
403 }
404 }
405
406 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceMonitorError {
407 #[inline(always)]
408 fn new_empty() -> Self {
409 Self::unknown()
410 }
411
412 #[inline]
413 unsafe fn decode(
414 &mut self,
415 decoder: &mut fidl::encoding::Decoder<'_, D>,
416 offset: usize,
417 _depth: fidl::encoding::Depth,
418 ) -> fidl::Result<()> {
419 decoder.debug_check_bounds::<Self>(offset);
420 let prim = decoder.read_num::<u32>(offset);
421
422 *self = Self::from_primitive_allow_unknown(prim);
423 Ok(())
424 }
425 }
426
427 impl fidl::encoding::ValueTypeMarker for ClearCountryRequest {
428 type Borrowed<'a> = &'a Self;
429 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
430 value
431 }
432 }
433
434 unsafe impl fidl::encoding::TypeMarker for ClearCountryRequest {
435 type Owned = Self;
436
437 #[inline(always)]
438 fn inline_align(_context: fidl::encoding::Context) -> usize {
439 2
440 }
441
442 #[inline(always)]
443 fn inline_size(_context: fidl::encoding::Context) -> usize {
444 2
445 }
446 #[inline(always)]
447 fn encode_is_copy() -> bool {
448 true
449 }
450
451 #[inline(always)]
452 fn decode_is_copy() -> bool {
453 true
454 }
455 }
456
457 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClearCountryRequest, D>
458 for &ClearCountryRequest
459 {
460 #[inline]
461 unsafe fn encode(
462 self,
463 encoder: &mut fidl::encoding::Encoder<'_, D>,
464 offset: usize,
465 _depth: fidl::encoding::Depth,
466 ) -> fidl::Result<()> {
467 encoder.debug_check_bounds::<ClearCountryRequest>(offset);
468 unsafe {
469 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
471 (buf_ptr as *mut ClearCountryRequest)
472 .write_unaligned((self as *const ClearCountryRequest).read());
473 }
476 Ok(())
477 }
478 }
479 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
480 fidl::encoding::Encode<ClearCountryRequest, D> for (T0,)
481 {
482 #[inline]
483 unsafe fn encode(
484 self,
485 encoder: &mut fidl::encoding::Encoder<'_, D>,
486 offset: usize,
487 depth: fidl::encoding::Depth,
488 ) -> fidl::Result<()> {
489 encoder.debug_check_bounds::<ClearCountryRequest>(offset);
490 self.0.encode(encoder, offset + 0, depth)?;
494 Ok(())
495 }
496 }
497
498 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClearCountryRequest {
499 #[inline(always)]
500 fn new_empty() -> Self {
501 Self { phy_id: fidl::new_empty!(u16, D) }
502 }
503
504 #[inline]
505 unsafe fn decode(
506 &mut self,
507 decoder: &mut fidl::encoding::Decoder<'_, D>,
508 offset: usize,
509 _depth: fidl::encoding::Depth,
510 ) -> fidl::Result<()> {
511 decoder.debug_check_bounds::<Self>(offset);
512 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
513 unsafe {
516 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
517 }
518 Ok(())
519 }
520 }
521
522 impl fidl::encoding::ValueTypeMarker for DestroyIfaceRequest {
523 type Borrowed<'a> = &'a Self;
524 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
525 value
526 }
527 }
528
529 unsafe impl fidl::encoding::TypeMarker for DestroyIfaceRequest {
530 type Owned = Self;
531
532 #[inline(always)]
533 fn inline_align(_context: fidl::encoding::Context) -> usize {
534 2
535 }
536
537 #[inline(always)]
538 fn inline_size(_context: fidl::encoding::Context) -> usize {
539 2
540 }
541 #[inline(always)]
542 fn encode_is_copy() -> bool {
543 true
544 }
545
546 #[inline(always)]
547 fn decode_is_copy() -> bool {
548 true
549 }
550 }
551
552 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyIfaceRequest, D>
553 for &DestroyIfaceRequest
554 {
555 #[inline]
556 unsafe fn encode(
557 self,
558 encoder: &mut fidl::encoding::Encoder<'_, D>,
559 offset: usize,
560 _depth: fidl::encoding::Depth,
561 ) -> fidl::Result<()> {
562 encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
563 unsafe {
564 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
566 (buf_ptr as *mut DestroyIfaceRequest)
567 .write_unaligned((self as *const DestroyIfaceRequest).read());
568 }
571 Ok(())
572 }
573 }
574 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
575 fidl::encoding::Encode<DestroyIfaceRequest, D> for (T0,)
576 {
577 #[inline]
578 unsafe fn encode(
579 self,
580 encoder: &mut fidl::encoding::Encoder<'_, D>,
581 offset: usize,
582 depth: fidl::encoding::Depth,
583 ) -> fidl::Result<()> {
584 encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
585 self.0.encode(encoder, offset + 0, depth)?;
589 Ok(())
590 }
591 }
592
593 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyIfaceRequest {
594 #[inline(always)]
595 fn new_empty() -> Self {
596 Self { iface_id: fidl::new_empty!(u16, D) }
597 }
598
599 #[inline]
600 unsafe fn decode(
601 &mut self,
602 decoder: &mut fidl::encoding::Decoder<'_, D>,
603 offset: usize,
604 _depth: fidl::encoding::Depth,
605 ) -> fidl::Result<()> {
606 decoder.debug_check_bounds::<Self>(offset);
607 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
608 unsafe {
611 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
612 }
613 Ok(())
614 }
615 }
616
617 impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryRequest {
618 type Borrowed<'a> = &'a Self;
619 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
620 value
621 }
622 }
623
624 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryRequest {
625 type Owned = Self;
626
627 #[inline(always)]
628 fn inline_align(_context: fidl::encoding::Context) -> usize {
629 2
630 }
631
632 #[inline(always)]
633 fn inline_size(_context: fidl::encoding::Context) -> usize {
634 2
635 }
636 #[inline(always)]
637 fn encode_is_copy() -> bool {
638 true
639 }
640
641 #[inline(always)]
642 fn decode_is_copy() -> bool {
643 true
644 }
645 }
646
647 unsafe impl<D: fidl::encoding::ResourceDialect>
648 fidl::encoding::Encode<DeviceMonitorClearCountryRequest, D>
649 for &DeviceMonitorClearCountryRequest
650 {
651 #[inline]
652 unsafe fn encode(
653 self,
654 encoder: &mut fidl::encoding::Encoder<'_, D>,
655 offset: usize,
656 _depth: fidl::encoding::Depth,
657 ) -> fidl::Result<()> {
658 encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
659 unsafe {
660 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
662 (buf_ptr as *mut DeviceMonitorClearCountryRequest)
663 .write_unaligned((self as *const DeviceMonitorClearCountryRequest).read());
664 }
667 Ok(())
668 }
669 }
670 unsafe impl<
671 D: fidl::encoding::ResourceDialect,
672 T0: fidl::encoding::Encode<ClearCountryRequest, D>,
673 > fidl::encoding::Encode<DeviceMonitorClearCountryRequest, D> for (T0,)
674 {
675 #[inline]
676 unsafe fn encode(
677 self,
678 encoder: &mut fidl::encoding::Encoder<'_, D>,
679 offset: usize,
680 depth: fidl::encoding::Depth,
681 ) -> fidl::Result<()> {
682 encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
683 self.0.encode(encoder, offset + 0, depth)?;
687 Ok(())
688 }
689 }
690
691 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
692 for DeviceMonitorClearCountryRequest
693 {
694 #[inline(always)]
695 fn new_empty() -> Self {
696 Self { req: fidl::new_empty!(ClearCountryRequest, D) }
697 }
698
699 #[inline]
700 unsafe fn decode(
701 &mut self,
702 decoder: &mut fidl::encoding::Decoder<'_, D>,
703 offset: usize,
704 _depth: fidl::encoding::Depth,
705 ) -> fidl::Result<()> {
706 decoder.debug_check_bounds::<Self>(offset);
707 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
708 unsafe {
711 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
712 }
713 Ok(())
714 }
715 }
716
717 impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryResponse {
718 type Borrowed<'a> = &'a Self;
719 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
720 value
721 }
722 }
723
724 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryResponse {
725 type Owned = Self;
726
727 #[inline(always)]
728 fn inline_align(_context: fidl::encoding::Context) -> usize {
729 4
730 }
731
732 #[inline(always)]
733 fn inline_size(_context: fidl::encoding::Context) -> usize {
734 4
735 }
736 #[inline(always)]
737 fn encode_is_copy() -> bool {
738 true
739 }
740
741 #[inline(always)]
742 fn decode_is_copy() -> bool {
743 true
744 }
745 }
746
747 unsafe impl<D: fidl::encoding::ResourceDialect>
748 fidl::encoding::Encode<DeviceMonitorClearCountryResponse, D>
749 for &DeviceMonitorClearCountryResponse
750 {
751 #[inline]
752 unsafe fn encode(
753 self,
754 encoder: &mut fidl::encoding::Encoder<'_, D>,
755 offset: usize,
756 _depth: fidl::encoding::Depth,
757 ) -> fidl::Result<()> {
758 encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
759 unsafe {
760 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
762 (buf_ptr as *mut DeviceMonitorClearCountryResponse)
763 .write_unaligned((self as *const DeviceMonitorClearCountryResponse).read());
764 }
767 Ok(())
768 }
769 }
770 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
771 fidl::encoding::Encode<DeviceMonitorClearCountryResponse, D> for (T0,)
772 {
773 #[inline]
774 unsafe fn encode(
775 self,
776 encoder: &mut fidl::encoding::Encoder<'_, D>,
777 offset: usize,
778 depth: fidl::encoding::Depth,
779 ) -> fidl::Result<()> {
780 encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
781 self.0.encode(encoder, offset + 0, depth)?;
785 Ok(())
786 }
787 }
788
789 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
790 for DeviceMonitorClearCountryResponse
791 {
792 #[inline(always)]
793 fn new_empty() -> Self {
794 Self { status: fidl::new_empty!(i32, D) }
795 }
796
797 #[inline]
798 unsafe fn decode(
799 &mut self,
800 decoder: &mut fidl::encoding::Decoder<'_, D>,
801 offset: usize,
802 _depth: fidl::encoding::Depth,
803 ) -> fidl::Result<()> {
804 decoder.debug_check_bounds::<Self>(offset);
805 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
806 unsafe {
809 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
810 }
811 Ok(())
812 }
813 }
814
815 impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceRequest {
816 type Borrowed<'a> = &'a Self;
817 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
818 value
819 }
820 }
821
822 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceRequest {
823 type Owned = Self;
824
825 #[inline(always)]
826 fn inline_align(_context: fidl::encoding::Context) -> usize {
827 2
828 }
829
830 #[inline(always)]
831 fn inline_size(_context: fidl::encoding::Context) -> usize {
832 2
833 }
834 #[inline(always)]
835 fn encode_is_copy() -> bool {
836 true
837 }
838
839 #[inline(always)]
840 fn decode_is_copy() -> bool {
841 true
842 }
843 }
844
845 unsafe impl<D: fidl::encoding::ResourceDialect>
846 fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest, D>
847 for &DeviceMonitorDestroyIfaceRequest
848 {
849 #[inline]
850 unsafe fn encode(
851 self,
852 encoder: &mut fidl::encoding::Encoder<'_, D>,
853 offset: usize,
854 _depth: fidl::encoding::Depth,
855 ) -> fidl::Result<()> {
856 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
857 unsafe {
858 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
860 (buf_ptr as *mut DeviceMonitorDestroyIfaceRequest)
861 .write_unaligned((self as *const DeviceMonitorDestroyIfaceRequest).read());
862 }
865 Ok(())
866 }
867 }
868 unsafe impl<
869 D: fidl::encoding::ResourceDialect,
870 T0: fidl::encoding::Encode<DestroyIfaceRequest, D>,
871 > fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest, D> for (T0,)
872 {
873 #[inline]
874 unsafe fn encode(
875 self,
876 encoder: &mut fidl::encoding::Encoder<'_, D>,
877 offset: usize,
878 depth: fidl::encoding::Depth,
879 ) -> fidl::Result<()> {
880 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
881 self.0.encode(encoder, offset + 0, depth)?;
885 Ok(())
886 }
887 }
888
889 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
890 for DeviceMonitorDestroyIfaceRequest
891 {
892 #[inline(always)]
893 fn new_empty() -> Self {
894 Self { req: fidl::new_empty!(DestroyIfaceRequest, D) }
895 }
896
897 #[inline]
898 unsafe fn decode(
899 &mut self,
900 decoder: &mut fidl::encoding::Decoder<'_, D>,
901 offset: usize,
902 _depth: fidl::encoding::Depth,
903 ) -> fidl::Result<()> {
904 decoder.debug_check_bounds::<Self>(offset);
905 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
906 unsafe {
909 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
910 }
911 Ok(())
912 }
913 }
914
915 impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceResponse {
916 type Borrowed<'a> = &'a Self;
917 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
918 value
919 }
920 }
921
922 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceResponse {
923 type Owned = Self;
924
925 #[inline(always)]
926 fn inline_align(_context: fidl::encoding::Context) -> usize {
927 4
928 }
929
930 #[inline(always)]
931 fn inline_size(_context: fidl::encoding::Context) -> usize {
932 4
933 }
934 #[inline(always)]
935 fn encode_is_copy() -> bool {
936 true
937 }
938
939 #[inline(always)]
940 fn decode_is_copy() -> bool {
941 true
942 }
943 }
944
945 unsafe impl<D: fidl::encoding::ResourceDialect>
946 fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, D>
947 for &DeviceMonitorDestroyIfaceResponse
948 {
949 #[inline]
950 unsafe fn encode(
951 self,
952 encoder: &mut fidl::encoding::Encoder<'_, D>,
953 offset: usize,
954 _depth: fidl::encoding::Depth,
955 ) -> fidl::Result<()> {
956 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
957 unsafe {
958 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
960 (buf_ptr as *mut DeviceMonitorDestroyIfaceResponse)
961 .write_unaligned((self as *const DeviceMonitorDestroyIfaceResponse).read());
962 }
965 Ok(())
966 }
967 }
968 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
969 fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, D> for (T0,)
970 {
971 #[inline]
972 unsafe fn encode(
973 self,
974 encoder: &mut fidl::encoding::Encoder<'_, D>,
975 offset: usize,
976 depth: fidl::encoding::Depth,
977 ) -> fidl::Result<()> {
978 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
979 self.0.encode(encoder, offset + 0, depth)?;
983 Ok(())
984 }
985 }
986
987 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
988 for DeviceMonitorDestroyIfaceResponse
989 {
990 #[inline(always)]
991 fn new_empty() -> Self {
992 Self { status: fidl::new_empty!(i32, D) }
993 }
994
995 #[inline]
996 unsafe fn decode(
997 &mut self,
998 decoder: &mut fidl::encoding::Decoder<'_, D>,
999 offset: usize,
1000 _depth: fidl::encoding::Depth,
1001 ) -> fidl::Result<()> {
1002 decoder.debug_check_bounds::<Self>(offset);
1003 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1004 unsafe {
1007 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1008 }
1009 Ok(())
1010 }
1011 }
1012
1013 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryRequest {
1014 type Borrowed<'a> = &'a Self;
1015 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1016 value
1017 }
1018 }
1019
1020 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryRequest {
1021 type Owned = Self;
1022
1023 #[inline(always)]
1024 fn inline_align(_context: fidl::encoding::Context) -> usize {
1025 2
1026 }
1027
1028 #[inline(always)]
1029 fn inline_size(_context: fidl::encoding::Context) -> usize {
1030 2
1031 }
1032 #[inline(always)]
1033 fn encode_is_copy() -> bool {
1034 true
1035 }
1036
1037 #[inline(always)]
1038 fn decode_is_copy() -> bool {
1039 true
1040 }
1041 }
1042
1043 unsafe impl<D: fidl::encoding::ResourceDialect>
1044 fidl::encoding::Encode<DeviceMonitorGetCountryRequest, D>
1045 for &DeviceMonitorGetCountryRequest
1046 {
1047 #[inline]
1048 unsafe fn encode(
1049 self,
1050 encoder: &mut fidl::encoding::Encoder<'_, D>,
1051 offset: usize,
1052 _depth: fidl::encoding::Depth,
1053 ) -> fidl::Result<()> {
1054 encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
1055 unsafe {
1056 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1058 (buf_ptr as *mut DeviceMonitorGetCountryRequest)
1059 .write_unaligned((self as *const DeviceMonitorGetCountryRequest).read());
1060 }
1063 Ok(())
1064 }
1065 }
1066 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1067 fidl::encoding::Encode<DeviceMonitorGetCountryRequest, D> for (T0,)
1068 {
1069 #[inline]
1070 unsafe fn encode(
1071 self,
1072 encoder: &mut fidl::encoding::Encoder<'_, D>,
1073 offset: usize,
1074 depth: fidl::encoding::Depth,
1075 ) -> fidl::Result<()> {
1076 encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
1077 self.0.encode(encoder, offset + 0, depth)?;
1081 Ok(())
1082 }
1083 }
1084
1085 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1086 for DeviceMonitorGetCountryRequest
1087 {
1088 #[inline(always)]
1089 fn new_empty() -> Self {
1090 Self { phy_id: fidl::new_empty!(u16, D) }
1091 }
1092
1093 #[inline]
1094 unsafe fn decode(
1095 &mut self,
1096 decoder: &mut fidl::encoding::Decoder<'_, D>,
1097 offset: usize,
1098 _depth: fidl::encoding::Depth,
1099 ) -> fidl::Result<()> {
1100 decoder.debug_check_bounds::<Self>(offset);
1101 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1102 unsafe {
1105 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1106 }
1107 Ok(())
1108 }
1109 }
1110
1111 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathRequest {
1112 type Borrowed<'a> = &'a Self;
1113 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1114 value
1115 }
1116 }
1117
1118 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathRequest {
1119 type Owned = Self;
1120
1121 #[inline(always)]
1122 fn inline_align(_context: fidl::encoding::Context) -> usize {
1123 2
1124 }
1125
1126 #[inline(always)]
1127 fn inline_size(_context: fidl::encoding::Context) -> usize {
1128 2
1129 }
1130 #[inline(always)]
1131 fn encode_is_copy() -> bool {
1132 true
1133 }
1134
1135 #[inline(always)]
1136 fn decode_is_copy() -> bool {
1137 true
1138 }
1139 }
1140
1141 unsafe impl<D: fidl::encoding::ResourceDialect>
1142 fidl::encoding::Encode<DeviceMonitorGetDevPathRequest, D>
1143 for &DeviceMonitorGetDevPathRequest
1144 {
1145 #[inline]
1146 unsafe fn encode(
1147 self,
1148 encoder: &mut fidl::encoding::Encoder<'_, D>,
1149 offset: usize,
1150 _depth: fidl::encoding::Depth,
1151 ) -> fidl::Result<()> {
1152 encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
1153 unsafe {
1154 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1156 (buf_ptr as *mut DeviceMonitorGetDevPathRequest)
1157 .write_unaligned((self as *const DeviceMonitorGetDevPathRequest).read());
1158 }
1161 Ok(())
1162 }
1163 }
1164 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1165 fidl::encoding::Encode<DeviceMonitorGetDevPathRequest, D> for (T0,)
1166 {
1167 #[inline]
1168 unsafe fn encode(
1169 self,
1170 encoder: &mut fidl::encoding::Encoder<'_, D>,
1171 offset: usize,
1172 depth: fidl::encoding::Depth,
1173 ) -> fidl::Result<()> {
1174 encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
1175 self.0.encode(encoder, offset + 0, depth)?;
1179 Ok(())
1180 }
1181 }
1182
1183 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1184 for DeviceMonitorGetDevPathRequest
1185 {
1186 #[inline(always)]
1187 fn new_empty() -> Self {
1188 Self { phy_id: fidl::new_empty!(u16, D) }
1189 }
1190
1191 #[inline]
1192 unsafe fn decode(
1193 &mut self,
1194 decoder: &mut fidl::encoding::Decoder<'_, D>,
1195 offset: usize,
1196 _depth: fidl::encoding::Depth,
1197 ) -> fidl::Result<()> {
1198 decoder.debug_check_bounds::<Self>(offset);
1199 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1200 unsafe {
1203 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1204 }
1205 Ok(())
1206 }
1207 }
1208
1209 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathResponse {
1210 type Borrowed<'a> = &'a Self;
1211 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1212 value
1213 }
1214 }
1215
1216 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathResponse {
1217 type Owned = Self;
1218
1219 #[inline(always)]
1220 fn inline_align(_context: fidl::encoding::Context) -> usize {
1221 8
1222 }
1223
1224 #[inline(always)]
1225 fn inline_size(_context: fidl::encoding::Context) -> usize {
1226 16
1227 }
1228 }
1229
1230 unsafe impl<D: fidl::encoding::ResourceDialect>
1231 fidl::encoding::Encode<DeviceMonitorGetDevPathResponse, D>
1232 for &DeviceMonitorGetDevPathResponse
1233 {
1234 #[inline]
1235 unsafe fn encode(
1236 self,
1237 encoder: &mut fidl::encoding::Encoder<'_, D>,
1238 offset: usize,
1239 _depth: fidl::encoding::Depth,
1240 ) -> fidl::Result<()> {
1241 encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
1242 fidl::encoding::Encode::<DeviceMonitorGetDevPathResponse, D>::encode(
1244 (
1245 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.dev_path),
1246 ),
1247 encoder, offset, _depth
1248 )
1249 }
1250 }
1251 unsafe impl<
1252 D: fidl::encoding::ResourceDialect,
1253 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
1254 > fidl::encoding::Encode<DeviceMonitorGetDevPathResponse, D> for (T0,)
1255 {
1256 #[inline]
1257 unsafe fn encode(
1258 self,
1259 encoder: &mut fidl::encoding::Encoder<'_, D>,
1260 offset: usize,
1261 depth: fidl::encoding::Depth,
1262 ) -> fidl::Result<()> {
1263 encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
1264 self.0.encode(encoder, offset + 0, depth)?;
1268 Ok(())
1269 }
1270 }
1271
1272 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1273 for DeviceMonitorGetDevPathResponse
1274 {
1275 #[inline(always)]
1276 fn new_empty() -> Self {
1277 Self {
1278 dev_path: fidl::new_empty!(
1279 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1280 D
1281 ),
1282 }
1283 }
1284
1285 #[inline]
1286 unsafe fn decode(
1287 &mut self,
1288 decoder: &mut fidl::encoding::Decoder<'_, D>,
1289 offset: usize,
1290 _depth: fidl::encoding::Depth,
1291 ) -> fidl::Result<()> {
1292 decoder.debug_check_bounds::<Self>(offset);
1293 fidl::decode!(
1295 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1296 D,
1297 &mut self.dev_path,
1298 decoder,
1299 offset + 0,
1300 _depth
1301 )?;
1302 Ok(())
1303 }
1304 }
1305
1306 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeRequest {
1307 type Borrowed<'a> = &'a Self;
1308 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1309 value
1310 }
1311 }
1312
1313 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeRequest {
1314 type Owned = Self;
1315
1316 #[inline(always)]
1317 fn inline_align(_context: fidl::encoding::Context) -> usize {
1318 2
1319 }
1320
1321 #[inline(always)]
1322 fn inline_size(_context: fidl::encoding::Context) -> usize {
1323 2
1324 }
1325 #[inline(always)]
1326 fn encode_is_copy() -> bool {
1327 true
1328 }
1329
1330 #[inline(always)]
1331 fn decode_is_copy() -> bool {
1332 true
1333 }
1334 }
1335
1336 unsafe impl<D: fidl::encoding::ResourceDialect>
1337 fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest, D>
1338 for &DeviceMonitorGetPowerSaveModeRequest
1339 {
1340 #[inline]
1341 unsafe fn encode(
1342 self,
1343 encoder: &mut fidl::encoding::Encoder<'_, D>,
1344 offset: usize,
1345 _depth: fidl::encoding::Depth,
1346 ) -> fidl::Result<()> {
1347 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
1348 unsafe {
1349 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1351 (buf_ptr as *mut DeviceMonitorGetPowerSaveModeRequest)
1352 .write_unaligned((self as *const DeviceMonitorGetPowerSaveModeRequest).read());
1353 }
1356 Ok(())
1357 }
1358 }
1359 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1360 fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest, D> for (T0,)
1361 {
1362 #[inline]
1363 unsafe fn encode(
1364 self,
1365 encoder: &mut fidl::encoding::Encoder<'_, D>,
1366 offset: usize,
1367 depth: fidl::encoding::Depth,
1368 ) -> fidl::Result<()> {
1369 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
1370 self.0.encode(encoder, offset + 0, depth)?;
1374 Ok(())
1375 }
1376 }
1377
1378 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1379 for DeviceMonitorGetPowerSaveModeRequest
1380 {
1381 #[inline(always)]
1382 fn new_empty() -> Self {
1383 Self { phy_id: fidl::new_empty!(u16, D) }
1384 }
1385
1386 #[inline]
1387 unsafe fn decode(
1388 &mut self,
1389 decoder: &mut fidl::encoding::Decoder<'_, D>,
1390 offset: usize,
1391 _depth: fidl::encoding::Depth,
1392 ) -> fidl::Result<()> {
1393 decoder.debug_check_bounds::<Self>(offset);
1394 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1395 unsafe {
1398 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1399 }
1400 Ok(())
1401 }
1402 }
1403
1404 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
1405 type Borrowed<'a> = &'a Self;
1406 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1407 value
1408 }
1409 }
1410
1411 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
1412 type Owned = Self;
1413
1414 #[inline(always)]
1415 fn inline_align(_context: fidl::encoding::Context) -> usize {
1416 2
1417 }
1418
1419 #[inline(always)]
1420 fn inline_size(_context: fidl::encoding::Context) -> usize {
1421 2
1422 }
1423 #[inline(always)]
1424 fn encode_is_copy() -> bool {
1425 true
1426 }
1427
1428 #[inline(always)]
1429 fn decode_is_copy() -> bool {
1430 true
1431 }
1432 }
1433
1434 unsafe impl<D: fidl::encoding::ResourceDialect>
1435 fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest, D>
1436 for &DeviceMonitorGetSupportedMacRolesRequest
1437 {
1438 #[inline]
1439 unsafe fn encode(
1440 self,
1441 encoder: &mut fidl::encoding::Encoder<'_, D>,
1442 offset: usize,
1443 _depth: fidl::encoding::Depth,
1444 ) -> fidl::Result<()> {
1445 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
1446 unsafe {
1447 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1449 (buf_ptr as *mut DeviceMonitorGetSupportedMacRolesRequest).write_unaligned(
1450 (self as *const DeviceMonitorGetSupportedMacRolesRequest).read(),
1451 );
1452 }
1455 Ok(())
1456 }
1457 }
1458 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1459 fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest, D> for (T0,)
1460 {
1461 #[inline]
1462 unsafe fn encode(
1463 self,
1464 encoder: &mut fidl::encoding::Encoder<'_, D>,
1465 offset: usize,
1466 depth: fidl::encoding::Depth,
1467 ) -> fidl::Result<()> {
1468 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
1469 self.0.encode(encoder, offset + 0, depth)?;
1473 Ok(())
1474 }
1475 }
1476
1477 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1478 for DeviceMonitorGetSupportedMacRolesRequest
1479 {
1480 #[inline(always)]
1481 fn new_empty() -> Self {
1482 Self { phy_id: fidl::new_empty!(u16, D) }
1483 }
1484
1485 #[inline]
1486 unsafe fn decode(
1487 &mut self,
1488 decoder: &mut fidl::encoding::Decoder<'_, D>,
1489 offset: usize,
1490 _depth: fidl::encoding::Depth,
1491 ) -> fidl::Result<()> {
1492 decoder.debug_check_bounds::<Self>(offset);
1493 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1494 unsafe {
1497 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1498 }
1499 Ok(())
1500 }
1501 }
1502
1503 impl fidl::encoding::ValueTypeMarker for DeviceMonitorListIfacesResponse {
1504 type Borrowed<'a> = &'a Self;
1505 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1506 value
1507 }
1508 }
1509
1510 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListIfacesResponse {
1511 type Owned = Self;
1512
1513 #[inline(always)]
1514 fn inline_align(_context: fidl::encoding::Context) -> usize {
1515 8
1516 }
1517
1518 #[inline(always)]
1519 fn inline_size(_context: fidl::encoding::Context) -> usize {
1520 16
1521 }
1522 }
1523
1524 unsafe impl<D: fidl::encoding::ResourceDialect>
1525 fidl::encoding::Encode<DeviceMonitorListIfacesResponse, D>
1526 for &DeviceMonitorListIfacesResponse
1527 {
1528 #[inline]
1529 unsafe fn encode(
1530 self,
1531 encoder: &mut fidl::encoding::Encoder<'_, D>,
1532 offset: usize,
1533 _depth: fidl::encoding::Depth,
1534 ) -> fidl::Result<()> {
1535 encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
1536 fidl::encoding::Encode::<DeviceMonitorListIfacesResponse, D>::encode(
1538 (
1539 <fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_list),
1540 ),
1541 encoder, offset, _depth
1542 )
1543 }
1544 }
1545 unsafe impl<
1546 D: fidl::encoding::ResourceDialect,
1547 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
1548 > fidl::encoding::Encode<DeviceMonitorListIfacesResponse, D> for (T0,)
1549 {
1550 #[inline]
1551 unsafe fn encode(
1552 self,
1553 encoder: &mut fidl::encoding::Encoder<'_, D>,
1554 offset: usize,
1555 depth: fidl::encoding::Depth,
1556 ) -> fidl::Result<()> {
1557 encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
1558 self.0.encode(encoder, offset + 0, depth)?;
1562 Ok(())
1563 }
1564 }
1565
1566 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1567 for DeviceMonitorListIfacesResponse
1568 {
1569 #[inline(always)]
1570 fn new_empty() -> Self {
1571 Self { iface_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, D) }
1572 }
1573
1574 #[inline]
1575 unsafe fn decode(
1576 &mut self,
1577 decoder: &mut fidl::encoding::Decoder<'_, D>,
1578 offset: usize,
1579 _depth: fidl::encoding::Depth,
1580 ) -> fidl::Result<()> {
1581 decoder.debug_check_bounds::<Self>(offset);
1582 fidl::decode!(
1584 fidl::encoding::UnboundedVector<u16>,
1585 D,
1586 &mut self.iface_list,
1587 decoder,
1588 offset + 0,
1589 _depth
1590 )?;
1591 Ok(())
1592 }
1593 }
1594
1595 impl fidl::encoding::ValueTypeMarker for DeviceMonitorListPhysResponse {
1596 type Borrowed<'a> = &'a Self;
1597 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1598 value
1599 }
1600 }
1601
1602 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListPhysResponse {
1603 type Owned = Self;
1604
1605 #[inline(always)]
1606 fn inline_align(_context: fidl::encoding::Context) -> usize {
1607 8
1608 }
1609
1610 #[inline(always)]
1611 fn inline_size(_context: fidl::encoding::Context) -> usize {
1612 16
1613 }
1614 }
1615
1616 unsafe impl<D: fidl::encoding::ResourceDialect>
1617 fidl::encoding::Encode<DeviceMonitorListPhysResponse, D>
1618 for &DeviceMonitorListPhysResponse
1619 {
1620 #[inline]
1621 unsafe fn encode(
1622 self,
1623 encoder: &mut fidl::encoding::Encoder<'_, D>,
1624 offset: usize,
1625 _depth: fidl::encoding::Depth,
1626 ) -> fidl::Result<()> {
1627 encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
1628 fidl::encoding::Encode::<DeviceMonitorListPhysResponse, D>::encode(
1630 (
1631 <fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_list),
1632 ),
1633 encoder, offset, _depth
1634 )
1635 }
1636 }
1637 unsafe impl<
1638 D: fidl::encoding::ResourceDialect,
1639 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
1640 > fidl::encoding::Encode<DeviceMonitorListPhysResponse, D> for (T0,)
1641 {
1642 #[inline]
1643 unsafe fn encode(
1644 self,
1645 encoder: &mut fidl::encoding::Encoder<'_, D>,
1646 offset: usize,
1647 depth: fidl::encoding::Depth,
1648 ) -> fidl::Result<()> {
1649 encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
1650 self.0.encode(encoder, offset + 0, depth)?;
1654 Ok(())
1655 }
1656 }
1657
1658 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1659 for DeviceMonitorListPhysResponse
1660 {
1661 #[inline(always)]
1662 fn new_empty() -> Self {
1663 Self { phy_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, D) }
1664 }
1665
1666 #[inline]
1667 unsafe fn decode(
1668 &mut self,
1669 decoder: &mut fidl::encoding::Decoder<'_, D>,
1670 offset: usize,
1671 _depth: fidl::encoding::Depth,
1672 ) -> fidl::Result<()> {
1673 decoder.debug_check_bounds::<Self>(offset);
1674 fidl::decode!(
1676 fidl::encoding::UnboundedVector<u16>,
1677 D,
1678 &mut self.phy_list,
1679 decoder,
1680 offset + 0,
1681 _depth
1682 )?;
1683 Ok(())
1684 }
1685 }
1686
1687 impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceRequest {
1688 type Borrowed<'a> = &'a Self;
1689 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1690 value
1691 }
1692 }
1693
1694 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceRequest {
1695 type Owned = Self;
1696
1697 #[inline(always)]
1698 fn inline_align(_context: fidl::encoding::Context) -> usize {
1699 2
1700 }
1701
1702 #[inline(always)]
1703 fn inline_size(_context: fidl::encoding::Context) -> usize {
1704 2
1705 }
1706 #[inline(always)]
1707 fn encode_is_copy() -> bool {
1708 true
1709 }
1710
1711 #[inline(always)]
1712 fn decode_is_copy() -> bool {
1713 true
1714 }
1715 }
1716
1717 unsafe impl<D: fidl::encoding::ResourceDialect>
1718 fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest, D>
1719 for &DeviceMonitorQueryIfaceRequest
1720 {
1721 #[inline]
1722 unsafe fn encode(
1723 self,
1724 encoder: &mut fidl::encoding::Encoder<'_, D>,
1725 offset: usize,
1726 _depth: fidl::encoding::Depth,
1727 ) -> fidl::Result<()> {
1728 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
1729 unsafe {
1730 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1732 (buf_ptr as *mut DeviceMonitorQueryIfaceRequest)
1733 .write_unaligned((self as *const DeviceMonitorQueryIfaceRequest).read());
1734 }
1737 Ok(())
1738 }
1739 }
1740 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1741 fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest, D> for (T0,)
1742 {
1743 #[inline]
1744 unsafe fn encode(
1745 self,
1746 encoder: &mut fidl::encoding::Encoder<'_, D>,
1747 offset: usize,
1748 depth: fidl::encoding::Depth,
1749 ) -> fidl::Result<()> {
1750 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
1751 self.0.encode(encoder, offset + 0, depth)?;
1755 Ok(())
1756 }
1757 }
1758
1759 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1760 for DeviceMonitorQueryIfaceRequest
1761 {
1762 #[inline(always)]
1763 fn new_empty() -> Self {
1764 Self { iface_id: fidl::new_empty!(u16, D) }
1765 }
1766
1767 #[inline]
1768 unsafe fn decode(
1769 &mut self,
1770 decoder: &mut fidl::encoding::Decoder<'_, D>,
1771 offset: usize,
1772 _depth: fidl::encoding::Depth,
1773 ) -> fidl::Result<()> {
1774 decoder.debug_check_bounds::<Self>(offset);
1775 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1776 unsafe {
1779 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1780 }
1781 Ok(())
1782 }
1783 }
1784
1785 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryRequest {
1786 type Borrowed<'a> = &'a Self;
1787 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1788 value
1789 }
1790 }
1791
1792 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryRequest {
1793 type Owned = Self;
1794
1795 #[inline(always)]
1796 fn inline_align(_context: fidl::encoding::Context) -> usize {
1797 2
1798 }
1799
1800 #[inline(always)]
1801 fn inline_size(_context: fidl::encoding::Context) -> usize {
1802 4
1803 }
1804 #[inline(always)]
1805 fn encode_is_copy() -> bool {
1806 true
1807 }
1808
1809 #[inline(always)]
1810 fn decode_is_copy() -> bool {
1811 true
1812 }
1813 }
1814
1815 unsafe impl<D: fidl::encoding::ResourceDialect>
1816 fidl::encoding::Encode<DeviceMonitorSetCountryRequest, D>
1817 for &DeviceMonitorSetCountryRequest
1818 {
1819 #[inline]
1820 unsafe fn encode(
1821 self,
1822 encoder: &mut fidl::encoding::Encoder<'_, D>,
1823 offset: usize,
1824 _depth: fidl::encoding::Depth,
1825 ) -> fidl::Result<()> {
1826 encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
1827 unsafe {
1828 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1830 (buf_ptr as *mut DeviceMonitorSetCountryRequest)
1831 .write_unaligned((self as *const DeviceMonitorSetCountryRequest).read());
1832 }
1835 Ok(())
1836 }
1837 }
1838 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetCountryRequest, D>>
1839 fidl::encoding::Encode<DeviceMonitorSetCountryRequest, D> for (T0,)
1840 {
1841 #[inline]
1842 unsafe fn encode(
1843 self,
1844 encoder: &mut fidl::encoding::Encoder<'_, D>,
1845 offset: usize,
1846 depth: fidl::encoding::Depth,
1847 ) -> fidl::Result<()> {
1848 encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
1849 self.0.encode(encoder, offset + 0, depth)?;
1853 Ok(())
1854 }
1855 }
1856
1857 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1858 for DeviceMonitorSetCountryRequest
1859 {
1860 #[inline(always)]
1861 fn new_empty() -> Self {
1862 Self { req: fidl::new_empty!(SetCountryRequest, D) }
1863 }
1864
1865 #[inline]
1866 unsafe fn decode(
1867 &mut self,
1868 decoder: &mut fidl::encoding::Decoder<'_, D>,
1869 offset: usize,
1870 _depth: fidl::encoding::Depth,
1871 ) -> fidl::Result<()> {
1872 decoder.debug_check_bounds::<Self>(offset);
1873 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1874 unsafe {
1877 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1878 }
1879 Ok(())
1880 }
1881 }
1882
1883 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryResponse {
1884 type Borrowed<'a> = &'a Self;
1885 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1886 value
1887 }
1888 }
1889
1890 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryResponse {
1891 type Owned = Self;
1892
1893 #[inline(always)]
1894 fn inline_align(_context: fidl::encoding::Context) -> usize {
1895 4
1896 }
1897
1898 #[inline(always)]
1899 fn inline_size(_context: fidl::encoding::Context) -> usize {
1900 4
1901 }
1902 #[inline(always)]
1903 fn encode_is_copy() -> bool {
1904 true
1905 }
1906
1907 #[inline(always)]
1908 fn decode_is_copy() -> bool {
1909 true
1910 }
1911 }
1912
1913 unsafe impl<D: fidl::encoding::ResourceDialect>
1914 fidl::encoding::Encode<DeviceMonitorSetCountryResponse, D>
1915 for &DeviceMonitorSetCountryResponse
1916 {
1917 #[inline]
1918 unsafe fn encode(
1919 self,
1920 encoder: &mut fidl::encoding::Encoder<'_, D>,
1921 offset: usize,
1922 _depth: fidl::encoding::Depth,
1923 ) -> fidl::Result<()> {
1924 encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
1925 unsafe {
1926 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1928 (buf_ptr as *mut DeviceMonitorSetCountryResponse)
1929 .write_unaligned((self as *const DeviceMonitorSetCountryResponse).read());
1930 }
1933 Ok(())
1934 }
1935 }
1936 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1937 fidl::encoding::Encode<DeviceMonitorSetCountryResponse, D> for (T0,)
1938 {
1939 #[inline]
1940 unsafe fn encode(
1941 self,
1942 encoder: &mut fidl::encoding::Encoder<'_, D>,
1943 offset: usize,
1944 depth: fidl::encoding::Depth,
1945 ) -> fidl::Result<()> {
1946 encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
1947 self.0.encode(encoder, offset + 0, depth)?;
1951 Ok(())
1952 }
1953 }
1954
1955 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1956 for DeviceMonitorSetCountryResponse
1957 {
1958 #[inline(always)]
1959 fn new_empty() -> Self {
1960 Self { status: fidl::new_empty!(i32, D) }
1961 }
1962
1963 #[inline]
1964 unsafe fn decode(
1965 &mut self,
1966 decoder: &mut fidl::encoding::Decoder<'_, D>,
1967 offset: usize,
1968 _depth: fidl::encoding::Depth,
1969 ) -> fidl::Result<()> {
1970 decoder.debug_check_bounds::<Self>(offset);
1971 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1972 unsafe {
1975 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1976 }
1977 Ok(())
1978 }
1979 }
1980
1981 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeRequest {
1982 type Borrowed<'a> = &'a Self;
1983 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1984 value
1985 }
1986 }
1987
1988 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeRequest {
1989 type Owned = Self;
1990
1991 #[inline(always)]
1992 fn inline_align(_context: fidl::encoding::Context) -> usize {
1993 4
1994 }
1995
1996 #[inline(always)]
1997 fn inline_size(_context: fidl::encoding::Context) -> usize {
1998 8
1999 }
2000 }
2001
2002 unsafe impl<D: fidl::encoding::ResourceDialect>
2003 fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, D>
2004 for &DeviceMonitorSetPowerSaveModeRequest
2005 {
2006 #[inline]
2007 unsafe fn encode(
2008 self,
2009 encoder: &mut fidl::encoding::Encoder<'_, D>,
2010 offset: usize,
2011 _depth: fidl::encoding::Depth,
2012 ) -> fidl::Result<()> {
2013 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
2014 fidl::encoding::Encode::<DeviceMonitorSetPowerSaveModeRequest, D>::encode(
2016 (<SetPowerSaveModeRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
2017 encoder,
2018 offset,
2019 _depth,
2020 )
2021 }
2022 }
2023 unsafe impl<
2024 D: fidl::encoding::ResourceDialect,
2025 T0: fidl::encoding::Encode<SetPowerSaveModeRequest, D>,
2026 > fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, D> for (T0,)
2027 {
2028 #[inline]
2029 unsafe fn encode(
2030 self,
2031 encoder: &mut fidl::encoding::Encoder<'_, D>,
2032 offset: usize,
2033 depth: fidl::encoding::Depth,
2034 ) -> fidl::Result<()> {
2035 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
2036 self.0.encode(encoder, offset + 0, depth)?;
2040 Ok(())
2041 }
2042 }
2043
2044 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2045 for DeviceMonitorSetPowerSaveModeRequest
2046 {
2047 #[inline(always)]
2048 fn new_empty() -> Self {
2049 Self { req: fidl::new_empty!(SetPowerSaveModeRequest, D) }
2050 }
2051
2052 #[inline]
2053 unsafe fn decode(
2054 &mut self,
2055 decoder: &mut fidl::encoding::Decoder<'_, D>,
2056 offset: usize,
2057 _depth: fidl::encoding::Depth,
2058 ) -> fidl::Result<()> {
2059 decoder.debug_check_bounds::<Self>(offset);
2060 fidl::decode!(SetPowerSaveModeRequest, D, &mut self.req, decoder, offset + 0, _depth)?;
2062 Ok(())
2063 }
2064 }
2065
2066 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeResponse {
2067 type Borrowed<'a> = &'a Self;
2068 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2069 value
2070 }
2071 }
2072
2073 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeResponse {
2074 type Owned = Self;
2075
2076 #[inline(always)]
2077 fn inline_align(_context: fidl::encoding::Context) -> usize {
2078 4
2079 }
2080
2081 #[inline(always)]
2082 fn inline_size(_context: fidl::encoding::Context) -> usize {
2083 4
2084 }
2085 #[inline(always)]
2086 fn encode_is_copy() -> bool {
2087 true
2088 }
2089
2090 #[inline(always)]
2091 fn decode_is_copy() -> bool {
2092 true
2093 }
2094 }
2095
2096 unsafe impl<D: fidl::encoding::ResourceDialect>
2097 fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, D>
2098 for &DeviceMonitorSetPowerSaveModeResponse
2099 {
2100 #[inline]
2101 unsafe fn encode(
2102 self,
2103 encoder: &mut fidl::encoding::Encoder<'_, D>,
2104 offset: usize,
2105 _depth: fidl::encoding::Depth,
2106 ) -> fidl::Result<()> {
2107 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
2108 unsafe {
2109 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2111 (buf_ptr as *mut DeviceMonitorSetPowerSaveModeResponse)
2112 .write_unaligned((self as *const DeviceMonitorSetPowerSaveModeResponse).read());
2113 }
2116 Ok(())
2117 }
2118 }
2119 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2120 fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, D> for (T0,)
2121 {
2122 #[inline]
2123 unsafe fn encode(
2124 self,
2125 encoder: &mut fidl::encoding::Encoder<'_, D>,
2126 offset: usize,
2127 depth: fidl::encoding::Depth,
2128 ) -> fidl::Result<()> {
2129 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
2130 self.0.encode(encoder, offset + 0, depth)?;
2134 Ok(())
2135 }
2136 }
2137
2138 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2139 for DeviceMonitorSetPowerSaveModeResponse
2140 {
2141 #[inline(always)]
2142 fn new_empty() -> Self {
2143 Self { status: fidl::new_empty!(i32, D) }
2144 }
2145
2146 #[inline]
2147 unsafe fn decode(
2148 &mut self,
2149 decoder: &mut fidl::encoding::Decoder<'_, D>,
2150 offset: usize,
2151 _depth: fidl::encoding::Depth,
2152 ) -> fidl::Result<()> {
2153 decoder.debug_check_bounds::<Self>(offset);
2154 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2155 unsafe {
2158 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2159 }
2160 Ok(())
2161 }
2162 }
2163
2164 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryResponse {
2165 type Borrowed<'a> = &'a Self;
2166 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2167 value
2168 }
2169 }
2170
2171 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryResponse {
2172 type Owned = Self;
2173
2174 #[inline(always)]
2175 fn inline_align(_context: fidl::encoding::Context) -> usize {
2176 1
2177 }
2178
2179 #[inline(always)]
2180 fn inline_size(_context: fidl::encoding::Context) -> usize {
2181 2
2182 }
2183 #[inline(always)]
2184 fn encode_is_copy() -> bool {
2185 true
2186 }
2187
2188 #[inline(always)]
2189 fn decode_is_copy() -> bool {
2190 true
2191 }
2192 }
2193
2194 unsafe impl<D: fidl::encoding::ResourceDialect>
2195 fidl::encoding::Encode<DeviceMonitorGetCountryResponse, D>
2196 for &DeviceMonitorGetCountryResponse
2197 {
2198 #[inline]
2199 unsafe fn encode(
2200 self,
2201 encoder: &mut fidl::encoding::Encoder<'_, D>,
2202 offset: usize,
2203 _depth: fidl::encoding::Depth,
2204 ) -> fidl::Result<()> {
2205 encoder.debug_check_bounds::<DeviceMonitorGetCountryResponse>(offset);
2206 unsafe {
2207 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2209 (buf_ptr as *mut DeviceMonitorGetCountryResponse)
2210 .write_unaligned((self as *const DeviceMonitorGetCountryResponse).read());
2211 }
2214 Ok(())
2215 }
2216 }
2217 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GetCountryResponse, D>>
2218 fidl::encoding::Encode<DeviceMonitorGetCountryResponse, D> for (T0,)
2219 {
2220 #[inline]
2221 unsafe fn encode(
2222 self,
2223 encoder: &mut fidl::encoding::Encoder<'_, D>,
2224 offset: usize,
2225 depth: fidl::encoding::Depth,
2226 ) -> fidl::Result<()> {
2227 encoder.debug_check_bounds::<DeviceMonitorGetCountryResponse>(offset);
2228 self.0.encode(encoder, offset + 0, depth)?;
2232 Ok(())
2233 }
2234 }
2235
2236 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2237 for DeviceMonitorGetCountryResponse
2238 {
2239 #[inline(always)]
2240 fn new_empty() -> Self {
2241 Self { resp: fidl::new_empty!(GetCountryResponse, D) }
2242 }
2243
2244 #[inline]
2245 unsafe fn decode(
2246 &mut self,
2247 decoder: &mut fidl::encoding::Decoder<'_, D>,
2248 offset: usize,
2249 _depth: fidl::encoding::Depth,
2250 ) -> fidl::Result<()> {
2251 decoder.debug_check_bounds::<Self>(offset);
2252 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2253 unsafe {
2256 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2257 }
2258 Ok(())
2259 }
2260 }
2261
2262 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeResponse {
2263 type Borrowed<'a> = &'a Self;
2264 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2265 value
2266 }
2267 }
2268
2269 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeResponse {
2270 type Owned = Self;
2271
2272 #[inline(always)]
2273 fn inline_align(_context: fidl::encoding::Context) -> usize {
2274 4
2275 }
2276
2277 #[inline(always)]
2278 fn inline_size(_context: fidl::encoding::Context) -> usize {
2279 4
2280 }
2281 }
2282
2283 unsafe impl<D: fidl::encoding::ResourceDialect>
2284 fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, D>
2285 for &DeviceMonitorGetPowerSaveModeResponse
2286 {
2287 #[inline]
2288 unsafe fn encode(
2289 self,
2290 encoder: &mut fidl::encoding::Encoder<'_, D>,
2291 offset: usize,
2292 _depth: fidl::encoding::Depth,
2293 ) -> fidl::Result<()> {
2294 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
2295 fidl::encoding::Encode::<DeviceMonitorGetPowerSaveModeResponse, D>::encode(
2297 (<GetPowerSaveModeResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
2298 encoder,
2299 offset,
2300 _depth,
2301 )
2302 }
2303 }
2304 unsafe impl<
2305 D: fidl::encoding::ResourceDialect,
2306 T0: fidl::encoding::Encode<GetPowerSaveModeResponse, D>,
2307 > fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, D> for (T0,)
2308 {
2309 #[inline]
2310 unsafe fn encode(
2311 self,
2312 encoder: &mut fidl::encoding::Encoder<'_, D>,
2313 offset: usize,
2314 depth: fidl::encoding::Depth,
2315 ) -> fidl::Result<()> {
2316 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
2317 self.0.encode(encoder, offset + 0, depth)?;
2321 Ok(())
2322 }
2323 }
2324
2325 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2326 for DeviceMonitorGetPowerSaveModeResponse
2327 {
2328 #[inline(always)]
2329 fn new_empty() -> Self {
2330 Self { resp: fidl::new_empty!(GetPowerSaveModeResponse, D) }
2331 }
2332
2333 #[inline]
2334 unsafe fn decode(
2335 &mut self,
2336 decoder: &mut fidl::encoding::Decoder<'_, D>,
2337 offset: usize,
2338 _depth: fidl::encoding::Depth,
2339 ) -> fidl::Result<()> {
2340 decoder.debug_check_bounds::<Self>(offset);
2341 fidl::decode!(
2343 GetPowerSaveModeResponse,
2344 D,
2345 &mut self.resp,
2346 decoder,
2347 offset + 0,
2348 _depth
2349 )?;
2350 Ok(())
2351 }
2352 }
2353
2354 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
2355 type Borrowed<'a> = &'a Self;
2356 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2357 value
2358 }
2359 }
2360
2361 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
2362 type Owned = Self;
2363
2364 #[inline(always)]
2365 fn inline_align(_context: fidl::encoding::Context) -> usize {
2366 8
2367 }
2368
2369 #[inline(always)]
2370 fn inline_size(_context: fidl::encoding::Context) -> usize {
2371 16
2372 }
2373 }
2374
2375 unsafe impl<D: fidl::encoding::ResourceDialect>
2376 fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse, D>
2377 for &DeviceMonitorGetSupportedMacRolesResponse
2378 {
2379 #[inline]
2380 unsafe fn encode(
2381 self,
2382 encoder: &mut fidl::encoding::Encoder<'_, D>,
2383 offset: usize,
2384 _depth: fidl::encoding::Depth,
2385 ) -> fidl::Result<()> {
2386 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
2387 fidl::encoding::Encode::<DeviceMonitorGetSupportedMacRolesResponse, D>::encode(
2389 (
2390 <fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_mac_roles),
2391 ),
2392 encoder, offset, _depth
2393 )
2394 }
2395 }
2396 unsafe impl<
2397 D: fidl::encoding::ResourceDialect,
2398 T0: fidl::encoding::Encode<
2399 fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>,
2400 D,
2401 >,
2402 > fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse, D> for (T0,)
2403 {
2404 #[inline]
2405 unsafe fn encode(
2406 self,
2407 encoder: &mut fidl::encoding::Encoder<'_, D>,
2408 offset: usize,
2409 depth: fidl::encoding::Depth,
2410 ) -> fidl::Result<()> {
2411 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
2412 self.0.encode(encoder, offset + 0, depth)?;
2416 Ok(())
2417 }
2418 }
2419
2420 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2421 for DeviceMonitorGetSupportedMacRolesResponse
2422 {
2423 #[inline(always)]
2424 fn new_empty() -> Self {
2425 Self {
2426 supported_mac_roles: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>, D),
2427 }
2428 }
2429
2430 #[inline]
2431 unsafe fn decode(
2432 &mut self,
2433 decoder: &mut fidl::encoding::Decoder<'_, D>,
2434 offset: usize,
2435 _depth: fidl::encoding::Depth,
2436 ) -> fidl::Result<()> {
2437 decoder.debug_check_bounds::<Self>(offset);
2438 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>, D, &mut self.supported_mac_roles, decoder, offset + 0, _depth)?;
2440 Ok(())
2441 }
2442 }
2443
2444 impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceResponse {
2445 type Borrowed<'a> = &'a Self;
2446 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2447 value
2448 }
2449 }
2450
2451 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceResponse {
2452 type Owned = Self;
2453
2454 #[inline(always)]
2455 fn inline_align(_context: fidl::encoding::Context) -> usize {
2456 4
2457 }
2458
2459 #[inline(always)]
2460 fn inline_size(_context: fidl::encoding::Context) -> usize {
2461 16
2462 }
2463 }
2464
2465 unsafe impl<D: fidl::encoding::ResourceDialect>
2466 fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, D>
2467 for &DeviceMonitorQueryIfaceResponse
2468 {
2469 #[inline]
2470 unsafe fn encode(
2471 self,
2472 encoder: &mut fidl::encoding::Encoder<'_, D>,
2473 offset: usize,
2474 _depth: fidl::encoding::Depth,
2475 ) -> fidl::Result<()> {
2476 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
2477 fidl::encoding::Encode::<DeviceMonitorQueryIfaceResponse, D>::encode(
2479 (<QueryIfaceResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
2480 encoder,
2481 offset,
2482 _depth,
2483 )
2484 }
2485 }
2486 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<QueryIfaceResponse, D>>
2487 fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, D> for (T0,)
2488 {
2489 #[inline]
2490 unsafe fn encode(
2491 self,
2492 encoder: &mut fidl::encoding::Encoder<'_, D>,
2493 offset: usize,
2494 depth: fidl::encoding::Depth,
2495 ) -> fidl::Result<()> {
2496 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
2497 self.0.encode(encoder, offset + 0, depth)?;
2501 Ok(())
2502 }
2503 }
2504
2505 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2506 for DeviceMonitorQueryIfaceResponse
2507 {
2508 #[inline(always)]
2509 fn new_empty() -> Self {
2510 Self { resp: fidl::new_empty!(QueryIfaceResponse, D) }
2511 }
2512
2513 #[inline]
2514 unsafe fn decode(
2515 &mut self,
2516 decoder: &mut fidl::encoding::Decoder<'_, D>,
2517 offset: usize,
2518 _depth: fidl::encoding::Depth,
2519 ) -> fidl::Result<()> {
2520 decoder.debug_check_bounds::<Self>(offset);
2521 fidl::decode!(QueryIfaceResponse, D, &mut self.resp, decoder, offset + 0, _depth)?;
2523 Ok(())
2524 }
2525 }
2526
2527 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceAddedRequest {
2528 type Borrowed<'a> = &'a Self;
2529 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2530 value
2531 }
2532 }
2533
2534 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceAddedRequest {
2535 type Owned = Self;
2536
2537 #[inline(always)]
2538 fn inline_align(_context: fidl::encoding::Context) -> usize {
2539 2
2540 }
2541
2542 #[inline(always)]
2543 fn inline_size(_context: fidl::encoding::Context) -> usize {
2544 2
2545 }
2546 #[inline(always)]
2547 fn encode_is_copy() -> bool {
2548 true
2549 }
2550
2551 #[inline(always)]
2552 fn decode_is_copy() -> bool {
2553 true
2554 }
2555 }
2556
2557 unsafe impl<D: fidl::encoding::ResourceDialect>
2558 fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest, D>
2559 for &DeviceWatcherOnIfaceAddedRequest
2560 {
2561 #[inline]
2562 unsafe fn encode(
2563 self,
2564 encoder: &mut fidl::encoding::Encoder<'_, D>,
2565 offset: usize,
2566 _depth: fidl::encoding::Depth,
2567 ) -> fidl::Result<()> {
2568 encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
2569 unsafe {
2570 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2572 (buf_ptr as *mut DeviceWatcherOnIfaceAddedRequest)
2573 .write_unaligned((self as *const DeviceWatcherOnIfaceAddedRequest).read());
2574 }
2577 Ok(())
2578 }
2579 }
2580 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2581 fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest, D> for (T0,)
2582 {
2583 #[inline]
2584 unsafe fn encode(
2585 self,
2586 encoder: &mut fidl::encoding::Encoder<'_, D>,
2587 offset: usize,
2588 depth: fidl::encoding::Depth,
2589 ) -> fidl::Result<()> {
2590 encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
2591 self.0.encode(encoder, offset + 0, depth)?;
2595 Ok(())
2596 }
2597 }
2598
2599 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2600 for DeviceWatcherOnIfaceAddedRequest
2601 {
2602 #[inline(always)]
2603 fn new_empty() -> Self {
2604 Self { iface_id: fidl::new_empty!(u16, D) }
2605 }
2606
2607 #[inline]
2608 unsafe fn decode(
2609 &mut self,
2610 decoder: &mut fidl::encoding::Decoder<'_, D>,
2611 offset: usize,
2612 _depth: fidl::encoding::Depth,
2613 ) -> fidl::Result<()> {
2614 decoder.debug_check_bounds::<Self>(offset);
2615 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2616 unsafe {
2619 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2620 }
2621 Ok(())
2622 }
2623 }
2624
2625 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceRemovedRequest {
2626 type Borrowed<'a> = &'a Self;
2627 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2628 value
2629 }
2630 }
2631
2632 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceRemovedRequest {
2633 type Owned = Self;
2634
2635 #[inline(always)]
2636 fn inline_align(_context: fidl::encoding::Context) -> usize {
2637 2
2638 }
2639
2640 #[inline(always)]
2641 fn inline_size(_context: fidl::encoding::Context) -> usize {
2642 2
2643 }
2644 #[inline(always)]
2645 fn encode_is_copy() -> bool {
2646 true
2647 }
2648
2649 #[inline(always)]
2650 fn decode_is_copy() -> bool {
2651 true
2652 }
2653 }
2654
2655 unsafe impl<D: fidl::encoding::ResourceDialect>
2656 fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest, D>
2657 for &DeviceWatcherOnIfaceRemovedRequest
2658 {
2659 #[inline]
2660 unsafe fn encode(
2661 self,
2662 encoder: &mut fidl::encoding::Encoder<'_, D>,
2663 offset: usize,
2664 _depth: fidl::encoding::Depth,
2665 ) -> fidl::Result<()> {
2666 encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
2667 unsafe {
2668 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2670 (buf_ptr as *mut DeviceWatcherOnIfaceRemovedRequest)
2671 .write_unaligned((self as *const DeviceWatcherOnIfaceRemovedRequest).read());
2672 }
2675 Ok(())
2676 }
2677 }
2678 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2679 fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest, D> for (T0,)
2680 {
2681 #[inline]
2682 unsafe fn encode(
2683 self,
2684 encoder: &mut fidl::encoding::Encoder<'_, D>,
2685 offset: usize,
2686 depth: fidl::encoding::Depth,
2687 ) -> fidl::Result<()> {
2688 encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
2689 self.0.encode(encoder, offset + 0, depth)?;
2693 Ok(())
2694 }
2695 }
2696
2697 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2698 for DeviceWatcherOnIfaceRemovedRequest
2699 {
2700 #[inline(always)]
2701 fn new_empty() -> Self {
2702 Self { iface_id: fidl::new_empty!(u16, D) }
2703 }
2704
2705 #[inline]
2706 unsafe fn decode(
2707 &mut self,
2708 decoder: &mut fidl::encoding::Decoder<'_, D>,
2709 offset: usize,
2710 _depth: fidl::encoding::Depth,
2711 ) -> fidl::Result<()> {
2712 decoder.debug_check_bounds::<Self>(offset);
2713 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2714 unsafe {
2717 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2718 }
2719 Ok(())
2720 }
2721 }
2722
2723 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyAddedRequest {
2724 type Borrowed<'a> = &'a Self;
2725 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2726 value
2727 }
2728 }
2729
2730 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyAddedRequest {
2731 type Owned = Self;
2732
2733 #[inline(always)]
2734 fn inline_align(_context: fidl::encoding::Context) -> usize {
2735 2
2736 }
2737
2738 #[inline(always)]
2739 fn inline_size(_context: fidl::encoding::Context) -> usize {
2740 2
2741 }
2742 #[inline(always)]
2743 fn encode_is_copy() -> bool {
2744 true
2745 }
2746
2747 #[inline(always)]
2748 fn decode_is_copy() -> bool {
2749 true
2750 }
2751 }
2752
2753 unsafe impl<D: fidl::encoding::ResourceDialect>
2754 fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest, D>
2755 for &DeviceWatcherOnPhyAddedRequest
2756 {
2757 #[inline]
2758 unsafe fn encode(
2759 self,
2760 encoder: &mut fidl::encoding::Encoder<'_, D>,
2761 offset: usize,
2762 _depth: fidl::encoding::Depth,
2763 ) -> fidl::Result<()> {
2764 encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
2765 unsafe {
2766 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2768 (buf_ptr as *mut DeviceWatcherOnPhyAddedRequest)
2769 .write_unaligned((self as *const DeviceWatcherOnPhyAddedRequest).read());
2770 }
2773 Ok(())
2774 }
2775 }
2776 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2777 fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest, D> for (T0,)
2778 {
2779 #[inline]
2780 unsafe fn encode(
2781 self,
2782 encoder: &mut fidl::encoding::Encoder<'_, D>,
2783 offset: usize,
2784 depth: fidl::encoding::Depth,
2785 ) -> fidl::Result<()> {
2786 encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
2787 self.0.encode(encoder, offset + 0, depth)?;
2791 Ok(())
2792 }
2793 }
2794
2795 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2796 for DeviceWatcherOnPhyAddedRequest
2797 {
2798 #[inline(always)]
2799 fn new_empty() -> Self {
2800 Self { phy_id: fidl::new_empty!(u16, D) }
2801 }
2802
2803 #[inline]
2804 unsafe fn decode(
2805 &mut self,
2806 decoder: &mut fidl::encoding::Decoder<'_, D>,
2807 offset: usize,
2808 _depth: fidl::encoding::Depth,
2809 ) -> fidl::Result<()> {
2810 decoder.debug_check_bounds::<Self>(offset);
2811 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2812 unsafe {
2815 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2816 }
2817 Ok(())
2818 }
2819 }
2820
2821 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyRemovedRequest {
2822 type Borrowed<'a> = &'a Self;
2823 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2824 value
2825 }
2826 }
2827
2828 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyRemovedRequest {
2829 type Owned = Self;
2830
2831 #[inline(always)]
2832 fn inline_align(_context: fidl::encoding::Context) -> usize {
2833 2
2834 }
2835
2836 #[inline(always)]
2837 fn inline_size(_context: fidl::encoding::Context) -> usize {
2838 2
2839 }
2840 #[inline(always)]
2841 fn encode_is_copy() -> bool {
2842 true
2843 }
2844
2845 #[inline(always)]
2846 fn decode_is_copy() -> bool {
2847 true
2848 }
2849 }
2850
2851 unsafe impl<D: fidl::encoding::ResourceDialect>
2852 fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest, D>
2853 for &DeviceWatcherOnPhyRemovedRequest
2854 {
2855 #[inline]
2856 unsafe fn encode(
2857 self,
2858 encoder: &mut fidl::encoding::Encoder<'_, D>,
2859 offset: usize,
2860 _depth: fidl::encoding::Depth,
2861 ) -> fidl::Result<()> {
2862 encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
2863 unsafe {
2864 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2866 (buf_ptr as *mut DeviceWatcherOnPhyRemovedRequest)
2867 .write_unaligned((self as *const DeviceWatcherOnPhyRemovedRequest).read());
2868 }
2871 Ok(())
2872 }
2873 }
2874 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2875 fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest, D> for (T0,)
2876 {
2877 #[inline]
2878 unsafe fn encode(
2879 self,
2880 encoder: &mut fidl::encoding::Encoder<'_, D>,
2881 offset: usize,
2882 depth: fidl::encoding::Depth,
2883 ) -> fidl::Result<()> {
2884 encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
2885 self.0.encode(encoder, offset + 0, depth)?;
2889 Ok(())
2890 }
2891 }
2892
2893 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2894 for DeviceWatcherOnPhyRemovedRequest
2895 {
2896 #[inline(always)]
2897 fn new_empty() -> Self {
2898 Self { phy_id: fidl::new_empty!(u16, D) }
2899 }
2900
2901 #[inline]
2902 unsafe fn decode(
2903 &mut self,
2904 decoder: &mut fidl::encoding::Decoder<'_, D>,
2905 offset: usize,
2906 _depth: fidl::encoding::Depth,
2907 ) -> fidl::Result<()> {
2908 decoder.debug_check_bounds::<Self>(offset);
2909 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2910 unsafe {
2913 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2914 }
2915 Ok(())
2916 }
2917 }
2918
2919 impl fidl::encoding::ValueTypeMarker for GetCountryResponse {
2920 type Borrowed<'a> = &'a Self;
2921 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2922 value
2923 }
2924 }
2925
2926 unsafe impl fidl::encoding::TypeMarker for GetCountryResponse {
2927 type Owned = Self;
2928
2929 #[inline(always)]
2930 fn inline_align(_context: fidl::encoding::Context) -> usize {
2931 1
2932 }
2933
2934 #[inline(always)]
2935 fn inline_size(_context: fidl::encoding::Context) -> usize {
2936 2
2937 }
2938 #[inline(always)]
2939 fn encode_is_copy() -> bool {
2940 true
2941 }
2942
2943 #[inline(always)]
2944 fn decode_is_copy() -> bool {
2945 true
2946 }
2947 }
2948
2949 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GetCountryResponse, D>
2950 for &GetCountryResponse
2951 {
2952 #[inline]
2953 unsafe fn encode(
2954 self,
2955 encoder: &mut fidl::encoding::Encoder<'_, D>,
2956 offset: usize,
2957 _depth: fidl::encoding::Depth,
2958 ) -> fidl::Result<()> {
2959 encoder.debug_check_bounds::<GetCountryResponse>(offset);
2960 unsafe {
2961 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2963 (buf_ptr as *mut GetCountryResponse)
2964 .write_unaligned((self as *const GetCountryResponse).read());
2965 }
2968 Ok(())
2969 }
2970 }
2971 unsafe impl<
2972 D: fidl::encoding::ResourceDialect,
2973 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
2974 > fidl::encoding::Encode<GetCountryResponse, D> for (T0,)
2975 {
2976 #[inline]
2977 unsafe fn encode(
2978 self,
2979 encoder: &mut fidl::encoding::Encoder<'_, D>,
2980 offset: usize,
2981 depth: fidl::encoding::Depth,
2982 ) -> fidl::Result<()> {
2983 encoder.debug_check_bounds::<GetCountryResponse>(offset);
2984 self.0.encode(encoder, offset + 0, depth)?;
2988 Ok(())
2989 }
2990 }
2991
2992 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetCountryResponse {
2993 #[inline(always)]
2994 fn new_empty() -> Self {
2995 Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
2996 }
2997
2998 #[inline]
2999 unsafe fn decode(
3000 &mut self,
3001 decoder: &mut fidl::encoding::Decoder<'_, D>,
3002 offset: usize,
3003 _depth: fidl::encoding::Depth,
3004 ) -> fidl::Result<()> {
3005 decoder.debug_check_bounds::<Self>(offset);
3006 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3007 unsafe {
3010 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3011 }
3012 Ok(())
3013 }
3014 }
3015
3016 impl fidl::encoding::ValueTypeMarker for GetPowerSaveModeResponse {
3017 type Borrowed<'a> = &'a Self;
3018 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3019 value
3020 }
3021 }
3022
3023 unsafe impl fidl::encoding::TypeMarker for GetPowerSaveModeResponse {
3024 type Owned = Self;
3025
3026 #[inline(always)]
3027 fn inline_align(_context: fidl::encoding::Context) -> usize {
3028 4
3029 }
3030
3031 #[inline(always)]
3032 fn inline_size(_context: fidl::encoding::Context) -> usize {
3033 4
3034 }
3035 }
3036
3037 unsafe impl<D: fidl::encoding::ResourceDialect>
3038 fidl::encoding::Encode<GetPowerSaveModeResponse, D> for &GetPowerSaveModeResponse
3039 {
3040 #[inline]
3041 unsafe fn encode(
3042 self,
3043 encoder: &mut fidl::encoding::Encoder<'_, D>,
3044 offset: usize,
3045 _depth: fidl::encoding::Depth,
3046 ) -> fidl::Result<()> {
3047 encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
3048 fidl::encoding::Encode::<GetPowerSaveModeResponse, D>::encode(
3050 (
3051 <fidl_fuchsia_wlan_common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
3052 ),
3053 encoder, offset, _depth
3054 )
3055 }
3056 }
3057 unsafe impl<
3058 D: fidl::encoding::ResourceDialect,
3059 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::PowerSaveType, D>,
3060 > fidl::encoding::Encode<GetPowerSaveModeResponse, D> for (T0,)
3061 {
3062 #[inline]
3063 unsafe fn encode(
3064 self,
3065 encoder: &mut fidl::encoding::Encoder<'_, D>,
3066 offset: usize,
3067 depth: fidl::encoding::Depth,
3068 ) -> fidl::Result<()> {
3069 encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
3070 self.0.encode(encoder, offset + 0, depth)?;
3074 Ok(())
3075 }
3076 }
3077
3078 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3079 for GetPowerSaveModeResponse
3080 {
3081 #[inline(always)]
3082 fn new_empty() -> Self {
3083 Self { ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common::PowerSaveType, D) }
3084 }
3085
3086 #[inline]
3087 unsafe fn decode(
3088 &mut self,
3089 decoder: &mut fidl::encoding::Decoder<'_, D>,
3090 offset: usize,
3091 _depth: fidl::encoding::Depth,
3092 ) -> fidl::Result<()> {
3093 decoder.debug_check_bounds::<Self>(offset);
3094 fidl::decode!(
3096 fidl_fuchsia_wlan_common::PowerSaveType,
3097 D,
3098 &mut self.ps_mode,
3099 decoder,
3100 offset + 0,
3101 _depth
3102 )?;
3103 Ok(())
3104 }
3105 }
3106
3107 impl fidl::encoding::ValueTypeMarker for QueryIfaceResponse {
3108 type Borrowed<'a> = &'a Self;
3109 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3110 value
3111 }
3112 }
3113
3114 unsafe impl fidl::encoding::TypeMarker for QueryIfaceResponse {
3115 type Owned = Self;
3116
3117 #[inline(always)]
3118 fn inline_align(_context: fidl::encoding::Context) -> usize {
3119 4
3120 }
3121
3122 #[inline(always)]
3123 fn inline_size(_context: fidl::encoding::Context) -> usize {
3124 16
3125 }
3126 }
3127
3128 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QueryIfaceResponse, D>
3129 for &QueryIfaceResponse
3130 {
3131 #[inline]
3132 unsafe fn encode(
3133 self,
3134 encoder: &mut fidl::encoding::Encoder<'_, D>,
3135 offset: usize,
3136 _depth: fidl::encoding::Depth,
3137 ) -> fidl::Result<()> {
3138 encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
3139 fidl::encoding::Encode::<QueryIfaceResponse, D>::encode(
3141 (
3142 <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
3143 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
3144 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
3145 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_assigned_id),
3146 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
3147 ),
3148 encoder, offset, _depth
3149 )
3150 }
3151 }
3152 unsafe impl<
3153 D: fidl::encoding::ResourceDialect,
3154 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanMacRole, D>,
3155 T1: fidl::encoding::Encode<u16, D>,
3156 T2: fidl::encoding::Encode<u16, D>,
3157 T3: fidl::encoding::Encode<u16, D>,
3158 T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
3159 > fidl::encoding::Encode<QueryIfaceResponse, D> for (T0, T1, T2, T3, T4)
3160 {
3161 #[inline]
3162 unsafe fn encode(
3163 self,
3164 encoder: &mut fidl::encoding::Encoder<'_, D>,
3165 offset: usize,
3166 depth: fidl::encoding::Depth,
3167 ) -> fidl::Result<()> {
3168 encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
3169 self.0.encode(encoder, offset + 0, depth)?;
3173 self.1.encode(encoder, offset + 4, depth)?;
3174 self.2.encode(encoder, offset + 6, depth)?;
3175 self.3.encode(encoder, offset + 8, depth)?;
3176 self.4.encode(encoder, offset + 10, depth)?;
3177 Ok(())
3178 }
3179 }
3180
3181 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QueryIfaceResponse {
3182 #[inline(always)]
3183 fn new_empty() -> Self {
3184 Self {
3185 role: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D),
3186 id: fidl::new_empty!(u16, D),
3187 phy_id: fidl::new_empty!(u16, D),
3188 phy_assigned_id: fidl::new_empty!(u16, D),
3189 sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
3190 }
3191 }
3192
3193 #[inline]
3194 unsafe fn decode(
3195 &mut self,
3196 decoder: &mut fidl::encoding::Decoder<'_, D>,
3197 offset: usize,
3198 _depth: fidl::encoding::Depth,
3199 ) -> fidl::Result<()> {
3200 decoder.debug_check_bounds::<Self>(offset);
3201 fidl::decode!(
3203 fidl_fuchsia_wlan_common::WlanMacRole,
3204 D,
3205 &mut self.role,
3206 decoder,
3207 offset + 0,
3208 _depth
3209 )?;
3210 fidl::decode!(u16, D, &mut self.id, decoder, offset + 4, _depth)?;
3211 fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 6, _depth)?;
3212 fidl::decode!(u16, D, &mut self.phy_assigned_id, decoder, offset + 8, _depth)?;
3213 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 10, _depth)?;
3214 Ok(())
3215 }
3216 }
3217
3218 impl fidl::encoding::ValueTypeMarker for SetCountryRequest {
3219 type Borrowed<'a> = &'a Self;
3220 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3221 value
3222 }
3223 }
3224
3225 unsafe impl fidl::encoding::TypeMarker for SetCountryRequest {
3226 type Owned = Self;
3227
3228 #[inline(always)]
3229 fn inline_align(_context: fidl::encoding::Context) -> usize {
3230 2
3231 }
3232
3233 #[inline(always)]
3234 fn inline_size(_context: fidl::encoding::Context) -> usize {
3235 4
3236 }
3237 #[inline(always)]
3238 fn encode_is_copy() -> bool {
3239 true
3240 }
3241
3242 #[inline(always)]
3243 fn decode_is_copy() -> bool {
3244 true
3245 }
3246 }
3247
3248 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCountryRequest, D>
3249 for &SetCountryRequest
3250 {
3251 #[inline]
3252 unsafe fn encode(
3253 self,
3254 encoder: &mut fidl::encoding::Encoder<'_, D>,
3255 offset: usize,
3256 _depth: fidl::encoding::Depth,
3257 ) -> fidl::Result<()> {
3258 encoder.debug_check_bounds::<SetCountryRequest>(offset);
3259 unsafe {
3260 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3262 (buf_ptr as *mut SetCountryRequest)
3263 .write_unaligned((self as *const SetCountryRequest).read());
3264 }
3267 Ok(())
3268 }
3269 }
3270 unsafe impl<
3271 D: fidl::encoding::ResourceDialect,
3272 T0: fidl::encoding::Encode<u16, D>,
3273 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
3274 > fidl::encoding::Encode<SetCountryRequest, D> for (T0, T1)
3275 {
3276 #[inline]
3277 unsafe fn encode(
3278 self,
3279 encoder: &mut fidl::encoding::Encoder<'_, D>,
3280 offset: usize,
3281 depth: fidl::encoding::Depth,
3282 ) -> fidl::Result<()> {
3283 encoder.debug_check_bounds::<SetCountryRequest>(offset);
3284 self.0.encode(encoder, offset + 0, depth)?;
3288 self.1.encode(encoder, offset + 2, depth)?;
3289 Ok(())
3290 }
3291 }
3292
3293 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCountryRequest {
3294 #[inline(always)]
3295 fn new_empty() -> Self {
3296 Self {
3297 phy_id: fidl::new_empty!(u16, D),
3298 alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D),
3299 }
3300 }
3301
3302 #[inline]
3303 unsafe fn decode(
3304 &mut self,
3305 decoder: &mut fidl::encoding::Decoder<'_, D>,
3306 offset: usize,
3307 _depth: fidl::encoding::Depth,
3308 ) -> fidl::Result<()> {
3309 decoder.debug_check_bounds::<Self>(offset);
3310 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3311 unsafe {
3314 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3315 }
3316 Ok(())
3317 }
3318 }
3319
3320 impl fidl::encoding::ValueTypeMarker for SetPowerSaveModeRequest {
3321 type Borrowed<'a> = &'a Self;
3322 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3323 value
3324 }
3325 }
3326
3327 unsafe impl fidl::encoding::TypeMarker for SetPowerSaveModeRequest {
3328 type Owned = Self;
3329
3330 #[inline(always)]
3331 fn inline_align(_context: fidl::encoding::Context) -> usize {
3332 4
3333 }
3334
3335 #[inline(always)]
3336 fn inline_size(_context: fidl::encoding::Context) -> usize {
3337 8
3338 }
3339 }
3340
3341 unsafe impl<D: fidl::encoding::ResourceDialect>
3342 fidl::encoding::Encode<SetPowerSaveModeRequest, D> for &SetPowerSaveModeRequest
3343 {
3344 #[inline]
3345 unsafe fn encode(
3346 self,
3347 encoder: &mut fidl::encoding::Encoder<'_, D>,
3348 offset: usize,
3349 _depth: fidl::encoding::Depth,
3350 ) -> fidl::Result<()> {
3351 encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
3352 fidl::encoding::Encode::<SetPowerSaveModeRequest, D>::encode(
3354 (
3355 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
3356 <fidl_fuchsia_wlan_common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
3357 ),
3358 encoder, offset, _depth
3359 )
3360 }
3361 }
3362 unsafe impl<
3363 D: fidl::encoding::ResourceDialect,
3364 T0: fidl::encoding::Encode<u16, D>,
3365 T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::PowerSaveType, D>,
3366 > fidl::encoding::Encode<SetPowerSaveModeRequest, D> for (T0, T1)
3367 {
3368 #[inline]
3369 unsafe fn encode(
3370 self,
3371 encoder: &mut fidl::encoding::Encoder<'_, D>,
3372 offset: usize,
3373 depth: fidl::encoding::Depth,
3374 ) -> fidl::Result<()> {
3375 encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
3376 unsafe {
3379 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3380 (ptr as *mut u32).write_unaligned(0);
3381 }
3382 self.0.encode(encoder, offset + 0, depth)?;
3384 self.1.encode(encoder, offset + 4, depth)?;
3385 Ok(())
3386 }
3387 }
3388
3389 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3390 for SetPowerSaveModeRequest
3391 {
3392 #[inline(always)]
3393 fn new_empty() -> Self {
3394 Self {
3395 phy_id: fidl::new_empty!(u16, D),
3396 ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common::PowerSaveType, D),
3397 }
3398 }
3399
3400 #[inline]
3401 unsafe fn decode(
3402 &mut self,
3403 decoder: &mut fidl::encoding::Decoder<'_, D>,
3404 offset: usize,
3405 _depth: fidl::encoding::Depth,
3406 ) -> fidl::Result<()> {
3407 decoder.debug_check_bounds::<Self>(offset);
3408 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3410 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3411 let mask = 0xffff0000u32;
3412 let maskedval = padval & mask;
3413 if maskedval != 0 {
3414 return Err(fidl::Error::NonZeroPadding {
3415 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3416 });
3417 }
3418 fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
3419 fidl::decode!(
3420 fidl_fuchsia_wlan_common::PowerSaveType,
3421 D,
3422 &mut self.ps_mode,
3423 decoder,
3424 offset + 4,
3425 _depth
3426 )?;
3427 Ok(())
3428 }
3429 }
3430
3431 impl DeviceMonitorCreateIfaceRequest {
3432 #[inline(always)]
3433 fn max_ordinal_present(&self) -> u64 {
3434 if let Some(_) = self.sta_address {
3435 return 3;
3436 }
3437 if let Some(_) = self.role {
3438 return 2;
3439 }
3440 if let Some(_) = self.phy_id {
3441 return 1;
3442 }
3443 0
3444 }
3445 }
3446
3447 impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceRequest {
3448 type Borrowed<'a> = &'a Self;
3449 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3450 value
3451 }
3452 }
3453
3454 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceRequest {
3455 type Owned = Self;
3456
3457 #[inline(always)]
3458 fn inline_align(_context: fidl::encoding::Context) -> usize {
3459 8
3460 }
3461
3462 #[inline(always)]
3463 fn inline_size(_context: fidl::encoding::Context) -> usize {
3464 16
3465 }
3466 }
3467
3468 unsafe impl<D: fidl::encoding::ResourceDialect>
3469 fidl::encoding::Encode<DeviceMonitorCreateIfaceRequest, D>
3470 for &DeviceMonitorCreateIfaceRequest
3471 {
3472 unsafe fn encode(
3473 self,
3474 encoder: &mut fidl::encoding::Encoder<'_, D>,
3475 offset: usize,
3476 mut depth: fidl::encoding::Depth,
3477 ) -> fidl::Result<()> {
3478 encoder.debug_check_bounds::<DeviceMonitorCreateIfaceRequest>(offset);
3479 let max_ordinal: u64 = self.max_ordinal_present();
3481 encoder.write_num(max_ordinal, offset);
3482 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3483 if max_ordinal == 0 {
3485 return Ok(());
3486 }
3487 depth.increment()?;
3488 let envelope_size = 8;
3489 let bytes_len = max_ordinal as usize * envelope_size;
3490 #[allow(unused_variables)]
3491 let offset = encoder.out_of_line_offset(bytes_len);
3492 let mut _prev_end_offset: usize = 0;
3493 if 1 > max_ordinal {
3494 return Ok(());
3495 }
3496
3497 let cur_offset: usize = (1 - 1) * envelope_size;
3500
3501 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3503
3504 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3509 self.phy_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3510 encoder,
3511 offset + cur_offset,
3512 depth,
3513 )?;
3514
3515 _prev_end_offset = cur_offset + envelope_size;
3516 if 2 > max_ordinal {
3517 return Ok(());
3518 }
3519
3520 let cur_offset: usize = (2 - 1) * envelope_size;
3523
3524 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3526
3527 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanMacRole, D>(
3532 self.role.as_ref().map(<fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
3533 encoder, offset + cur_offset, depth
3534 )?;
3535
3536 _prev_end_offset = cur_offset + envelope_size;
3537 if 3 > max_ordinal {
3538 return Ok(());
3539 }
3540
3541 let cur_offset: usize = (3 - 1) * envelope_size;
3544
3545 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3547
3548 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3553 self.sta_address
3554 .as_ref()
3555 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3556 encoder,
3557 offset + cur_offset,
3558 depth,
3559 )?;
3560
3561 _prev_end_offset = cur_offset + envelope_size;
3562
3563 Ok(())
3564 }
3565 }
3566
3567 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3568 for DeviceMonitorCreateIfaceRequest
3569 {
3570 #[inline(always)]
3571 fn new_empty() -> Self {
3572 Self::default()
3573 }
3574
3575 unsafe fn decode(
3576 &mut self,
3577 decoder: &mut fidl::encoding::Decoder<'_, D>,
3578 offset: usize,
3579 mut depth: fidl::encoding::Depth,
3580 ) -> fidl::Result<()> {
3581 decoder.debug_check_bounds::<Self>(offset);
3582 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3583 None => return Err(fidl::Error::NotNullable),
3584 Some(len) => len,
3585 };
3586 if len == 0 {
3588 return Ok(());
3589 };
3590 depth.increment()?;
3591 let envelope_size = 8;
3592 let bytes_len = len * envelope_size;
3593 let offset = decoder.out_of_line_offset(bytes_len)?;
3594 let mut _next_ordinal_to_read = 0;
3596 let mut next_offset = offset;
3597 let end_offset = offset + bytes_len;
3598 _next_ordinal_to_read += 1;
3599 if next_offset >= end_offset {
3600 return Ok(());
3601 }
3602
3603 while _next_ordinal_to_read < 1 {
3605 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3606 _next_ordinal_to_read += 1;
3607 next_offset += envelope_size;
3608 }
3609
3610 let next_out_of_line = decoder.next_out_of_line();
3611 let handles_before = decoder.remaining_handles();
3612 if let Some((inlined, num_bytes, num_handles)) =
3613 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3614 {
3615 let member_inline_size =
3616 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3617 if inlined != (member_inline_size <= 4) {
3618 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3619 }
3620 let inner_offset;
3621 let mut inner_depth = depth.clone();
3622 if inlined {
3623 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3624 inner_offset = next_offset;
3625 } else {
3626 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3627 inner_depth.increment()?;
3628 }
3629 let val_ref = self.phy_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
3630 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3631 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3632 {
3633 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3634 }
3635 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3636 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3637 }
3638 }
3639
3640 next_offset += envelope_size;
3641 _next_ordinal_to_read += 1;
3642 if next_offset >= end_offset {
3643 return Ok(());
3644 }
3645
3646 while _next_ordinal_to_read < 2 {
3648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3649 _next_ordinal_to_read += 1;
3650 next_offset += envelope_size;
3651 }
3652
3653 let next_out_of_line = decoder.next_out_of_line();
3654 let handles_before = decoder.remaining_handles();
3655 if let Some((inlined, num_bytes, num_handles)) =
3656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3657 {
3658 let member_inline_size = <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3659 if inlined != (member_inline_size <= 4) {
3660 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3661 }
3662 let inner_offset;
3663 let mut inner_depth = depth.clone();
3664 if inlined {
3665 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3666 inner_offset = next_offset;
3667 } else {
3668 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3669 inner_depth.increment()?;
3670 }
3671 let val_ref = self.role.get_or_insert_with(|| {
3672 fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D)
3673 });
3674 fidl::decode!(
3675 fidl_fuchsia_wlan_common::WlanMacRole,
3676 D,
3677 val_ref,
3678 decoder,
3679 inner_offset,
3680 inner_depth
3681 )?;
3682 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3683 {
3684 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3685 }
3686 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3687 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3688 }
3689 }
3690
3691 next_offset += envelope_size;
3692 _next_ordinal_to_read += 1;
3693 if next_offset >= end_offset {
3694 return Ok(());
3695 }
3696
3697 while _next_ordinal_to_read < 3 {
3699 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3700 _next_ordinal_to_read += 1;
3701 next_offset += envelope_size;
3702 }
3703
3704 let next_out_of_line = decoder.next_out_of_line();
3705 let handles_before = decoder.remaining_handles();
3706 if let Some((inlined, num_bytes, num_handles)) =
3707 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3708 {
3709 let member_inline_size =
3710 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3711 decoder.context,
3712 );
3713 if inlined != (member_inline_size <= 4) {
3714 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3715 }
3716 let inner_offset;
3717 let mut inner_depth = depth.clone();
3718 if inlined {
3719 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3720 inner_offset = next_offset;
3721 } else {
3722 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3723 inner_depth.increment()?;
3724 }
3725 let val_ref = self
3726 .sta_address
3727 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3728 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3729 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3730 {
3731 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3732 }
3733 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3734 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3735 }
3736 }
3737
3738 next_offset += envelope_size;
3739
3740 while next_offset < end_offset {
3742 _next_ordinal_to_read += 1;
3743 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3744 next_offset += envelope_size;
3745 }
3746
3747 Ok(())
3748 }
3749 }
3750
3751 impl DeviceMonitorCreateIfaceResponse {
3752 #[inline(always)]
3753 fn max_ordinal_present(&self) -> u64 {
3754 if let Some(_) = self.iface_id {
3755 return 1;
3756 }
3757 0
3758 }
3759 }
3760
3761 impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceResponse {
3762 type Borrowed<'a> = &'a Self;
3763 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3764 value
3765 }
3766 }
3767
3768 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceResponse {
3769 type Owned = Self;
3770
3771 #[inline(always)]
3772 fn inline_align(_context: fidl::encoding::Context) -> usize {
3773 8
3774 }
3775
3776 #[inline(always)]
3777 fn inline_size(_context: fidl::encoding::Context) -> usize {
3778 16
3779 }
3780 }
3781
3782 unsafe impl<D: fidl::encoding::ResourceDialect>
3783 fidl::encoding::Encode<DeviceMonitorCreateIfaceResponse, D>
3784 for &DeviceMonitorCreateIfaceResponse
3785 {
3786 unsafe fn encode(
3787 self,
3788 encoder: &mut fidl::encoding::Encoder<'_, D>,
3789 offset: usize,
3790 mut depth: fidl::encoding::Depth,
3791 ) -> fidl::Result<()> {
3792 encoder.debug_check_bounds::<DeviceMonitorCreateIfaceResponse>(offset);
3793 let max_ordinal: u64 = self.max_ordinal_present();
3795 encoder.write_num(max_ordinal, offset);
3796 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3797 if max_ordinal == 0 {
3799 return Ok(());
3800 }
3801 depth.increment()?;
3802 let envelope_size = 8;
3803 let bytes_len = max_ordinal as usize * envelope_size;
3804 #[allow(unused_variables)]
3805 let offset = encoder.out_of_line_offset(bytes_len);
3806 let mut _prev_end_offset: usize = 0;
3807 if 1 > max_ordinal {
3808 return Ok(());
3809 }
3810
3811 let cur_offset: usize = (1 - 1) * envelope_size;
3814
3815 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3817
3818 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3823 self.iface_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3824 encoder,
3825 offset + cur_offset,
3826 depth,
3827 )?;
3828
3829 _prev_end_offset = cur_offset + envelope_size;
3830
3831 Ok(())
3832 }
3833 }
3834
3835 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3836 for DeviceMonitorCreateIfaceResponse
3837 {
3838 #[inline(always)]
3839 fn new_empty() -> Self {
3840 Self::default()
3841 }
3842
3843 unsafe fn decode(
3844 &mut self,
3845 decoder: &mut fidl::encoding::Decoder<'_, D>,
3846 offset: usize,
3847 mut depth: fidl::encoding::Depth,
3848 ) -> fidl::Result<()> {
3849 decoder.debug_check_bounds::<Self>(offset);
3850 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3851 None => return Err(fidl::Error::NotNullable),
3852 Some(len) => len,
3853 };
3854 if len == 0 {
3856 return Ok(());
3857 };
3858 depth.increment()?;
3859 let envelope_size = 8;
3860 let bytes_len = len * envelope_size;
3861 let offset = decoder.out_of_line_offset(bytes_len)?;
3862 let mut _next_ordinal_to_read = 0;
3864 let mut next_offset = offset;
3865 let end_offset = offset + bytes_len;
3866 _next_ordinal_to_read += 1;
3867 if next_offset >= end_offset {
3868 return Ok(());
3869 }
3870
3871 while _next_ordinal_to_read < 1 {
3873 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3874 _next_ordinal_to_read += 1;
3875 next_offset += envelope_size;
3876 }
3877
3878 let next_out_of_line = decoder.next_out_of_line();
3879 let handles_before = decoder.remaining_handles();
3880 if let Some((inlined, num_bytes, num_handles)) =
3881 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3882 {
3883 let member_inline_size =
3884 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3885 if inlined != (member_inline_size <= 4) {
3886 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3887 }
3888 let inner_offset;
3889 let mut inner_depth = depth.clone();
3890 if inlined {
3891 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3892 inner_offset = next_offset;
3893 } else {
3894 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3895 inner_depth.increment()?;
3896 }
3897 let val_ref = self.iface_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
3898 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3899 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3900 {
3901 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3902 }
3903 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3904 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3905 }
3906 }
3907
3908 next_offset += envelope_size;
3909
3910 while next_offset < end_offset {
3912 _next_ordinal_to_read += 1;
3913 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3914 next_offset += envelope_size;
3915 }
3916
3917 Ok(())
3918 }
3919 }
3920
3921 impl fidl::encoding::ValueTypeMarker for GetIfaceHistogramStatsResponse {
3922 type Borrowed<'a> = &'a Self;
3923 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3924 value
3925 }
3926 }
3927
3928 unsafe impl fidl::encoding::TypeMarker for GetIfaceHistogramStatsResponse {
3929 type Owned = Self;
3930
3931 #[inline(always)]
3932 fn inline_align(_context: fidl::encoding::Context) -> usize {
3933 8
3934 }
3935
3936 #[inline(always)]
3937 fn inline_size(_context: fidl::encoding::Context) -> usize {
3938 16
3939 }
3940 }
3941
3942 unsafe impl<D: fidl::encoding::ResourceDialect>
3943 fidl::encoding::Encode<GetIfaceHistogramStatsResponse, D>
3944 for &GetIfaceHistogramStatsResponse
3945 {
3946 #[inline]
3947 unsafe fn encode(
3948 self,
3949 encoder: &mut fidl::encoding::Encoder<'_, D>,
3950 offset: usize,
3951 _depth: fidl::encoding::Depth,
3952 ) -> fidl::Result<()> {
3953 encoder.debug_check_bounds::<GetIfaceHistogramStatsResponse>(offset);
3954 encoder.write_num::<u64>(self.ordinal(), offset);
3955 match self {
3956 GetIfaceHistogramStatsResponse::Stats(ref val) => {
3957 fidl::encoding::encode_in_envelope::<fidl_fuchsia_wlan_stats::IfaceHistogramStats, D>(
3958 <fidl_fuchsia_wlan_stats::IfaceHistogramStats as fidl::encoding::ValueTypeMarker>::borrow(val),
3959 encoder, offset + 8, _depth
3960 )
3961 }
3962 GetIfaceHistogramStatsResponse::ErrorStatus(ref val) => {
3963 fidl::encoding::encode_in_envelope::<i32, D>(
3964 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
3965 encoder, offset + 8, _depth
3966 )
3967 }
3968 }
3969 }
3970 }
3971
3972 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3973 for GetIfaceHistogramStatsResponse
3974 {
3975 #[inline(always)]
3976 fn new_empty() -> Self {
3977 Self::Stats(fidl::new_empty!(fidl_fuchsia_wlan_stats::IfaceHistogramStats, D))
3978 }
3979
3980 #[inline]
3981 unsafe fn decode(
3982 &mut self,
3983 decoder: &mut fidl::encoding::Decoder<'_, D>,
3984 offset: usize,
3985 mut depth: fidl::encoding::Depth,
3986 ) -> fidl::Result<()> {
3987 decoder.debug_check_bounds::<Self>(offset);
3988 #[allow(unused_variables)]
3989 let next_out_of_line = decoder.next_out_of_line();
3990 let handles_before = decoder.remaining_handles();
3991 let (ordinal, inlined, num_bytes, num_handles) =
3992 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3993
3994 let member_inline_size = match ordinal {
3995 1 => <fidl_fuchsia_wlan_stats::IfaceHistogramStats as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3996 2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3997 _ => return Err(fidl::Error::UnknownUnionTag),
3998 };
3999
4000 if inlined != (member_inline_size <= 4) {
4001 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4002 }
4003 let _inner_offset;
4004 if inlined {
4005 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4006 _inner_offset = offset + 8;
4007 } else {
4008 depth.increment()?;
4009 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4010 }
4011 match ordinal {
4012 1 => {
4013 #[allow(irrefutable_let_patterns)]
4014 if let GetIfaceHistogramStatsResponse::Stats(_) = self {
4015 } else {
4017 *self = GetIfaceHistogramStatsResponse::Stats(fidl::new_empty!(
4019 fidl_fuchsia_wlan_stats::IfaceHistogramStats,
4020 D
4021 ));
4022 }
4023 #[allow(irrefutable_let_patterns)]
4024 if let GetIfaceHistogramStatsResponse::Stats(ref mut val) = self {
4025 fidl::decode!(
4026 fidl_fuchsia_wlan_stats::IfaceHistogramStats,
4027 D,
4028 val,
4029 decoder,
4030 _inner_offset,
4031 depth
4032 )?;
4033 } else {
4034 unreachable!()
4035 }
4036 }
4037 2 => {
4038 #[allow(irrefutable_let_patterns)]
4039 if let GetIfaceHistogramStatsResponse::ErrorStatus(_) = self {
4040 } else {
4042 *self =
4044 GetIfaceHistogramStatsResponse::ErrorStatus(fidl::new_empty!(i32, D));
4045 }
4046 #[allow(irrefutable_let_patterns)]
4047 if let GetIfaceHistogramStatsResponse::ErrorStatus(ref mut val) = self {
4048 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
4049 } else {
4050 unreachable!()
4051 }
4052 }
4053 ordinal => panic!("unexpected ordinal {:?}", ordinal),
4054 }
4055 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4056 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4057 }
4058 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4059 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4060 }
4061 Ok(())
4062 }
4063 }
4064}