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)]
12#[repr(u8)]
13pub enum CriticalErrorReason {
14 FwCrash = 1,
15}
16
17impl CriticalErrorReason {
18 #[inline]
19 pub fn from_primitive(prim: u8) -> Option<Self> {
20 match prim {
21 1 => Some(Self::FwCrash),
22 _ => None,
23 }
24 }
25
26 #[inline]
27 pub const fn into_primitive(self) -> u8 {
28 self as u8
29 }
30}
31
32#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
33pub enum DeviceMonitorError {
34 Internal,
35 #[doc(hidden)]
36 __SourceBreaking {
37 unknown_ordinal: u32,
38 },
39}
40
41#[macro_export]
43macro_rules! DeviceMonitorErrorUnknown {
44 () => {
45 _
46 };
47}
48
49impl DeviceMonitorError {
50 #[inline]
51 pub fn from_primitive(prim: u32) -> Option<Self> {
52 match prim {
53 1 => Some(Self::Internal),
54 _ => None,
55 }
56 }
57
58 #[inline]
59 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
60 match prim {
61 1 => Self::Internal,
62 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
63 }
64 }
65
66 #[inline]
67 pub fn unknown() -> Self {
68 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
69 }
70
71 #[inline]
72 pub const fn into_primitive(self) -> u32 {
73 match self {
74 Self::Internal => 1,
75 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
76 }
77 }
78
79 #[inline]
80 pub fn is_unknown(&self) -> bool {
81 match self {
82 Self::__SourceBreaking { unknown_ordinal: _ } => true,
83 _ => false,
84 }
85 }
86}
87
88#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
89#[repr(C)]
90pub struct ClearCountryRequest {
91 pub phy_id: u16,
92}
93
94impl fidl::Persistable for ClearCountryRequest {}
95
96#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
97#[repr(C)]
98pub struct DestroyIfaceRequest {
99 pub iface_id: u16,
100}
101
102impl fidl::Persistable for DestroyIfaceRequest {}
103
104#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105#[repr(C)]
106pub struct DeviceMonitorClearCountryRequest {
107 pub req: ClearCountryRequest,
108}
109
110impl fidl::Persistable for DeviceMonitorClearCountryRequest {}
111
112#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
113#[repr(C)]
114pub struct DeviceMonitorClearCountryResponse {
115 pub status: i32,
116}
117
118impl fidl::Persistable for DeviceMonitorClearCountryResponse {}
119
120#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121#[repr(C)]
122pub struct DeviceMonitorDestroyIfaceRequest {
123 pub req: DestroyIfaceRequest,
124}
125
126impl fidl::Persistable for DeviceMonitorDestroyIfaceRequest {}
127
128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
129#[repr(C)]
130pub struct DeviceMonitorDestroyIfaceResponse {
131 pub status: i32,
132}
133
134impl fidl::Persistable for DeviceMonitorDestroyIfaceResponse {}
135
136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137#[repr(C)]
138pub struct DeviceMonitorGetCountryRequest {
139 pub phy_id: u16,
140}
141
142impl fidl::Persistable for DeviceMonitorGetCountryRequest {}
143
144#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145#[repr(C)]
146pub struct DeviceMonitorGetDevPathRequest {
147 pub phy_id: u16,
148}
149
150impl fidl::Persistable for DeviceMonitorGetDevPathRequest {}
151
152#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
153pub struct DeviceMonitorGetDevPathResponse {
154 pub dev_path: Option<String>,
155}
156
157impl fidl::Persistable for DeviceMonitorGetDevPathResponse {}
158
159#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
160#[repr(C)]
161pub struct DeviceMonitorGetPowerSaveModeRequest {
162 pub phy_id: u16,
163}
164
165impl fidl::Persistable for DeviceMonitorGetPowerSaveModeRequest {}
166
167#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168#[repr(C)]
169pub struct DeviceMonitorGetPowerStateRequest {
170 pub phy_id: u16,
171}
172
173impl fidl::Persistable for DeviceMonitorGetPowerStateRequest {}
174
175#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
176#[repr(C)]
177pub struct DeviceMonitorGetSupportedMacRolesRequest {
178 pub phy_id: u16,
179}
180
181impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesRequest {}
182
183#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
184#[repr(C)]
185pub struct DeviceMonitorGetTxPowerScenarioRequest {
186 pub phy_id: u16,
187}
188
189impl fidl::Persistable for DeviceMonitorGetTxPowerScenarioRequest {}
190
191#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
192pub struct DeviceMonitorListIfacesResponse {
193 pub iface_list: Vec<u16>,
194}
195
196impl fidl::Persistable for DeviceMonitorListIfacesResponse {}
197
198#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
199pub struct DeviceMonitorListPhysResponse {
200 pub phy_list: Vec<u16>,
201}
202
203impl fidl::Persistable for DeviceMonitorListPhysResponse {}
204
205#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
206#[repr(C)]
207pub struct DeviceMonitorPowerDownRequest {
208 pub phy_id: u16,
209}
210
211impl fidl::Persistable for DeviceMonitorPowerDownRequest {}
212
213#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
214#[repr(C)]
215pub struct DeviceMonitorPowerUpRequest {
216 pub phy_id: u16,
217}
218
219impl fidl::Persistable for DeviceMonitorPowerUpRequest {}
220
221#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
222#[repr(C)]
223pub struct DeviceMonitorQueryIfaceRequest {
224 pub iface_id: u16,
225}
226
227impl fidl::Persistable for DeviceMonitorQueryIfaceRequest {}
228
229#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
230#[repr(C)]
231pub struct DeviceMonitorResetRequest {
232 pub phy_id: u16,
233}
234
235impl fidl::Persistable for DeviceMonitorResetRequest {}
236
237#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
238#[repr(C)]
239pub struct DeviceMonitorResetTxPowerScenarioRequest {
240 pub phy_id: u16,
241}
242
243impl fidl::Persistable for DeviceMonitorResetTxPowerScenarioRequest {}
244
245#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
246pub struct DeviceMonitorSetBtCoexistenceModeRequest {
247 pub phy_id: u16,
248 pub mode: fidl_fuchsia_wlan_internal__common::BtCoexistenceMode,
249}
250
251impl fidl::Persistable for DeviceMonitorSetBtCoexistenceModeRequest {}
252
253#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
254#[repr(C)]
255pub struct DeviceMonitorSetCountryRequest {
256 pub req: SetCountryRequest,
257}
258
259impl fidl::Persistable for DeviceMonitorSetCountryRequest {}
260
261#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
262#[repr(C)]
263pub struct DeviceMonitorSetCountryResponse {
264 pub status: i32,
265}
266
267impl fidl::Persistable for DeviceMonitorSetCountryResponse {}
268
269#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
270pub struct DeviceMonitorSetPowerSaveModeRequest {
271 pub req: SetPowerSaveModeRequest,
272}
273
274impl fidl::Persistable for DeviceMonitorSetPowerSaveModeRequest {}
275
276#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
277#[repr(C)]
278pub struct DeviceMonitorSetPowerSaveModeResponse {
279 pub status: i32,
280}
281
282impl fidl::Persistable for DeviceMonitorSetPowerSaveModeResponse {}
283
284#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
285pub struct DeviceMonitorSetTxPowerScenarioRequest {
286 pub phy_id: u16,
287 pub scenario: fidl_fuchsia_wlan_internal__common::TxPowerScenario,
288}
289
290impl fidl::Persistable for DeviceMonitorSetTxPowerScenarioRequest {}
291
292#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
293#[repr(C)]
294pub struct DeviceMonitorGetCountryResponse {
295 pub resp: GetCountryResponse,
296}
297
298impl fidl::Persistable for DeviceMonitorGetCountryResponse {}
299
300#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
301pub struct DeviceMonitorGetPowerSaveModeResponse {
302 pub resp: GetPowerSaveModeResponse,
303}
304
305impl fidl::Persistable for DeviceMonitorGetPowerSaveModeResponse {}
306
307#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
308pub struct DeviceMonitorGetPowerStateResponse {
309 pub power_on: bool,
310}
311
312impl fidl::Persistable for DeviceMonitorGetPowerStateResponse {}
313
314#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
315pub struct DeviceMonitorGetSupportedMacRolesResponse {
316 pub supported_mac_roles: Vec<fidl_fuchsia_wlan_common__common::WlanMacRole>,
317}
318
319impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesResponse {}
320
321#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
322pub struct DeviceMonitorGetTxPowerScenarioResponse {
323 pub scenario: fidl_fuchsia_wlan_internal__common::TxPowerScenario,
324}
325
326impl fidl::Persistable for DeviceMonitorGetTxPowerScenarioResponse {}
327
328#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
329pub struct DeviceMonitorQueryIfaceResponse {
330 pub resp: QueryIfaceResponse,
331}
332
333impl fidl::Persistable for DeviceMonitorQueryIfaceResponse {}
334
335#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
336#[repr(C)]
337pub struct DeviceWatcherOnIfaceAddedRequest {
338 pub iface_id: u16,
339}
340
341impl fidl::Persistable for DeviceWatcherOnIfaceAddedRequest {}
342
343#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
344#[repr(C)]
345pub struct DeviceWatcherOnIfaceRemovedRequest {
346 pub iface_id: u16,
347}
348
349impl fidl::Persistable for DeviceWatcherOnIfaceRemovedRequest {}
350
351#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
352#[repr(C)]
353pub struct DeviceWatcherOnPhyAddedRequest {
354 pub phy_id: u16,
355}
356
357impl fidl::Persistable for DeviceWatcherOnPhyAddedRequest {}
358
359#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
360#[repr(C)]
361pub struct DeviceWatcherOnPhyRemovedRequest {
362 pub phy_id: u16,
363}
364
365impl fidl::Persistable for DeviceWatcherOnPhyRemovedRequest {}
366
367#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
368#[repr(C)]
369pub struct GetCountryResponse {
370 pub alpha2: [u8; 2],
371}
372
373impl fidl::Persistable for GetCountryResponse {}
374
375#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
376pub struct GetPowerSaveModeResponse {
377 pub ps_mode: fidl_fuchsia_wlan_common__common::PowerSaveType,
379}
380
381impl fidl::Persistable for GetPowerSaveModeResponse {}
382
383#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
384pub struct PhyEventWatcherOnCriticalErrorRequest {
385 pub phy_id: u16,
386 pub reason_code: CriticalErrorReason,
387}
388
389impl fidl::Persistable for PhyEventWatcherOnCriticalErrorRequest {}
390
391#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
392pub struct QueryIfaceResponse {
393 pub role: fidl_fuchsia_wlan_common__common::WlanMacRole,
395 pub id: u16,
397 pub phy_id: u16,
399 pub phy_assigned_id: u16,
401 pub sta_addr: [u8; 6],
403}
404
405impl fidl::Persistable for QueryIfaceResponse {}
406
407#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
408#[repr(C)]
409pub struct SetCountryRequest {
410 pub phy_id: u16,
411 pub alpha2: [u8; 2],
412}
413
414impl fidl::Persistable for SetCountryRequest {}
415
416#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
417pub struct SetPowerSaveModeRequest {
418 pub phy_id: u16,
420 pub ps_mode: fidl_fuchsia_wlan_common__common::PowerSaveType,
422}
423
424impl fidl::Persistable for SetPowerSaveModeRequest {}
425
426#[derive(Clone, Debug, Default, PartialEq)]
427pub struct DeviceMonitorCreateIfaceRequest {
428 pub phy_id: Option<u16>,
429 pub role: Option<fidl_fuchsia_wlan_common__common::WlanMacRole>,
430 pub sta_address: Option<[u8; 6]>,
431 #[doc(hidden)]
432 pub __source_breaking: fidl::marker::SourceBreaking,
433}
434
435impl fidl::Persistable for DeviceMonitorCreateIfaceRequest {}
436
437#[derive(Clone, Debug, Default, PartialEq)]
438pub struct DeviceMonitorCreateIfaceResponse {
439 pub iface_id: Option<u16>,
440 #[doc(hidden)]
441 pub __source_breaking: fidl::marker::SourceBreaking,
442}
443
444impl fidl::Persistable for DeviceMonitorCreateIfaceResponse {}
445
446#[derive(Clone, Debug, PartialEq)]
447pub enum GetIfaceHistogramStatsResponse {
448 Stats(fidl_fuchsia_wlan_stats__common::IfaceHistogramStats),
449 ErrorStatus(i32),
450}
451
452impl GetIfaceHistogramStatsResponse {
453 #[inline]
454 pub fn ordinal(&self) -> u64 {
455 match *self {
456 Self::Stats(_) => 1,
457 Self::ErrorStatus(_) => 2,
458 }
459 }
460}
461
462impl fidl::Persistable for GetIfaceHistogramStatsResponse {}
463
464pub mod device_monitor_ordinals {
465 pub const LIST_PHYS: u64 = 0x3a08518874196aab;
466 pub const LIST_IFACES: u64 = 0x129e758fb8e0b113;
467 pub const GET_DEV_PATH: u64 = 0x4aa489b57113bccf;
468 pub const GET_SUPPORTED_MAC_ROLES: u64 = 0x172b3d2eabd5a14e;
469 pub const WATCH_DEVICES: u64 = 0x4615941e67e31b8e;
470 pub const WATCH_PHY_EVENTS: u64 = 0x2c5af9d064099745;
471 pub const GET_COUNTRY: u64 = 0x6f1040bd81bde90e;
472 pub const SET_COUNTRY: u64 = 0xdaa7b77a5a6e71b;
473 pub const CLEAR_COUNTRY: u64 = 0x66714d61103120e9;
474 pub const SET_POWER_SAVE_MODE: u64 = 0x62202b4d360533bc;
475 pub const GET_POWER_SAVE_MODE: u64 = 0x14304d406ada8693;
476 pub const POWER_DOWN: u64 = 0x374ad717fe8902e0;
477 pub const POWER_UP: u64 = 0xa2379b639869c17;
478 pub const RESET: u64 = 0x6def240c9f8c6867;
479 pub const SET_TX_POWER_SCENARIO: u64 = 0x7c51443a985934fd;
480 pub const RESET_TX_POWER_SCENARIO: u64 = 0x4790357c9cdddc4a;
481 pub const GET_TX_POWER_SCENARIO: u64 = 0x555fb197f90e9830;
482 pub const GET_POWER_STATE: u64 = 0x58cf95c5bbbe3f;
483 pub const SET_BT_COEXISTENCE_MODE: u64 = 0x97539596c9a79c7;
484 pub const CREATE_IFACE: u64 = 0x1e1d30c24c0ec144;
485 pub const QUERY_IFACE: u64 = 0x1a48c4a2b86259ef;
486 pub const DESTROY_IFACE: u64 = 0x4c77982c1616a3b0;
487 pub const GET_CLIENT_SME: u64 = 0x1b056c379ca98273;
488 pub const GET_AP_SME: u64 = 0x754de680c4318c52;
489 pub const GET_SME_TELEMETRY: u64 = 0x1baf42b003f7452a;
490}
491
492pub mod device_watcher_ordinals {
493 pub const ON_PHY_ADDED: u64 = 0x771c58e0bd059f86;
494 pub const ON_PHY_REMOVED: u64 = 0x4ad72b96ccb7cff6;
495 pub const ON_IFACE_ADDED: u64 = 0x6ee685e4aa1f31d8;
496 pub const ON_IFACE_REMOVED: u64 = 0x3b771b1fce38c291;
497}
498
499pub mod phy_event_watcher_ordinals {
500 pub const ON_CRITICAL_ERROR: u64 = 0x609a325d54f9e6ac;
501}
502
503mod internal {
504 use super::*;
505 unsafe impl fidl::encoding::TypeMarker for CriticalErrorReason {
506 type Owned = Self;
507
508 #[inline(always)]
509 fn inline_align(_context: fidl::encoding::Context) -> usize {
510 std::mem::align_of::<u8>()
511 }
512
513 #[inline(always)]
514 fn inline_size(_context: fidl::encoding::Context) -> usize {
515 std::mem::size_of::<u8>()
516 }
517
518 #[inline(always)]
519 fn encode_is_copy() -> bool {
520 true
521 }
522
523 #[inline(always)]
524 fn decode_is_copy() -> bool {
525 false
526 }
527 }
528
529 impl fidl::encoding::ValueTypeMarker for CriticalErrorReason {
530 type Borrowed<'a> = Self;
531 #[inline(always)]
532 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
533 *value
534 }
535 }
536
537 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
538 for CriticalErrorReason
539 {
540 #[inline]
541 unsafe fn encode(
542 self,
543 encoder: &mut fidl::encoding::Encoder<'_, D>,
544 offset: usize,
545 _depth: fidl::encoding::Depth,
546 ) -> fidl::Result<()> {
547 encoder.debug_check_bounds::<Self>(offset);
548 encoder.write_num(self.into_primitive(), offset);
549 Ok(())
550 }
551 }
552
553 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CriticalErrorReason {
554 #[inline(always)]
555 fn new_empty() -> Self {
556 Self::FwCrash
557 }
558
559 #[inline]
560 unsafe fn decode(
561 &mut self,
562 decoder: &mut fidl::encoding::Decoder<'_, D>,
563 offset: usize,
564 _depth: fidl::encoding::Depth,
565 ) -> fidl::Result<()> {
566 decoder.debug_check_bounds::<Self>(offset);
567 let prim = decoder.read_num::<u8>(offset);
568
569 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
570 Ok(())
571 }
572 }
573 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorError {
574 type Owned = Self;
575
576 #[inline(always)]
577 fn inline_align(_context: fidl::encoding::Context) -> usize {
578 std::mem::align_of::<u32>()
579 }
580
581 #[inline(always)]
582 fn inline_size(_context: fidl::encoding::Context) -> usize {
583 std::mem::size_of::<u32>()
584 }
585
586 #[inline(always)]
587 fn encode_is_copy() -> bool {
588 false
589 }
590
591 #[inline(always)]
592 fn decode_is_copy() -> bool {
593 false
594 }
595 }
596
597 impl fidl::encoding::ValueTypeMarker for DeviceMonitorError {
598 type Borrowed<'a> = Self;
599 #[inline(always)]
600 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
601 *value
602 }
603 }
604
605 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
606 for DeviceMonitorError
607 {
608 #[inline]
609 unsafe fn encode(
610 self,
611 encoder: &mut fidl::encoding::Encoder<'_, D>,
612 offset: usize,
613 _depth: fidl::encoding::Depth,
614 ) -> fidl::Result<()> {
615 encoder.debug_check_bounds::<Self>(offset);
616 encoder.write_num(self.into_primitive(), offset);
617 Ok(())
618 }
619 }
620
621 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceMonitorError {
622 #[inline(always)]
623 fn new_empty() -> Self {
624 Self::unknown()
625 }
626
627 #[inline]
628 unsafe fn decode(
629 &mut self,
630 decoder: &mut fidl::encoding::Decoder<'_, D>,
631 offset: usize,
632 _depth: fidl::encoding::Depth,
633 ) -> fidl::Result<()> {
634 decoder.debug_check_bounds::<Self>(offset);
635 let prim = decoder.read_num::<u32>(offset);
636
637 *self = Self::from_primitive_allow_unknown(prim);
638 Ok(())
639 }
640 }
641
642 impl fidl::encoding::ValueTypeMarker for ClearCountryRequest {
643 type Borrowed<'a> = &'a Self;
644 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
645 value
646 }
647 }
648
649 unsafe impl fidl::encoding::TypeMarker for ClearCountryRequest {
650 type Owned = Self;
651
652 #[inline(always)]
653 fn inline_align(_context: fidl::encoding::Context) -> usize {
654 2
655 }
656
657 #[inline(always)]
658 fn inline_size(_context: fidl::encoding::Context) -> usize {
659 2
660 }
661 #[inline(always)]
662 fn encode_is_copy() -> bool {
663 true
664 }
665
666 #[inline(always)]
667 fn decode_is_copy() -> bool {
668 true
669 }
670 }
671
672 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClearCountryRequest, D>
673 for &ClearCountryRequest
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::<ClearCountryRequest>(offset);
683 unsafe {
684 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
686 (buf_ptr as *mut ClearCountryRequest)
687 .write_unaligned((self as *const ClearCountryRequest).read());
688 }
691 Ok(())
692 }
693 }
694 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
695 fidl::encoding::Encode<ClearCountryRequest, D> for (T0,)
696 {
697 #[inline]
698 unsafe fn encode(
699 self,
700 encoder: &mut fidl::encoding::Encoder<'_, D>,
701 offset: usize,
702 depth: fidl::encoding::Depth,
703 ) -> fidl::Result<()> {
704 encoder.debug_check_bounds::<ClearCountryRequest>(offset);
705 self.0.encode(encoder, offset + 0, depth)?;
709 Ok(())
710 }
711 }
712
713 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClearCountryRequest {
714 #[inline(always)]
715 fn new_empty() -> Self {
716 Self { phy_id: fidl::new_empty!(u16, D) }
717 }
718
719 #[inline]
720 unsafe fn decode(
721 &mut self,
722 decoder: &mut fidl::encoding::Decoder<'_, D>,
723 offset: usize,
724 _depth: fidl::encoding::Depth,
725 ) -> fidl::Result<()> {
726 decoder.debug_check_bounds::<Self>(offset);
727 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
728 unsafe {
731 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
732 }
733 Ok(())
734 }
735 }
736
737 impl fidl::encoding::ValueTypeMarker for DestroyIfaceRequest {
738 type Borrowed<'a> = &'a Self;
739 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
740 value
741 }
742 }
743
744 unsafe impl fidl::encoding::TypeMarker for DestroyIfaceRequest {
745 type Owned = Self;
746
747 #[inline(always)]
748 fn inline_align(_context: fidl::encoding::Context) -> usize {
749 2
750 }
751
752 #[inline(always)]
753 fn inline_size(_context: fidl::encoding::Context) -> usize {
754 2
755 }
756 #[inline(always)]
757 fn encode_is_copy() -> bool {
758 true
759 }
760
761 #[inline(always)]
762 fn decode_is_copy() -> bool {
763 true
764 }
765 }
766
767 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DestroyIfaceRequest, D>
768 for &DestroyIfaceRequest
769 {
770 #[inline]
771 unsafe fn encode(
772 self,
773 encoder: &mut fidl::encoding::Encoder<'_, D>,
774 offset: usize,
775 _depth: fidl::encoding::Depth,
776 ) -> fidl::Result<()> {
777 encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
778 unsafe {
779 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
781 (buf_ptr as *mut DestroyIfaceRequest)
782 .write_unaligned((self as *const DestroyIfaceRequest).read());
783 }
786 Ok(())
787 }
788 }
789 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
790 fidl::encoding::Encode<DestroyIfaceRequest, D> for (T0,)
791 {
792 #[inline]
793 unsafe fn encode(
794 self,
795 encoder: &mut fidl::encoding::Encoder<'_, D>,
796 offset: usize,
797 depth: fidl::encoding::Depth,
798 ) -> fidl::Result<()> {
799 encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
800 self.0.encode(encoder, offset + 0, depth)?;
804 Ok(())
805 }
806 }
807
808 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyIfaceRequest {
809 #[inline(always)]
810 fn new_empty() -> Self {
811 Self { iface_id: fidl::new_empty!(u16, D) }
812 }
813
814 #[inline]
815 unsafe fn decode(
816 &mut self,
817 decoder: &mut fidl::encoding::Decoder<'_, D>,
818 offset: usize,
819 _depth: fidl::encoding::Depth,
820 ) -> fidl::Result<()> {
821 decoder.debug_check_bounds::<Self>(offset);
822 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
823 unsafe {
826 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
827 }
828 Ok(())
829 }
830 }
831
832 impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryRequest {
833 type Borrowed<'a> = &'a Self;
834 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
835 value
836 }
837 }
838
839 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryRequest {
840 type Owned = Self;
841
842 #[inline(always)]
843 fn inline_align(_context: fidl::encoding::Context) -> usize {
844 2
845 }
846
847 #[inline(always)]
848 fn inline_size(_context: fidl::encoding::Context) -> usize {
849 2
850 }
851 #[inline(always)]
852 fn encode_is_copy() -> bool {
853 true
854 }
855
856 #[inline(always)]
857 fn decode_is_copy() -> bool {
858 true
859 }
860 }
861
862 unsafe impl<D: fidl::encoding::ResourceDialect>
863 fidl::encoding::Encode<DeviceMonitorClearCountryRequest, D>
864 for &DeviceMonitorClearCountryRequest
865 {
866 #[inline]
867 unsafe fn encode(
868 self,
869 encoder: &mut fidl::encoding::Encoder<'_, D>,
870 offset: usize,
871 _depth: fidl::encoding::Depth,
872 ) -> fidl::Result<()> {
873 encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
874 unsafe {
875 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
877 (buf_ptr as *mut DeviceMonitorClearCountryRequest)
878 .write_unaligned((self as *const DeviceMonitorClearCountryRequest).read());
879 }
882 Ok(())
883 }
884 }
885 unsafe impl<
886 D: fidl::encoding::ResourceDialect,
887 T0: fidl::encoding::Encode<ClearCountryRequest, D>,
888 > fidl::encoding::Encode<DeviceMonitorClearCountryRequest, D> for (T0,)
889 {
890 #[inline]
891 unsafe fn encode(
892 self,
893 encoder: &mut fidl::encoding::Encoder<'_, D>,
894 offset: usize,
895 depth: fidl::encoding::Depth,
896 ) -> fidl::Result<()> {
897 encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
898 self.0.encode(encoder, offset + 0, depth)?;
902 Ok(())
903 }
904 }
905
906 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
907 for DeviceMonitorClearCountryRequest
908 {
909 #[inline(always)]
910 fn new_empty() -> Self {
911 Self { req: fidl::new_empty!(ClearCountryRequest, D) }
912 }
913
914 #[inline]
915 unsafe fn decode(
916 &mut self,
917 decoder: &mut fidl::encoding::Decoder<'_, D>,
918 offset: usize,
919 _depth: fidl::encoding::Depth,
920 ) -> fidl::Result<()> {
921 decoder.debug_check_bounds::<Self>(offset);
922 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
923 unsafe {
926 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
927 }
928 Ok(())
929 }
930 }
931
932 impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryResponse {
933 type Borrowed<'a> = &'a Self;
934 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
935 value
936 }
937 }
938
939 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryResponse {
940 type Owned = Self;
941
942 #[inline(always)]
943 fn inline_align(_context: fidl::encoding::Context) -> usize {
944 4
945 }
946
947 #[inline(always)]
948 fn inline_size(_context: fidl::encoding::Context) -> usize {
949 4
950 }
951 #[inline(always)]
952 fn encode_is_copy() -> bool {
953 true
954 }
955
956 #[inline(always)]
957 fn decode_is_copy() -> bool {
958 true
959 }
960 }
961
962 unsafe impl<D: fidl::encoding::ResourceDialect>
963 fidl::encoding::Encode<DeviceMonitorClearCountryResponse, D>
964 for &DeviceMonitorClearCountryResponse
965 {
966 #[inline]
967 unsafe fn encode(
968 self,
969 encoder: &mut fidl::encoding::Encoder<'_, D>,
970 offset: usize,
971 _depth: fidl::encoding::Depth,
972 ) -> fidl::Result<()> {
973 encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
974 unsafe {
975 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
977 (buf_ptr as *mut DeviceMonitorClearCountryResponse)
978 .write_unaligned((self as *const DeviceMonitorClearCountryResponse).read());
979 }
982 Ok(())
983 }
984 }
985 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
986 fidl::encoding::Encode<DeviceMonitorClearCountryResponse, D> for (T0,)
987 {
988 #[inline]
989 unsafe fn encode(
990 self,
991 encoder: &mut fidl::encoding::Encoder<'_, D>,
992 offset: usize,
993 depth: fidl::encoding::Depth,
994 ) -> fidl::Result<()> {
995 encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
996 self.0.encode(encoder, offset + 0, depth)?;
1000 Ok(())
1001 }
1002 }
1003
1004 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1005 for DeviceMonitorClearCountryResponse
1006 {
1007 #[inline(always)]
1008 fn new_empty() -> Self {
1009 Self { status: fidl::new_empty!(i32, D) }
1010 }
1011
1012 #[inline]
1013 unsafe fn decode(
1014 &mut self,
1015 decoder: &mut fidl::encoding::Decoder<'_, D>,
1016 offset: usize,
1017 _depth: fidl::encoding::Depth,
1018 ) -> fidl::Result<()> {
1019 decoder.debug_check_bounds::<Self>(offset);
1020 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1021 unsafe {
1024 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1025 }
1026 Ok(())
1027 }
1028 }
1029
1030 impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceRequest {
1031 type Borrowed<'a> = &'a Self;
1032 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1033 value
1034 }
1035 }
1036
1037 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceRequest {
1038 type Owned = Self;
1039
1040 #[inline(always)]
1041 fn inline_align(_context: fidl::encoding::Context) -> usize {
1042 2
1043 }
1044
1045 #[inline(always)]
1046 fn inline_size(_context: fidl::encoding::Context) -> usize {
1047 2
1048 }
1049 #[inline(always)]
1050 fn encode_is_copy() -> bool {
1051 true
1052 }
1053
1054 #[inline(always)]
1055 fn decode_is_copy() -> bool {
1056 true
1057 }
1058 }
1059
1060 unsafe impl<D: fidl::encoding::ResourceDialect>
1061 fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest, D>
1062 for &DeviceMonitorDestroyIfaceRequest
1063 {
1064 #[inline]
1065 unsafe fn encode(
1066 self,
1067 encoder: &mut fidl::encoding::Encoder<'_, D>,
1068 offset: usize,
1069 _depth: fidl::encoding::Depth,
1070 ) -> fidl::Result<()> {
1071 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
1072 unsafe {
1073 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1075 (buf_ptr as *mut DeviceMonitorDestroyIfaceRequest)
1076 .write_unaligned((self as *const DeviceMonitorDestroyIfaceRequest).read());
1077 }
1080 Ok(())
1081 }
1082 }
1083 unsafe impl<
1084 D: fidl::encoding::ResourceDialect,
1085 T0: fidl::encoding::Encode<DestroyIfaceRequest, D>,
1086 > fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest, D> for (T0,)
1087 {
1088 #[inline]
1089 unsafe fn encode(
1090 self,
1091 encoder: &mut fidl::encoding::Encoder<'_, D>,
1092 offset: usize,
1093 depth: fidl::encoding::Depth,
1094 ) -> fidl::Result<()> {
1095 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
1096 self.0.encode(encoder, offset + 0, depth)?;
1100 Ok(())
1101 }
1102 }
1103
1104 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1105 for DeviceMonitorDestroyIfaceRequest
1106 {
1107 #[inline(always)]
1108 fn new_empty() -> Self {
1109 Self { req: fidl::new_empty!(DestroyIfaceRequest, D) }
1110 }
1111
1112 #[inline]
1113 unsafe fn decode(
1114 &mut self,
1115 decoder: &mut fidl::encoding::Decoder<'_, D>,
1116 offset: usize,
1117 _depth: fidl::encoding::Depth,
1118 ) -> fidl::Result<()> {
1119 decoder.debug_check_bounds::<Self>(offset);
1120 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1121 unsafe {
1124 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1125 }
1126 Ok(())
1127 }
1128 }
1129
1130 impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceResponse {
1131 type Borrowed<'a> = &'a Self;
1132 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1133 value
1134 }
1135 }
1136
1137 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceResponse {
1138 type Owned = Self;
1139
1140 #[inline(always)]
1141 fn inline_align(_context: fidl::encoding::Context) -> usize {
1142 4
1143 }
1144
1145 #[inline(always)]
1146 fn inline_size(_context: fidl::encoding::Context) -> usize {
1147 4
1148 }
1149 #[inline(always)]
1150 fn encode_is_copy() -> bool {
1151 true
1152 }
1153
1154 #[inline(always)]
1155 fn decode_is_copy() -> bool {
1156 true
1157 }
1158 }
1159
1160 unsafe impl<D: fidl::encoding::ResourceDialect>
1161 fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, D>
1162 for &DeviceMonitorDestroyIfaceResponse
1163 {
1164 #[inline]
1165 unsafe fn encode(
1166 self,
1167 encoder: &mut fidl::encoding::Encoder<'_, D>,
1168 offset: usize,
1169 _depth: fidl::encoding::Depth,
1170 ) -> fidl::Result<()> {
1171 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
1172 unsafe {
1173 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1175 (buf_ptr as *mut DeviceMonitorDestroyIfaceResponse)
1176 .write_unaligned((self as *const DeviceMonitorDestroyIfaceResponse).read());
1177 }
1180 Ok(())
1181 }
1182 }
1183 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1184 fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, D> for (T0,)
1185 {
1186 #[inline]
1187 unsafe fn encode(
1188 self,
1189 encoder: &mut fidl::encoding::Encoder<'_, D>,
1190 offset: usize,
1191 depth: fidl::encoding::Depth,
1192 ) -> fidl::Result<()> {
1193 encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
1194 self.0.encode(encoder, offset + 0, depth)?;
1198 Ok(())
1199 }
1200 }
1201
1202 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1203 for DeviceMonitorDestroyIfaceResponse
1204 {
1205 #[inline(always)]
1206 fn new_empty() -> Self {
1207 Self { status: fidl::new_empty!(i32, D) }
1208 }
1209
1210 #[inline]
1211 unsafe fn decode(
1212 &mut self,
1213 decoder: &mut fidl::encoding::Decoder<'_, D>,
1214 offset: usize,
1215 _depth: fidl::encoding::Depth,
1216 ) -> fidl::Result<()> {
1217 decoder.debug_check_bounds::<Self>(offset);
1218 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1219 unsafe {
1222 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1223 }
1224 Ok(())
1225 }
1226 }
1227
1228 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryRequest {
1229 type Borrowed<'a> = &'a Self;
1230 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1231 value
1232 }
1233 }
1234
1235 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryRequest {
1236 type Owned = Self;
1237
1238 #[inline(always)]
1239 fn inline_align(_context: fidl::encoding::Context) -> usize {
1240 2
1241 }
1242
1243 #[inline(always)]
1244 fn inline_size(_context: fidl::encoding::Context) -> usize {
1245 2
1246 }
1247 #[inline(always)]
1248 fn encode_is_copy() -> bool {
1249 true
1250 }
1251
1252 #[inline(always)]
1253 fn decode_is_copy() -> bool {
1254 true
1255 }
1256 }
1257
1258 unsafe impl<D: fidl::encoding::ResourceDialect>
1259 fidl::encoding::Encode<DeviceMonitorGetCountryRequest, D>
1260 for &DeviceMonitorGetCountryRequest
1261 {
1262 #[inline]
1263 unsafe fn encode(
1264 self,
1265 encoder: &mut fidl::encoding::Encoder<'_, D>,
1266 offset: usize,
1267 _depth: fidl::encoding::Depth,
1268 ) -> fidl::Result<()> {
1269 encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
1270 unsafe {
1271 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1273 (buf_ptr as *mut DeviceMonitorGetCountryRequest)
1274 .write_unaligned((self as *const DeviceMonitorGetCountryRequest).read());
1275 }
1278 Ok(())
1279 }
1280 }
1281 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1282 fidl::encoding::Encode<DeviceMonitorGetCountryRequest, D> for (T0,)
1283 {
1284 #[inline]
1285 unsafe fn encode(
1286 self,
1287 encoder: &mut fidl::encoding::Encoder<'_, D>,
1288 offset: usize,
1289 depth: fidl::encoding::Depth,
1290 ) -> fidl::Result<()> {
1291 encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
1292 self.0.encode(encoder, offset + 0, depth)?;
1296 Ok(())
1297 }
1298 }
1299
1300 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1301 for DeviceMonitorGetCountryRequest
1302 {
1303 #[inline(always)]
1304 fn new_empty() -> Self {
1305 Self { phy_id: fidl::new_empty!(u16, D) }
1306 }
1307
1308 #[inline]
1309 unsafe fn decode(
1310 &mut self,
1311 decoder: &mut fidl::encoding::Decoder<'_, D>,
1312 offset: usize,
1313 _depth: fidl::encoding::Depth,
1314 ) -> fidl::Result<()> {
1315 decoder.debug_check_bounds::<Self>(offset);
1316 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1317 unsafe {
1320 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1321 }
1322 Ok(())
1323 }
1324 }
1325
1326 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathRequest {
1327 type Borrowed<'a> = &'a Self;
1328 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1329 value
1330 }
1331 }
1332
1333 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathRequest {
1334 type Owned = Self;
1335
1336 #[inline(always)]
1337 fn inline_align(_context: fidl::encoding::Context) -> usize {
1338 2
1339 }
1340
1341 #[inline(always)]
1342 fn inline_size(_context: fidl::encoding::Context) -> usize {
1343 2
1344 }
1345 #[inline(always)]
1346 fn encode_is_copy() -> bool {
1347 true
1348 }
1349
1350 #[inline(always)]
1351 fn decode_is_copy() -> bool {
1352 true
1353 }
1354 }
1355
1356 unsafe impl<D: fidl::encoding::ResourceDialect>
1357 fidl::encoding::Encode<DeviceMonitorGetDevPathRequest, D>
1358 for &DeviceMonitorGetDevPathRequest
1359 {
1360 #[inline]
1361 unsafe fn encode(
1362 self,
1363 encoder: &mut fidl::encoding::Encoder<'_, D>,
1364 offset: usize,
1365 _depth: fidl::encoding::Depth,
1366 ) -> fidl::Result<()> {
1367 encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
1368 unsafe {
1369 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1371 (buf_ptr as *mut DeviceMonitorGetDevPathRequest)
1372 .write_unaligned((self as *const DeviceMonitorGetDevPathRequest).read());
1373 }
1376 Ok(())
1377 }
1378 }
1379 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1380 fidl::encoding::Encode<DeviceMonitorGetDevPathRequest, D> for (T0,)
1381 {
1382 #[inline]
1383 unsafe fn encode(
1384 self,
1385 encoder: &mut fidl::encoding::Encoder<'_, D>,
1386 offset: usize,
1387 depth: fidl::encoding::Depth,
1388 ) -> fidl::Result<()> {
1389 encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
1390 self.0.encode(encoder, offset + 0, depth)?;
1394 Ok(())
1395 }
1396 }
1397
1398 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1399 for DeviceMonitorGetDevPathRequest
1400 {
1401 #[inline(always)]
1402 fn new_empty() -> Self {
1403 Self { phy_id: fidl::new_empty!(u16, D) }
1404 }
1405
1406 #[inline]
1407 unsafe fn decode(
1408 &mut self,
1409 decoder: &mut fidl::encoding::Decoder<'_, D>,
1410 offset: usize,
1411 _depth: fidl::encoding::Depth,
1412 ) -> fidl::Result<()> {
1413 decoder.debug_check_bounds::<Self>(offset);
1414 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1415 unsafe {
1418 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1419 }
1420 Ok(())
1421 }
1422 }
1423
1424 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathResponse {
1425 type Borrowed<'a> = &'a Self;
1426 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1427 value
1428 }
1429 }
1430
1431 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathResponse {
1432 type Owned = Self;
1433
1434 #[inline(always)]
1435 fn inline_align(_context: fidl::encoding::Context) -> usize {
1436 8
1437 }
1438
1439 #[inline(always)]
1440 fn inline_size(_context: fidl::encoding::Context) -> usize {
1441 16
1442 }
1443 }
1444
1445 unsafe impl<D: fidl::encoding::ResourceDialect>
1446 fidl::encoding::Encode<DeviceMonitorGetDevPathResponse, D>
1447 for &DeviceMonitorGetDevPathResponse
1448 {
1449 #[inline]
1450 unsafe fn encode(
1451 self,
1452 encoder: &mut fidl::encoding::Encoder<'_, D>,
1453 offset: usize,
1454 _depth: fidl::encoding::Depth,
1455 ) -> fidl::Result<()> {
1456 encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
1457 fidl::encoding::Encode::<DeviceMonitorGetDevPathResponse, D>::encode(
1459 (
1460 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.dev_path),
1461 ),
1462 encoder, offset, _depth
1463 )
1464 }
1465 }
1466 unsafe impl<
1467 D: fidl::encoding::ResourceDialect,
1468 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
1469 > fidl::encoding::Encode<DeviceMonitorGetDevPathResponse, D> for (T0,)
1470 {
1471 #[inline]
1472 unsafe fn encode(
1473 self,
1474 encoder: &mut fidl::encoding::Encoder<'_, D>,
1475 offset: usize,
1476 depth: fidl::encoding::Depth,
1477 ) -> fidl::Result<()> {
1478 encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
1479 self.0.encode(encoder, offset + 0, depth)?;
1483 Ok(())
1484 }
1485 }
1486
1487 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1488 for DeviceMonitorGetDevPathResponse
1489 {
1490 #[inline(always)]
1491 fn new_empty() -> Self {
1492 Self {
1493 dev_path: fidl::new_empty!(
1494 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1495 D
1496 ),
1497 }
1498 }
1499
1500 #[inline]
1501 unsafe fn decode(
1502 &mut self,
1503 decoder: &mut fidl::encoding::Decoder<'_, D>,
1504 offset: usize,
1505 _depth: fidl::encoding::Depth,
1506 ) -> fidl::Result<()> {
1507 decoder.debug_check_bounds::<Self>(offset);
1508 fidl::decode!(
1510 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1511 D,
1512 &mut self.dev_path,
1513 decoder,
1514 offset + 0,
1515 _depth
1516 )?;
1517 Ok(())
1518 }
1519 }
1520
1521 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeRequest {
1522 type Borrowed<'a> = &'a Self;
1523 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1524 value
1525 }
1526 }
1527
1528 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeRequest {
1529 type Owned = Self;
1530
1531 #[inline(always)]
1532 fn inline_align(_context: fidl::encoding::Context) -> usize {
1533 2
1534 }
1535
1536 #[inline(always)]
1537 fn inline_size(_context: fidl::encoding::Context) -> usize {
1538 2
1539 }
1540 #[inline(always)]
1541 fn encode_is_copy() -> bool {
1542 true
1543 }
1544
1545 #[inline(always)]
1546 fn decode_is_copy() -> bool {
1547 true
1548 }
1549 }
1550
1551 unsafe impl<D: fidl::encoding::ResourceDialect>
1552 fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest, D>
1553 for &DeviceMonitorGetPowerSaveModeRequest
1554 {
1555 #[inline]
1556 unsafe fn encode(
1557 self,
1558 encoder: &mut fidl::encoding::Encoder<'_, D>,
1559 offset: usize,
1560 _depth: fidl::encoding::Depth,
1561 ) -> fidl::Result<()> {
1562 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
1563 unsafe {
1564 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1566 (buf_ptr as *mut DeviceMonitorGetPowerSaveModeRequest)
1567 .write_unaligned((self as *const DeviceMonitorGetPowerSaveModeRequest).read());
1568 }
1571 Ok(())
1572 }
1573 }
1574 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1575 fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest, D> for (T0,)
1576 {
1577 #[inline]
1578 unsafe fn encode(
1579 self,
1580 encoder: &mut fidl::encoding::Encoder<'_, D>,
1581 offset: usize,
1582 depth: fidl::encoding::Depth,
1583 ) -> fidl::Result<()> {
1584 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
1585 self.0.encode(encoder, offset + 0, depth)?;
1589 Ok(())
1590 }
1591 }
1592
1593 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1594 for DeviceMonitorGetPowerSaveModeRequest
1595 {
1596 #[inline(always)]
1597 fn new_empty() -> Self {
1598 Self { phy_id: fidl::new_empty!(u16, D) }
1599 }
1600
1601 #[inline]
1602 unsafe fn decode(
1603 &mut self,
1604 decoder: &mut fidl::encoding::Decoder<'_, D>,
1605 offset: usize,
1606 _depth: fidl::encoding::Depth,
1607 ) -> fidl::Result<()> {
1608 decoder.debug_check_bounds::<Self>(offset);
1609 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1610 unsafe {
1613 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1614 }
1615 Ok(())
1616 }
1617 }
1618
1619 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerStateRequest {
1620 type Borrowed<'a> = &'a Self;
1621 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1622 value
1623 }
1624 }
1625
1626 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerStateRequest {
1627 type Owned = Self;
1628
1629 #[inline(always)]
1630 fn inline_align(_context: fidl::encoding::Context) -> usize {
1631 2
1632 }
1633
1634 #[inline(always)]
1635 fn inline_size(_context: fidl::encoding::Context) -> usize {
1636 2
1637 }
1638 #[inline(always)]
1639 fn encode_is_copy() -> bool {
1640 true
1641 }
1642
1643 #[inline(always)]
1644 fn decode_is_copy() -> bool {
1645 true
1646 }
1647 }
1648
1649 unsafe impl<D: fidl::encoding::ResourceDialect>
1650 fidl::encoding::Encode<DeviceMonitorGetPowerStateRequest, D>
1651 for &DeviceMonitorGetPowerStateRequest
1652 {
1653 #[inline]
1654 unsafe fn encode(
1655 self,
1656 encoder: &mut fidl::encoding::Encoder<'_, D>,
1657 offset: usize,
1658 _depth: fidl::encoding::Depth,
1659 ) -> fidl::Result<()> {
1660 encoder.debug_check_bounds::<DeviceMonitorGetPowerStateRequest>(offset);
1661 unsafe {
1662 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1664 (buf_ptr as *mut DeviceMonitorGetPowerStateRequest)
1665 .write_unaligned((self as *const DeviceMonitorGetPowerStateRequest).read());
1666 }
1669 Ok(())
1670 }
1671 }
1672 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1673 fidl::encoding::Encode<DeviceMonitorGetPowerStateRequest, D> for (T0,)
1674 {
1675 #[inline]
1676 unsafe fn encode(
1677 self,
1678 encoder: &mut fidl::encoding::Encoder<'_, D>,
1679 offset: usize,
1680 depth: fidl::encoding::Depth,
1681 ) -> fidl::Result<()> {
1682 encoder.debug_check_bounds::<DeviceMonitorGetPowerStateRequest>(offset);
1683 self.0.encode(encoder, offset + 0, depth)?;
1687 Ok(())
1688 }
1689 }
1690
1691 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1692 for DeviceMonitorGetPowerStateRequest
1693 {
1694 #[inline(always)]
1695 fn new_empty() -> Self {
1696 Self { phy_id: fidl::new_empty!(u16, D) }
1697 }
1698
1699 #[inline]
1700 unsafe fn decode(
1701 &mut self,
1702 decoder: &mut fidl::encoding::Decoder<'_, D>,
1703 offset: usize,
1704 _depth: fidl::encoding::Depth,
1705 ) -> fidl::Result<()> {
1706 decoder.debug_check_bounds::<Self>(offset);
1707 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1708 unsafe {
1711 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1712 }
1713 Ok(())
1714 }
1715 }
1716
1717 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
1718 type Borrowed<'a> = &'a Self;
1719 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1720 value
1721 }
1722 }
1723
1724 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
1725 type Owned = Self;
1726
1727 #[inline(always)]
1728 fn inline_align(_context: fidl::encoding::Context) -> usize {
1729 2
1730 }
1731
1732 #[inline(always)]
1733 fn inline_size(_context: fidl::encoding::Context) -> usize {
1734 2
1735 }
1736 #[inline(always)]
1737 fn encode_is_copy() -> bool {
1738 true
1739 }
1740
1741 #[inline(always)]
1742 fn decode_is_copy() -> bool {
1743 true
1744 }
1745 }
1746
1747 unsafe impl<D: fidl::encoding::ResourceDialect>
1748 fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest, D>
1749 for &DeviceMonitorGetSupportedMacRolesRequest
1750 {
1751 #[inline]
1752 unsafe fn encode(
1753 self,
1754 encoder: &mut fidl::encoding::Encoder<'_, D>,
1755 offset: usize,
1756 _depth: fidl::encoding::Depth,
1757 ) -> fidl::Result<()> {
1758 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
1759 unsafe {
1760 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1762 (buf_ptr as *mut DeviceMonitorGetSupportedMacRolesRequest).write_unaligned(
1763 (self as *const DeviceMonitorGetSupportedMacRolesRequest).read(),
1764 );
1765 }
1768 Ok(())
1769 }
1770 }
1771 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1772 fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest, D> for (T0,)
1773 {
1774 #[inline]
1775 unsafe fn encode(
1776 self,
1777 encoder: &mut fidl::encoding::Encoder<'_, D>,
1778 offset: usize,
1779 depth: fidl::encoding::Depth,
1780 ) -> fidl::Result<()> {
1781 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
1782 self.0.encode(encoder, offset + 0, depth)?;
1786 Ok(())
1787 }
1788 }
1789
1790 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1791 for DeviceMonitorGetSupportedMacRolesRequest
1792 {
1793 #[inline(always)]
1794 fn new_empty() -> Self {
1795 Self { phy_id: fidl::new_empty!(u16, D) }
1796 }
1797
1798 #[inline]
1799 unsafe fn decode(
1800 &mut self,
1801 decoder: &mut fidl::encoding::Decoder<'_, D>,
1802 offset: usize,
1803 _depth: fidl::encoding::Depth,
1804 ) -> fidl::Result<()> {
1805 decoder.debug_check_bounds::<Self>(offset);
1806 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1807 unsafe {
1810 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1811 }
1812 Ok(())
1813 }
1814 }
1815
1816 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetTxPowerScenarioRequest {
1817 type Borrowed<'a> = &'a Self;
1818 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1819 value
1820 }
1821 }
1822
1823 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetTxPowerScenarioRequest {
1824 type Owned = Self;
1825
1826 #[inline(always)]
1827 fn inline_align(_context: fidl::encoding::Context) -> usize {
1828 2
1829 }
1830
1831 #[inline(always)]
1832 fn inline_size(_context: fidl::encoding::Context) -> usize {
1833 2
1834 }
1835 #[inline(always)]
1836 fn encode_is_copy() -> bool {
1837 true
1838 }
1839
1840 #[inline(always)]
1841 fn decode_is_copy() -> bool {
1842 true
1843 }
1844 }
1845
1846 unsafe impl<D: fidl::encoding::ResourceDialect>
1847 fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioRequest, D>
1848 for &DeviceMonitorGetTxPowerScenarioRequest
1849 {
1850 #[inline]
1851 unsafe fn encode(
1852 self,
1853 encoder: &mut fidl::encoding::Encoder<'_, D>,
1854 offset: usize,
1855 _depth: fidl::encoding::Depth,
1856 ) -> fidl::Result<()> {
1857 encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioRequest>(offset);
1858 unsafe {
1859 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1861 (buf_ptr as *mut DeviceMonitorGetTxPowerScenarioRequest).write_unaligned(
1862 (self as *const DeviceMonitorGetTxPowerScenarioRequest).read(),
1863 );
1864 }
1867 Ok(())
1868 }
1869 }
1870 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1871 fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioRequest, D> for (T0,)
1872 {
1873 #[inline]
1874 unsafe fn encode(
1875 self,
1876 encoder: &mut fidl::encoding::Encoder<'_, D>,
1877 offset: usize,
1878 depth: fidl::encoding::Depth,
1879 ) -> fidl::Result<()> {
1880 encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioRequest>(offset);
1881 self.0.encode(encoder, offset + 0, depth)?;
1885 Ok(())
1886 }
1887 }
1888
1889 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1890 for DeviceMonitorGetTxPowerScenarioRequest
1891 {
1892 #[inline(always)]
1893 fn new_empty() -> Self {
1894 Self { phy_id: fidl::new_empty!(u16, D) }
1895 }
1896
1897 #[inline]
1898 unsafe fn decode(
1899 &mut self,
1900 decoder: &mut fidl::encoding::Decoder<'_, D>,
1901 offset: usize,
1902 _depth: fidl::encoding::Depth,
1903 ) -> fidl::Result<()> {
1904 decoder.debug_check_bounds::<Self>(offset);
1905 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1906 unsafe {
1909 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1910 }
1911 Ok(())
1912 }
1913 }
1914
1915 impl fidl::encoding::ValueTypeMarker for DeviceMonitorListIfacesResponse {
1916 type Borrowed<'a> = &'a Self;
1917 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1918 value
1919 }
1920 }
1921
1922 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListIfacesResponse {
1923 type Owned = Self;
1924
1925 #[inline(always)]
1926 fn inline_align(_context: fidl::encoding::Context) -> usize {
1927 8
1928 }
1929
1930 #[inline(always)]
1931 fn inline_size(_context: fidl::encoding::Context) -> usize {
1932 16
1933 }
1934 }
1935
1936 unsafe impl<D: fidl::encoding::ResourceDialect>
1937 fidl::encoding::Encode<DeviceMonitorListIfacesResponse, D>
1938 for &DeviceMonitorListIfacesResponse
1939 {
1940 #[inline]
1941 unsafe fn encode(
1942 self,
1943 encoder: &mut fidl::encoding::Encoder<'_, D>,
1944 offset: usize,
1945 _depth: fidl::encoding::Depth,
1946 ) -> fidl::Result<()> {
1947 encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
1948 fidl::encoding::Encode::<DeviceMonitorListIfacesResponse, D>::encode(
1950 (
1951 <fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_list),
1952 ),
1953 encoder, offset, _depth
1954 )
1955 }
1956 }
1957 unsafe impl<
1958 D: fidl::encoding::ResourceDialect,
1959 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
1960 > fidl::encoding::Encode<DeviceMonitorListIfacesResponse, D> for (T0,)
1961 {
1962 #[inline]
1963 unsafe fn encode(
1964 self,
1965 encoder: &mut fidl::encoding::Encoder<'_, D>,
1966 offset: usize,
1967 depth: fidl::encoding::Depth,
1968 ) -> fidl::Result<()> {
1969 encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
1970 self.0.encode(encoder, offset + 0, depth)?;
1974 Ok(())
1975 }
1976 }
1977
1978 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1979 for DeviceMonitorListIfacesResponse
1980 {
1981 #[inline(always)]
1982 fn new_empty() -> Self {
1983 Self { iface_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, D) }
1984 }
1985
1986 #[inline]
1987 unsafe fn decode(
1988 &mut self,
1989 decoder: &mut fidl::encoding::Decoder<'_, D>,
1990 offset: usize,
1991 _depth: fidl::encoding::Depth,
1992 ) -> fidl::Result<()> {
1993 decoder.debug_check_bounds::<Self>(offset);
1994 fidl::decode!(
1996 fidl::encoding::UnboundedVector<u16>,
1997 D,
1998 &mut self.iface_list,
1999 decoder,
2000 offset + 0,
2001 _depth
2002 )?;
2003 Ok(())
2004 }
2005 }
2006
2007 impl fidl::encoding::ValueTypeMarker for DeviceMonitorListPhysResponse {
2008 type Borrowed<'a> = &'a Self;
2009 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2010 value
2011 }
2012 }
2013
2014 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListPhysResponse {
2015 type Owned = Self;
2016
2017 #[inline(always)]
2018 fn inline_align(_context: fidl::encoding::Context) -> usize {
2019 8
2020 }
2021
2022 #[inline(always)]
2023 fn inline_size(_context: fidl::encoding::Context) -> usize {
2024 16
2025 }
2026 }
2027
2028 unsafe impl<D: fidl::encoding::ResourceDialect>
2029 fidl::encoding::Encode<DeviceMonitorListPhysResponse, D>
2030 for &DeviceMonitorListPhysResponse
2031 {
2032 #[inline]
2033 unsafe fn encode(
2034 self,
2035 encoder: &mut fidl::encoding::Encoder<'_, D>,
2036 offset: usize,
2037 _depth: fidl::encoding::Depth,
2038 ) -> fidl::Result<()> {
2039 encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
2040 fidl::encoding::Encode::<DeviceMonitorListPhysResponse, D>::encode(
2042 (
2043 <fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_list),
2044 ),
2045 encoder, offset, _depth
2046 )
2047 }
2048 }
2049 unsafe impl<
2050 D: fidl::encoding::ResourceDialect,
2051 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
2052 > fidl::encoding::Encode<DeviceMonitorListPhysResponse, D> for (T0,)
2053 {
2054 #[inline]
2055 unsafe fn encode(
2056 self,
2057 encoder: &mut fidl::encoding::Encoder<'_, D>,
2058 offset: usize,
2059 depth: fidl::encoding::Depth,
2060 ) -> fidl::Result<()> {
2061 encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
2062 self.0.encode(encoder, offset + 0, depth)?;
2066 Ok(())
2067 }
2068 }
2069
2070 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2071 for DeviceMonitorListPhysResponse
2072 {
2073 #[inline(always)]
2074 fn new_empty() -> Self {
2075 Self { phy_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, D) }
2076 }
2077
2078 #[inline]
2079 unsafe fn decode(
2080 &mut self,
2081 decoder: &mut fidl::encoding::Decoder<'_, D>,
2082 offset: usize,
2083 _depth: fidl::encoding::Depth,
2084 ) -> fidl::Result<()> {
2085 decoder.debug_check_bounds::<Self>(offset);
2086 fidl::decode!(
2088 fidl::encoding::UnboundedVector<u16>,
2089 D,
2090 &mut self.phy_list,
2091 decoder,
2092 offset + 0,
2093 _depth
2094 )?;
2095 Ok(())
2096 }
2097 }
2098
2099 impl fidl::encoding::ValueTypeMarker for DeviceMonitorPowerDownRequest {
2100 type Borrowed<'a> = &'a Self;
2101 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2102 value
2103 }
2104 }
2105
2106 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorPowerDownRequest {
2107 type Owned = Self;
2108
2109 #[inline(always)]
2110 fn inline_align(_context: fidl::encoding::Context) -> usize {
2111 2
2112 }
2113
2114 #[inline(always)]
2115 fn inline_size(_context: fidl::encoding::Context) -> usize {
2116 2
2117 }
2118 #[inline(always)]
2119 fn encode_is_copy() -> bool {
2120 true
2121 }
2122
2123 #[inline(always)]
2124 fn decode_is_copy() -> bool {
2125 true
2126 }
2127 }
2128
2129 unsafe impl<D: fidl::encoding::ResourceDialect>
2130 fidl::encoding::Encode<DeviceMonitorPowerDownRequest, D>
2131 for &DeviceMonitorPowerDownRequest
2132 {
2133 #[inline]
2134 unsafe fn encode(
2135 self,
2136 encoder: &mut fidl::encoding::Encoder<'_, D>,
2137 offset: usize,
2138 _depth: fidl::encoding::Depth,
2139 ) -> fidl::Result<()> {
2140 encoder.debug_check_bounds::<DeviceMonitorPowerDownRequest>(offset);
2141 unsafe {
2142 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2144 (buf_ptr as *mut DeviceMonitorPowerDownRequest)
2145 .write_unaligned((self as *const DeviceMonitorPowerDownRequest).read());
2146 }
2149 Ok(())
2150 }
2151 }
2152 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2153 fidl::encoding::Encode<DeviceMonitorPowerDownRequest, D> for (T0,)
2154 {
2155 #[inline]
2156 unsafe fn encode(
2157 self,
2158 encoder: &mut fidl::encoding::Encoder<'_, D>,
2159 offset: usize,
2160 depth: fidl::encoding::Depth,
2161 ) -> fidl::Result<()> {
2162 encoder.debug_check_bounds::<DeviceMonitorPowerDownRequest>(offset);
2163 self.0.encode(encoder, offset + 0, depth)?;
2167 Ok(())
2168 }
2169 }
2170
2171 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2172 for DeviceMonitorPowerDownRequest
2173 {
2174 #[inline(always)]
2175 fn new_empty() -> Self {
2176 Self { phy_id: fidl::new_empty!(u16, D) }
2177 }
2178
2179 #[inline]
2180 unsafe fn decode(
2181 &mut self,
2182 decoder: &mut fidl::encoding::Decoder<'_, D>,
2183 offset: usize,
2184 _depth: fidl::encoding::Depth,
2185 ) -> fidl::Result<()> {
2186 decoder.debug_check_bounds::<Self>(offset);
2187 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2188 unsafe {
2191 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2192 }
2193 Ok(())
2194 }
2195 }
2196
2197 impl fidl::encoding::ValueTypeMarker for DeviceMonitorPowerUpRequest {
2198 type Borrowed<'a> = &'a Self;
2199 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2200 value
2201 }
2202 }
2203
2204 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorPowerUpRequest {
2205 type Owned = Self;
2206
2207 #[inline(always)]
2208 fn inline_align(_context: fidl::encoding::Context) -> usize {
2209 2
2210 }
2211
2212 #[inline(always)]
2213 fn inline_size(_context: fidl::encoding::Context) -> usize {
2214 2
2215 }
2216 #[inline(always)]
2217 fn encode_is_copy() -> bool {
2218 true
2219 }
2220
2221 #[inline(always)]
2222 fn decode_is_copy() -> bool {
2223 true
2224 }
2225 }
2226
2227 unsafe impl<D: fidl::encoding::ResourceDialect>
2228 fidl::encoding::Encode<DeviceMonitorPowerUpRequest, D> for &DeviceMonitorPowerUpRequest
2229 {
2230 #[inline]
2231 unsafe fn encode(
2232 self,
2233 encoder: &mut fidl::encoding::Encoder<'_, D>,
2234 offset: usize,
2235 _depth: fidl::encoding::Depth,
2236 ) -> fidl::Result<()> {
2237 encoder.debug_check_bounds::<DeviceMonitorPowerUpRequest>(offset);
2238 unsafe {
2239 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2241 (buf_ptr as *mut DeviceMonitorPowerUpRequest)
2242 .write_unaligned((self as *const DeviceMonitorPowerUpRequest).read());
2243 }
2246 Ok(())
2247 }
2248 }
2249 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2250 fidl::encoding::Encode<DeviceMonitorPowerUpRequest, D> for (T0,)
2251 {
2252 #[inline]
2253 unsafe fn encode(
2254 self,
2255 encoder: &mut fidl::encoding::Encoder<'_, D>,
2256 offset: usize,
2257 depth: fidl::encoding::Depth,
2258 ) -> fidl::Result<()> {
2259 encoder.debug_check_bounds::<DeviceMonitorPowerUpRequest>(offset);
2260 self.0.encode(encoder, offset + 0, depth)?;
2264 Ok(())
2265 }
2266 }
2267
2268 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2269 for DeviceMonitorPowerUpRequest
2270 {
2271 #[inline(always)]
2272 fn new_empty() -> Self {
2273 Self { phy_id: fidl::new_empty!(u16, D) }
2274 }
2275
2276 #[inline]
2277 unsafe fn decode(
2278 &mut self,
2279 decoder: &mut fidl::encoding::Decoder<'_, D>,
2280 offset: usize,
2281 _depth: fidl::encoding::Depth,
2282 ) -> fidl::Result<()> {
2283 decoder.debug_check_bounds::<Self>(offset);
2284 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2285 unsafe {
2288 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2289 }
2290 Ok(())
2291 }
2292 }
2293
2294 impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceRequest {
2295 type Borrowed<'a> = &'a Self;
2296 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2297 value
2298 }
2299 }
2300
2301 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceRequest {
2302 type Owned = Self;
2303
2304 #[inline(always)]
2305 fn inline_align(_context: fidl::encoding::Context) -> usize {
2306 2
2307 }
2308
2309 #[inline(always)]
2310 fn inline_size(_context: fidl::encoding::Context) -> usize {
2311 2
2312 }
2313 #[inline(always)]
2314 fn encode_is_copy() -> bool {
2315 true
2316 }
2317
2318 #[inline(always)]
2319 fn decode_is_copy() -> bool {
2320 true
2321 }
2322 }
2323
2324 unsafe impl<D: fidl::encoding::ResourceDialect>
2325 fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest, D>
2326 for &DeviceMonitorQueryIfaceRequest
2327 {
2328 #[inline]
2329 unsafe fn encode(
2330 self,
2331 encoder: &mut fidl::encoding::Encoder<'_, D>,
2332 offset: usize,
2333 _depth: fidl::encoding::Depth,
2334 ) -> fidl::Result<()> {
2335 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
2336 unsafe {
2337 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2339 (buf_ptr as *mut DeviceMonitorQueryIfaceRequest)
2340 .write_unaligned((self as *const DeviceMonitorQueryIfaceRequest).read());
2341 }
2344 Ok(())
2345 }
2346 }
2347 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2348 fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest, D> for (T0,)
2349 {
2350 #[inline]
2351 unsafe fn encode(
2352 self,
2353 encoder: &mut fidl::encoding::Encoder<'_, D>,
2354 offset: usize,
2355 depth: fidl::encoding::Depth,
2356 ) -> fidl::Result<()> {
2357 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
2358 self.0.encode(encoder, offset + 0, depth)?;
2362 Ok(())
2363 }
2364 }
2365
2366 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2367 for DeviceMonitorQueryIfaceRequest
2368 {
2369 #[inline(always)]
2370 fn new_empty() -> Self {
2371 Self { iface_id: fidl::new_empty!(u16, D) }
2372 }
2373
2374 #[inline]
2375 unsafe fn decode(
2376 &mut self,
2377 decoder: &mut fidl::encoding::Decoder<'_, D>,
2378 offset: usize,
2379 _depth: fidl::encoding::Depth,
2380 ) -> fidl::Result<()> {
2381 decoder.debug_check_bounds::<Self>(offset);
2382 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2383 unsafe {
2386 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2387 }
2388 Ok(())
2389 }
2390 }
2391
2392 impl fidl::encoding::ValueTypeMarker for DeviceMonitorResetRequest {
2393 type Borrowed<'a> = &'a Self;
2394 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2395 value
2396 }
2397 }
2398
2399 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorResetRequest {
2400 type Owned = Self;
2401
2402 #[inline(always)]
2403 fn inline_align(_context: fidl::encoding::Context) -> usize {
2404 2
2405 }
2406
2407 #[inline(always)]
2408 fn inline_size(_context: fidl::encoding::Context) -> usize {
2409 2
2410 }
2411 #[inline(always)]
2412 fn encode_is_copy() -> bool {
2413 true
2414 }
2415
2416 #[inline(always)]
2417 fn decode_is_copy() -> bool {
2418 true
2419 }
2420 }
2421
2422 unsafe impl<D: fidl::encoding::ResourceDialect>
2423 fidl::encoding::Encode<DeviceMonitorResetRequest, D> for &DeviceMonitorResetRequest
2424 {
2425 #[inline]
2426 unsafe fn encode(
2427 self,
2428 encoder: &mut fidl::encoding::Encoder<'_, D>,
2429 offset: usize,
2430 _depth: fidl::encoding::Depth,
2431 ) -> fidl::Result<()> {
2432 encoder.debug_check_bounds::<DeviceMonitorResetRequest>(offset);
2433 unsafe {
2434 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2436 (buf_ptr as *mut DeviceMonitorResetRequest)
2437 .write_unaligned((self as *const DeviceMonitorResetRequest).read());
2438 }
2441 Ok(())
2442 }
2443 }
2444 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2445 fidl::encoding::Encode<DeviceMonitorResetRequest, D> for (T0,)
2446 {
2447 #[inline]
2448 unsafe fn encode(
2449 self,
2450 encoder: &mut fidl::encoding::Encoder<'_, D>,
2451 offset: usize,
2452 depth: fidl::encoding::Depth,
2453 ) -> fidl::Result<()> {
2454 encoder.debug_check_bounds::<DeviceMonitorResetRequest>(offset);
2455 self.0.encode(encoder, offset + 0, depth)?;
2459 Ok(())
2460 }
2461 }
2462
2463 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2464 for DeviceMonitorResetRequest
2465 {
2466 #[inline(always)]
2467 fn new_empty() -> Self {
2468 Self { phy_id: fidl::new_empty!(u16, D) }
2469 }
2470
2471 #[inline]
2472 unsafe fn decode(
2473 &mut self,
2474 decoder: &mut fidl::encoding::Decoder<'_, D>,
2475 offset: usize,
2476 _depth: fidl::encoding::Depth,
2477 ) -> fidl::Result<()> {
2478 decoder.debug_check_bounds::<Self>(offset);
2479 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2480 unsafe {
2483 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2484 }
2485 Ok(())
2486 }
2487 }
2488
2489 impl fidl::encoding::ValueTypeMarker for DeviceMonitorResetTxPowerScenarioRequest {
2490 type Borrowed<'a> = &'a Self;
2491 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2492 value
2493 }
2494 }
2495
2496 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorResetTxPowerScenarioRequest {
2497 type Owned = Self;
2498
2499 #[inline(always)]
2500 fn inline_align(_context: fidl::encoding::Context) -> usize {
2501 2
2502 }
2503
2504 #[inline(always)]
2505 fn inline_size(_context: fidl::encoding::Context) -> usize {
2506 2
2507 }
2508 #[inline(always)]
2509 fn encode_is_copy() -> bool {
2510 true
2511 }
2512
2513 #[inline(always)]
2514 fn decode_is_copy() -> bool {
2515 true
2516 }
2517 }
2518
2519 unsafe impl<D: fidl::encoding::ResourceDialect>
2520 fidl::encoding::Encode<DeviceMonitorResetTxPowerScenarioRequest, D>
2521 for &DeviceMonitorResetTxPowerScenarioRequest
2522 {
2523 #[inline]
2524 unsafe fn encode(
2525 self,
2526 encoder: &mut fidl::encoding::Encoder<'_, D>,
2527 offset: usize,
2528 _depth: fidl::encoding::Depth,
2529 ) -> fidl::Result<()> {
2530 encoder.debug_check_bounds::<DeviceMonitorResetTxPowerScenarioRequest>(offset);
2531 unsafe {
2532 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2534 (buf_ptr as *mut DeviceMonitorResetTxPowerScenarioRequest).write_unaligned(
2535 (self as *const DeviceMonitorResetTxPowerScenarioRequest).read(),
2536 );
2537 }
2540 Ok(())
2541 }
2542 }
2543 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
2544 fidl::encoding::Encode<DeviceMonitorResetTxPowerScenarioRequest, D> for (T0,)
2545 {
2546 #[inline]
2547 unsafe fn encode(
2548 self,
2549 encoder: &mut fidl::encoding::Encoder<'_, D>,
2550 offset: usize,
2551 depth: fidl::encoding::Depth,
2552 ) -> fidl::Result<()> {
2553 encoder.debug_check_bounds::<DeviceMonitorResetTxPowerScenarioRequest>(offset);
2554 self.0.encode(encoder, offset + 0, depth)?;
2558 Ok(())
2559 }
2560 }
2561
2562 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2563 for DeviceMonitorResetTxPowerScenarioRequest
2564 {
2565 #[inline(always)]
2566 fn new_empty() -> Self {
2567 Self { phy_id: fidl::new_empty!(u16, D) }
2568 }
2569
2570 #[inline]
2571 unsafe fn decode(
2572 &mut self,
2573 decoder: &mut fidl::encoding::Decoder<'_, D>,
2574 offset: usize,
2575 _depth: fidl::encoding::Depth,
2576 ) -> fidl::Result<()> {
2577 decoder.debug_check_bounds::<Self>(offset);
2578 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2579 unsafe {
2582 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2583 }
2584 Ok(())
2585 }
2586 }
2587
2588 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetBtCoexistenceModeRequest {
2589 type Borrowed<'a> = &'a Self;
2590 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2591 value
2592 }
2593 }
2594
2595 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetBtCoexistenceModeRequest {
2596 type Owned = Self;
2597
2598 #[inline(always)]
2599 fn inline_align(_context: fidl::encoding::Context) -> usize {
2600 4
2601 }
2602
2603 #[inline(always)]
2604 fn inline_size(_context: fidl::encoding::Context) -> usize {
2605 8
2606 }
2607 }
2608
2609 unsafe impl<D: fidl::encoding::ResourceDialect>
2610 fidl::encoding::Encode<DeviceMonitorSetBtCoexistenceModeRequest, D>
2611 for &DeviceMonitorSetBtCoexistenceModeRequest
2612 {
2613 #[inline]
2614 unsafe fn encode(
2615 self,
2616 encoder: &mut fidl::encoding::Encoder<'_, D>,
2617 offset: usize,
2618 _depth: fidl::encoding::Depth,
2619 ) -> fidl::Result<()> {
2620 encoder.debug_check_bounds::<DeviceMonitorSetBtCoexistenceModeRequest>(offset);
2621 fidl::encoding::Encode::<DeviceMonitorSetBtCoexistenceModeRequest, D>::encode(
2623 (
2624 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
2625 <fidl_fuchsia_wlan_internal__common::BtCoexistenceMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2626 ),
2627 encoder, offset, _depth
2628 )
2629 }
2630 }
2631 unsafe impl<
2632 D: fidl::encoding::ResourceDialect,
2633 T0: fidl::encoding::Encode<u16, D>,
2634 T1: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::BtCoexistenceMode, D>,
2635 > fidl::encoding::Encode<DeviceMonitorSetBtCoexistenceModeRequest, D> for (T0, T1)
2636 {
2637 #[inline]
2638 unsafe fn encode(
2639 self,
2640 encoder: &mut fidl::encoding::Encoder<'_, D>,
2641 offset: usize,
2642 depth: fidl::encoding::Depth,
2643 ) -> fidl::Result<()> {
2644 encoder.debug_check_bounds::<DeviceMonitorSetBtCoexistenceModeRequest>(offset);
2645 unsafe {
2648 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2649 (ptr as *mut u32).write_unaligned(0);
2650 }
2651 self.0.encode(encoder, offset + 0, depth)?;
2653 self.1.encode(encoder, offset + 4, depth)?;
2654 Ok(())
2655 }
2656 }
2657
2658 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2659 for DeviceMonitorSetBtCoexistenceModeRequest
2660 {
2661 #[inline(always)]
2662 fn new_empty() -> Self {
2663 Self {
2664 phy_id: fidl::new_empty!(u16, D),
2665 mode: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::BtCoexistenceMode, D),
2666 }
2667 }
2668
2669 #[inline]
2670 unsafe fn decode(
2671 &mut self,
2672 decoder: &mut fidl::encoding::Decoder<'_, D>,
2673 offset: usize,
2674 _depth: fidl::encoding::Depth,
2675 ) -> fidl::Result<()> {
2676 decoder.debug_check_bounds::<Self>(offset);
2677 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2679 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2680 let mask = 0xffff0000u32;
2681 let maskedval = padval & mask;
2682 if maskedval != 0 {
2683 return Err(fidl::Error::NonZeroPadding {
2684 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2685 });
2686 }
2687 fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
2688 fidl::decode!(
2689 fidl_fuchsia_wlan_internal__common::BtCoexistenceMode,
2690 D,
2691 &mut self.mode,
2692 decoder,
2693 offset + 4,
2694 _depth
2695 )?;
2696 Ok(())
2697 }
2698 }
2699
2700 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryRequest {
2701 type Borrowed<'a> = &'a Self;
2702 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2703 value
2704 }
2705 }
2706
2707 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryRequest {
2708 type Owned = Self;
2709
2710 #[inline(always)]
2711 fn inline_align(_context: fidl::encoding::Context) -> usize {
2712 2
2713 }
2714
2715 #[inline(always)]
2716 fn inline_size(_context: fidl::encoding::Context) -> usize {
2717 4
2718 }
2719 #[inline(always)]
2720 fn encode_is_copy() -> bool {
2721 true
2722 }
2723
2724 #[inline(always)]
2725 fn decode_is_copy() -> bool {
2726 true
2727 }
2728 }
2729
2730 unsafe impl<D: fidl::encoding::ResourceDialect>
2731 fidl::encoding::Encode<DeviceMonitorSetCountryRequest, D>
2732 for &DeviceMonitorSetCountryRequest
2733 {
2734 #[inline]
2735 unsafe fn encode(
2736 self,
2737 encoder: &mut fidl::encoding::Encoder<'_, D>,
2738 offset: usize,
2739 _depth: fidl::encoding::Depth,
2740 ) -> fidl::Result<()> {
2741 encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
2742 unsafe {
2743 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2745 (buf_ptr as *mut DeviceMonitorSetCountryRequest)
2746 .write_unaligned((self as *const DeviceMonitorSetCountryRequest).read());
2747 }
2750 Ok(())
2751 }
2752 }
2753 unsafe impl<
2754 D: fidl::encoding::ResourceDialect,
2755 T0: fidl::encoding::Encode<SetCountryRequest, D>,
2756 > fidl::encoding::Encode<DeviceMonitorSetCountryRequest, D> for (T0,)
2757 {
2758 #[inline]
2759 unsafe fn encode(
2760 self,
2761 encoder: &mut fidl::encoding::Encoder<'_, D>,
2762 offset: usize,
2763 depth: fidl::encoding::Depth,
2764 ) -> fidl::Result<()> {
2765 encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
2766 self.0.encode(encoder, offset + 0, depth)?;
2770 Ok(())
2771 }
2772 }
2773
2774 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2775 for DeviceMonitorSetCountryRequest
2776 {
2777 #[inline(always)]
2778 fn new_empty() -> Self {
2779 Self { req: fidl::new_empty!(SetCountryRequest, D) }
2780 }
2781
2782 #[inline]
2783 unsafe fn decode(
2784 &mut self,
2785 decoder: &mut fidl::encoding::Decoder<'_, D>,
2786 offset: usize,
2787 _depth: fidl::encoding::Depth,
2788 ) -> fidl::Result<()> {
2789 decoder.debug_check_bounds::<Self>(offset);
2790 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2791 unsafe {
2794 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2795 }
2796 Ok(())
2797 }
2798 }
2799
2800 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryResponse {
2801 type Borrowed<'a> = &'a Self;
2802 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2803 value
2804 }
2805 }
2806
2807 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryResponse {
2808 type Owned = Self;
2809
2810 #[inline(always)]
2811 fn inline_align(_context: fidl::encoding::Context) -> usize {
2812 4
2813 }
2814
2815 #[inline(always)]
2816 fn inline_size(_context: fidl::encoding::Context) -> usize {
2817 4
2818 }
2819 #[inline(always)]
2820 fn encode_is_copy() -> bool {
2821 true
2822 }
2823
2824 #[inline(always)]
2825 fn decode_is_copy() -> bool {
2826 true
2827 }
2828 }
2829
2830 unsafe impl<D: fidl::encoding::ResourceDialect>
2831 fidl::encoding::Encode<DeviceMonitorSetCountryResponse, D>
2832 for &DeviceMonitorSetCountryResponse
2833 {
2834 #[inline]
2835 unsafe fn encode(
2836 self,
2837 encoder: &mut fidl::encoding::Encoder<'_, D>,
2838 offset: usize,
2839 _depth: fidl::encoding::Depth,
2840 ) -> fidl::Result<()> {
2841 encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
2842 unsafe {
2843 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2845 (buf_ptr as *mut DeviceMonitorSetCountryResponse)
2846 .write_unaligned((self as *const DeviceMonitorSetCountryResponse).read());
2847 }
2850 Ok(())
2851 }
2852 }
2853 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2854 fidl::encoding::Encode<DeviceMonitorSetCountryResponse, D> for (T0,)
2855 {
2856 #[inline]
2857 unsafe fn encode(
2858 self,
2859 encoder: &mut fidl::encoding::Encoder<'_, D>,
2860 offset: usize,
2861 depth: fidl::encoding::Depth,
2862 ) -> fidl::Result<()> {
2863 encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
2864 self.0.encode(encoder, offset + 0, depth)?;
2868 Ok(())
2869 }
2870 }
2871
2872 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2873 for DeviceMonitorSetCountryResponse
2874 {
2875 #[inline(always)]
2876 fn new_empty() -> Self {
2877 Self { status: fidl::new_empty!(i32, D) }
2878 }
2879
2880 #[inline]
2881 unsafe fn decode(
2882 &mut self,
2883 decoder: &mut fidl::encoding::Decoder<'_, D>,
2884 offset: usize,
2885 _depth: fidl::encoding::Depth,
2886 ) -> fidl::Result<()> {
2887 decoder.debug_check_bounds::<Self>(offset);
2888 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2889 unsafe {
2892 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2893 }
2894 Ok(())
2895 }
2896 }
2897
2898 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeRequest {
2899 type Borrowed<'a> = &'a Self;
2900 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2901 value
2902 }
2903 }
2904
2905 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeRequest {
2906 type Owned = Self;
2907
2908 #[inline(always)]
2909 fn inline_align(_context: fidl::encoding::Context) -> usize {
2910 4
2911 }
2912
2913 #[inline(always)]
2914 fn inline_size(_context: fidl::encoding::Context) -> usize {
2915 8
2916 }
2917 }
2918
2919 unsafe impl<D: fidl::encoding::ResourceDialect>
2920 fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, D>
2921 for &DeviceMonitorSetPowerSaveModeRequest
2922 {
2923 #[inline]
2924 unsafe fn encode(
2925 self,
2926 encoder: &mut fidl::encoding::Encoder<'_, D>,
2927 offset: usize,
2928 _depth: fidl::encoding::Depth,
2929 ) -> fidl::Result<()> {
2930 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
2931 fidl::encoding::Encode::<DeviceMonitorSetPowerSaveModeRequest, D>::encode(
2933 (<SetPowerSaveModeRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
2934 encoder,
2935 offset,
2936 _depth,
2937 )
2938 }
2939 }
2940 unsafe impl<
2941 D: fidl::encoding::ResourceDialect,
2942 T0: fidl::encoding::Encode<SetPowerSaveModeRequest, D>,
2943 > fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, D> for (T0,)
2944 {
2945 #[inline]
2946 unsafe fn encode(
2947 self,
2948 encoder: &mut fidl::encoding::Encoder<'_, D>,
2949 offset: usize,
2950 depth: fidl::encoding::Depth,
2951 ) -> fidl::Result<()> {
2952 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
2953 self.0.encode(encoder, offset + 0, depth)?;
2957 Ok(())
2958 }
2959 }
2960
2961 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2962 for DeviceMonitorSetPowerSaveModeRequest
2963 {
2964 #[inline(always)]
2965 fn new_empty() -> Self {
2966 Self { req: fidl::new_empty!(SetPowerSaveModeRequest, D) }
2967 }
2968
2969 #[inline]
2970 unsafe fn decode(
2971 &mut self,
2972 decoder: &mut fidl::encoding::Decoder<'_, D>,
2973 offset: usize,
2974 _depth: fidl::encoding::Depth,
2975 ) -> fidl::Result<()> {
2976 decoder.debug_check_bounds::<Self>(offset);
2977 fidl::decode!(SetPowerSaveModeRequest, D, &mut self.req, decoder, offset + 0, _depth)?;
2979 Ok(())
2980 }
2981 }
2982
2983 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeResponse {
2984 type Borrowed<'a> = &'a Self;
2985 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2986 value
2987 }
2988 }
2989
2990 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeResponse {
2991 type Owned = Self;
2992
2993 #[inline(always)]
2994 fn inline_align(_context: fidl::encoding::Context) -> usize {
2995 4
2996 }
2997
2998 #[inline(always)]
2999 fn inline_size(_context: fidl::encoding::Context) -> usize {
3000 4
3001 }
3002 #[inline(always)]
3003 fn encode_is_copy() -> bool {
3004 true
3005 }
3006
3007 #[inline(always)]
3008 fn decode_is_copy() -> bool {
3009 true
3010 }
3011 }
3012
3013 unsafe impl<D: fidl::encoding::ResourceDialect>
3014 fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, D>
3015 for &DeviceMonitorSetPowerSaveModeResponse
3016 {
3017 #[inline]
3018 unsafe fn encode(
3019 self,
3020 encoder: &mut fidl::encoding::Encoder<'_, D>,
3021 offset: usize,
3022 _depth: fidl::encoding::Depth,
3023 ) -> fidl::Result<()> {
3024 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
3025 unsafe {
3026 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3028 (buf_ptr as *mut DeviceMonitorSetPowerSaveModeResponse)
3029 .write_unaligned((self as *const DeviceMonitorSetPowerSaveModeResponse).read());
3030 }
3033 Ok(())
3034 }
3035 }
3036 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
3037 fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, D> for (T0,)
3038 {
3039 #[inline]
3040 unsafe fn encode(
3041 self,
3042 encoder: &mut fidl::encoding::Encoder<'_, D>,
3043 offset: usize,
3044 depth: fidl::encoding::Depth,
3045 ) -> fidl::Result<()> {
3046 encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
3047 self.0.encode(encoder, offset + 0, depth)?;
3051 Ok(())
3052 }
3053 }
3054
3055 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3056 for DeviceMonitorSetPowerSaveModeResponse
3057 {
3058 #[inline(always)]
3059 fn new_empty() -> Self {
3060 Self { status: fidl::new_empty!(i32, D) }
3061 }
3062
3063 #[inline]
3064 unsafe fn decode(
3065 &mut self,
3066 decoder: &mut fidl::encoding::Decoder<'_, D>,
3067 offset: usize,
3068 _depth: fidl::encoding::Depth,
3069 ) -> fidl::Result<()> {
3070 decoder.debug_check_bounds::<Self>(offset);
3071 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3072 unsafe {
3075 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3076 }
3077 Ok(())
3078 }
3079 }
3080
3081 impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetTxPowerScenarioRequest {
3082 type Borrowed<'a> = &'a Self;
3083 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3084 value
3085 }
3086 }
3087
3088 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetTxPowerScenarioRequest {
3089 type Owned = Self;
3090
3091 #[inline(always)]
3092 fn inline_align(_context: fidl::encoding::Context) -> usize {
3093 4
3094 }
3095
3096 #[inline(always)]
3097 fn inline_size(_context: fidl::encoding::Context) -> usize {
3098 8
3099 }
3100 }
3101
3102 unsafe impl<D: fidl::encoding::ResourceDialect>
3103 fidl::encoding::Encode<DeviceMonitorSetTxPowerScenarioRequest, D>
3104 for &DeviceMonitorSetTxPowerScenarioRequest
3105 {
3106 #[inline]
3107 unsafe fn encode(
3108 self,
3109 encoder: &mut fidl::encoding::Encoder<'_, D>,
3110 offset: usize,
3111 _depth: fidl::encoding::Depth,
3112 ) -> fidl::Result<()> {
3113 encoder.debug_check_bounds::<DeviceMonitorSetTxPowerScenarioRequest>(offset);
3114 fidl::encoding::Encode::<DeviceMonitorSetTxPowerScenarioRequest, D>::encode(
3116 (
3117 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
3118 <fidl_fuchsia_wlan_internal__common::TxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow(&self.scenario),
3119 ),
3120 encoder, offset, _depth
3121 )
3122 }
3123 }
3124 unsafe impl<
3125 D: fidl::encoding::ResourceDialect,
3126 T0: fidl::encoding::Encode<u16, D>,
3127 T1: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::TxPowerScenario, D>,
3128 > fidl::encoding::Encode<DeviceMonitorSetTxPowerScenarioRequest, D> for (T0, T1)
3129 {
3130 #[inline]
3131 unsafe fn encode(
3132 self,
3133 encoder: &mut fidl::encoding::Encoder<'_, D>,
3134 offset: usize,
3135 depth: fidl::encoding::Depth,
3136 ) -> fidl::Result<()> {
3137 encoder.debug_check_bounds::<DeviceMonitorSetTxPowerScenarioRequest>(offset);
3138 unsafe {
3141 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3142 (ptr as *mut u32).write_unaligned(0);
3143 }
3144 self.0.encode(encoder, offset + 0, depth)?;
3146 self.1.encode(encoder, offset + 4, depth)?;
3147 Ok(())
3148 }
3149 }
3150
3151 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3152 for DeviceMonitorSetTxPowerScenarioRequest
3153 {
3154 #[inline(always)]
3155 fn new_empty() -> Self {
3156 Self {
3157 phy_id: fidl::new_empty!(u16, D),
3158 scenario: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::TxPowerScenario, D),
3159 }
3160 }
3161
3162 #[inline]
3163 unsafe fn decode(
3164 &mut self,
3165 decoder: &mut fidl::encoding::Decoder<'_, D>,
3166 offset: usize,
3167 _depth: fidl::encoding::Depth,
3168 ) -> fidl::Result<()> {
3169 decoder.debug_check_bounds::<Self>(offset);
3170 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3172 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3173 let mask = 0xffff0000u32;
3174 let maskedval = padval & mask;
3175 if maskedval != 0 {
3176 return Err(fidl::Error::NonZeroPadding {
3177 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3178 });
3179 }
3180 fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
3181 fidl::decode!(
3182 fidl_fuchsia_wlan_internal__common::TxPowerScenario,
3183 D,
3184 &mut self.scenario,
3185 decoder,
3186 offset + 4,
3187 _depth
3188 )?;
3189 Ok(())
3190 }
3191 }
3192
3193 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryResponse {
3194 type Borrowed<'a> = &'a Self;
3195 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3196 value
3197 }
3198 }
3199
3200 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryResponse {
3201 type Owned = Self;
3202
3203 #[inline(always)]
3204 fn inline_align(_context: fidl::encoding::Context) -> usize {
3205 1
3206 }
3207
3208 #[inline(always)]
3209 fn inline_size(_context: fidl::encoding::Context) -> usize {
3210 2
3211 }
3212 #[inline(always)]
3213 fn encode_is_copy() -> bool {
3214 true
3215 }
3216
3217 #[inline(always)]
3218 fn decode_is_copy() -> bool {
3219 true
3220 }
3221 }
3222
3223 unsafe impl<D: fidl::encoding::ResourceDialect>
3224 fidl::encoding::Encode<DeviceMonitorGetCountryResponse, D>
3225 for &DeviceMonitorGetCountryResponse
3226 {
3227 #[inline]
3228 unsafe fn encode(
3229 self,
3230 encoder: &mut fidl::encoding::Encoder<'_, D>,
3231 offset: usize,
3232 _depth: fidl::encoding::Depth,
3233 ) -> fidl::Result<()> {
3234 encoder.debug_check_bounds::<DeviceMonitorGetCountryResponse>(offset);
3235 unsafe {
3236 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3238 (buf_ptr as *mut DeviceMonitorGetCountryResponse)
3239 .write_unaligned((self as *const DeviceMonitorGetCountryResponse).read());
3240 }
3243 Ok(())
3244 }
3245 }
3246 unsafe impl<
3247 D: fidl::encoding::ResourceDialect,
3248 T0: fidl::encoding::Encode<GetCountryResponse, D>,
3249 > fidl::encoding::Encode<DeviceMonitorGetCountryResponse, D> for (T0,)
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::<DeviceMonitorGetCountryResponse>(offset);
3259 self.0.encode(encoder, offset + 0, depth)?;
3263 Ok(())
3264 }
3265 }
3266
3267 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3268 for DeviceMonitorGetCountryResponse
3269 {
3270 #[inline(always)]
3271 fn new_empty() -> Self {
3272 Self { resp: fidl::new_empty!(GetCountryResponse, D) }
3273 }
3274
3275 #[inline]
3276 unsafe fn decode(
3277 &mut self,
3278 decoder: &mut fidl::encoding::Decoder<'_, D>,
3279 offset: usize,
3280 _depth: fidl::encoding::Depth,
3281 ) -> fidl::Result<()> {
3282 decoder.debug_check_bounds::<Self>(offset);
3283 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3284 unsafe {
3287 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3288 }
3289 Ok(())
3290 }
3291 }
3292
3293 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeResponse {
3294 type Borrowed<'a> = &'a Self;
3295 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3296 value
3297 }
3298 }
3299
3300 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeResponse {
3301 type Owned = Self;
3302
3303 #[inline(always)]
3304 fn inline_align(_context: fidl::encoding::Context) -> usize {
3305 4
3306 }
3307
3308 #[inline(always)]
3309 fn inline_size(_context: fidl::encoding::Context) -> usize {
3310 4
3311 }
3312 }
3313
3314 unsafe impl<D: fidl::encoding::ResourceDialect>
3315 fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, D>
3316 for &DeviceMonitorGetPowerSaveModeResponse
3317 {
3318 #[inline]
3319 unsafe fn encode(
3320 self,
3321 encoder: &mut fidl::encoding::Encoder<'_, D>,
3322 offset: usize,
3323 _depth: fidl::encoding::Depth,
3324 ) -> fidl::Result<()> {
3325 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
3326 fidl::encoding::Encode::<DeviceMonitorGetPowerSaveModeResponse, D>::encode(
3328 (<GetPowerSaveModeResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
3329 encoder,
3330 offset,
3331 _depth,
3332 )
3333 }
3334 }
3335 unsafe impl<
3336 D: fidl::encoding::ResourceDialect,
3337 T0: fidl::encoding::Encode<GetPowerSaveModeResponse, D>,
3338 > fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, D> for (T0,)
3339 {
3340 #[inline]
3341 unsafe fn encode(
3342 self,
3343 encoder: &mut fidl::encoding::Encoder<'_, D>,
3344 offset: usize,
3345 depth: fidl::encoding::Depth,
3346 ) -> fidl::Result<()> {
3347 encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
3348 self.0.encode(encoder, offset + 0, depth)?;
3352 Ok(())
3353 }
3354 }
3355
3356 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3357 for DeviceMonitorGetPowerSaveModeResponse
3358 {
3359 #[inline(always)]
3360 fn new_empty() -> Self {
3361 Self { resp: fidl::new_empty!(GetPowerSaveModeResponse, D) }
3362 }
3363
3364 #[inline]
3365 unsafe fn decode(
3366 &mut self,
3367 decoder: &mut fidl::encoding::Decoder<'_, D>,
3368 offset: usize,
3369 _depth: fidl::encoding::Depth,
3370 ) -> fidl::Result<()> {
3371 decoder.debug_check_bounds::<Self>(offset);
3372 fidl::decode!(
3374 GetPowerSaveModeResponse,
3375 D,
3376 &mut self.resp,
3377 decoder,
3378 offset + 0,
3379 _depth
3380 )?;
3381 Ok(())
3382 }
3383 }
3384
3385 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerStateResponse {
3386 type Borrowed<'a> = &'a Self;
3387 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3388 value
3389 }
3390 }
3391
3392 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerStateResponse {
3393 type Owned = Self;
3394
3395 #[inline(always)]
3396 fn inline_align(_context: fidl::encoding::Context) -> usize {
3397 1
3398 }
3399
3400 #[inline(always)]
3401 fn inline_size(_context: fidl::encoding::Context) -> usize {
3402 1
3403 }
3404 }
3405
3406 unsafe impl<D: fidl::encoding::ResourceDialect>
3407 fidl::encoding::Encode<DeviceMonitorGetPowerStateResponse, D>
3408 for &DeviceMonitorGetPowerStateResponse
3409 {
3410 #[inline]
3411 unsafe fn encode(
3412 self,
3413 encoder: &mut fidl::encoding::Encoder<'_, D>,
3414 offset: usize,
3415 _depth: fidl::encoding::Depth,
3416 ) -> fidl::Result<()> {
3417 encoder.debug_check_bounds::<DeviceMonitorGetPowerStateResponse>(offset);
3418 fidl::encoding::Encode::<DeviceMonitorGetPowerStateResponse, D>::encode(
3420 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.power_on),),
3421 encoder,
3422 offset,
3423 _depth,
3424 )
3425 }
3426 }
3427 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3428 fidl::encoding::Encode<DeviceMonitorGetPowerStateResponse, D> for (T0,)
3429 {
3430 #[inline]
3431 unsafe fn encode(
3432 self,
3433 encoder: &mut fidl::encoding::Encoder<'_, D>,
3434 offset: usize,
3435 depth: fidl::encoding::Depth,
3436 ) -> fidl::Result<()> {
3437 encoder.debug_check_bounds::<DeviceMonitorGetPowerStateResponse>(offset);
3438 self.0.encode(encoder, offset + 0, depth)?;
3442 Ok(())
3443 }
3444 }
3445
3446 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3447 for DeviceMonitorGetPowerStateResponse
3448 {
3449 #[inline(always)]
3450 fn new_empty() -> Self {
3451 Self { power_on: fidl::new_empty!(bool, D) }
3452 }
3453
3454 #[inline]
3455 unsafe fn decode(
3456 &mut self,
3457 decoder: &mut fidl::encoding::Decoder<'_, D>,
3458 offset: usize,
3459 _depth: fidl::encoding::Depth,
3460 ) -> fidl::Result<()> {
3461 decoder.debug_check_bounds::<Self>(offset);
3462 fidl::decode!(bool, D, &mut self.power_on, decoder, offset + 0, _depth)?;
3464 Ok(())
3465 }
3466 }
3467
3468 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
3469 type Borrowed<'a> = &'a Self;
3470 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3471 value
3472 }
3473 }
3474
3475 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
3476 type Owned = Self;
3477
3478 #[inline(always)]
3479 fn inline_align(_context: fidl::encoding::Context) -> usize {
3480 8
3481 }
3482
3483 #[inline(always)]
3484 fn inline_size(_context: fidl::encoding::Context) -> usize {
3485 16
3486 }
3487 }
3488
3489 unsafe impl<D: fidl::encoding::ResourceDialect>
3490 fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse, D>
3491 for &DeviceMonitorGetSupportedMacRolesResponse
3492 {
3493 #[inline]
3494 unsafe fn encode(
3495 self,
3496 encoder: &mut fidl::encoding::Encoder<'_, D>,
3497 offset: usize,
3498 _depth: fidl::encoding::Depth,
3499 ) -> fidl::Result<()> {
3500 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
3501 fidl::encoding::Encode::<DeviceMonitorGetSupportedMacRolesResponse, D>::encode(
3503 (
3504 <fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_mac_roles),
3505 ),
3506 encoder, offset, _depth
3507 )
3508 }
3509 }
3510 unsafe impl<
3511 D: fidl::encoding::ResourceDialect,
3512 T0: fidl::encoding::Encode<
3513 fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>,
3514 D,
3515 >,
3516 > fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse, D> for (T0,)
3517 {
3518 #[inline]
3519 unsafe fn encode(
3520 self,
3521 encoder: &mut fidl::encoding::Encoder<'_, D>,
3522 offset: usize,
3523 depth: fidl::encoding::Depth,
3524 ) -> fidl::Result<()> {
3525 encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
3526 self.0.encode(encoder, offset + 0, depth)?;
3530 Ok(())
3531 }
3532 }
3533
3534 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3535 for DeviceMonitorGetSupportedMacRolesResponse
3536 {
3537 #[inline(always)]
3538 fn new_empty() -> Self {
3539 Self {
3540 supported_mac_roles: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D),
3541 }
3542 }
3543
3544 #[inline]
3545 unsafe fn decode(
3546 &mut self,
3547 decoder: &mut fidl::encoding::Decoder<'_, D>,
3548 offset: usize,
3549 _depth: fidl::encoding::Depth,
3550 ) -> fidl::Result<()> {
3551 decoder.debug_check_bounds::<Self>(offset);
3552 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanMacRole, 16>, D, &mut self.supported_mac_roles, decoder, offset + 0, _depth)?;
3554 Ok(())
3555 }
3556 }
3557
3558 impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetTxPowerScenarioResponse {
3559 type Borrowed<'a> = &'a Self;
3560 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3561 value
3562 }
3563 }
3564
3565 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetTxPowerScenarioResponse {
3566 type Owned = Self;
3567
3568 #[inline(always)]
3569 fn inline_align(_context: fidl::encoding::Context) -> usize {
3570 4
3571 }
3572
3573 #[inline(always)]
3574 fn inline_size(_context: fidl::encoding::Context) -> usize {
3575 4
3576 }
3577 }
3578
3579 unsafe impl<D: fidl::encoding::ResourceDialect>
3580 fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioResponse, D>
3581 for &DeviceMonitorGetTxPowerScenarioResponse
3582 {
3583 #[inline]
3584 unsafe fn encode(
3585 self,
3586 encoder: &mut fidl::encoding::Encoder<'_, D>,
3587 offset: usize,
3588 _depth: fidl::encoding::Depth,
3589 ) -> fidl::Result<()> {
3590 encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioResponse>(offset);
3591 fidl::encoding::Encode::<DeviceMonitorGetTxPowerScenarioResponse, D>::encode(
3593 (
3594 <fidl_fuchsia_wlan_internal__common::TxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow(&self.scenario),
3595 ),
3596 encoder, offset, _depth
3597 )
3598 }
3599 }
3600 unsafe impl<
3601 D: fidl::encoding::ResourceDialect,
3602 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_internal__common::TxPowerScenario, D>,
3603 > fidl::encoding::Encode<DeviceMonitorGetTxPowerScenarioResponse, D> for (T0,)
3604 {
3605 #[inline]
3606 unsafe fn encode(
3607 self,
3608 encoder: &mut fidl::encoding::Encoder<'_, D>,
3609 offset: usize,
3610 depth: fidl::encoding::Depth,
3611 ) -> fidl::Result<()> {
3612 encoder.debug_check_bounds::<DeviceMonitorGetTxPowerScenarioResponse>(offset);
3613 self.0.encode(encoder, offset + 0, depth)?;
3617 Ok(())
3618 }
3619 }
3620
3621 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3622 for DeviceMonitorGetTxPowerScenarioResponse
3623 {
3624 #[inline(always)]
3625 fn new_empty() -> Self {
3626 Self {
3627 scenario: fidl::new_empty!(fidl_fuchsia_wlan_internal__common::TxPowerScenario, D),
3628 }
3629 }
3630
3631 #[inline]
3632 unsafe fn decode(
3633 &mut self,
3634 decoder: &mut fidl::encoding::Decoder<'_, D>,
3635 offset: usize,
3636 _depth: fidl::encoding::Depth,
3637 ) -> fidl::Result<()> {
3638 decoder.debug_check_bounds::<Self>(offset);
3639 fidl::decode!(
3641 fidl_fuchsia_wlan_internal__common::TxPowerScenario,
3642 D,
3643 &mut self.scenario,
3644 decoder,
3645 offset + 0,
3646 _depth
3647 )?;
3648 Ok(())
3649 }
3650 }
3651
3652 impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceResponse {
3653 type Borrowed<'a> = &'a Self;
3654 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3655 value
3656 }
3657 }
3658
3659 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceResponse {
3660 type Owned = Self;
3661
3662 #[inline(always)]
3663 fn inline_align(_context: fidl::encoding::Context) -> usize {
3664 4
3665 }
3666
3667 #[inline(always)]
3668 fn inline_size(_context: fidl::encoding::Context) -> usize {
3669 16
3670 }
3671 }
3672
3673 unsafe impl<D: fidl::encoding::ResourceDialect>
3674 fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, D>
3675 for &DeviceMonitorQueryIfaceResponse
3676 {
3677 #[inline]
3678 unsafe fn encode(
3679 self,
3680 encoder: &mut fidl::encoding::Encoder<'_, D>,
3681 offset: usize,
3682 _depth: fidl::encoding::Depth,
3683 ) -> fidl::Result<()> {
3684 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
3685 fidl::encoding::Encode::<DeviceMonitorQueryIfaceResponse, D>::encode(
3687 (<QueryIfaceResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
3688 encoder,
3689 offset,
3690 _depth,
3691 )
3692 }
3693 }
3694 unsafe impl<
3695 D: fidl::encoding::ResourceDialect,
3696 T0: fidl::encoding::Encode<QueryIfaceResponse, D>,
3697 > fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, D> for (T0,)
3698 {
3699 #[inline]
3700 unsafe fn encode(
3701 self,
3702 encoder: &mut fidl::encoding::Encoder<'_, D>,
3703 offset: usize,
3704 depth: fidl::encoding::Depth,
3705 ) -> fidl::Result<()> {
3706 encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
3707 self.0.encode(encoder, offset + 0, depth)?;
3711 Ok(())
3712 }
3713 }
3714
3715 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3716 for DeviceMonitorQueryIfaceResponse
3717 {
3718 #[inline(always)]
3719 fn new_empty() -> Self {
3720 Self { resp: fidl::new_empty!(QueryIfaceResponse, D) }
3721 }
3722
3723 #[inline]
3724 unsafe fn decode(
3725 &mut self,
3726 decoder: &mut fidl::encoding::Decoder<'_, D>,
3727 offset: usize,
3728 _depth: fidl::encoding::Depth,
3729 ) -> fidl::Result<()> {
3730 decoder.debug_check_bounds::<Self>(offset);
3731 fidl::decode!(QueryIfaceResponse, D, &mut self.resp, decoder, offset + 0, _depth)?;
3733 Ok(())
3734 }
3735 }
3736
3737 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceAddedRequest {
3738 type Borrowed<'a> = &'a Self;
3739 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3740 value
3741 }
3742 }
3743
3744 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceAddedRequest {
3745 type Owned = Self;
3746
3747 #[inline(always)]
3748 fn inline_align(_context: fidl::encoding::Context) -> usize {
3749 2
3750 }
3751
3752 #[inline(always)]
3753 fn inline_size(_context: fidl::encoding::Context) -> usize {
3754 2
3755 }
3756 #[inline(always)]
3757 fn encode_is_copy() -> bool {
3758 true
3759 }
3760
3761 #[inline(always)]
3762 fn decode_is_copy() -> bool {
3763 true
3764 }
3765 }
3766
3767 unsafe impl<D: fidl::encoding::ResourceDialect>
3768 fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest, D>
3769 for &DeviceWatcherOnIfaceAddedRequest
3770 {
3771 #[inline]
3772 unsafe fn encode(
3773 self,
3774 encoder: &mut fidl::encoding::Encoder<'_, D>,
3775 offset: usize,
3776 _depth: fidl::encoding::Depth,
3777 ) -> fidl::Result<()> {
3778 encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
3779 unsafe {
3780 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3782 (buf_ptr as *mut DeviceWatcherOnIfaceAddedRequest)
3783 .write_unaligned((self as *const DeviceWatcherOnIfaceAddedRequest).read());
3784 }
3787 Ok(())
3788 }
3789 }
3790 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
3791 fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest, D> for (T0,)
3792 {
3793 #[inline]
3794 unsafe fn encode(
3795 self,
3796 encoder: &mut fidl::encoding::Encoder<'_, D>,
3797 offset: usize,
3798 depth: fidl::encoding::Depth,
3799 ) -> fidl::Result<()> {
3800 encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
3801 self.0.encode(encoder, offset + 0, depth)?;
3805 Ok(())
3806 }
3807 }
3808
3809 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3810 for DeviceWatcherOnIfaceAddedRequest
3811 {
3812 #[inline(always)]
3813 fn new_empty() -> Self {
3814 Self { iface_id: fidl::new_empty!(u16, D) }
3815 }
3816
3817 #[inline]
3818 unsafe fn decode(
3819 &mut self,
3820 decoder: &mut fidl::encoding::Decoder<'_, D>,
3821 offset: usize,
3822 _depth: fidl::encoding::Depth,
3823 ) -> fidl::Result<()> {
3824 decoder.debug_check_bounds::<Self>(offset);
3825 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3826 unsafe {
3829 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3830 }
3831 Ok(())
3832 }
3833 }
3834
3835 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceRemovedRequest {
3836 type Borrowed<'a> = &'a Self;
3837 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3838 value
3839 }
3840 }
3841
3842 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceRemovedRequest {
3843 type Owned = Self;
3844
3845 #[inline(always)]
3846 fn inline_align(_context: fidl::encoding::Context) -> usize {
3847 2
3848 }
3849
3850 #[inline(always)]
3851 fn inline_size(_context: fidl::encoding::Context) -> usize {
3852 2
3853 }
3854 #[inline(always)]
3855 fn encode_is_copy() -> bool {
3856 true
3857 }
3858
3859 #[inline(always)]
3860 fn decode_is_copy() -> bool {
3861 true
3862 }
3863 }
3864
3865 unsafe impl<D: fidl::encoding::ResourceDialect>
3866 fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest, D>
3867 for &DeviceWatcherOnIfaceRemovedRequest
3868 {
3869 #[inline]
3870 unsafe fn encode(
3871 self,
3872 encoder: &mut fidl::encoding::Encoder<'_, D>,
3873 offset: usize,
3874 _depth: fidl::encoding::Depth,
3875 ) -> fidl::Result<()> {
3876 encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
3877 unsafe {
3878 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3880 (buf_ptr as *mut DeviceWatcherOnIfaceRemovedRequest)
3881 .write_unaligned((self as *const DeviceWatcherOnIfaceRemovedRequest).read());
3882 }
3885 Ok(())
3886 }
3887 }
3888 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
3889 fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest, D> for (T0,)
3890 {
3891 #[inline]
3892 unsafe fn encode(
3893 self,
3894 encoder: &mut fidl::encoding::Encoder<'_, D>,
3895 offset: usize,
3896 depth: fidl::encoding::Depth,
3897 ) -> fidl::Result<()> {
3898 encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
3899 self.0.encode(encoder, offset + 0, depth)?;
3903 Ok(())
3904 }
3905 }
3906
3907 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3908 for DeviceWatcherOnIfaceRemovedRequest
3909 {
3910 #[inline(always)]
3911 fn new_empty() -> Self {
3912 Self { iface_id: fidl::new_empty!(u16, D) }
3913 }
3914
3915 #[inline]
3916 unsafe fn decode(
3917 &mut self,
3918 decoder: &mut fidl::encoding::Decoder<'_, D>,
3919 offset: usize,
3920 _depth: fidl::encoding::Depth,
3921 ) -> fidl::Result<()> {
3922 decoder.debug_check_bounds::<Self>(offset);
3923 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3924 unsafe {
3927 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3928 }
3929 Ok(())
3930 }
3931 }
3932
3933 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyAddedRequest {
3934 type Borrowed<'a> = &'a Self;
3935 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3936 value
3937 }
3938 }
3939
3940 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyAddedRequest {
3941 type Owned = Self;
3942
3943 #[inline(always)]
3944 fn inline_align(_context: fidl::encoding::Context) -> usize {
3945 2
3946 }
3947
3948 #[inline(always)]
3949 fn inline_size(_context: fidl::encoding::Context) -> usize {
3950 2
3951 }
3952 #[inline(always)]
3953 fn encode_is_copy() -> bool {
3954 true
3955 }
3956
3957 #[inline(always)]
3958 fn decode_is_copy() -> bool {
3959 true
3960 }
3961 }
3962
3963 unsafe impl<D: fidl::encoding::ResourceDialect>
3964 fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest, D>
3965 for &DeviceWatcherOnPhyAddedRequest
3966 {
3967 #[inline]
3968 unsafe fn encode(
3969 self,
3970 encoder: &mut fidl::encoding::Encoder<'_, D>,
3971 offset: usize,
3972 _depth: fidl::encoding::Depth,
3973 ) -> fidl::Result<()> {
3974 encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
3975 unsafe {
3976 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3978 (buf_ptr as *mut DeviceWatcherOnPhyAddedRequest)
3979 .write_unaligned((self as *const DeviceWatcherOnPhyAddedRequest).read());
3980 }
3983 Ok(())
3984 }
3985 }
3986 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
3987 fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest, D> for (T0,)
3988 {
3989 #[inline]
3990 unsafe fn encode(
3991 self,
3992 encoder: &mut fidl::encoding::Encoder<'_, D>,
3993 offset: usize,
3994 depth: fidl::encoding::Depth,
3995 ) -> fidl::Result<()> {
3996 encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
3997 self.0.encode(encoder, offset + 0, depth)?;
4001 Ok(())
4002 }
4003 }
4004
4005 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4006 for DeviceWatcherOnPhyAddedRequest
4007 {
4008 #[inline(always)]
4009 fn new_empty() -> Self {
4010 Self { phy_id: fidl::new_empty!(u16, D) }
4011 }
4012
4013 #[inline]
4014 unsafe fn decode(
4015 &mut self,
4016 decoder: &mut fidl::encoding::Decoder<'_, D>,
4017 offset: usize,
4018 _depth: fidl::encoding::Depth,
4019 ) -> fidl::Result<()> {
4020 decoder.debug_check_bounds::<Self>(offset);
4021 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4022 unsafe {
4025 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
4026 }
4027 Ok(())
4028 }
4029 }
4030
4031 impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyRemovedRequest {
4032 type Borrowed<'a> = &'a Self;
4033 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4034 value
4035 }
4036 }
4037
4038 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyRemovedRequest {
4039 type Owned = Self;
4040
4041 #[inline(always)]
4042 fn inline_align(_context: fidl::encoding::Context) -> usize {
4043 2
4044 }
4045
4046 #[inline(always)]
4047 fn inline_size(_context: fidl::encoding::Context) -> usize {
4048 2
4049 }
4050 #[inline(always)]
4051 fn encode_is_copy() -> bool {
4052 true
4053 }
4054
4055 #[inline(always)]
4056 fn decode_is_copy() -> bool {
4057 true
4058 }
4059 }
4060
4061 unsafe impl<D: fidl::encoding::ResourceDialect>
4062 fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest, D>
4063 for &DeviceWatcherOnPhyRemovedRequest
4064 {
4065 #[inline]
4066 unsafe fn encode(
4067 self,
4068 encoder: &mut fidl::encoding::Encoder<'_, D>,
4069 offset: usize,
4070 _depth: fidl::encoding::Depth,
4071 ) -> fidl::Result<()> {
4072 encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
4073 unsafe {
4074 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4076 (buf_ptr as *mut DeviceWatcherOnPhyRemovedRequest)
4077 .write_unaligned((self as *const DeviceWatcherOnPhyRemovedRequest).read());
4078 }
4081 Ok(())
4082 }
4083 }
4084 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
4085 fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest, D> for (T0,)
4086 {
4087 #[inline]
4088 unsafe fn encode(
4089 self,
4090 encoder: &mut fidl::encoding::Encoder<'_, D>,
4091 offset: usize,
4092 depth: fidl::encoding::Depth,
4093 ) -> fidl::Result<()> {
4094 encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
4095 self.0.encode(encoder, offset + 0, depth)?;
4099 Ok(())
4100 }
4101 }
4102
4103 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4104 for DeviceWatcherOnPhyRemovedRequest
4105 {
4106 #[inline(always)]
4107 fn new_empty() -> Self {
4108 Self { phy_id: fidl::new_empty!(u16, D) }
4109 }
4110
4111 #[inline]
4112 unsafe fn decode(
4113 &mut self,
4114 decoder: &mut fidl::encoding::Decoder<'_, D>,
4115 offset: usize,
4116 _depth: fidl::encoding::Depth,
4117 ) -> fidl::Result<()> {
4118 decoder.debug_check_bounds::<Self>(offset);
4119 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4120 unsafe {
4123 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
4124 }
4125 Ok(())
4126 }
4127 }
4128
4129 impl fidl::encoding::ValueTypeMarker for GetCountryResponse {
4130 type Borrowed<'a> = &'a Self;
4131 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4132 value
4133 }
4134 }
4135
4136 unsafe impl fidl::encoding::TypeMarker for GetCountryResponse {
4137 type Owned = Self;
4138
4139 #[inline(always)]
4140 fn inline_align(_context: fidl::encoding::Context) -> usize {
4141 1
4142 }
4143
4144 #[inline(always)]
4145 fn inline_size(_context: fidl::encoding::Context) -> usize {
4146 2
4147 }
4148 #[inline(always)]
4149 fn encode_is_copy() -> bool {
4150 true
4151 }
4152
4153 #[inline(always)]
4154 fn decode_is_copy() -> bool {
4155 true
4156 }
4157 }
4158
4159 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GetCountryResponse, D>
4160 for &GetCountryResponse
4161 {
4162 #[inline]
4163 unsafe fn encode(
4164 self,
4165 encoder: &mut fidl::encoding::Encoder<'_, D>,
4166 offset: usize,
4167 _depth: fidl::encoding::Depth,
4168 ) -> fidl::Result<()> {
4169 encoder.debug_check_bounds::<GetCountryResponse>(offset);
4170 unsafe {
4171 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4173 (buf_ptr as *mut GetCountryResponse)
4174 .write_unaligned((self as *const GetCountryResponse).read());
4175 }
4178 Ok(())
4179 }
4180 }
4181 unsafe impl<
4182 D: fidl::encoding::ResourceDialect,
4183 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
4184 > fidl::encoding::Encode<GetCountryResponse, D> for (T0,)
4185 {
4186 #[inline]
4187 unsafe fn encode(
4188 self,
4189 encoder: &mut fidl::encoding::Encoder<'_, D>,
4190 offset: usize,
4191 depth: fidl::encoding::Depth,
4192 ) -> fidl::Result<()> {
4193 encoder.debug_check_bounds::<GetCountryResponse>(offset);
4194 self.0.encode(encoder, offset + 0, depth)?;
4198 Ok(())
4199 }
4200 }
4201
4202 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetCountryResponse {
4203 #[inline(always)]
4204 fn new_empty() -> Self {
4205 Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
4206 }
4207
4208 #[inline]
4209 unsafe fn decode(
4210 &mut self,
4211 decoder: &mut fidl::encoding::Decoder<'_, D>,
4212 offset: usize,
4213 _depth: fidl::encoding::Depth,
4214 ) -> fidl::Result<()> {
4215 decoder.debug_check_bounds::<Self>(offset);
4216 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4217 unsafe {
4220 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
4221 }
4222 Ok(())
4223 }
4224 }
4225
4226 impl fidl::encoding::ValueTypeMarker for GetPowerSaveModeResponse {
4227 type Borrowed<'a> = &'a Self;
4228 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4229 value
4230 }
4231 }
4232
4233 unsafe impl fidl::encoding::TypeMarker for GetPowerSaveModeResponse {
4234 type Owned = Self;
4235
4236 #[inline(always)]
4237 fn inline_align(_context: fidl::encoding::Context) -> usize {
4238 4
4239 }
4240
4241 #[inline(always)]
4242 fn inline_size(_context: fidl::encoding::Context) -> usize {
4243 4
4244 }
4245 }
4246
4247 unsafe impl<D: fidl::encoding::ResourceDialect>
4248 fidl::encoding::Encode<GetPowerSaveModeResponse, D> for &GetPowerSaveModeResponse
4249 {
4250 #[inline]
4251 unsafe fn encode(
4252 self,
4253 encoder: &mut fidl::encoding::Encoder<'_, D>,
4254 offset: usize,
4255 _depth: fidl::encoding::Depth,
4256 ) -> fidl::Result<()> {
4257 encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
4258 fidl::encoding::Encode::<GetPowerSaveModeResponse, D>::encode(
4260 (
4261 <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
4262 ),
4263 encoder, offset, _depth
4264 )
4265 }
4266 }
4267 unsafe impl<
4268 D: fidl::encoding::ResourceDialect,
4269 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
4270 > fidl::encoding::Encode<GetPowerSaveModeResponse, D> for (T0,)
4271 {
4272 #[inline]
4273 unsafe fn encode(
4274 self,
4275 encoder: &mut fidl::encoding::Encoder<'_, D>,
4276 offset: usize,
4277 depth: fidl::encoding::Depth,
4278 ) -> fidl::Result<()> {
4279 encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
4280 self.0.encode(encoder, offset + 0, depth)?;
4284 Ok(())
4285 }
4286 }
4287
4288 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4289 for GetPowerSaveModeResponse
4290 {
4291 #[inline(always)]
4292 fn new_empty() -> Self {
4293 Self { ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D) }
4294 }
4295
4296 #[inline]
4297 unsafe fn decode(
4298 &mut self,
4299 decoder: &mut fidl::encoding::Decoder<'_, D>,
4300 offset: usize,
4301 _depth: fidl::encoding::Depth,
4302 ) -> fidl::Result<()> {
4303 decoder.debug_check_bounds::<Self>(offset);
4304 fidl::decode!(
4306 fidl_fuchsia_wlan_common__common::PowerSaveType,
4307 D,
4308 &mut self.ps_mode,
4309 decoder,
4310 offset + 0,
4311 _depth
4312 )?;
4313 Ok(())
4314 }
4315 }
4316
4317 impl fidl::encoding::ValueTypeMarker for PhyEventWatcherOnCriticalErrorRequest {
4318 type Borrowed<'a> = &'a Self;
4319 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4320 value
4321 }
4322 }
4323
4324 unsafe impl fidl::encoding::TypeMarker for PhyEventWatcherOnCriticalErrorRequest {
4325 type Owned = Self;
4326
4327 #[inline(always)]
4328 fn inline_align(_context: fidl::encoding::Context) -> usize {
4329 2
4330 }
4331
4332 #[inline(always)]
4333 fn inline_size(_context: fidl::encoding::Context) -> usize {
4334 4
4335 }
4336 }
4337
4338 unsafe impl<D: fidl::encoding::ResourceDialect>
4339 fidl::encoding::Encode<PhyEventWatcherOnCriticalErrorRequest, D>
4340 for &PhyEventWatcherOnCriticalErrorRequest
4341 {
4342 #[inline]
4343 unsafe fn encode(
4344 self,
4345 encoder: &mut fidl::encoding::Encoder<'_, D>,
4346 offset: usize,
4347 _depth: fidl::encoding::Depth,
4348 ) -> fidl::Result<()> {
4349 encoder.debug_check_bounds::<PhyEventWatcherOnCriticalErrorRequest>(offset);
4350 fidl::encoding::Encode::<PhyEventWatcherOnCriticalErrorRequest, D>::encode(
4352 (
4353 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
4354 <CriticalErrorReason as fidl::encoding::ValueTypeMarker>::borrow(
4355 &self.reason_code,
4356 ),
4357 ),
4358 encoder,
4359 offset,
4360 _depth,
4361 )
4362 }
4363 }
4364 unsafe impl<
4365 D: fidl::encoding::ResourceDialect,
4366 T0: fidl::encoding::Encode<u16, D>,
4367 T1: fidl::encoding::Encode<CriticalErrorReason, D>,
4368 > fidl::encoding::Encode<PhyEventWatcherOnCriticalErrorRequest, D> for (T0, T1)
4369 {
4370 #[inline]
4371 unsafe fn encode(
4372 self,
4373 encoder: &mut fidl::encoding::Encoder<'_, D>,
4374 offset: usize,
4375 depth: fidl::encoding::Depth,
4376 ) -> fidl::Result<()> {
4377 encoder.debug_check_bounds::<PhyEventWatcherOnCriticalErrorRequest>(offset);
4378 unsafe {
4381 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
4382 (ptr as *mut u16).write_unaligned(0);
4383 }
4384 self.0.encode(encoder, offset + 0, depth)?;
4386 self.1.encode(encoder, offset + 2, depth)?;
4387 Ok(())
4388 }
4389 }
4390
4391 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4392 for PhyEventWatcherOnCriticalErrorRequest
4393 {
4394 #[inline(always)]
4395 fn new_empty() -> Self {
4396 Self {
4397 phy_id: fidl::new_empty!(u16, D),
4398 reason_code: fidl::new_empty!(CriticalErrorReason, D),
4399 }
4400 }
4401
4402 #[inline]
4403 unsafe fn decode(
4404 &mut self,
4405 decoder: &mut fidl::encoding::Decoder<'_, D>,
4406 offset: usize,
4407 _depth: fidl::encoding::Depth,
4408 ) -> fidl::Result<()> {
4409 decoder.debug_check_bounds::<Self>(offset);
4410 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(2) };
4412 let padval = unsafe { (ptr as *const u16).read_unaligned() };
4413 let mask = 0xff00u16;
4414 let maskedval = padval & mask;
4415 if maskedval != 0 {
4416 return Err(fidl::Error::NonZeroPadding {
4417 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
4418 });
4419 }
4420 fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
4421 fidl::decode!(
4422 CriticalErrorReason,
4423 D,
4424 &mut self.reason_code,
4425 decoder,
4426 offset + 2,
4427 _depth
4428 )?;
4429 Ok(())
4430 }
4431 }
4432
4433 impl fidl::encoding::ValueTypeMarker for QueryIfaceResponse {
4434 type Borrowed<'a> = &'a Self;
4435 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4436 value
4437 }
4438 }
4439
4440 unsafe impl fidl::encoding::TypeMarker for QueryIfaceResponse {
4441 type Owned = Self;
4442
4443 #[inline(always)]
4444 fn inline_align(_context: fidl::encoding::Context) -> usize {
4445 4
4446 }
4447
4448 #[inline(always)]
4449 fn inline_size(_context: fidl::encoding::Context) -> usize {
4450 16
4451 }
4452 }
4453
4454 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QueryIfaceResponse, D>
4455 for &QueryIfaceResponse
4456 {
4457 #[inline]
4458 unsafe fn encode(
4459 self,
4460 encoder: &mut fidl::encoding::Encoder<'_, D>,
4461 offset: usize,
4462 _depth: fidl::encoding::Depth,
4463 ) -> fidl::Result<()> {
4464 encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
4465 fidl::encoding::Encode::<QueryIfaceResponse, D>::encode(
4467 (
4468 <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
4469 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4470 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
4471 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_assigned_id),
4472 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
4473 ),
4474 encoder, offset, _depth
4475 )
4476 }
4477 }
4478 unsafe impl<
4479 D: fidl::encoding::ResourceDialect,
4480 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanMacRole, D>,
4481 T1: fidl::encoding::Encode<u16, D>,
4482 T2: fidl::encoding::Encode<u16, D>,
4483 T3: fidl::encoding::Encode<u16, D>,
4484 T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
4485 > fidl::encoding::Encode<QueryIfaceResponse, D> for (T0, T1, T2, T3, T4)
4486 {
4487 #[inline]
4488 unsafe fn encode(
4489 self,
4490 encoder: &mut fidl::encoding::Encoder<'_, D>,
4491 offset: usize,
4492 depth: fidl::encoding::Depth,
4493 ) -> fidl::Result<()> {
4494 encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
4495 self.0.encode(encoder, offset + 0, depth)?;
4499 self.1.encode(encoder, offset + 4, depth)?;
4500 self.2.encode(encoder, offset + 6, depth)?;
4501 self.3.encode(encoder, offset + 8, depth)?;
4502 self.4.encode(encoder, offset + 10, depth)?;
4503 Ok(())
4504 }
4505 }
4506
4507 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QueryIfaceResponse {
4508 #[inline(always)]
4509 fn new_empty() -> Self {
4510 Self {
4511 role: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D),
4512 id: fidl::new_empty!(u16, D),
4513 phy_id: fidl::new_empty!(u16, D),
4514 phy_assigned_id: fidl::new_empty!(u16, D),
4515 sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
4516 }
4517 }
4518
4519 #[inline]
4520 unsafe fn decode(
4521 &mut self,
4522 decoder: &mut fidl::encoding::Decoder<'_, D>,
4523 offset: usize,
4524 _depth: fidl::encoding::Depth,
4525 ) -> fidl::Result<()> {
4526 decoder.debug_check_bounds::<Self>(offset);
4527 fidl::decode!(
4529 fidl_fuchsia_wlan_common__common::WlanMacRole,
4530 D,
4531 &mut self.role,
4532 decoder,
4533 offset + 0,
4534 _depth
4535 )?;
4536 fidl::decode!(u16, D, &mut self.id, decoder, offset + 4, _depth)?;
4537 fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 6, _depth)?;
4538 fidl::decode!(u16, D, &mut self.phy_assigned_id, decoder, offset + 8, _depth)?;
4539 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 10, _depth)?;
4540 Ok(())
4541 }
4542 }
4543
4544 impl fidl::encoding::ValueTypeMarker for SetCountryRequest {
4545 type Borrowed<'a> = &'a Self;
4546 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4547 value
4548 }
4549 }
4550
4551 unsafe impl fidl::encoding::TypeMarker for SetCountryRequest {
4552 type Owned = Self;
4553
4554 #[inline(always)]
4555 fn inline_align(_context: fidl::encoding::Context) -> usize {
4556 2
4557 }
4558
4559 #[inline(always)]
4560 fn inline_size(_context: fidl::encoding::Context) -> usize {
4561 4
4562 }
4563 #[inline(always)]
4564 fn encode_is_copy() -> bool {
4565 true
4566 }
4567
4568 #[inline(always)]
4569 fn decode_is_copy() -> bool {
4570 true
4571 }
4572 }
4573
4574 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCountryRequest, D>
4575 for &SetCountryRequest
4576 {
4577 #[inline]
4578 unsafe fn encode(
4579 self,
4580 encoder: &mut fidl::encoding::Encoder<'_, D>,
4581 offset: usize,
4582 _depth: fidl::encoding::Depth,
4583 ) -> fidl::Result<()> {
4584 encoder.debug_check_bounds::<SetCountryRequest>(offset);
4585 unsafe {
4586 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4588 (buf_ptr as *mut SetCountryRequest)
4589 .write_unaligned((self as *const SetCountryRequest).read());
4590 }
4593 Ok(())
4594 }
4595 }
4596 unsafe impl<
4597 D: fidl::encoding::ResourceDialect,
4598 T0: fidl::encoding::Encode<u16, D>,
4599 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
4600 > fidl::encoding::Encode<SetCountryRequest, D> for (T0, T1)
4601 {
4602 #[inline]
4603 unsafe fn encode(
4604 self,
4605 encoder: &mut fidl::encoding::Encoder<'_, D>,
4606 offset: usize,
4607 depth: fidl::encoding::Depth,
4608 ) -> fidl::Result<()> {
4609 encoder.debug_check_bounds::<SetCountryRequest>(offset);
4610 self.0.encode(encoder, offset + 0, depth)?;
4614 self.1.encode(encoder, offset + 2, depth)?;
4615 Ok(())
4616 }
4617 }
4618
4619 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCountryRequest {
4620 #[inline(always)]
4621 fn new_empty() -> Self {
4622 Self {
4623 phy_id: fidl::new_empty!(u16, D),
4624 alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D),
4625 }
4626 }
4627
4628 #[inline]
4629 unsafe fn decode(
4630 &mut self,
4631 decoder: &mut fidl::encoding::Decoder<'_, D>,
4632 offset: usize,
4633 _depth: fidl::encoding::Depth,
4634 ) -> fidl::Result<()> {
4635 decoder.debug_check_bounds::<Self>(offset);
4636 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4637 unsafe {
4640 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4641 }
4642 Ok(())
4643 }
4644 }
4645
4646 impl fidl::encoding::ValueTypeMarker for SetPowerSaveModeRequest {
4647 type Borrowed<'a> = &'a Self;
4648 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4649 value
4650 }
4651 }
4652
4653 unsafe impl fidl::encoding::TypeMarker for SetPowerSaveModeRequest {
4654 type Owned = Self;
4655
4656 #[inline(always)]
4657 fn inline_align(_context: fidl::encoding::Context) -> usize {
4658 4
4659 }
4660
4661 #[inline(always)]
4662 fn inline_size(_context: fidl::encoding::Context) -> usize {
4663 8
4664 }
4665 }
4666
4667 unsafe impl<D: fidl::encoding::ResourceDialect>
4668 fidl::encoding::Encode<SetPowerSaveModeRequest, D> for &SetPowerSaveModeRequest
4669 {
4670 #[inline]
4671 unsafe fn encode(
4672 self,
4673 encoder: &mut fidl::encoding::Encoder<'_, D>,
4674 offset: usize,
4675 _depth: fidl::encoding::Depth,
4676 ) -> fidl::Result<()> {
4677 encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
4678 fidl::encoding::Encode::<SetPowerSaveModeRequest, D>::encode(
4680 (
4681 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
4682 <fidl_fuchsia_wlan_common__common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
4683 ),
4684 encoder, offset, _depth
4685 )
4686 }
4687 }
4688 unsafe impl<
4689 D: fidl::encoding::ResourceDialect,
4690 T0: fidl::encoding::Encode<u16, D>,
4691 T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::PowerSaveType, D>,
4692 > fidl::encoding::Encode<SetPowerSaveModeRequest, D> for (T0, T1)
4693 {
4694 #[inline]
4695 unsafe fn encode(
4696 self,
4697 encoder: &mut fidl::encoding::Encoder<'_, D>,
4698 offset: usize,
4699 depth: fidl::encoding::Depth,
4700 ) -> fidl::Result<()> {
4701 encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
4702 unsafe {
4705 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4706 (ptr as *mut u32).write_unaligned(0);
4707 }
4708 self.0.encode(encoder, offset + 0, depth)?;
4710 self.1.encode(encoder, offset + 4, depth)?;
4711 Ok(())
4712 }
4713 }
4714
4715 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4716 for SetPowerSaveModeRequest
4717 {
4718 #[inline(always)]
4719 fn new_empty() -> Self {
4720 Self {
4721 phy_id: fidl::new_empty!(u16, D),
4722 ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common__common::PowerSaveType, D),
4723 }
4724 }
4725
4726 #[inline]
4727 unsafe fn decode(
4728 &mut self,
4729 decoder: &mut fidl::encoding::Decoder<'_, D>,
4730 offset: usize,
4731 _depth: fidl::encoding::Depth,
4732 ) -> fidl::Result<()> {
4733 decoder.debug_check_bounds::<Self>(offset);
4734 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4736 let padval = unsafe { (ptr as *const u32).read_unaligned() };
4737 let mask = 0xffff0000u32;
4738 let maskedval = padval & mask;
4739 if maskedval != 0 {
4740 return Err(fidl::Error::NonZeroPadding {
4741 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4742 });
4743 }
4744 fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
4745 fidl::decode!(
4746 fidl_fuchsia_wlan_common__common::PowerSaveType,
4747 D,
4748 &mut self.ps_mode,
4749 decoder,
4750 offset + 4,
4751 _depth
4752 )?;
4753 Ok(())
4754 }
4755 }
4756
4757 impl DeviceMonitorCreateIfaceRequest {
4758 #[inline(always)]
4759 fn max_ordinal_present(&self) -> u64 {
4760 if let Some(_) = self.sta_address {
4761 return 3;
4762 }
4763 if let Some(_) = self.role {
4764 return 2;
4765 }
4766 if let Some(_) = self.phy_id {
4767 return 1;
4768 }
4769 0
4770 }
4771 }
4772
4773 impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceRequest {
4774 type Borrowed<'a> = &'a Self;
4775 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4776 value
4777 }
4778 }
4779
4780 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceRequest {
4781 type Owned = Self;
4782
4783 #[inline(always)]
4784 fn inline_align(_context: fidl::encoding::Context) -> usize {
4785 8
4786 }
4787
4788 #[inline(always)]
4789 fn inline_size(_context: fidl::encoding::Context) -> usize {
4790 16
4791 }
4792 }
4793
4794 unsafe impl<D: fidl::encoding::ResourceDialect>
4795 fidl::encoding::Encode<DeviceMonitorCreateIfaceRequest, D>
4796 for &DeviceMonitorCreateIfaceRequest
4797 {
4798 unsafe fn encode(
4799 self,
4800 encoder: &mut fidl::encoding::Encoder<'_, D>,
4801 offset: usize,
4802 mut depth: fidl::encoding::Depth,
4803 ) -> fidl::Result<()> {
4804 encoder.debug_check_bounds::<DeviceMonitorCreateIfaceRequest>(offset);
4805 let max_ordinal: u64 = self.max_ordinal_present();
4807 encoder.write_num(max_ordinal, offset);
4808 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4809 if max_ordinal == 0 {
4811 return Ok(());
4812 }
4813 depth.increment()?;
4814 let envelope_size = 8;
4815 let bytes_len = max_ordinal as usize * envelope_size;
4816 #[allow(unused_variables)]
4817 let offset = encoder.out_of_line_offset(bytes_len);
4818 let mut _prev_end_offset: usize = 0;
4819 if 1 > max_ordinal {
4820 return Ok(());
4821 }
4822
4823 let cur_offset: usize = (1 - 1) * envelope_size;
4826
4827 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4829
4830 fidl::encoding::encode_in_envelope_optional::<u16, D>(
4835 self.phy_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
4836 encoder,
4837 offset + cur_offset,
4838 depth,
4839 )?;
4840
4841 _prev_end_offset = cur_offset + envelope_size;
4842 if 2 > max_ordinal {
4843 return Ok(());
4844 }
4845
4846 let cur_offset: usize = (2 - 1) * envelope_size;
4849
4850 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4852
4853 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanMacRole, D>(
4858 self.role.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
4859 encoder, offset + cur_offset, depth
4860 )?;
4861
4862 _prev_end_offset = cur_offset + envelope_size;
4863 if 3 > max_ordinal {
4864 return Ok(());
4865 }
4866
4867 let cur_offset: usize = (3 - 1) * envelope_size;
4870
4871 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4873
4874 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4879 self.sta_address
4880 .as_ref()
4881 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4882 encoder,
4883 offset + cur_offset,
4884 depth,
4885 )?;
4886
4887 _prev_end_offset = cur_offset + envelope_size;
4888
4889 Ok(())
4890 }
4891 }
4892
4893 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4894 for DeviceMonitorCreateIfaceRequest
4895 {
4896 #[inline(always)]
4897 fn new_empty() -> Self {
4898 Self::default()
4899 }
4900
4901 unsafe fn decode(
4902 &mut self,
4903 decoder: &mut fidl::encoding::Decoder<'_, D>,
4904 offset: usize,
4905 mut depth: fidl::encoding::Depth,
4906 ) -> fidl::Result<()> {
4907 decoder.debug_check_bounds::<Self>(offset);
4908 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4909 None => return Err(fidl::Error::NotNullable),
4910 Some(len) => len,
4911 };
4912 if len == 0 {
4914 return Ok(());
4915 };
4916 depth.increment()?;
4917 let envelope_size = 8;
4918 let bytes_len = len * envelope_size;
4919 let offset = decoder.out_of_line_offset(bytes_len)?;
4920 let mut _next_ordinal_to_read = 0;
4922 let mut next_offset = offset;
4923 let end_offset = offset + bytes_len;
4924 _next_ordinal_to_read += 1;
4925 if next_offset >= end_offset {
4926 return Ok(());
4927 }
4928
4929 while _next_ordinal_to_read < 1 {
4931 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4932 _next_ordinal_to_read += 1;
4933 next_offset += envelope_size;
4934 }
4935
4936 let next_out_of_line = decoder.next_out_of_line();
4937 let handles_before = decoder.remaining_handles();
4938 if let Some((inlined, num_bytes, num_handles)) =
4939 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4940 {
4941 let member_inline_size =
4942 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4943 if inlined != (member_inline_size <= 4) {
4944 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4945 }
4946 let inner_offset;
4947 let mut inner_depth = depth.clone();
4948 if inlined {
4949 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4950 inner_offset = next_offset;
4951 } else {
4952 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4953 inner_depth.increment()?;
4954 }
4955 let val_ref = self.phy_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
4956 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4957 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4958 {
4959 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4960 }
4961 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4962 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4963 }
4964 }
4965
4966 next_offset += envelope_size;
4967 _next_ordinal_to_read += 1;
4968 if next_offset >= end_offset {
4969 return Ok(());
4970 }
4971
4972 while _next_ordinal_to_read < 2 {
4974 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4975 _next_ordinal_to_read += 1;
4976 next_offset += envelope_size;
4977 }
4978
4979 let next_out_of_line = decoder.next_out_of_line();
4980 let handles_before = decoder.remaining_handles();
4981 if let Some((inlined, num_bytes, num_handles)) =
4982 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4983 {
4984 let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4985 if inlined != (member_inline_size <= 4) {
4986 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4987 }
4988 let inner_offset;
4989 let mut inner_depth = depth.clone();
4990 if inlined {
4991 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4992 inner_offset = next_offset;
4993 } else {
4994 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4995 inner_depth.increment()?;
4996 }
4997 let val_ref = self.role.get_or_insert_with(|| {
4998 fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D)
4999 });
5000 fidl::decode!(
5001 fidl_fuchsia_wlan_common__common::WlanMacRole,
5002 D,
5003 val_ref,
5004 decoder,
5005 inner_offset,
5006 inner_depth
5007 )?;
5008 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5009 {
5010 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5011 }
5012 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5013 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5014 }
5015 }
5016
5017 next_offset += envelope_size;
5018 _next_ordinal_to_read += 1;
5019 if next_offset >= end_offset {
5020 return Ok(());
5021 }
5022
5023 while _next_ordinal_to_read < 3 {
5025 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5026 _next_ordinal_to_read += 1;
5027 next_offset += envelope_size;
5028 }
5029
5030 let next_out_of_line = decoder.next_out_of_line();
5031 let handles_before = decoder.remaining_handles();
5032 if let Some((inlined, num_bytes, num_handles)) =
5033 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5034 {
5035 let member_inline_size =
5036 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
5037 decoder.context,
5038 );
5039 if inlined != (member_inline_size <= 4) {
5040 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5041 }
5042 let inner_offset;
5043 let mut inner_depth = depth.clone();
5044 if inlined {
5045 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5046 inner_offset = next_offset;
5047 } else {
5048 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5049 inner_depth.increment()?;
5050 }
5051 let val_ref = self
5052 .sta_address
5053 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
5054 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
5055 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5056 {
5057 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5058 }
5059 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5060 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5061 }
5062 }
5063
5064 next_offset += envelope_size;
5065
5066 while next_offset < end_offset {
5068 _next_ordinal_to_read += 1;
5069 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5070 next_offset += envelope_size;
5071 }
5072
5073 Ok(())
5074 }
5075 }
5076
5077 impl DeviceMonitorCreateIfaceResponse {
5078 #[inline(always)]
5079 fn max_ordinal_present(&self) -> u64 {
5080 if let Some(_) = self.iface_id {
5081 return 1;
5082 }
5083 0
5084 }
5085 }
5086
5087 impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceResponse {
5088 type Borrowed<'a> = &'a Self;
5089 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5090 value
5091 }
5092 }
5093
5094 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceResponse {
5095 type Owned = Self;
5096
5097 #[inline(always)]
5098 fn inline_align(_context: fidl::encoding::Context) -> usize {
5099 8
5100 }
5101
5102 #[inline(always)]
5103 fn inline_size(_context: fidl::encoding::Context) -> usize {
5104 16
5105 }
5106 }
5107
5108 unsafe impl<D: fidl::encoding::ResourceDialect>
5109 fidl::encoding::Encode<DeviceMonitorCreateIfaceResponse, D>
5110 for &DeviceMonitorCreateIfaceResponse
5111 {
5112 unsafe fn encode(
5113 self,
5114 encoder: &mut fidl::encoding::Encoder<'_, D>,
5115 offset: usize,
5116 mut depth: fidl::encoding::Depth,
5117 ) -> fidl::Result<()> {
5118 encoder.debug_check_bounds::<DeviceMonitorCreateIfaceResponse>(offset);
5119 let max_ordinal: u64 = self.max_ordinal_present();
5121 encoder.write_num(max_ordinal, offset);
5122 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5123 if max_ordinal == 0 {
5125 return Ok(());
5126 }
5127 depth.increment()?;
5128 let envelope_size = 8;
5129 let bytes_len = max_ordinal as usize * envelope_size;
5130 #[allow(unused_variables)]
5131 let offset = encoder.out_of_line_offset(bytes_len);
5132 let mut _prev_end_offset: usize = 0;
5133 if 1 > max_ordinal {
5134 return Ok(());
5135 }
5136
5137 let cur_offset: usize = (1 - 1) * envelope_size;
5140
5141 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5143
5144 fidl::encoding::encode_in_envelope_optional::<u16, D>(
5149 self.iface_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
5150 encoder,
5151 offset + cur_offset,
5152 depth,
5153 )?;
5154
5155 _prev_end_offset = cur_offset + envelope_size;
5156
5157 Ok(())
5158 }
5159 }
5160
5161 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5162 for DeviceMonitorCreateIfaceResponse
5163 {
5164 #[inline(always)]
5165 fn new_empty() -> Self {
5166 Self::default()
5167 }
5168
5169 unsafe fn decode(
5170 &mut self,
5171 decoder: &mut fidl::encoding::Decoder<'_, D>,
5172 offset: usize,
5173 mut depth: fidl::encoding::Depth,
5174 ) -> fidl::Result<()> {
5175 decoder.debug_check_bounds::<Self>(offset);
5176 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5177 None => return Err(fidl::Error::NotNullable),
5178 Some(len) => len,
5179 };
5180 if len == 0 {
5182 return Ok(());
5183 };
5184 depth.increment()?;
5185 let envelope_size = 8;
5186 let bytes_len = len * envelope_size;
5187 let offset = decoder.out_of_line_offset(bytes_len)?;
5188 let mut _next_ordinal_to_read = 0;
5190 let mut next_offset = offset;
5191 let end_offset = offset + bytes_len;
5192 _next_ordinal_to_read += 1;
5193 if next_offset >= end_offset {
5194 return Ok(());
5195 }
5196
5197 while _next_ordinal_to_read < 1 {
5199 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5200 _next_ordinal_to_read += 1;
5201 next_offset += envelope_size;
5202 }
5203
5204 let next_out_of_line = decoder.next_out_of_line();
5205 let handles_before = decoder.remaining_handles();
5206 if let Some((inlined, num_bytes, num_handles)) =
5207 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5208 {
5209 let member_inline_size =
5210 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5211 if inlined != (member_inline_size <= 4) {
5212 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5213 }
5214 let inner_offset;
5215 let mut inner_depth = depth.clone();
5216 if inlined {
5217 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5218 inner_offset = next_offset;
5219 } else {
5220 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5221 inner_depth.increment()?;
5222 }
5223 let val_ref = self.iface_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
5224 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
5225 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5226 {
5227 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5228 }
5229 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5230 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5231 }
5232 }
5233
5234 next_offset += envelope_size;
5235
5236 while next_offset < end_offset {
5238 _next_ordinal_to_read += 1;
5239 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5240 next_offset += envelope_size;
5241 }
5242
5243 Ok(())
5244 }
5245 }
5246
5247 impl fidl::encoding::ValueTypeMarker for GetIfaceHistogramStatsResponse {
5248 type Borrowed<'a> = &'a Self;
5249 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5250 value
5251 }
5252 }
5253
5254 unsafe impl fidl::encoding::TypeMarker for GetIfaceHistogramStatsResponse {
5255 type Owned = Self;
5256
5257 #[inline(always)]
5258 fn inline_align(_context: fidl::encoding::Context) -> usize {
5259 8
5260 }
5261
5262 #[inline(always)]
5263 fn inline_size(_context: fidl::encoding::Context) -> usize {
5264 16
5265 }
5266 }
5267
5268 unsafe impl<D: fidl::encoding::ResourceDialect>
5269 fidl::encoding::Encode<GetIfaceHistogramStatsResponse, D>
5270 for &GetIfaceHistogramStatsResponse
5271 {
5272 #[inline]
5273 unsafe fn encode(
5274 self,
5275 encoder: &mut fidl::encoding::Encoder<'_, D>,
5276 offset: usize,
5277 _depth: fidl::encoding::Depth,
5278 ) -> fidl::Result<()> {
5279 encoder.debug_check_bounds::<GetIfaceHistogramStatsResponse>(offset);
5280 encoder.write_num::<u64>(self.ordinal(), offset);
5281 match self {
5282 GetIfaceHistogramStatsResponse::Stats(ref val) => {
5283 fidl::encoding::encode_in_envelope::<fidl_fuchsia_wlan_stats__common::IfaceHistogramStats, D>(
5284 <fidl_fuchsia_wlan_stats__common::IfaceHistogramStats as fidl::encoding::ValueTypeMarker>::borrow(val),
5285 encoder, offset + 8, _depth
5286 )
5287 }
5288 GetIfaceHistogramStatsResponse::ErrorStatus(ref val) => {
5289 fidl::encoding::encode_in_envelope::<i32, D>(
5290 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
5291 encoder, offset + 8, _depth
5292 )
5293 }
5294 }
5295 }
5296 }
5297
5298 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5299 for GetIfaceHistogramStatsResponse
5300 {
5301 #[inline(always)]
5302 fn new_empty() -> Self {
5303 Self::Stats(fidl::new_empty!(fidl_fuchsia_wlan_stats__common::IfaceHistogramStats, D))
5304 }
5305
5306 #[inline]
5307 unsafe fn decode(
5308 &mut self,
5309 decoder: &mut fidl::encoding::Decoder<'_, D>,
5310 offset: usize,
5311 mut depth: fidl::encoding::Depth,
5312 ) -> fidl::Result<()> {
5313 decoder.debug_check_bounds::<Self>(offset);
5314 #[allow(unused_variables)]
5315 let next_out_of_line = decoder.next_out_of_line();
5316 let handles_before = decoder.remaining_handles();
5317 let (ordinal, inlined, num_bytes, num_handles) =
5318 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5319
5320 let member_inline_size = match ordinal {
5321 1 => <fidl_fuchsia_wlan_stats__common::IfaceHistogramStats as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5322 2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5323 _ => return Err(fidl::Error::UnknownUnionTag),
5324 };
5325
5326 if inlined != (member_inline_size <= 4) {
5327 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5328 }
5329 let _inner_offset;
5330 if inlined {
5331 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5332 _inner_offset = offset + 8;
5333 } else {
5334 depth.increment()?;
5335 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5336 }
5337 match ordinal {
5338 1 => {
5339 #[allow(irrefutable_let_patterns)]
5340 if let GetIfaceHistogramStatsResponse::Stats(_) = self {
5341 } else {
5343 *self = GetIfaceHistogramStatsResponse::Stats(fidl::new_empty!(
5345 fidl_fuchsia_wlan_stats__common::IfaceHistogramStats,
5346 D
5347 ));
5348 }
5349 #[allow(irrefutable_let_patterns)]
5350 if let GetIfaceHistogramStatsResponse::Stats(ref mut val) = self {
5351 fidl::decode!(
5352 fidl_fuchsia_wlan_stats__common::IfaceHistogramStats,
5353 D,
5354 val,
5355 decoder,
5356 _inner_offset,
5357 depth
5358 )?;
5359 } else {
5360 unreachable!()
5361 }
5362 }
5363 2 => {
5364 #[allow(irrefutable_let_patterns)]
5365 if let GetIfaceHistogramStatsResponse::ErrorStatus(_) = self {
5366 } else {
5368 *self =
5370 GetIfaceHistogramStatsResponse::ErrorStatus(fidl::new_empty!(i32, D));
5371 }
5372 #[allow(irrefutable_let_patterns)]
5373 if let GetIfaceHistogramStatsResponse::ErrorStatus(ref mut val) = self {
5374 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
5375 } else {
5376 unreachable!()
5377 }
5378 }
5379 ordinal => panic!("unexpected ordinal {:?}", ordinal),
5380 }
5381 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5382 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5383 }
5384 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5385 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5386 }
5387 Ok(())
5388 }
5389 }
5390}