Skip to main content

fidl_next_common_fuchsia_power_broker/
fidl_next_common_fuchsia_power_broker.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8    #[repr(u32)]
9    pub enum AddElementError {
10        Invalid = 1,
11        NotAuthorized = 2,
12        UnknownOrdinal_(u32) = 3,
13    }
14    impl ::std::convert::From<u32> for AddElementError {
15        fn from(value: u32) -> Self {
16            match value {
17                1 => Self::Invalid,
18                2 => Self::NotAuthorized,
19
20                _ => Self::UnknownOrdinal_(value),
21            }
22        }
23    }
24
25    unsafe impl<___E> ::fidl_next::Encode<crate::wire::AddElementError, ___E> for AddElementError
26    where
27        ___E: ?Sized,
28    {
29        #[inline]
30        fn encode(
31            self,
32            encoder: &mut ___E,
33            out: &mut ::core::mem::MaybeUninit<crate::wire::AddElementError>,
34            _: (),
35        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36            ::fidl_next::Encode::encode(&self, encoder, out, ())
37        }
38    }
39
40    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AddElementError, ___E>
41        for &'a AddElementError
42    where
43        ___E: ?Sized,
44    {
45        #[inline]
46        fn encode(
47            self,
48            encoder: &mut ___E,
49            out: &mut ::core::mem::MaybeUninit<crate::wire::AddElementError>,
50            _: (),
51        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
52            ::fidl_next::munge!(let crate::wire::AddElementError { value } = out);
53            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
54                AddElementError::Invalid => 1,
55
56                AddElementError::NotAuthorized => 2,
57
58                AddElementError::UnknownOrdinal_(value) => value,
59            }));
60
61            Ok(())
62        }
63    }
64
65    impl ::core::convert::From<crate::wire::AddElementError> for AddElementError {
66        fn from(wire: crate::wire::AddElementError) -> Self {
67            match u32::from(wire.value) {
68                1 => Self::Invalid,
69
70                2 => Self::NotAuthorized,
71
72                value => Self::UnknownOrdinal_(value),
73            }
74        }
75    }
76
77    impl ::fidl_next::FromWire<crate::wire::AddElementError> for AddElementError {
78        #[inline]
79        fn from_wire(wire: crate::wire::AddElementError) -> Self {
80            Self::from(wire)
81        }
82    }
83
84    impl ::fidl_next::FromWireRef<crate::wire::AddElementError> for AddElementError {
85        #[inline]
86        fn from_wire_ref(wire: &crate::wire::AddElementError) -> Self {
87            Self::from(*wire)
88        }
89    }
90
91    #[doc = " Used to describe the power level of an element.\n Could extend this further to support additional types of power\n levels, such as ACPI.\n"]
92    pub type PowerLevel = u8;
93
94    #[doc = " BinaryPowerLevel is a well-known set of PowerLevels with only two\n states: OFF and ON.\n"]
95    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
96    #[repr(u8)]
97    pub enum BinaryPowerLevel {
98        Off = 0,
99        On = 1,
100    }
101    impl ::core::convert::TryFrom<u8> for BinaryPowerLevel {
102        type Error = ::fidl_next::UnknownStrictEnumMemberError;
103        fn try_from(
104            value: u8,
105        ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
106            match value {
107                0 => Ok(Self::Off),
108                1 => Ok(Self::On),
109
110                _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
111            }
112        }
113    }
114
115    unsafe impl<___E> ::fidl_next::Encode<crate::wire::BinaryPowerLevel, ___E> for BinaryPowerLevel
116    where
117        ___E: ?Sized,
118    {
119        #[inline]
120        fn encode(
121            self,
122            encoder: &mut ___E,
123            out: &mut ::core::mem::MaybeUninit<crate::wire::BinaryPowerLevel>,
124            _: (),
125        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
126            ::fidl_next::Encode::encode(&self, encoder, out, ())
127        }
128    }
129
130    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BinaryPowerLevel, ___E>
131        for &'a BinaryPowerLevel
132    where
133        ___E: ?Sized,
134    {
135        #[inline]
136        fn encode(
137            self,
138            encoder: &mut ___E,
139            out: &mut ::core::mem::MaybeUninit<crate::wire::BinaryPowerLevel>,
140            _: (),
141        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
142            ::fidl_next::munge!(let crate::wire::BinaryPowerLevel { value } = out);
143            let _ = value.write(u8::from(match *self {
144                BinaryPowerLevel::Off => 0,
145
146                BinaryPowerLevel::On => 1,
147            }));
148
149            Ok(())
150        }
151    }
152
153    impl ::core::convert::From<crate::wire::BinaryPowerLevel> for BinaryPowerLevel {
154        fn from(wire: crate::wire::BinaryPowerLevel) -> Self {
155            match u8::from(wire.value) {
156                0 => Self::Off,
157
158                1 => Self::On,
159
160                _ => unsafe { ::core::hint::unreachable_unchecked() },
161            }
162        }
163    }
164
165    impl ::fidl_next::FromWire<crate::wire::BinaryPowerLevel> for BinaryPowerLevel {
166        #[inline]
167        fn from_wire(wire: crate::wire::BinaryPowerLevel) -> Self {
168            Self::from(wire)
169        }
170    }
171
172    impl ::fidl_next::FromWireRef<crate::wire::BinaryPowerLevel> for BinaryPowerLevel {
173        #[inline]
174        fn from_wire_ref(wire: &crate::wire::BinaryPowerLevel) -> Self {
175            Self::from(*wire)
176        }
177    }
178
179    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
180    #[repr(C)]
181    pub struct ElementControlRegisterDependencyTokenResponse {}
182
183    unsafe impl<___E>
184        ::fidl_next::Encode<crate::wire::ElementControlRegisterDependencyTokenResponse, ___E>
185        for ElementControlRegisterDependencyTokenResponse
186    where
187        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
188    {
189        #[inline]
190        fn encode(
191            self,
192            encoder_: &mut ___E,
193            out_: &mut ::core::mem::MaybeUninit<
194                crate::wire::ElementControlRegisterDependencyTokenResponse,
195            >,
196            _: (),
197        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
198            ::fidl_next::munge! {
199                let crate::wire::ElementControlRegisterDependencyTokenResponse {
200
201                        _empty,
202
203                } = out_;
204            }
205
206            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
207
208            Ok(())
209        }
210    }
211
212    unsafe impl<'a, ___E>
213        ::fidl_next::Encode<crate::wire::ElementControlRegisterDependencyTokenResponse, ___E>
214        for &'a ElementControlRegisterDependencyTokenResponse
215    where
216        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
217    {
218        #[inline]
219        fn encode(
220            self,
221            encoder_: &mut ___E,
222            out_: &mut ::core::mem::MaybeUninit<
223                crate::wire::ElementControlRegisterDependencyTokenResponse,
224            >,
225            _: (),
226        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
227            ::fidl_next::munge! {
228                let crate::wire::ElementControlRegisterDependencyTokenResponse {
229
230                        _empty,
231
232
233                } = out_;
234            }
235
236            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
237
238            Ok(())
239        }
240    }
241
242    unsafe impl<___E>
243        ::fidl_next::EncodeOption<
244            ::fidl_next::wire::Box<
245                'static,
246                crate::wire::ElementControlRegisterDependencyTokenResponse,
247            >,
248            ___E,
249        > for ElementControlRegisterDependencyTokenResponse
250    where
251        ___E: ::fidl_next::Encoder + ?Sized,
252        ElementControlRegisterDependencyTokenResponse:
253            ::fidl_next::Encode<crate::wire::ElementControlRegisterDependencyTokenResponse, ___E>,
254    {
255        #[inline]
256        fn encode_option(
257            this: ::core::option::Option<Self>,
258            encoder: &mut ___E,
259            out: &mut ::core::mem::MaybeUninit<
260                ::fidl_next::wire::Box<
261                    'static,
262                    crate::wire::ElementControlRegisterDependencyTokenResponse,
263                >,
264            >,
265            _: (),
266        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
267            if let Some(inner) = this {
268                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
269                ::fidl_next::wire::Box::encode_present(out);
270            } else {
271                ::fidl_next::wire::Box::encode_absent(out);
272            }
273
274            Ok(())
275        }
276    }
277
278    unsafe impl<'a, ___E>
279        ::fidl_next::EncodeOption<
280            ::fidl_next::wire::Box<
281                'static,
282                crate::wire::ElementControlRegisterDependencyTokenResponse,
283            >,
284            ___E,
285        > for &'a ElementControlRegisterDependencyTokenResponse
286    where
287        ___E: ::fidl_next::Encoder + ?Sized,
288        &'a ElementControlRegisterDependencyTokenResponse:
289            ::fidl_next::Encode<crate::wire::ElementControlRegisterDependencyTokenResponse, ___E>,
290    {
291        #[inline]
292        fn encode_option(
293            this: ::core::option::Option<Self>,
294            encoder: &mut ___E,
295            out: &mut ::core::mem::MaybeUninit<
296                ::fidl_next::wire::Box<
297                    'static,
298                    crate::wire::ElementControlRegisterDependencyTokenResponse,
299                >,
300            >,
301            _: (),
302        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
303            if let Some(inner) = this {
304                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
305                ::fidl_next::wire::Box::encode_present(out);
306            } else {
307                ::fidl_next::wire::Box::encode_absent(out);
308            }
309
310            Ok(())
311        }
312    }
313
314    impl ::fidl_next::FromWire<crate::wire::ElementControlRegisterDependencyTokenResponse>
315        for ElementControlRegisterDependencyTokenResponse
316    {
317        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
318            crate::wire::ElementControlRegisterDependencyTokenResponse,
319            Self,
320        > = unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
321
322        #[inline]
323        fn from_wire(wire: crate::wire::ElementControlRegisterDependencyTokenResponse) -> Self {
324            Self {}
325        }
326    }
327
328    impl ::fidl_next::FromWireRef<crate::wire::ElementControlRegisterDependencyTokenResponse>
329        for ElementControlRegisterDependencyTokenResponse
330    {
331        #[inline]
332        fn from_wire_ref(
333            wire: &crate::wire::ElementControlRegisterDependencyTokenResponse,
334        ) -> Self {
335            Self {}
336        }
337    }
338
339    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
340    #[repr(u32)]
341    pub enum RegisterDependencyTokenError {
342        AlreadyInUse = 1,
343        Internal = 2,
344        UnknownOrdinal_(u32) = 3,
345    }
346    impl ::std::convert::From<u32> for RegisterDependencyTokenError {
347        fn from(value: u32) -> Self {
348            match value {
349                1 => Self::AlreadyInUse,
350                2 => Self::Internal,
351
352                _ => Self::UnknownOrdinal_(value),
353            }
354        }
355    }
356
357    unsafe impl<___E> ::fidl_next::Encode<crate::wire::RegisterDependencyTokenError, ___E>
358        for RegisterDependencyTokenError
359    where
360        ___E: ?Sized,
361    {
362        #[inline]
363        fn encode(
364            self,
365            encoder: &mut ___E,
366            out: &mut ::core::mem::MaybeUninit<crate::wire::RegisterDependencyTokenError>,
367            _: (),
368        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
369            ::fidl_next::Encode::encode(&self, encoder, out, ())
370        }
371    }
372
373    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RegisterDependencyTokenError, ___E>
374        for &'a RegisterDependencyTokenError
375    where
376        ___E: ?Sized,
377    {
378        #[inline]
379        fn encode(
380            self,
381            encoder: &mut ___E,
382            out: &mut ::core::mem::MaybeUninit<crate::wire::RegisterDependencyTokenError>,
383            _: (),
384        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
385            ::fidl_next::munge!(let crate::wire::RegisterDependencyTokenError { value } = out);
386            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
387                RegisterDependencyTokenError::AlreadyInUse => 1,
388
389                RegisterDependencyTokenError::Internal => 2,
390
391                RegisterDependencyTokenError::UnknownOrdinal_(value) => value,
392            }));
393
394            Ok(())
395        }
396    }
397
398    impl ::core::convert::From<crate::wire::RegisterDependencyTokenError>
399        for RegisterDependencyTokenError
400    {
401        fn from(wire: crate::wire::RegisterDependencyTokenError) -> Self {
402            match u32::from(wire.value) {
403                1 => Self::AlreadyInUse,
404
405                2 => Self::Internal,
406
407                value => Self::UnknownOrdinal_(value),
408            }
409        }
410    }
411
412    impl ::fidl_next::FromWire<crate::wire::RegisterDependencyTokenError>
413        for RegisterDependencyTokenError
414    {
415        #[inline]
416        fn from_wire(wire: crate::wire::RegisterDependencyTokenError) -> Self {
417            Self::from(wire)
418        }
419    }
420
421    impl ::fidl_next::FromWireRef<crate::wire::RegisterDependencyTokenError>
422        for RegisterDependencyTokenError
423    {
424        #[inline]
425        fn from_wire_ref(wire: &crate::wire::RegisterDependencyTokenError) -> Self {
426            Self::from(*wire)
427        }
428    }
429
430    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
431    #[repr(C)]
432    pub struct ElementControlUnregisterDependencyTokenResponse {}
433
434    unsafe impl<___E>
435        ::fidl_next::Encode<crate::wire::ElementControlUnregisterDependencyTokenResponse, ___E>
436        for ElementControlUnregisterDependencyTokenResponse
437    where
438        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
439    {
440        #[inline]
441        fn encode(
442            self,
443            encoder_: &mut ___E,
444            out_: &mut ::core::mem::MaybeUninit<
445                crate::wire::ElementControlUnregisterDependencyTokenResponse,
446            >,
447            _: (),
448        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
449            ::fidl_next::munge! {
450                let crate::wire::ElementControlUnregisterDependencyTokenResponse {
451
452                        _empty,
453
454                } = out_;
455            }
456
457            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
458
459            Ok(())
460        }
461    }
462
463    unsafe impl<'a, ___E>
464        ::fidl_next::Encode<crate::wire::ElementControlUnregisterDependencyTokenResponse, ___E>
465        for &'a ElementControlUnregisterDependencyTokenResponse
466    where
467        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
468    {
469        #[inline]
470        fn encode(
471            self,
472            encoder_: &mut ___E,
473            out_: &mut ::core::mem::MaybeUninit<
474                crate::wire::ElementControlUnregisterDependencyTokenResponse,
475            >,
476            _: (),
477        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
478            ::fidl_next::munge! {
479                let crate::wire::ElementControlUnregisterDependencyTokenResponse {
480
481                        _empty,
482
483
484                } = out_;
485            }
486
487            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
488
489            Ok(())
490        }
491    }
492
493    unsafe impl<___E>
494        ::fidl_next::EncodeOption<
495            ::fidl_next::wire::Box<
496                'static,
497                crate::wire::ElementControlUnregisterDependencyTokenResponse,
498            >,
499            ___E,
500        > for ElementControlUnregisterDependencyTokenResponse
501    where
502        ___E: ::fidl_next::Encoder + ?Sized,
503        ElementControlUnregisterDependencyTokenResponse:
504            ::fidl_next::Encode<crate::wire::ElementControlUnregisterDependencyTokenResponse, ___E>,
505    {
506        #[inline]
507        fn encode_option(
508            this: ::core::option::Option<Self>,
509            encoder: &mut ___E,
510            out: &mut ::core::mem::MaybeUninit<
511                ::fidl_next::wire::Box<
512                    'static,
513                    crate::wire::ElementControlUnregisterDependencyTokenResponse,
514                >,
515            >,
516            _: (),
517        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
518            if let Some(inner) = this {
519                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
520                ::fidl_next::wire::Box::encode_present(out);
521            } else {
522                ::fidl_next::wire::Box::encode_absent(out);
523            }
524
525            Ok(())
526        }
527    }
528
529    unsafe impl<'a, ___E>
530        ::fidl_next::EncodeOption<
531            ::fidl_next::wire::Box<
532                'static,
533                crate::wire::ElementControlUnregisterDependencyTokenResponse,
534            >,
535            ___E,
536        > for &'a ElementControlUnregisterDependencyTokenResponse
537    where
538        ___E: ::fidl_next::Encoder + ?Sized,
539        &'a ElementControlUnregisterDependencyTokenResponse:
540            ::fidl_next::Encode<crate::wire::ElementControlUnregisterDependencyTokenResponse, ___E>,
541    {
542        #[inline]
543        fn encode_option(
544            this: ::core::option::Option<Self>,
545            encoder: &mut ___E,
546            out: &mut ::core::mem::MaybeUninit<
547                ::fidl_next::wire::Box<
548                    'static,
549                    crate::wire::ElementControlUnregisterDependencyTokenResponse,
550                >,
551            >,
552            _: (),
553        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
554            if let Some(inner) = this {
555                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
556                ::fidl_next::wire::Box::encode_present(out);
557            } else {
558                ::fidl_next::wire::Box::encode_absent(out);
559            }
560
561            Ok(())
562        }
563    }
564
565    impl ::fidl_next::FromWire<crate::wire::ElementControlUnregisterDependencyTokenResponse>
566        for ElementControlUnregisterDependencyTokenResponse
567    {
568        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
569            crate::wire::ElementControlUnregisterDependencyTokenResponse,
570            Self,
571        > = unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
572
573        #[inline]
574        fn from_wire(wire: crate::wire::ElementControlUnregisterDependencyTokenResponse) -> Self {
575            Self {}
576        }
577    }
578
579    impl ::fidl_next::FromWireRef<crate::wire::ElementControlUnregisterDependencyTokenResponse>
580        for ElementControlUnregisterDependencyTokenResponse
581    {
582        #[inline]
583        fn from_wire_ref(
584            wire: &crate::wire::ElementControlUnregisterDependencyTokenResponse,
585        ) -> Self {
586            Self {}
587        }
588    }
589
590    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
591    #[repr(u32)]
592    pub enum UnregisterDependencyTokenError {
593        NotAuthorized = 1,
594        NotFound = 2,
595        UnknownOrdinal_(u32) = 3,
596    }
597    impl ::std::convert::From<u32> for UnregisterDependencyTokenError {
598        fn from(value: u32) -> Self {
599            match value {
600                1 => Self::NotAuthorized,
601                2 => Self::NotFound,
602
603                _ => Self::UnknownOrdinal_(value),
604            }
605        }
606    }
607
608    unsafe impl<___E> ::fidl_next::Encode<crate::wire::UnregisterDependencyTokenError, ___E>
609        for UnregisterDependencyTokenError
610    where
611        ___E: ?Sized,
612    {
613        #[inline]
614        fn encode(
615            self,
616            encoder: &mut ___E,
617            out: &mut ::core::mem::MaybeUninit<crate::wire::UnregisterDependencyTokenError>,
618            _: (),
619        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
620            ::fidl_next::Encode::encode(&self, encoder, out, ())
621        }
622    }
623
624    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UnregisterDependencyTokenError, ___E>
625        for &'a UnregisterDependencyTokenError
626    where
627        ___E: ?Sized,
628    {
629        #[inline]
630        fn encode(
631            self,
632            encoder: &mut ___E,
633            out: &mut ::core::mem::MaybeUninit<crate::wire::UnregisterDependencyTokenError>,
634            _: (),
635        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
636            ::fidl_next::munge!(let crate::wire::UnregisterDependencyTokenError { value } = out);
637            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
638                UnregisterDependencyTokenError::NotAuthorized => 1,
639
640                UnregisterDependencyTokenError::NotFound => 2,
641
642                UnregisterDependencyTokenError::UnknownOrdinal_(value) => value,
643            }));
644
645            Ok(())
646        }
647    }
648
649    impl ::core::convert::From<crate::wire::UnregisterDependencyTokenError>
650        for UnregisterDependencyTokenError
651    {
652        fn from(wire: crate::wire::UnregisterDependencyTokenError) -> Self {
653            match u32::from(wire.value) {
654                1 => Self::NotAuthorized,
655
656                2 => Self::NotFound,
657
658                value => Self::UnknownOrdinal_(value),
659            }
660        }
661    }
662
663    impl ::fidl_next::FromWire<crate::wire::UnregisterDependencyTokenError>
664        for UnregisterDependencyTokenError
665    {
666        #[inline]
667        fn from_wire(wire: crate::wire::UnregisterDependencyTokenError) -> Self {
668            Self::from(wire)
669        }
670    }
671
672    impl ::fidl_next::FromWireRef<crate::wire::UnregisterDependencyTokenError>
673        for UnregisterDependencyTokenError
674    {
675        #[inline]
676        fn from_wire_ref(wire: &crate::wire::UnregisterDependencyTokenError) -> Self {
677            Self::from(*wire)
678        }
679    }
680
681    #[doc = " Mapping of a plaintext name to a PowerLevel. Names are expected to be unique between\n elements and persistent across reboots of the same build, but consistency is not\n guaranteed between different builds.\n"]
682    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
683    pub struct PowerLevelName {
684        pub level: ::core::option::Option<u8>,
685
686        pub name: ::core::option::Option<::std::string::String>,
687    }
688
689    impl PowerLevelName {
690        fn __max_ordinal(&self) -> usize {
691            if self.name.is_some() {
692                return 2;
693            }
694
695            if self.level.is_some() {
696                return 1;
697            }
698
699            0
700        }
701    }
702
703    unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerLevelName<'static>, ___E> for PowerLevelName
704    where
705        ___E: ::fidl_next::Encoder + ?Sized,
706    {
707        #[inline]
708        fn encode(
709            mut self,
710            encoder: &mut ___E,
711            out: &mut ::core::mem::MaybeUninit<crate::wire::PowerLevelName<'static>>,
712            _: (),
713        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
714            ::fidl_next::munge!(let crate::wire::PowerLevelName { table } = out);
715
716            let max_ord = self.__max_ordinal();
717
718            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
719            ::fidl_next::Wire::zero_padding(&mut out);
720
721            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
722                ::fidl_next::wire::Envelope,
723            >(encoder, max_ord);
724
725            for i in 1..=max_ord {
726                match i {
727                    2 => {
728                        if let Some(value) = self.name.take() {
729                            ::fidl_next::wire::Envelope::encode_value::<
730                                ::fidl_next::wire::String<'static>,
731                                ___E,
732                            >(
733                                value, preallocated.encoder, &mut out, 16
734                            )?;
735                        } else {
736                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
737                        }
738                    }
739
740                    1 => {
741                        if let Some(value) = self.level.take() {
742                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
743                                value,
744                                preallocated.encoder,
745                                &mut out,
746                                (),
747                            )?;
748                        } else {
749                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
750                        }
751                    }
752
753                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
754                }
755                unsafe {
756                    preallocated.write_next(out.assume_init_ref());
757                }
758            }
759
760            ::fidl_next::wire::Table::encode_len(table, max_ord);
761
762            Ok(())
763        }
764    }
765
766    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PowerLevelName<'static>, ___E>
767        for &'a PowerLevelName
768    where
769        ___E: ::fidl_next::Encoder + ?Sized,
770    {
771        #[inline]
772        fn encode(
773            self,
774            encoder: &mut ___E,
775            out: &mut ::core::mem::MaybeUninit<crate::wire::PowerLevelName<'static>>,
776            _: (),
777        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
778            ::fidl_next::munge!(let crate::wire::PowerLevelName { table } = out);
779
780            let max_ord = self.__max_ordinal();
781
782            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
783            ::fidl_next::Wire::zero_padding(&mut out);
784
785            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
786                ::fidl_next::wire::Envelope,
787            >(encoder, max_ord);
788
789            for i in 1..=max_ord {
790                match i {
791                    2 => {
792                        if let Some(value) = &self.name {
793                            ::fidl_next::wire::Envelope::encode_value::<
794                                ::fidl_next::wire::String<'static>,
795                                ___E,
796                            >(
797                                value, preallocated.encoder, &mut out, 16
798                            )?;
799                        } else {
800                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
801                        }
802                    }
803
804                    1 => {
805                        if let Some(value) = &self.level {
806                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
807                                value,
808                                preallocated.encoder,
809                                &mut out,
810                                (),
811                            )?;
812                        } else {
813                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
814                        }
815                    }
816
817                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
818                }
819                unsafe {
820                    preallocated.write_next(out.assume_init_ref());
821                }
822            }
823
824            ::fidl_next::wire::Table::encode_len(table, max_ord);
825
826            Ok(())
827        }
828    }
829
830    impl<'de> ::fidl_next::FromWire<crate::wire::PowerLevelName<'de>> for PowerLevelName {
831        #[inline]
832        fn from_wire(wire_: crate::wire::PowerLevelName<'de>) -> Self {
833            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
834
835            let level = wire_.table.get(1);
836
837            let name = wire_.table.get(2);
838
839            Self {
840                level: level.map(|envelope| {
841                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
842                }),
843
844                name: name.map(|envelope| {
845                    ::fidl_next::FromWire::from_wire(unsafe {
846                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
847                    })
848                }),
849            }
850        }
851    }
852
853    impl<'de> ::fidl_next::FromWireRef<crate::wire::PowerLevelName<'de>> for PowerLevelName {
854        #[inline]
855        fn from_wire_ref(wire: &crate::wire::PowerLevelName<'de>) -> Self {
856            Self {
857                level: wire.table.get(1).map(|envelope| {
858                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
859                        envelope.deref_unchecked::<u8>()
860                    })
861                }),
862
863                name: wire.table.get(2).map(|envelope| {
864                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
865                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
866                    })
867                }),
868            }
869        }
870    }
871
872    #[doc = " Mapping of a vector of [`fuchsia.power.broker/PowerLevelName`] to a Power Element via\n its plaintext name. Names are expected to be unique between elements and persistent\n across reboots of the same build, but consistency is not guaranteed between different builds.\n"]
873    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
874    pub struct ElementPowerLevelNames {
875        pub identifier: ::core::option::Option<::std::string::String>,
876
877        pub levels: ::core::option::Option<::std::vec::Vec<crate::natural::PowerLevelName>>,
878    }
879
880    impl ElementPowerLevelNames {
881        fn __max_ordinal(&self) -> usize {
882            if self.levels.is_some() {
883                return 2;
884            }
885
886            if self.identifier.is_some() {
887                return 1;
888            }
889
890            0
891        }
892    }
893
894    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ElementPowerLevelNames<'static>, ___E>
895        for ElementPowerLevelNames
896    where
897        ___E: ::fidl_next::Encoder + ?Sized,
898    {
899        #[inline]
900        fn encode(
901            mut self,
902            encoder: &mut ___E,
903            out: &mut ::core::mem::MaybeUninit<crate::wire::ElementPowerLevelNames<'static>>,
904            _: (),
905        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
906            ::fidl_next::munge!(let crate::wire::ElementPowerLevelNames { table } = out);
907
908            let max_ord = self.__max_ordinal();
909
910            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
911            ::fidl_next::Wire::zero_padding(&mut out);
912
913            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
914                ::fidl_next::wire::Envelope,
915            >(encoder, max_ord);
916
917            for i in 1..=max_ord {
918                match i {
919                    2 => {
920                        if let Some(value) = self.levels.take() {
921                            ::fidl_next::wire::Envelope::encode_value::<
922                                ::fidl_next::wire::Vector<
923                                    'static,
924                                    crate::wire::PowerLevelName<'static>,
925                                >,
926                                ___E,
927                            >(
928                                value, preallocated.encoder, &mut out, (256, ())
929                            )?;
930                        } else {
931                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
932                        }
933                    }
934
935                    1 => {
936                        if let Some(value) = self.identifier.take() {
937                            ::fidl_next::wire::Envelope::encode_value::<
938                                ::fidl_next::wire::String<'static>,
939                                ___E,
940                            >(
941                                value, preallocated.encoder, &mut out, 64
942                            )?;
943                        } else {
944                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
945                        }
946                    }
947
948                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
949                }
950                unsafe {
951                    preallocated.write_next(out.assume_init_ref());
952                }
953            }
954
955            ::fidl_next::wire::Table::encode_len(table, max_ord);
956
957            Ok(())
958        }
959    }
960
961    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ElementPowerLevelNames<'static>, ___E>
962        for &'a ElementPowerLevelNames
963    where
964        ___E: ::fidl_next::Encoder + ?Sized,
965    {
966        #[inline]
967        fn encode(
968            self,
969            encoder: &mut ___E,
970            out: &mut ::core::mem::MaybeUninit<crate::wire::ElementPowerLevelNames<'static>>,
971            _: (),
972        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
973            ::fidl_next::munge!(let crate::wire::ElementPowerLevelNames { table } = out);
974
975            let max_ord = self.__max_ordinal();
976
977            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
978            ::fidl_next::Wire::zero_padding(&mut out);
979
980            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
981                ::fidl_next::wire::Envelope,
982            >(encoder, max_ord);
983
984            for i in 1..=max_ord {
985                match i {
986                    2 => {
987                        if let Some(value) = &self.levels {
988                            ::fidl_next::wire::Envelope::encode_value::<
989                                ::fidl_next::wire::Vector<
990                                    'static,
991                                    crate::wire::PowerLevelName<'static>,
992                                >,
993                                ___E,
994                            >(
995                                value, preallocated.encoder, &mut out, (256, ())
996                            )?;
997                        } else {
998                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
999                        }
1000                    }
1001
1002                    1 => {
1003                        if let Some(value) = &self.identifier {
1004                            ::fidl_next::wire::Envelope::encode_value::<
1005                                ::fidl_next::wire::String<'static>,
1006                                ___E,
1007                            >(
1008                                value, preallocated.encoder, &mut out, 64
1009                            )?;
1010                        } else {
1011                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
1012                        }
1013                    }
1014
1015                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1016                }
1017                unsafe {
1018                    preallocated.write_next(out.assume_init_ref());
1019                }
1020            }
1021
1022            ::fidl_next::wire::Table::encode_len(table, max_ord);
1023
1024            Ok(())
1025        }
1026    }
1027
1028    impl<'de> ::fidl_next::FromWire<crate::wire::ElementPowerLevelNames<'de>>
1029        for ElementPowerLevelNames
1030    {
1031        #[inline]
1032        fn from_wire(wire_: crate::wire::ElementPowerLevelNames<'de>) -> Self {
1033            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1034
1035            let identifier = wire_.table.get(1);
1036
1037            let levels = wire_.table.get(2);
1038
1039            Self {
1040
1041
1042                identifier: identifier.map(|envelope| ::fidl_next::FromWire::from_wire(
1043                    unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
1044                )),
1045
1046
1047                levels: levels.map(|envelope| ::fidl_next::FromWire::from_wire(
1048                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>() }
1049                )),
1050
1051        }
1052        }
1053    }
1054
1055    impl<'de> ::fidl_next::FromWireRef<crate::wire::ElementPowerLevelNames<'de>>
1056        for ElementPowerLevelNames
1057    {
1058        #[inline]
1059        fn from_wire_ref(wire: &crate::wire::ElementPowerLevelNames<'de>) -> Self {
1060            Self {
1061
1062
1063                identifier: wire.table.get(1)
1064                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1065                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
1066                    )),
1067
1068
1069                levels: wire.table.get(2)
1070                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1071                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>() }
1072                    )),
1073
1074        }
1075        }
1076    }
1077
1078    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1079    #[repr(u32)]
1080    pub enum ElementInfoProviderError {
1081        Unknown = 0,
1082        Failed = 1,
1083        UnknownOrdinal_(u32) = 2,
1084    }
1085    impl ::std::convert::From<u32> for ElementInfoProviderError {
1086        fn from(value: u32) -> Self {
1087            match value {
1088                0 => Self::Unknown,
1089                1 => Self::Failed,
1090
1091                _ => Self::UnknownOrdinal_(value),
1092            }
1093        }
1094    }
1095
1096    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ElementInfoProviderError, ___E>
1097        for ElementInfoProviderError
1098    where
1099        ___E: ?Sized,
1100    {
1101        #[inline]
1102        fn encode(
1103            self,
1104            encoder: &mut ___E,
1105            out: &mut ::core::mem::MaybeUninit<crate::wire::ElementInfoProviderError>,
1106            _: (),
1107        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1108            ::fidl_next::Encode::encode(&self, encoder, out, ())
1109        }
1110    }
1111
1112    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ElementInfoProviderError, ___E>
1113        for &'a ElementInfoProviderError
1114    where
1115        ___E: ?Sized,
1116    {
1117        #[inline]
1118        fn encode(
1119            self,
1120            encoder: &mut ___E,
1121            out: &mut ::core::mem::MaybeUninit<crate::wire::ElementInfoProviderError>,
1122            _: (),
1123        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1124            ::fidl_next::munge!(let crate::wire::ElementInfoProviderError { value } = out);
1125            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1126                ElementInfoProviderError::Unknown => 0,
1127
1128                ElementInfoProviderError::Failed => 1,
1129
1130                ElementInfoProviderError::UnknownOrdinal_(value) => value,
1131            }));
1132
1133            Ok(())
1134        }
1135    }
1136
1137    impl ::core::convert::From<crate::wire::ElementInfoProviderError> for ElementInfoProviderError {
1138        fn from(wire: crate::wire::ElementInfoProviderError) -> Self {
1139            match u32::from(wire.value) {
1140                0 => Self::Unknown,
1141
1142                1 => Self::Failed,
1143
1144                value => Self::UnknownOrdinal_(value),
1145            }
1146        }
1147    }
1148
1149    impl ::fidl_next::FromWire<crate::wire::ElementInfoProviderError> for ElementInfoProviderError {
1150        #[inline]
1151        fn from_wire(wire: crate::wire::ElementInfoProviderError) -> Self {
1152            Self::from(wire)
1153        }
1154    }
1155
1156    impl ::fidl_next::FromWireRef<crate::wire::ElementInfoProviderError> for ElementInfoProviderError {
1157        #[inline]
1158        fn from_wire_ref(wire: &crate::wire::ElementInfoProviderError) -> Self {
1159            Self::from(*wire)
1160        }
1161    }
1162
1163    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1164    #[repr(C)]
1165    pub struct ElementRunnerSetLevelRequest {
1166        pub level: u8,
1167    }
1168
1169    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>
1170        for ElementRunnerSetLevelRequest
1171    where
1172        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1173    {
1174        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1175            Self,
1176            crate::wire::ElementRunnerSetLevelRequest,
1177        > = unsafe {
1178            ::fidl_next::CopyOptimization::enable_if(
1179                true && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(),
1180            )
1181        };
1182
1183        #[inline]
1184        fn encode(
1185            self,
1186            encoder_: &mut ___E,
1187            out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelRequest>,
1188            _: (),
1189        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1190            ::fidl_next::munge! {
1191                let crate::wire::ElementRunnerSetLevelRequest {
1192                    level,
1193
1194                } = out_;
1195            }
1196
1197            ::fidl_next::Encode::encode(self.level, encoder_, level, ())?;
1198
1199            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(level.as_mut_ptr()) };
1200
1201            Ok(())
1202        }
1203    }
1204
1205    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>
1206        for &'a ElementRunnerSetLevelRequest
1207    where
1208        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1209    {
1210        #[inline]
1211        fn encode(
1212            self,
1213            encoder_: &mut ___E,
1214            out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelRequest>,
1215            _: (),
1216        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1217            ::fidl_next::munge! {
1218                let crate::wire::ElementRunnerSetLevelRequest {
1219
1220                    level,
1221
1222                } = out_;
1223            }
1224
1225            ::fidl_next::Encode::encode(&self.level, encoder_, level, ())?;
1226
1227            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(level.as_mut_ptr()) };
1228
1229            Ok(())
1230        }
1231    }
1232
1233    unsafe impl<___E>
1234        ::fidl_next::EncodeOption<
1235            ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1236            ___E,
1237        > for ElementRunnerSetLevelRequest
1238    where
1239        ___E: ::fidl_next::Encoder + ?Sized,
1240        ElementRunnerSetLevelRequest:
1241            ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>,
1242    {
1243        #[inline]
1244        fn encode_option(
1245            this: ::core::option::Option<Self>,
1246            encoder: &mut ___E,
1247            out: &mut ::core::mem::MaybeUninit<
1248                ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1249            >,
1250            _: (),
1251        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1252            if let Some(inner) = this {
1253                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1254                ::fidl_next::wire::Box::encode_present(out);
1255            } else {
1256                ::fidl_next::wire::Box::encode_absent(out);
1257            }
1258
1259            Ok(())
1260        }
1261    }
1262
1263    unsafe impl<'a, ___E>
1264        ::fidl_next::EncodeOption<
1265            ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1266            ___E,
1267        > for &'a ElementRunnerSetLevelRequest
1268    where
1269        ___E: ::fidl_next::Encoder + ?Sized,
1270        &'a ElementRunnerSetLevelRequest:
1271            ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>,
1272    {
1273        #[inline]
1274        fn encode_option(
1275            this: ::core::option::Option<Self>,
1276            encoder: &mut ___E,
1277            out: &mut ::core::mem::MaybeUninit<
1278                ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1279            >,
1280            _: (),
1281        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1282            if let Some(inner) = this {
1283                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1284                ::fidl_next::wire::Box::encode_present(out);
1285            } else {
1286                ::fidl_next::wire::Box::encode_absent(out);
1287            }
1288
1289            Ok(())
1290        }
1291    }
1292
1293    impl ::fidl_next::FromWire<crate::wire::ElementRunnerSetLevelRequest>
1294        for ElementRunnerSetLevelRequest
1295    {
1296        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1297            crate::wire::ElementRunnerSetLevelRequest,
1298            Self,
1299        > = unsafe {
1300            ::fidl_next::CopyOptimization::enable_if(
1301                true && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(),
1302            )
1303        };
1304
1305        #[inline]
1306        fn from_wire(wire: crate::wire::ElementRunnerSetLevelRequest) -> Self {
1307            Self { level: ::fidl_next::FromWire::from_wire(wire.level) }
1308        }
1309    }
1310
1311    impl ::fidl_next::FromWireRef<crate::wire::ElementRunnerSetLevelRequest>
1312        for ElementRunnerSetLevelRequest
1313    {
1314        #[inline]
1315        fn from_wire_ref(wire: &crate::wire::ElementRunnerSetLevelRequest) -> Self {
1316            Self { level: ::fidl_next::FromWireRef::from_wire_ref(&wire.level) }
1317        }
1318    }
1319
1320    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1321    #[repr(C)]
1322    pub struct ElementRunnerSetLevelResponse {}
1323
1324    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelResponse, ___E>
1325        for ElementRunnerSetLevelResponse
1326    where
1327        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1328    {
1329        #[inline]
1330        fn encode(
1331            self,
1332            encoder_: &mut ___E,
1333            out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelResponse>,
1334            _: (),
1335        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1336            ::fidl_next::munge! {
1337                let crate::wire::ElementRunnerSetLevelResponse {
1338
1339                        _empty,
1340
1341                } = out_;
1342            }
1343
1344            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1345
1346            Ok(())
1347        }
1348    }
1349
1350    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelResponse, ___E>
1351        for &'a ElementRunnerSetLevelResponse
1352    where
1353        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1354    {
1355        #[inline]
1356        fn encode(
1357            self,
1358            encoder_: &mut ___E,
1359            out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelResponse>,
1360            _: (),
1361        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1362            ::fidl_next::munge! {
1363                let crate::wire::ElementRunnerSetLevelResponse {
1364
1365                        _empty,
1366
1367
1368                } = out_;
1369            }
1370
1371            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1372
1373            Ok(())
1374        }
1375    }
1376
1377    unsafe impl<___E>
1378        ::fidl_next::EncodeOption<
1379            ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelResponse>,
1380            ___E,
1381        > for ElementRunnerSetLevelResponse
1382    where
1383        ___E: ::fidl_next::Encoder + ?Sized,
1384        ElementRunnerSetLevelResponse:
1385            ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelResponse, ___E>,
1386    {
1387        #[inline]
1388        fn encode_option(
1389            this: ::core::option::Option<Self>,
1390            encoder: &mut ___E,
1391            out: &mut ::core::mem::MaybeUninit<
1392                ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelResponse>,
1393            >,
1394            _: (),
1395        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1396            if let Some(inner) = this {
1397                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1398                ::fidl_next::wire::Box::encode_present(out);
1399            } else {
1400                ::fidl_next::wire::Box::encode_absent(out);
1401            }
1402
1403            Ok(())
1404        }
1405    }
1406
1407    unsafe impl<'a, ___E>
1408        ::fidl_next::EncodeOption<
1409            ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelResponse>,
1410            ___E,
1411        > for &'a ElementRunnerSetLevelResponse
1412    where
1413        ___E: ::fidl_next::Encoder + ?Sized,
1414        &'a ElementRunnerSetLevelResponse:
1415            ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelResponse, ___E>,
1416    {
1417        #[inline]
1418        fn encode_option(
1419            this: ::core::option::Option<Self>,
1420            encoder: &mut ___E,
1421            out: &mut ::core::mem::MaybeUninit<
1422                ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelResponse>,
1423            >,
1424            _: (),
1425        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1426            if let Some(inner) = this {
1427                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1428                ::fidl_next::wire::Box::encode_present(out);
1429            } else {
1430                ::fidl_next::wire::Box::encode_absent(out);
1431            }
1432
1433            Ok(())
1434        }
1435    }
1436
1437    impl ::fidl_next::FromWire<crate::wire::ElementRunnerSetLevelResponse>
1438        for ElementRunnerSetLevelResponse
1439    {
1440        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1441            crate::wire::ElementRunnerSetLevelResponse,
1442            Self,
1443        > = unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1444
1445        #[inline]
1446        fn from_wire(wire: crate::wire::ElementRunnerSetLevelResponse) -> Self {
1447            Self {}
1448        }
1449    }
1450
1451    impl ::fidl_next::FromWireRef<crate::wire::ElementRunnerSetLevelResponse>
1452        for ElementRunnerSetLevelResponse
1453    {
1454        #[inline]
1455        fn from_wire_ref(wire: &crate::wire::ElementRunnerSetLevelResponse) -> Self {
1456            Self {}
1457        }
1458    }
1459
1460    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1461    #[repr(u32)]
1462    pub enum LeaseStatus {
1463        Unknown = 0,
1464        Pending = 1,
1465        Satisfied = 2,
1466        UnknownOrdinal_(u32) = 3,
1467    }
1468    impl ::std::convert::From<u32> for LeaseStatus {
1469        fn from(value: u32) -> Self {
1470            match value {
1471                0 => Self::Unknown,
1472                1 => Self::Pending,
1473                2 => Self::Satisfied,
1474
1475                _ => Self::UnknownOrdinal_(value),
1476            }
1477        }
1478    }
1479
1480    unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseStatus, ___E> for LeaseStatus
1481    where
1482        ___E: ?Sized,
1483    {
1484        #[inline]
1485        fn encode(
1486            self,
1487            encoder: &mut ___E,
1488            out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseStatus>,
1489            _: (),
1490        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1491            ::fidl_next::Encode::encode(&self, encoder, out, ())
1492        }
1493    }
1494
1495    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseStatus, ___E> for &'a LeaseStatus
1496    where
1497        ___E: ?Sized,
1498    {
1499        #[inline]
1500        fn encode(
1501            self,
1502            encoder: &mut ___E,
1503            out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseStatus>,
1504            _: (),
1505        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1506            ::fidl_next::munge!(let crate::wire::LeaseStatus { value } = out);
1507            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1508                LeaseStatus::Unknown => 0,
1509
1510                LeaseStatus::Pending => 1,
1511
1512                LeaseStatus::Satisfied => 2,
1513
1514                LeaseStatus::UnknownOrdinal_(value) => value,
1515            }));
1516
1517            Ok(())
1518        }
1519    }
1520
1521    impl ::core::convert::From<crate::wire::LeaseStatus> for LeaseStatus {
1522        fn from(wire: crate::wire::LeaseStatus) -> Self {
1523            match u32::from(wire.value) {
1524                0 => Self::Unknown,
1525
1526                1 => Self::Pending,
1527
1528                2 => Self::Satisfied,
1529
1530                value => Self::UnknownOrdinal_(value),
1531            }
1532        }
1533    }
1534
1535    impl ::fidl_next::FromWire<crate::wire::LeaseStatus> for LeaseStatus {
1536        #[inline]
1537        fn from_wire(wire: crate::wire::LeaseStatus) -> Self {
1538            Self::from(wire)
1539        }
1540    }
1541
1542    impl ::fidl_next::FromWireRef<crate::wire::LeaseStatus> for LeaseStatus {
1543        #[inline]
1544        fn from_wire_ref(wire: &crate::wire::LeaseStatus) -> Self {
1545            Self::from(*wire)
1546        }
1547    }
1548
1549    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1550    #[repr(C)]
1551    pub struct LeaseControlWatchStatusRequest {
1552        pub last_status: crate::natural::LeaseStatus,
1553    }
1554
1555    unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>
1556        for LeaseControlWatchStatusRequest
1557    where
1558        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1559    {
1560        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1561            Self,
1562            crate::wire::LeaseControlWatchStatusRequest,
1563        > = unsafe {
1564            ::fidl_next::CopyOptimization::enable_if(
1565                true && <crate::natural::LeaseStatus as ::fidl_next::Encode<
1566                    crate::wire::LeaseStatus,
1567                    ___E,
1568                >>::COPY_OPTIMIZATION
1569                    .is_enabled(),
1570            )
1571        };
1572
1573        #[inline]
1574        fn encode(
1575            self,
1576            encoder_: &mut ___E,
1577            out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusRequest>,
1578            _: (),
1579        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1580            ::fidl_next::munge! {
1581                let crate::wire::LeaseControlWatchStatusRequest {
1582                    last_status,
1583
1584                } = out_;
1585            }
1586
1587            ::fidl_next::Encode::encode(self.last_status, encoder_, last_status, ())?;
1588
1589            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(last_status.as_mut_ptr()) };
1590
1591            Ok(())
1592        }
1593    }
1594
1595    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>
1596        for &'a LeaseControlWatchStatusRequest
1597    where
1598        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1599    {
1600        #[inline]
1601        fn encode(
1602            self,
1603            encoder_: &mut ___E,
1604            out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusRequest>,
1605            _: (),
1606        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1607            ::fidl_next::munge! {
1608                let crate::wire::LeaseControlWatchStatusRequest {
1609
1610                    last_status,
1611
1612                } = out_;
1613            }
1614
1615            ::fidl_next::Encode::encode(&self.last_status, encoder_, last_status, ())?;
1616
1617            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(last_status.as_mut_ptr()) };
1618
1619            Ok(())
1620        }
1621    }
1622
1623    unsafe impl<___E>
1624        ::fidl_next::EncodeOption<
1625            ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1626            ___E,
1627        > for LeaseControlWatchStatusRequest
1628    where
1629        ___E: ::fidl_next::Encoder + ?Sized,
1630        LeaseControlWatchStatusRequest:
1631            ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>,
1632    {
1633        #[inline]
1634        fn encode_option(
1635            this: ::core::option::Option<Self>,
1636            encoder: &mut ___E,
1637            out: &mut ::core::mem::MaybeUninit<
1638                ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1639            >,
1640            _: (),
1641        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1642            if let Some(inner) = this {
1643                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1644                ::fidl_next::wire::Box::encode_present(out);
1645            } else {
1646                ::fidl_next::wire::Box::encode_absent(out);
1647            }
1648
1649            Ok(())
1650        }
1651    }
1652
1653    unsafe impl<'a, ___E>
1654        ::fidl_next::EncodeOption<
1655            ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1656            ___E,
1657        > for &'a LeaseControlWatchStatusRequest
1658    where
1659        ___E: ::fidl_next::Encoder + ?Sized,
1660        &'a LeaseControlWatchStatusRequest:
1661            ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>,
1662    {
1663        #[inline]
1664        fn encode_option(
1665            this: ::core::option::Option<Self>,
1666            encoder: &mut ___E,
1667            out: &mut ::core::mem::MaybeUninit<
1668                ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1669            >,
1670            _: (),
1671        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1672            if let Some(inner) = this {
1673                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1674                ::fidl_next::wire::Box::encode_present(out);
1675            } else {
1676                ::fidl_next::wire::Box::encode_absent(out);
1677            }
1678
1679            Ok(())
1680        }
1681    }
1682
1683    impl ::fidl_next::FromWire<crate::wire::LeaseControlWatchStatusRequest>
1684        for LeaseControlWatchStatusRequest
1685    {
1686        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1687            crate::wire::LeaseControlWatchStatusRequest,
1688            Self,
1689        > = unsafe {
1690            ::fidl_next::CopyOptimization::enable_if(
1691                true && <crate::natural::LeaseStatus as ::fidl_next::FromWire<
1692                    crate::wire::LeaseStatus,
1693                >>::COPY_OPTIMIZATION
1694                    .is_enabled(),
1695            )
1696        };
1697
1698        #[inline]
1699        fn from_wire(wire: crate::wire::LeaseControlWatchStatusRequest) -> Self {
1700            Self { last_status: ::fidl_next::FromWire::from_wire(wire.last_status) }
1701        }
1702    }
1703
1704    impl ::fidl_next::FromWireRef<crate::wire::LeaseControlWatchStatusRequest>
1705        for LeaseControlWatchStatusRequest
1706    {
1707        #[inline]
1708        fn from_wire_ref(wire: &crate::wire::LeaseControlWatchStatusRequest) -> Self {
1709            Self { last_status: ::fidl_next::FromWireRef::from_wire_ref(&wire.last_status) }
1710        }
1711    }
1712
1713    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1714    #[repr(C)]
1715    pub struct LeaseControlWatchStatusResponse {
1716        pub status: crate::natural::LeaseStatus,
1717    }
1718
1719    unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>
1720        for LeaseControlWatchStatusResponse
1721    where
1722        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1723    {
1724        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1725            Self,
1726            crate::wire::LeaseControlWatchStatusResponse,
1727        > = unsafe {
1728            ::fidl_next::CopyOptimization::enable_if(
1729                true && <crate::natural::LeaseStatus as ::fidl_next::Encode<
1730                    crate::wire::LeaseStatus,
1731                    ___E,
1732                >>::COPY_OPTIMIZATION
1733                    .is_enabled(),
1734            )
1735        };
1736
1737        #[inline]
1738        fn encode(
1739            self,
1740            encoder_: &mut ___E,
1741            out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusResponse>,
1742            _: (),
1743        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1744            ::fidl_next::munge! {
1745                let crate::wire::LeaseControlWatchStatusResponse {
1746                    status,
1747
1748                } = out_;
1749            }
1750
1751            ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
1752
1753            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1754
1755            Ok(())
1756        }
1757    }
1758
1759    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>
1760        for &'a LeaseControlWatchStatusResponse
1761    where
1762        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1763    {
1764        #[inline]
1765        fn encode(
1766            self,
1767            encoder_: &mut ___E,
1768            out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusResponse>,
1769            _: (),
1770        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1771            ::fidl_next::munge! {
1772                let crate::wire::LeaseControlWatchStatusResponse {
1773
1774                    status,
1775
1776                } = out_;
1777            }
1778
1779            ::fidl_next::Encode::encode(&self.status, encoder_, status, ())?;
1780
1781            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1782
1783            Ok(())
1784        }
1785    }
1786
1787    unsafe impl<___E>
1788        ::fidl_next::EncodeOption<
1789            ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1790            ___E,
1791        > for LeaseControlWatchStatusResponse
1792    where
1793        ___E: ::fidl_next::Encoder + ?Sized,
1794        LeaseControlWatchStatusResponse:
1795            ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>,
1796    {
1797        #[inline]
1798        fn encode_option(
1799            this: ::core::option::Option<Self>,
1800            encoder: &mut ___E,
1801            out: &mut ::core::mem::MaybeUninit<
1802                ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1803            >,
1804            _: (),
1805        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1806            if let Some(inner) = this {
1807                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1808                ::fidl_next::wire::Box::encode_present(out);
1809            } else {
1810                ::fidl_next::wire::Box::encode_absent(out);
1811            }
1812
1813            Ok(())
1814        }
1815    }
1816
1817    unsafe impl<'a, ___E>
1818        ::fidl_next::EncodeOption<
1819            ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1820            ___E,
1821        > for &'a LeaseControlWatchStatusResponse
1822    where
1823        ___E: ::fidl_next::Encoder + ?Sized,
1824        &'a LeaseControlWatchStatusResponse:
1825            ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>,
1826    {
1827        #[inline]
1828        fn encode_option(
1829            this: ::core::option::Option<Self>,
1830            encoder: &mut ___E,
1831            out: &mut ::core::mem::MaybeUninit<
1832                ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1833            >,
1834            _: (),
1835        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1836            if let Some(inner) = this {
1837                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1838                ::fidl_next::wire::Box::encode_present(out);
1839            } else {
1840                ::fidl_next::wire::Box::encode_absent(out);
1841            }
1842
1843            Ok(())
1844        }
1845    }
1846
1847    impl ::fidl_next::FromWire<crate::wire::LeaseControlWatchStatusResponse>
1848        for LeaseControlWatchStatusResponse
1849    {
1850        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1851            crate::wire::LeaseControlWatchStatusResponse,
1852            Self,
1853        > = unsafe {
1854            ::fidl_next::CopyOptimization::enable_if(
1855                true && <crate::natural::LeaseStatus as ::fidl_next::FromWire<
1856                    crate::wire::LeaseStatus,
1857                >>::COPY_OPTIMIZATION
1858                    .is_enabled(),
1859            )
1860        };
1861
1862        #[inline]
1863        fn from_wire(wire: crate::wire::LeaseControlWatchStatusResponse) -> Self {
1864            Self { status: ::fidl_next::FromWire::from_wire(wire.status) }
1865        }
1866    }
1867
1868    impl ::fidl_next::FromWireRef<crate::wire::LeaseControlWatchStatusResponse>
1869        for LeaseControlWatchStatusResponse
1870    {
1871        #[inline]
1872        fn from_wire_ref(wire: &crate::wire::LeaseControlWatchStatusResponse) -> Self {
1873            Self { status: ::fidl_next::FromWireRef::from_wire_ref(&wire.status) }
1874        }
1875    }
1876
1877    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1878    #[repr(u32)]
1879    pub enum LeaseError {
1880        Internal = 1,
1881        NotAuthorized = 2,
1882        InvalidLevel = 3,
1883        InvalidArgument = 4,
1884        UnknownOrdinal_(u32) = 5,
1885    }
1886    impl ::std::convert::From<u32> for LeaseError {
1887        fn from(value: u32) -> Self {
1888            match value {
1889                1 => Self::Internal,
1890                2 => Self::NotAuthorized,
1891                3 => Self::InvalidLevel,
1892                4 => Self::InvalidArgument,
1893
1894                _ => Self::UnknownOrdinal_(value),
1895            }
1896        }
1897    }
1898
1899    unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseError, ___E> for LeaseError
1900    where
1901        ___E: ?Sized,
1902    {
1903        #[inline]
1904        fn encode(
1905            self,
1906            encoder: &mut ___E,
1907            out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseError>,
1908            _: (),
1909        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1910            ::fidl_next::Encode::encode(&self, encoder, out, ())
1911        }
1912    }
1913
1914    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseError, ___E> for &'a LeaseError
1915    where
1916        ___E: ?Sized,
1917    {
1918        #[inline]
1919        fn encode(
1920            self,
1921            encoder: &mut ___E,
1922            out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseError>,
1923            _: (),
1924        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1925            ::fidl_next::munge!(let crate::wire::LeaseError { value } = out);
1926            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1927                LeaseError::Internal => 1,
1928
1929                LeaseError::NotAuthorized => 2,
1930
1931                LeaseError::InvalidLevel => 3,
1932
1933                LeaseError::InvalidArgument => 4,
1934
1935                LeaseError::UnknownOrdinal_(value) => value,
1936            }));
1937
1938            Ok(())
1939        }
1940    }
1941
1942    impl ::core::convert::From<crate::wire::LeaseError> for LeaseError {
1943        fn from(wire: crate::wire::LeaseError) -> Self {
1944            match u32::from(wire.value) {
1945                1 => Self::Internal,
1946
1947                2 => Self::NotAuthorized,
1948
1949                3 => Self::InvalidLevel,
1950
1951                4 => Self::InvalidArgument,
1952
1953                value => Self::UnknownOrdinal_(value),
1954            }
1955        }
1956    }
1957
1958    impl ::fidl_next::FromWire<crate::wire::LeaseError> for LeaseError {
1959        #[inline]
1960        fn from_wire(wire: crate::wire::LeaseError) -> Self {
1961            Self::from(wire)
1962        }
1963    }
1964
1965    impl ::fidl_next::FromWireRef<crate::wire::LeaseError> for LeaseError {
1966        #[inline]
1967        fn from_wire_ref(wire: &crate::wire::LeaseError) -> Self {
1968            Self::from(*wire)
1969        }
1970    }
1971
1972    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1973    #[repr(u32)]
1974    pub enum ModifyDependencyError {
1975        AlreadyExists = 1,
1976        Invalid = 2,
1977        NotAuthorized = 3,
1978        NotFound = 4,
1979        UnknownOrdinal_(u32) = 5,
1980    }
1981    impl ::std::convert::From<u32> for ModifyDependencyError {
1982        fn from(value: u32) -> Self {
1983            match value {
1984                1 => Self::AlreadyExists,
1985                2 => Self::Invalid,
1986                3 => Self::NotAuthorized,
1987                4 => Self::NotFound,
1988
1989                _ => Self::UnknownOrdinal_(value),
1990            }
1991        }
1992    }
1993
1994    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ModifyDependencyError, ___E>
1995        for ModifyDependencyError
1996    where
1997        ___E: ?Sized,
1998    {
1999        #[inline]
2000        fn encode(
2001            self,
2002            encoder: &mut ___E,
2003            out: &mut ::core::mem::MaybeUninit<crate::wire::ModifyDependencyError>,
2004            _: (),
2005        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2006            ::fidl_next::Encode::encode(&self, encoder, out, ())
2007        }
2008    }
2009
2010    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ModifyDependencyError, ___E>
2011        for &'a ModifyDependencyError
2012    where
2013        ___E: ?Sized,
2014    {
2015        #[inline]
2016        fn encode(
2017            self,
2018            encoder: &mut ___E,
2019            out: &mut ::core::mem::MaybeUninit<crate::wire::ModifyDependencyError>,
2020            _: (),
2021        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2022            ::fidl_next::munge!(let crate::wire::ModifyDependencyError { value } = out);
2023            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2024                ModifyDependencyError::AlreadyExists => 1,
2025
2026                ModifyDependencyError::Invalid => 2,
2027
2028                ModifyDependencyError::NotAuthorized => 3,
2029
2030                ModifyDependencyError::NotFound => 4,
2031
2032                ModifyDependencyError::UnknownOrdinal_(value) => value,
2033            }));
2034
2035            Ok(())
2036        }
2037    }
2038
2039    impl ::core::convert::From<crate::wire::ModifyDependencyError> for ModifyDependencyError {
2040        fn from(wire: crate::wire::ModifyDependencyError) -> Self {
2041            match u32::from(wire.value) {
2042                1 => Self::AlreadyExists,
2043
2044                2 => Self::Invalid,
2045
2046                3 => Self::NotAuthorized,
2047
2048                4 => Self::NotFound,
2049
2050                value => Self::UnknownOrdinal_(value),
2051            }
2052        }
2053    }
2054
2055    impl ::fidl_next::FromWire<crate::wire::ModifyDependencyError> for ModifyDependencyError {
2056        #[inline]
2057        fn from_wire(wire: crate::wire::ModifyDependencyError) -> Self {
2058            Self::from(wire)
2059        }
2060    }
2061
2062    impl ::fidl_next::FromWireRef<crate::wire::ModifyDependencyError> for ModifyDependencyError {
2063        #[inline]
2064        fn from_wire_ref(wire: &crate::wire::ModifyDependencyError) -> Self {
2065            Self::from(*wire)
2066        }
2067    }
2068
2069    ::fidl_next::bitflags::bitflags! {
2070        #[doc = " Element Permissions\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct Permissions: u32 {
2071            const MODIFY_DEPENDENT = 1;
2072            const MODIFY_DEPENDENCY = 4;
2073
2074        }
2075    }
2076
2077    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Permissions, ___E> for Permissions
2078    where
2079        ___E: ?Sized,
2080    {
2081        #[inline]
2082        fn encode(
2083            self,
2084            encoder: &mut ___E,
2085            out: &mut ::core::mem::MaybeUninit<crate::wire::Permissions>,
2086            _: (),
2087        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2088            ::fidl_next::Encode::encode(&self, encoder, out, ())
2089        }
2090    }
2091
2092    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Permissions, ___E> for &'a Permissions
2093    where
2094        ___E: ?Sized,
2095    {
2096        #[inline]
2097        fn encode(
2098            self,
2099            _: &mut ___E,
2100            out: &mut ::core::mem::MaybeUninit<crate::wire::Permissions>,
2101            _: (),
2102        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2103            ::fidl_next::munge!(let crate::wire::Permissions { value } = out);
2104
2105            if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
2106                return Err(::fidl_next::EncodeError::InvalidStrictBits);
2107            }
2108
2109            let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
2110            Ok(())
2111        }
2112    }
2113
2114    impl ::core::convert::From<crate::wire::Permissions> for Permissions {
2115        fn from(wire: crate::wire::Permissions) -> Self {
2116            Self::from_bits_retain(u32::from(wire.value))
2117        }
2118    }
2119
2120    impl ::fidl_next::FromWire<crate::wire::Permissions> for Permissions {
2121        #[inline]
2122        fn from_wire(wire: crate::wire::Permissions) -> Self {
2123            Self::from(wire)
2124        }
2125    }
2126
2127    impl ::fidl_next::FromWireRef<crate::wire::Permissions> for Permissions {
2128        #[inline]
2129        fn from_wire_ref(wire: &crate::wire::Permissions) -> Self {
2130            Self::from(*wire)
2131        }
2132    }
2133
2134    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2135    #[repr(u32)]
2136    pub enum StatusError {
2137        Unknown = 1,
2138        UnknownOrdinal_(u32) = 2,
2139    }
2140    impl ::std::convert::From<u32> for StatusError {
2141        fn from(value: u32) -> Self {
2142            match value {
2143                1 => Self::Unknown,
2144
2145                _ => Self::UnknownOrdinal_(value),
2146            }
2147        }
2148    }
2149
2150    unsafe impl<___E> ::fidl_next::Encode<crate::wire::StatusError, ___E> for StatusError
2151    where
2152        ___E: ?Sized,
2153    {
2154        #[inline]
2155        fn encode(
2156            self,
2157            encoder: &mut ___E,
2158            out: &mut ::core::mem::MaybeUninit<crate::wire::StatusError>,
2159            _: (),
2160        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2161            ::fidl_next::Encode::encode(&self, encoder, out, ())
2162        }
2163    }
2164
2165    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StatusError, ___E> for &'a StatusError
2166    where
2167        ___E: ?Sized,
2168    {
2169        #[inline]
2170        fn encode(
2171            self,
2172            encoder: &mut ___E,
2173            out: &mut ::core::mem::MaybeUninit<crate::wire::StatusError>,
2174            _: (),
2175        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2176            ::fidl_next::munge!(let crate::wire::StatusError { value } = out);
2177            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2178                StatusError::Unknown => 1,
2179
2180                StatusError::UnknownOrdinal_(value) => value,
2181            }));
2182
2183            Ok(())
2184        }
2185    }
2186
2187    impl ::core::convert::From<crate::wire::StatusError> for StatusError {
2188        fn from(wire: crate::wire::StatusError) -> Self {
2189            match u32::from(wire.value) {
2190                1 => Self::Unknown,
2191
2192                value => Self::UnknownOrdinal_(value),
2193            }
2194        }
2195    }
2196
2197    impl ::fidl_next::FromWire<crate::wire::StatusError> for StatusError {
2198        #[inline]
2199        fn from_wire(wire: crate::wire::StatusError) -> Self {
2200            Self::from(wire)
2201        }
2202    }
2203
2204    impl ::fidl_next::FromWireRef<crate::wire::StatusError> for StatusError {
2205        #[inline]
2206        fn from_wire_ref(wire: &crate::wire::StatusError) -> Self {
2207            Self::from(*wire)
2208        }
2209    }
2210
2211    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2212    #[repr(C)]
2213    pub struct TopologyAddElementResponse {}
2214
2215    unsafe impl<___E> ::fidl_next::Encode<crate::wire::TopologyAddElementResponse, ___E>
2216        for TopologyAddElementResponse
2217    where
2218        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2219    {
2220        #[inline]
2221        fn encode(
2222            self,
2223            encoder_: &mut ___E,
2224            out_: &mut ::core::mem::MaybeUninit<crate::wire::TopologyAddElementResponse>,
2225            _: (),
2226        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2227            ::fidl_next::munge! {
2228                let crate::wire::TopologyAddElementResponse {
2229
2230                        _empty,
2231
2232                } = out_;
2233            }
2234
2235            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
2236
2237            Ok(())
2238        }
2239    }
2240
2241    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TopologyAddElementResponse, ___E>
2242        for &'a TopologyAddElementResponse
2243    where
2244        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2245    {
2246        #[inline]
2247        fn encode(
2248            self,
2249            encoder_: &mut ___E,
2250            out_: &mut ::core::mem::MaybeUninit<crate::wire::TopologyAddElementResponse>,
2251            _: (),
2252        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2253            ::fidl_next::munge! {
2254                let crate::wire::TopologyAddElementResponse {
2255
2256                        _empty,
2257
2258
2259                } = out_;
2260            }
2261
2262            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
2263
2264            Ok(())
2265        }
2266    }
2267
2268    unsafe impl<___E>
2269        ::fidl_next::EncodeOption<
2270            ::fidl_next::wire::Box<'static, crate::wire::TopologyAddElementResponse>,
2271            ___E,
2272        > for TopologyAddElementResponse
2273    where
2274        ___E: ::fidl_next::Encoder + ?Sized,
2275        TopologyAddElementResponse:
2276            ::fidl_next::Encode<crate::wire::TopologyAddElementResponse, ___E>,
2277    {
2278        #[inline]
2279        fn encode_option(
2280            this: ::core::option::Option<Self>,
2281            encoder: &mut ___E,
2282            out: &mut ::core::mem::MaybeUninit<
2283                ::fidl_next::wire::Box<'static, crate::wire::TopologyAddElementResponse>,
2284            >,
2285            _: (),
2286        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2287            if let Some(inner) = this {
2288                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2289                ::fidl_next::wire::Box::encode_present(out);
2290            } else {
2291                ::fidl_next::wire::Box::encode_absent(out);
2292            }
2293
2294            Ok(())
2295        }
2296    }
2297
2298    unsafe impl<'a, ___E>
2299        ::fidl_next::EncodeOption<
2300            ::fidl_next::wire::Box<'static, crate::wire::TopologyAddElementResponse>,
2301            ___E,
2302        > for &'a TopologyAddElementResponse
2303    where
2304        ___E: ::fidl_next::Encoder + ?Sized,
2305        &'a TopologyAddElementResponse:
2306            ::fidl_next::Encode<crate::wire::TopologyAddElementResponse, ___E>,
2307    {
2308        #[inline]
2309        fn encode_option(
2310            this: ::core::option::Option<Self>,
2311            encoder: &mut ___E,
2312            out: &mut ::core::mem::MaybeUninit<
2313                ::fidl_next::wire::Box<'static, crate::wire::TopologyAddElementResponse>,
2314            >,
2315            _: (),
2316        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2317            if let Some(inner) = this {
2318                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2319                ::fidl_next::wire::Box::encode_present(out);
2320            } else {
2321                ::fidl_next::wire::Box::encode_absent(out);
2322            }
2323
2324            Ok(())
2325        }
2326    }
2327
2328    impl ::fidl_next::FromWire<crate::wire::TopologyAddElementResponse> for TopologyAddElementResponse {
2329        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2330            crate::wire::TopologyAddElementResponse,
2331            Self,
2332        > = unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
2333
2334        #[inline]
2335        fn from_wire(wire: crate::wire::TopologyAddElementResponse) -> Self {
2336            Self {}
2337        }
2338    }
2339
2340    impl ::fidl_next::FromWireRef<crate::wire::TopologyAddElementResponse>
2341        for TopologyAddElementResponse
2342    {
2343        #[inline]
2344        fn from_wire_ref(wire: &crate::wire::TopologyAddElementResponse) -> Self {
2345            Self {}
2346        }
2347    }
2348
2349    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2350    #[repr(C)]
2351    pub struct TopologyLeaseResponse {}
2352
2353    unsafe impl<___E> ::fidl_next::Encode<crate::wire::TopologyLeaseResponse, ___E>
2354        for TopologyLeaseResponse
2355    where
2356        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2357    {
2358        #[inline]
2359        fn encode(
2360            self,
2361            encoder_: &mut ___E,
2362            out_: &mut ::core::mem::MaybeUninit<crate::wire::TopologyLeaseResponse>,
2363            _: (),
2364        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2365            ::fidl_next::munge! {
2366                let crate::wire::TopologyLeaseResponse {
2367
2368                        _empty,
2369
2370                } = out_;
2371            }
2372
2373            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
2374
2375            Ok(())
2376        }
2377    }
2378
2379    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TopologyLeaseResponse, ___E>
2380        for &'a TopologyLeaseResponse
2381    where
2382        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2383    {
2384        #[inline]
2385        fn encode(
2386            self,
2387            encoder_: &mut ___E,
2388            out_: &mut ::core::mem::MaybeUninit<crate::wire::TopologyLeaseResponse>,
2389            _: (),
2390        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2391            ::fidl_next::munge! {
2392                let crate::wire::TopologyLeaseResponse {
2393
2394                        _empty,
2395
2396
2397                } = out_;
2398            }
2399
2400            let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
2401
2402            Ok(())
2403        }
2404    }
2405
2406    unsafe impl<___E>
2407        ::fidl_next::EncodeOption<
2408            ::fidl_next::wire::Box<'static, crate::wire::TopologyLeaseResponse>,
2409            ___E,
2410        > for TopologyLeaseResponse
2411    where
2412        ___E: ::fidl_next::Encoder + ?Sized,
2413        TopologyLeaseResponse: ::fidl_next::Encode<crate::wire::TopologyLeaseResponse, ___E>,
2414    {
2415        #[inline]
2416        fn encode_option(
2417            this: ::core::option::Option<Self>,
2418            encoder: &mut ___E,
2419            out: &mut ::core::mem::MaybeUninit<
2420                ::fidl_next::wire::Box<'static, crate::wire::TopologyLeaseResponse>,
2421            >,
2422            _: (),
2423        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2424            if let Some(inner) = this {
2425                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2426                ::fidl_next::wire::Box::encode_present(out);
2427            } else {
2428                ::fidl_next::wire::Box::encode_absent(out);
2429            }
2430
2431            Ok(())
2432        }
2433    }
2434
2435    unsafe impl<'a, ___E>
2436        ::fidl_next::EncodeOption<
2437            ::fidl_next::wire::Box<'static, crate::wire::TopologyLeaseResponse>,
2438            ___E,
2439        > for &'a TopologyLeaseResponse
2440    where
2441        ___E: ::fidl_next::Encoder + ?Sized,
2442        &'a TopologyLeaseResponse: ::fidl_next::Encode<crate::wire::TopologyLeaseResponse, ___E>,
2443    {
2444        #[inline]
2445        fn encode_option(
2446            this: ::core::option::Option<Self>,
2447            encoder: &mut ___E,
2448            out: &mut ::core::mem::MaybeUninit<
2449                ::fidl_next::wire::Box<'static, crate::wire::TopologyLeaseResponse>,
2450            >,
2451            _: (),
2452        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2453            if let Some(inner) = this {
2454                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2455                ::fidl_next::wire::Box::encode_present(out);
2456            } else {
2457                ::fidl_next::wire::Box::encode_absent(out);
2458            }
2459
2460            Ok(())
2461        }
2462    }
2463
2464    impl ::fidl_next::FromWire<crate::wire::TopologyLeaseResponse> for TopologyLeaseResponse {
2465        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2466            crate::wire::TopologyLeaseResponse,
2467            Self,
2468        > = unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
2469
2470        #[inline]
2471        fn from_wire(wire: crate::wire::TopologyLeaseResponse) -> Self {
2472            Self {}
2473        }
2474    }
2475
2476    impl ::fidl_next::FromWireRef<crate::wire::TopologyLeaseResponse> for TopologyLeaseResponse {
2477        #[inline]
2478        fn from_wire_ref(wire: &crate::wire::TopologyLeaseResponse) -> Self {
2479            Self {}
2480        }
2481    }
2482}
2483
2484pub mod wire {
2485
2486    /// The wire type corresponding to [`AddElementError`].
2487    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2488    #[repr(transparent)]
2489    pub struct AddElementError {
2490        pub(crate) value: ::fidl_next::wire::Uint32,
2491    }
2492
2493    impl ::fidl_next::Constrained for AddElementError {
2494        type Constraint = ();
2495
2496        fn validate(
2497            _: ::fidl_next::Slot<'_, Self>,
2498            _: Self::Constraint,
2499        ) -> Result<(), ::fidl_next::ValidationError> {
2500            Ok(())
2501        }
2502    }
2503
2504    unsafe impl ::fidl_next::Wire for AddElementError {
2505        type Narrowed<'de> = Self;
2506
2507        #[inline]
2508        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2509            // Wire enums have no padding
2510        }
2511    }
2512
2513    impl AddElementError {
2514        pub const INVALID: AddElementError =
2515            AddElementError { value: ::fidl_next::wire::Uint32(1) };
2516
2517        pub const NOT_AUTHORIZED: AddElementError =
2518            AddElementError { value: ::fidl_next::wire::Uint32(2) };
2519    }
2520
2521    unsafe impl<___D> ::fidl_next::Decode<___D> for AddElementError
2522    where
2523        ___D: ?Sized,
2524    {
2525        fn decode(
2526            slot: ::fidl_next::Slot<'_, Self>,
2527            _: &mut ___D,
2528            _: (),
2529        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2530            Ok(())
2531        }
2532    }
2533
2534    impl ::core::convert::From<crate::natural::AddElementError> for AddElementError {
2535        fn from(natural: crate::natural::AddElementError) -> Self {
2536            match natural {
2537                crate::natural::AddElementError::Invalid => AddElementError::INVALID,
2538
2539                crate::natural::AddElementError::NotAuthorized => AddElementError::NOT_AUTHORIZED,
2540
2541                crate::natural::AddElementError::UnknownOrdinal_(value) => {
2542                    AddElementError { value: ::fidl_next::wire::Uint32::from(value) }
2543                }
2544            }
2545        }
2546    }
2547
2548    impl ::fidl_next::IntoNatural for AddElementError {
2549        type Natural = crate::natural::AddElementError;
2550    }
2551
2552    /// The wire type corresponding to [`PowerLevel`](crate::natural::PowerLevel).
2553    pub type PowerLevel = u8;
2554
2555    /// The wire type corresponding to [`BinaryPowerLevel`].
2556    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2557    #[repr(transparent)]
2558    pub struct BinaryPowerLevel {
2559        pub(crate) value: u8,
2560    }
2561
2562    impl ::fidl_next::Constrained for BinaryPowerLevel {
2563        type Constraint = ();
2564
2565        fn validate(
2566            _: ::fidl_next::Slot<'_, Self>,
2567            _: Self::Constraint,
2568        ) -> Result<(), ::fidl_next::ValidationError> {
2569            Ok(())
2570        }
2571    }
2572
2573    unsafe impl ::fidl_next::Wire for BinaryPowerLevel {
2574        type Narrowed<'de> = Self;
2575
2576        #[inline]
2577        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2578            // Wire enums have no padding
2579        }
2580    }
2581
2582    impl BinaryPowerLevel {
2583        pub const OFF: BinaryPowerLevel = BinaryPowerLevel { value: 0 };
2584
2585        pub const ON: BinaryPowerLevel = BinaryPowerLevel { value: 1 };
2586    }
2587
2588    unsafe impl<___D> ::fidl_next::Decode<___D> for BinaryPowerLevel
2589    where
2590        ___D: ?Sized,
2591    {
2592        fn decode(
2593            slot: ::fidl_next::Slot<'_, Self>,
2594            _: &mut ___D,
2595            _: (),
2596        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2597            ::fidl_next::munge!(let Self { value } = slot);
2598
2599            match u8::from(*value) {
2600                0 | 1 => (),
2601                unknown => {
2602                    return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
2603                }
2604            }
2605
2606            Ok(())
2607        }
2608    }
2609
2610    impl ::core::convert::From<crate::natural::BinaryPowerLevel> for BinaryPowerLevel {
2611        fn from(natural: crate::natural::BinaryPowerLevel) -> Self {
2612            match natural {
2613                crate::natural::BinaryPowerLevel::Off => BinaryPowerLevel::OFF,
2614
2615                crate::natural::BinaryPowerLevel::On => BinaryPowerLevel::ON,
2616            }
2617        }
2618    }
2619
2620    impl ::fidl_next::IntoNatural for BinaryPowerLevel {
2621        type Natural = crate::natural::BinaryPowerLevel;
2622    }
2623
2624    /// The wire type corresponding to [`ElementControlRegisterDependencyTokenResponse`].
2625    #[derive(Clone, Debug)]
2626    #[repr(C)]
2627    pub struct ElementControlRegisterDependencyTokenResponse {
2628        pub(crate) _empty: fidl_next::wire::EmptyStruct,
2629    }
2630
2631    static_assertions::const_assert_eq!(
2632        std::mem::size_of::<ElementControlRegisterDependencyTokenResponse>(),
2633        1
2634    );
2635    static_assertions::const_assert_eq!(
2636        std::mem::align_of::<ElementControlRegisterDependencyTokenResponse>(),
2637        1
2638    );
2639
2640    impl ::fidl_next::Constrained for ElementControlRegisterDependencyTokenResponse {
2641        type Constraint = ();
2642
2643        fn validate(
2644            _: ::fidl_next::Slot<'_, Self>,
2645            _: Self::Constraint,
2646        ) -> Result<(), ::fidl_next::ValidationError> {
2647            Ok(())
2648        }
2649    }
2650
2651    unsafe impl ::fidl_next::Wire for ElementControlRegisterDependencyTokenResponse {
2652        type Narrowed<'de> = ElementControlRegisterDependencyTokenResponse;
2653
2654        #[inline]
2655        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2656            ::fidl_next::munge! {
2657                let Self {
2658
2659                        _empty,
2660
2661
2662                } = &mut *out_;
2663            }
2664        }
2665    }
2666
2667    unsafe impl<___D> ::fidl_next::Decode<___D> for ElementControlRegisterDependencyTokenResponse
2668    where
2669        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2670    {
2671        fn decode(
2672            slot_: ::fidl_next::Slot<'_, Self>,
2673            decoder_: &mut ___D,
2674            _: (),
2675        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2676            ::fidl_next::munge! {
2677                let Self {
2678
2679                        mut _empty,
2680
2681
2682                } = slot_;
2683            }
2684
2685            if _empty.as_bytes() != &[0u8] {
2686                return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
2687            }
2688
2689            Ok(())
2690        }
2691    }
2692
2693    impl ::fidl_next::IntoNatural for ElementControlRegisterDependencyTokenResponse {
2694        type Natural = crate::natural::ElementControlRegisterDependencyTokenResponse;
2695    }
2696
2697    /// The wire type corresponding to [`RegisterDependencyTokenError`].
2698    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2699    #[repr(transparent)]
2700    pub struct RegisterDependencyTokenError {
2701        pub(crate) value: ::fidl_next::wire::Uint32,
2702    }
2703
2704    impl ::fidl_next::Constrained for RegisterDependencyTokenError {
2705        type Constraint = ();
2706
2707        fn validate(
2708            _: ::fidl_next::Slot<'_, Self>,
2709            _: Self::Constraint,
2710        ) -> Result<(), ::fidl_next::ValidationError> {
2711            Ok(())
2712        }
2713    }
2714
2715    unsafe impl ::fidl_next::Wire for RegisterDependencyTokenError {
2716        type Narrowed<'de> = Self;
2717
2718        #[inline]
2719        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2720            // Wire enums have no padding
2721        }
2722    }
2723
2724    impl RegisterDependencyTokenError {
2725        pub const ALREADY_IN_USE: RegisterDependencyTokenError =
2726            RegisterDependencyTokenError { value: ::fidl_next::wire::Uint32(1) };
2727
2728        pub const INTERNAL: RegisterDependencyTokenError =
2729            RegisterDependencyTokenError { value: ::fidl_next::wire::Uint32(2) };
2730    }
2731
2732    unsafe impl<___D> ::fidl_next::Decode<___D> for RegisterDependencyTokenError
2733    where
2734        ___D: ?Sized,
2735    {
2736        fn decode(
2737            slot: ::fidl_next::Slot<'_, Self>,
2738            _: &mut ___D,
2739            _: (),
2740        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2741            Ok(())
2742        }
2743    }
2744
2745    impl ::core::convert::From<crate::natural::RegisterDependencyTokenError>
2746        for RegisterDependencyTokenError
2747    {
2748        fn from(natural: crate::natural::RegisterDependencyTokenError) -> Self {
2749            match natural {
2750                crate::natural::RegisterDependencyTokenError::AlreadyInUse => {
2751                    RegisterDependencyTokenError::ALREADY_IN_USE
2752                }
2753
2754                crate::natural::RegisterDependencyTokenError::Internal => {
2755                    RegisterDependencyTokenError::INTERNAL
2756                }
2757
2758                crate::natural::RegisterDependencyTokenError::UnknownOrdinal_(value) => {
2759                    RegisterDependencyTokenError { value: ::fidl_next::wire::Uint32::from(value) }
2760                }
2761            }
2762        }
2763    }
2764
2765    impl ::fidl_next::IntoNatural for RegisterDependencyTokenError {
2766        type Natural = crate::natural::RegisterDependencyTokenError;
2767    }
2768
2769    /// The wire type corresponding to [`ElementControlUnregisterDependencyTokenResponse`].
2770    #[derive(Clone, Debug)]
2771    #[repr(C)]
2772    pub struct ElementControlUnregisterDependencyTokenResponse {
2773        pub(crate) _empty: fidl_next::wire::EmptyStruct,
2774    }
2775
2776    static_assertions::const_assert_eq!(
2777        std::mem::size_of::<ElementControlUnregisterDependencyTokenResponse>(),
2778        1
2779    );
2780    static_assertions::const_assert_eq!(
2781        std::mem::align_of::<ElementControlUnregisterDependencyTokenResponse>(),
2782        1
2783    );
2784
2785    impl ::fidl_next::Constrained for ElementControlUnregisterDependencyTokenResponse {
2786        type Constraint = ();
2787
2788        fn validate(
2789            _: ::fidl_next::Slot<'_, Self>,
2790            _: Self::Constraint,
2791        ) -> Result<(), ::fidl_next::ValidationError> {
2792            Ok(())
2793        }
2794    }
2795
2796    unsafe impl ::fidl_next::Wire for ElementControlUnregisterDependencyTokenResponse {
2797        type Narrowed<'de> = ElementControlUnregisterDependencyTokenResponse;
2798
2799        #[inline]
2800        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2801            ::fidl_next::munge! {
2802                let Self {
2803
2804                        _empty,
2805
2806
2807                } = &mut *out_;
2808            }
2809        }
2810    }
2811
2812    unsafe impl<___D> ::fidl_next::Decode<___D> for ElementControlUnregisterDependencyTokenResponse
2813    where
2814        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2815    {
2816        fn decode(
2817            slot_: ::fidl_next::Slot<'_, Self>,
2818            decoder_: &mut ___D,
2819            _: (),
2820        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2821            ::fidl_next::munge! {
2822                let Self {
2823
2824                        mut _empty,
2825
2826
2827                } = slot_;
2828            }
2829
2830            if _empty.as_bytes() != &[0u8] {
2831                return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
2832            }
2833
2834            Ok(())
2835        }
2836    }
2837
2838    impl ::fidl_next::IntoNatural for ElementControlUnregisterDependencyTokenResponse {
2839        type Natural = crate::natural::ElementControlUnregisterDependencyTokenResponse;
2840    }
2841
2842    /// The wire type corresponding to [`UnregisterDependencyTokenError`].
2843    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2844    #[repr(transparent)]
2845    pub struct UnregisterDependencyTokenError {
2846        pub(crate) value: ::fidl_next::wire::Uint32,
2847    }
2848
2849    impl ::fidl_next::Constrained for UnregisterDependencyTokenError {
2850        type Constraint = ();
2851
2852        fn validate(
2853            _: ::fidl_next::Slot<'_, Self>,
2854            _: Self::Constraint,
2855        ) -> Result<(), ::fidl_next::ValidationError> {
2856            Ok(())
2857        }
2858    }
2859
2860    unsafe impl ::fidl_next::Wire for UnregisterDependencyTokenError {
2861        type Narrowed<'de> = Self;
2862
2863        #[inline]
2864        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2865            // Wire enums have no padding
2866        }
2867    }
2868
2869    impl UnregisterDependencyTokenError {
2870        pub const NOT_AUTHORIZED: UnregisterDependencyTokenError =
2871            UnregisterDependencyTokenError { value: ::fidl_next::wire::Uint32(1) };
2872
2873        pub const NOT_FOUND: UnregisterDependencyTokenError =
2874            UnregisterDependencyTokenError { value: ::fidl_next::wire::Uint32(2) };
2875    }
2876
2877    unsafe impl<___D> ::fidl_next::Decode<___D> for UnregisterDependencyTokenError
2878    where
2879        ___D: ?Sized,
2880    {
2881        fn decode(
2882            slot: ::fidl_next::Slot<'_, Self>,
2883            _: &mut ___D,
2884            _: (),
2885        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2886            Ok(())
2887        }
2888    }
2889
2890    impl ::core::convert::From<crate::natural::UnregisterDependencyTokenError>
2891        for UnregisterDependencyTokenError
2892    {
2893        fn from(natural: crate::natural::UnregisterDependencyTokenError) -> Self {
2894            match natural {
2895                crate::natural::UnregisterDependencyTokenError::NotAuthorized => {
2896                    UnregisterDependencyTokenError::NOT_AUTHORIZED
2897                }
2898
2899                crate::natural::UnregisterDependencyTokenError::NotFound => {
2900                    UnregisterDependencyTokenError::NOT_FOUND
2901                }
2902
2903                crate::natural::UnregisterDependencyTokenError::UnknownOrdinal_(value) => {
2904                    UnregisterDependencyTokenError { value: ::fidl_next::wire::Uint32::from(value) }
2905                }
2906            }
2907        }
2908    }
2909
2910    impl ::fidl_next::IntoNatural for UnregisterDependencyTokenError {
2911        type Natural = crate::natural::UnregisterDependencyTokenError;
2912    }
2913
2914    /// The wire type corresponding to [`PowerLevelName`].
2915    #[repr(C)]
2916    pub struct PowerLevelName<'de> {
2917        pub(crate) table: ::fidl_next::wire::Table<'de>,
2918    }
2919
2920    impl<'de> Drop for PowerLevelName<'de> {
2921        fn drop(&mut self) {
2922            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2923
2924            let _ = self.table.get(2).map(|envelope| unsafe {
2925                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2926            });
2927        }
2928    }
2929
2930    impl ::fidl_next::Constrained for PowerLevelName<'_> {
2931        type Constraint = ();
2932
2933        fn validate(
2934            _: ::fidl_next::Slot<'_, Self>,
2935            _: Self::Constraint,
2936        ) -> Result<(), ::fidl_next::ValidationError> {
2937            Ok(())
2938        }
2939    }
2940
2941    unsafe impl ::fidl_next::Wire for PowerLevelName<'static> {
2942        type Narrowed<'de> = PowerLevelName<'de>;
2943
2944        #[inline]
2945        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2946            ::fidl_next::munge!(let Self { table } = out);
2947            ::fidl_next::wire::Table::zero_padding(table);
2948        }
2949    }
2950
2951    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerLevelName<'de>
2952    where
2953        ___D: ::fidl_next::Decoder<'de> + ?Sized,
2954    {
2955        fn decode(
2956            slot: ::fidl_next::Slot<'_, Self>,
2957            decoder: &mut ___D,
2958            _: (),
2959        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2960            ::fidl_next::munge!(let Self { table } = slot);
2961
2962            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2963                match ordinal {
2964                    0 => unsafe { ::core::hint::unreachable_unchecked() },
2965
2966                    1 => {
2967                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2968                            slot.as_mut(),
2969                            decoder,
2970                            (),
2971                        )?;
2972
2973                        Ok(())
2974                    }
2975
2976                    2 => {
2977                        ::fidl_next::wire::Envelope::decode_as::<
2978                            ___D,
2979                            ::fidl_next::wire::String<'de>,
2980                        >(slot.as_mut(), decoder, 16)?;
2981
2982                        let value = unsafe {
2983                            slot.deref_unchecked()
2984                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
2985                        };
2986
2987                        if value.len() > 16 {
2988                            return Err(::fidl_next::DecodeError::VectorTooLong {
2989                                size: value.len() as u64,
2990                                limit: 16,
2991                            });
2992                        }
2993
2994                        Ok(())
2995                    }
2996
2997                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2998                }
2999            })
3000        }
3001    }
3002
3003    impl<'de> PowerLevelName<'de> {
3004        pub fn level(&self) -> ::core::option::Option<&u8> {
3005            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3006        }
3007
3008        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
3009            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3010        }
3011    }
3012
3013    impl<'de> ::core::fmt::Debug for PowerLevelName<'de> {
3014        fn fmt(
3015            &self,
3016            f: &mut ::core::fmt::Formatter<'_>,
3017        ) -> ::core::result::Result<(), ::core::fmt::Error> {
3018            f.debug_struct("PowerLevelName")
3019                .field("level", &self.level())
3020                .field("name", &self.name())
3021                .finish()
3022        }
3023    }
3024
3025    impl<'de> ::fidl_next::IntoNatural for PowerLevelName<'de> {
3026        type Natural = crate::natural::PowerLevelName;
3027    }
3028
3029    /// The wire type corresponding to [`ElementPowerLevelNames`].
3030    #[repr(C)]
3031    pub struct ElementPowerLevelNames<'de> {
3032        pub(crate) table: ::fidl_next::wire::Table<'de>,
3033    }
3034
3035    impl<'de> Drop for ElementPowerLevelNames<'de> {
3036        fn drop(&mut self) {
3037            let _ = self.table.get(1).map(|envelope| unsafe {
3038                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3039            });
3040
3041            let _ = self.table.get(2)
3042                .map(|envelope| unsafe {
3043                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>()
3044                });
3045        }
3046    }
3047
3048    impl ::fidl_next::Constrained for ElementPowerLevelNames<'_> {
3049        type Constraint = ();
3050
3051        fn validate(
3052            _: ::fidl_next::Slot<'_, Self>,
3053            _: Self::Constraint,
3054        ) -> Result<(), ::fidl_next::ValidationError> {
3055            Ok(())
3056        }
3057    }
3058
3059    unsafe impl ::fidl_next::Wire for ElementPowerLevelNames<'static> {
3060        type Narrowed<'de> = ElementPowerLevelNames<'de>;
3061
3062        #[inline]
3063        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3064            ::fidl_next::munge!(let Self { table } = out);
3065            ::fidl_next::wire::Table::zero_padding(table);
3066        }
3067    }
3068
3069    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ElementPowerLevelNames<'de>
3070    where
3071        ___D: ::fidl_next::Decoder<'de> + ?Sized,
3072    {
3073        fn decode(
3074            slot: ::fidl_next::Slot<'_, Self>,
3075            decoder: &mut ___D,
3076            _: (),
3077        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3078            ::fidl_next::munge!(let Self { table } = slot);
3079
3080            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3081                match ordinal {
3082                    0 => unsafe { ::core::hint::unreachable_unchecked() },
3083
3084                    1 => {
3085                        ::fidl_next::wire::Envelope::decode_as::<
3086                            ___D,
3087                            ::fidl_next::wire::String<'de>,
3088                        >(slot.as_mut(), decoder, 64)?;
3089
3090                        let value = unsafe {
3091                            slot.deref_unchecked()
3092                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
3093                        };
3094
3095                        if value.len() > 64 {
3096                            return Err(::fidl_next::DecodeError::VectorTooLong {
3097                                size: value.len() as u64,
3098                                limit: 64,
3099                            });
3100                        }
3101
3102                        Ok(())
3103                    }
3104
3105                    2 => {
3106                        ::fidl_next::wire::Envelope::decode_as::<
3107                            ___D,
3108                            ::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>,
3109                        >(slot.as_mut(), decoder, (256, ()))?;
3110
3111                        let value = unsafe {
3112                            slot
3113                                            .deref_unchecked()
3114                                            .deref_unchecked::<
3115                                                ::fidl_next::wire::Vector<'_, crate::wire::PowerLevelName<'_>>
3116                                            >()
3117                        };
3118
3119                        if value.len() > 256 {
3120                            return Err(::fidl_next::DecodeError::VectorTooLong {
3121                                size: value.len() as u64,
3122                                limit: 256,
3123                            });
3124                        }
3125
3126                        Ok(())
3127                    }
3128
3129                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3130                }
3131            })
3132        }
3133    }
3134
3135    impl<'de> ElementPowerLevelNames<'de> {
3136        pub fn identifier(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
3137            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3138        }
3139
3140        pub fn levels(
3141            &self,
3142        ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>
3143        {
3144            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3145        }
3146    }
3147
3148    impl<'de> ::core::fmt::Debug for ElementPowerLevelNames<'de> {
3149        fn fmt(
3150            &self,
3151            f: &mut ::core::fmt::Formatter<'_>,
3152        ) -> ::core::result::Result<(), ::core::fmt::Error> {
3153            f.debug_struct("ElementPowerLevelNames")
3154                .field("identifier", &self.identifier())
3155                .field("levels", &self.levels())
3156                .finish()
3157        }
3158    }
3159
3160    impl<'de> ::fidl_next::IntoNatural for ElementPowerLevelNames<'de> {
3161        type Natural = crate::natural::ElementPowerLevelNames;
3162    }
3163
3164    /// The wire type corresponding to [`ElementInfoProviderError`].
3165    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3166    #[repr(transparent)]
3167    pub struct ElementInfoProviderError {
3168        pub(crate) value: ::fidl_next::wire::Uint32,
3169    }
3170
3171    impl ::fidl_next::Constrained for ElementInfoProviderError {
3172        type Constraint = ();
3173
3174        fn validate(
3175            _: ::fidl_next::Slot<'_, Self>,
3176            _: Self::Constraint,
3177        ) -> Result<(), ::fidl_next::ValidationError> {
3178            Ok(())
3179        }
3180    }
3181
3182    unsafe impl ::fidl_next::Wire for ElementInfoProviderError {
3183        type Narrowed<'de> = Self;
3184
3185        #[inline]
3186        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3187            // Wire enums have no padding
3188        }
3189    }
3190
3191    impl ElementInfoProviderError {
3192        pub const UNKNOWN: ElementInfoProviderError =
3193            ElementInfoProviderError { value: ::fidl_next::wire::Uint32(0) };
3194
3195        pub const FAILED: ElementInfoProviderError =
3196            ElementInfoProviderError { value: ::fidl_next::wire::Uint32(1) };
3197    }
3198
3199    unsafe impl<___D> ::fidl_next::Decode<___D> for ElementInfoProviderError
3200    where
3201        ___D: ?Sized,
3202    {
3203        fn decode(
3204            slot: ::fidl_next::Slot<'_, Self>,
3205            _: &mut ___D,
3206            _: (),
3207        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3208            Ok(())
3209        }
3210    }
3211
3212    impl ::core::convert::From<crate::natural::ElementInfoProviderError> for ElementInfoProviderError {
3213        fn from(natural: crate::natural::ElementInfoProviderError) -> Self {
3214            match natural {
3215                crate::natural::ElementInfoProviderError::Unknown => {
3216                    ElementInfoProviderError::UNKNOWN
3217                }
3218
3219                crate::natural::ElementInfoProviderError::Failed => {
3220                    ElementInfoProviderError::FAILED
3221                }
3222
3223                crate::natural::ElementInfoProviderError::UnknownOrdinal_(value) => {
3224                    ElementInfoProviderError { value: ::fidl_next::wire::Uint32::from(value) }
3225                }
3226            }
3227        }
3228    }
3229
3230    impl ::fidl_next::IntoNatural for ElementInfoProviderError {
3231        type Natural = crate::natural::ElementInfoProviderError;
3232    }
3233
3234    /// The wire type corresponding to [`ElementRunnerSetLevelRequest`].
3235    #[derive(Clone, Debug)]
3236    #[repr(C)]
3237    pub struct ElementRunnerSetLevelRequest {
3238        pub level: u8,
3239    }
3240
3241    static_assertions::const_assert_eq!(std::mem::size_of::<ElementRunnerSetLevelRequest>(), 1);
3242    static_assertions::const_assert_eq!(std::mem::align_of::<ElementRunnerSetLevelRequest>(), 1);
3243
3244    static_assertions::const_assert_eq!(
3245        std::mem::offset_of!(ElementRunnerSetLevelRequest, level),
3246        0
3247    );
3248
3249    impl ::fidl_next::Constrained for ElementRunnerSetLevelRequest {
3250        type Constraint = ();
3251
3252        fn validate(
3253            _: ::fidl_next::Slot<'_, Self>,
3254            _: Self::Constraint,
3255        ) -> Result<(), ::fidl_next::ValidationError> {
3256            Ok(())
3257        }
3258    }
3259
3260    unsafe impl ::fidl_next::Wire for ElementRunnerSetLevelRequest {
3261        type Narrowed<'de> = ElementRunnerSetLevelRequest;
3262
3263        #[inline]
3264        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3265            ::fidl_next::munge! {
3266                let Self {
3267
3268                    level,
3269
3270                } = &mut *out_;
3271            }
3272
3273            ::fidl_next::Wire::zero_padding(level);
3274        }
3275    }
3276
3277    unsafe impl<___D> ::fidl_next::Decode<___D> for ElementRunnerSetLevelRequest
3278    where
3279        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3280    {
3281        fn decode(
3282            slot_: ::fidl_next::Slot<'_, Self>,
3283            decoder_: &mut ___D,
3284            _: (),
3285        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3286            ::fidl_next::munge! {
3287                let Self {
3288
3289                    mut level,
3290
3291                } = slot_;
3292            }
3293
3294            let _field = level.as_mut();
3295
3296            ::fidl_next::Decode::decode(level.as_mut(), decoder_, ())?;
3297
3298            Ok(())
3299        }
3300    }
3301
3302    impl ::fidl_next::IntoNatural for ElementRunnerSetLevelRequest {
3303        type Natural = crate::natural::ElementRunnerSetLevelRequest;
3304    }
3305
3306    /// The wire type corresponding to [`ElementRunnerSetLevelResponse`].
3307    #[derive(Clone, Debug)]
3308    #[repr(C)]
3309    pub struct ElementRunnerSetLevelResponse {
3310        pub(crate) _empty: fidl_next::wire::EmptyStruct,
3311    }
3312
3313    static_assertions::const_assert_eq!(std::mem::size_of::<ElementRunnerSetLevelResponse>(), 1);
3314    static_assertions::const_assert_eq!(std::mem::align_of::<ElementRunnerSetLevelResponse>(), 1);
3315
3316    impl ::fidl_next::Constrained for ElementRunnerSetLevelResponse {
3317        type Constraint = ();
3318
3319        fn validate(
3320            _: ::fidl_next::Slot<'_, Self>,
3321            _: Self::Constraint,
3322        ) -> Result<(), ::fidl_next::ValidationError> {
3323            Ok(())
3324        }
3325    }
3326
3327    unsafe impl ::fidl_next::Wire for ElementRunnerSetLevelResponse {
3328        type Narrowed<'de> = ElementRunnerSetLevelResponse;
3329
3330        #[inline]
3331        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3332            ::fidl_next::munge! {
3333                let Self {
3334
3335                        _empty,
3336
3337
3338                } = &mut *out_;
3339            }
3340        }
3341    }
3342
3343    unsafe impl<___D> ::fidl_next::Decode<___D> for ElementRunnerSetLevelResponse
3344    where
3345        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3346    {
3347        fn decode(
3348            slot_: ::fidl_next::Slot<'_, Self>,
3349            decoder_: &mut ___D,
3350            _: (),
3351        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3352            ::fidl_next::munge! {
3353                let Self {
3354
3355                        mut _empty,
3356
3357
3358                } = slot_;
3359            }
3360
3361            if _empty.as_bytes() != &[0u8] {
3362                return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
3363            }
3364
3365            Ok(())
3366        }
3367    }
3368
3369    impl ::fidl_next::IntoNatural for ElementRunnerSetLevelResponse {
3370        type Natural = crate::natural::ElementRunnerSetLevelResponse;
3371    }
3372
3373    /// The wire type corresponding to [`LeaseStatus`].
3374    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3375    #[repr(transparent)]
3376    pub struct LeaseStatus {
3377        pub(crate) value: ::fidl_next::wire::Uint32,
3378    }
3379
3380    impl ::fidl_next::Constrained for LeaseStatus {
3381        type Constraint = ();
3382
3383        fn validate(
3384            _: ::fidl_next::Slot<'_, Self>,
3385            _: Self::Constraint,
3386        ) -> Result<(), ::fidl_next::ValidationError> {
3387            Ok(())
3388        }
3389    }
3390
3391    unsafe impl ::fidl_next::Wire for LeaseStatus {
3392        type Narrowed<'de> = Self;
3393
3394        #[inline]
3395        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3396            // Wire enums have no padding
3397        }
3398    }
3399
3400    impl LeaseStatus {
3401        pub const UNKNOWN: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(0) };
3402
3403        pub const PENDING: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(1) };
3404
3405        pub const SATISFIED: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(2) };
3406    }
3407
3408    unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseStatus
3409    where
3410        ___D: ?Sized,
3411    {
3412        fn decode(
3413            slot: ::fidl_next::Slot<'_, Self>,
3414            _: &mut ___D,
3415            _: (),
3416        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3417            Ok(())
3418        }
3419    }
3420
3421    impl ::core::convert::From<crate::natural::LeaseStatus> for LeaseStatus {
3422        fn from(natural: crate::natural::LeaseStatus) -> Self {
3423            match natural {
3424                crate::natural::LeaseStatus::Unknown => LeaseStatus::UNKNOWN,
3425
3426                crate::natural::LeaseStatus::Pending => LeaseStatus::PENDING,
3427
3428                crate::natural::LeaseStatus::Satisfied => LeaseStatus::SATISFIED,
3429
3430                crate::natural::LeaseStatus::UnknownOrdinal_(value) => {
3431                    LeaseStatus { value: ::fidl_next::wire::Uint32::from(value) }
3432                }
3433            }
3434        }
3435    }
3436
3437    impl ::fidl_next::IntoNatural for LeaseStatus {
3438        type Natural = crate::natural::LeaseStatus;
3439    }
3440
3441    /// The wire type corresponding to [`LeaseControlWatchStatusRequest`].
3442    #[derive(Clone, Debug)]
3443    #[repr(C)]
3444    pub struct LeaseControlWatchStatusRequest {
3445        pub last_status: crate::wire::LeaseStatus,
3446    }
3447
3448    static_assertions::const_assert_eq!(std::mem::size_of::<LeaseControlWatchStatusRequest>(), 4);
3449    static_assertions::const_assert_eq!(std::mem::align_of::<LeaseControlWatchStatusRequest>(), 4);
3450
3451    static_assertions::const_assert_eq!(
3452        std::mem::offset_of!(LeaseControlWatchStatusRequest, last_status),
3453        0
3454    );
3455
3456    impl ::fidl_next::Constrained for LeaseControlWatchStatusRequest {
3457        type Constraint = ();
3458
3459        fn validate(
3460            _: ::fidl_next::Slot<'_, Self>,
3461            _: Self::Constraint,
3462        ) -> Result<(), ::fidl_next::ValidationError> {
3463            Ok(())
3464        }
3465    }
3466
3467    unsafe impl ::fidl_next::Wire for LeaseControlWatchStatusRequest {
3468        type Narrowed<'de> = LeaseControlWatchStatusRequest;
3469
3470        #[inline]
3471        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3472            ::fidl_next::munge! {
3473                let Self {
3474
3475                    last_status,
3476
3477                } = &mut *out_;
3478            }
3479
3480            ::fidl_next::Wire::zero_padding(last_status);
3481        }
3482    }
3483
3484    unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseControlWatchStatusRequest
3485    where
3486        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3487    {
3488        fn decode(
3489            slot_: ::fidl_next::Slot<'_, Self>,
3490            decoder_: &mut ___D,
3491            _: (),
3492        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3493            ::fidl_next::munge! {
3494                let Self {
3495
3496                    mut last_status,
3497
3498                } = slot_;
3499            }
3500
3501            let _field = last_status.as_mut();
3502
3503            ::fidl_next::Decode::decode(last_status.as_mut(), decoder_, ())?;
3504
3505            Ok(())
3506        }
3507    }
3508
3509    impl ::fidl_next::IntoNatural for LeaseControlWatchStatusRequest {
3510        type Natural = crate::natural::LeaseControlWatchStatusRequest;
3511    }
3512
3513    /// The wire type corresponding to [`LeaseControlWatchStatusResponse`].
3514    #[derive(Clone, Debug)]
3515    #[repr(C)]
3516    pub struct LeaseControlWatchStatusResponse {
3517        pub status: crate::wire::LeaseStatus,
3518    }
3519
3520    static_assertions::const_assert_eq!(std::mem::size_of::<LeaseControlWatchStatusResponse>(), 4);
3521    static_assertions::const_assert_eq!(std::mem::align_of::<LeaseControlWatchStatusResponse>(), 4);
3522
3523    static_assertions::const_assert_eq!(
3524        std::mem::offset_of!(LeaseControlWatchStatusResponse, status),
3525        0
3526    );
3527
3528    impl ::fidl_next::Constrained for LeaseControlWatchStatusResponse {
3529        type Constraint = ();
3530
3531        fn validate(
3532            _: ::fidl_next::Slot<'_, Self>,
3533            _: Self::Constraint,
3534        ) -> Result<(), ::fidl_next::ValidationError> {
3535            Ok(())
3536        }
3537    }
3538
3539    unsafe impl ::fidl_next::Wire for LeaseControlWatchStatusResponse {
3540        type Narrowed<'de> = LeaseControlWatchStatusResponse;
3541
3542        #[inline]
3543        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3544            ::fidl_next::munge! {
3545                let Self {
3546
3547                    status,
3548
3549                } = &mut *out_;
3550            }
3551
3552            ::fidl_next::Wire::zero_padding(status);
3553        }
3554    }
3555
3556    unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseControlWatchStatusResponse
3557    where
3558        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3559    {
3560        fn decode(
3561            slot_: ::fidl_next::Slot<'_, Self>,
3562            decoder_: &mut ___D,
3563            _: (),
3564        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3565            ::fidl_next::munge! {
3566                let Self {
3567
3568                    mut status,
3569
3570                } = slot_;
3571            }
3572
3573            let _field = status.as_mut();
3574
3575            ::fidl_next::Decode::decode(status.as_mut(), decoder_, ())?;
3576
3577            Ok(())
3578        }
3579    }
3580
3581    impl ::fidl_next::IntoNatural for LeaseControlWatchStatusResponse {
3582        type Natural = crate::natural::LeaseControlWatchStatusResponse;
3583    }
3584
3585    /// The wire type corresponding to [`LeaseError`].
3586    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3587    #[repr(transparent)]
3588    pub struct LeaseError {
3589        pub(crate) value: ::fidl_next::wire::Uint32,
3590    }
3591
3592    impl ::fidl_next::Constrained for LeaseError {
3593        type Constraint = ();
3594
3595        fn validate(
3596            _: ::fidl_next::Slot<'_, Self>,
3597            _: Self::Constraint,
3598        ) -> Result<(), ::fidl_next::ValidationError> {
3599            Ok(())
3600        }
3601    }
3602
3603    unsafe impl ::fidl_next::Wire for LeaseError {
3604        type Narrowed<'de> = Self;
3605
3606        #[inline]
3607        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3608            // Wire enums have no padding
3609        }
3610    }
3611
3612    impl LeaseError {
3613        pub const INTERNAL: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(1) };
3614
3615        pub const NOT_AUTHORIZED: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(2) };
3616
3617        pub const INVALID_LEVEL: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(3) };
3618
3619        pub const INVALID_ARGUMENT: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(4) };
3620    }
3621
3622    unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseError
3623    where
3624        ___D: ?Sized,
3625    {
3626        fn decode(
3627            slot: ::fidl_next::Slot<'_, Self>,
3628            _: &mut ___D,
3629            _: (),
3630        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3631            Ok(())
3632        }
3633    }
3634
3635    impl ::core::convert::From<crate::natural::LeaseError> for LeaseError {
3636        fn from(natural: crate::natural::LeaseError) -> Self {
3637            match natural {
3638                crate::natural::LeaseError::Internal => LeaseError::INTERNAL,
3639
3640                crate::natural::LeaseError::NotAuthorized => LeaseError::NOT_AUTHORIZED,
3641
3642                crate::natural::LeaseError::InvalidLevel => LeaseError::INVALID_LEVEL,
3643
3644                crate::natural::LeaseError::InvalidArgument => LeaseError::INVALID_ARGUMENT,
3645
3646                crate::natural::LeaseError::UnknownOrdinal_(value) => {
3647                    LeaseError { value: ::fidl_next::wire::Uint32::from(value) }
3648                }
3649            }
3650        }
3651    }
3652
3653    impl ::fidl_next::IntoNatural for LeaseError {
3654        type Natural = crate::natural::LeaseError;
3655    }
3656
3657    /// The wire type corresponding to [`ModifyDependencyError`].
3658    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3659    #[repr(transparent)]
3660    pub struct ModifyDependencyError {
3661        pub(crate) value: ::fidl_next::wire::Uint32,
3662    }
3663
3664    impl ::fidl_next::Constrained for ModifyDependencyError {
3665        type Constraint = ();
3666
3667        fn validate(
3668            _: ::fidl_next::Slot<'_, Self>,
3669            _: Self::Constraint,
3670        ) -> Result<(), ::fidl_next::ValidationError> {
3671            Ok(())
3672        }
3673    }
3674
3675    unsafe impl ::fidl_next::Wire for ModifyDependencyError {
3676        type Narrowed<'de> = Self;
3677
3678        #[inline]
3679        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3680            // Wire enums have no padding
3681        }
3682    }
3683
3684    impl ModifyDependencyError {
3685        pub const ALREADY_EXISTS: ModifyDependencyError =
3686            ModifyDependencyError { value: ::fidl_next::wire::Uint32(1) };
3687
3688        pub const INVALID: ModifyDependencyError =
3689            ModifyDependencyError { value: ::fidl_next::wire::Uint32(2) };
3690
3691        pub const NOT_AUTHORIZED: ModifyDependencyError =
3692            ModifyDependencyError { value: ::fidl_next::wire::Uint32(3) };
3693
3694        pub const NOT_FOUND: ModifyDependencyError =
3695            ModifyDependencyError { value: ::fidl_next::wire::Uint32(4) };
3696    }
3697
3698    unsafe impl<___D> ::fidl_next::Decode<___D> for ModifyDependencyError
3699    where
3700        ___D: ?Sized,
3701    {
3702        fn decode(
3703            slot: ::fidl_next::Slot<'_, Self>,
3704            _: &mut ___D,
3705            _: (),
3706        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3707            Ok(())
3708        }
3709    }
3710
3711    impl ::core::convert::From<crate::natural::ModifyDependencyError> for ModifyDependencyError {
3712        fn from(natural: crate::natural::ModifyDependencyError) -> Self {
3713            match natural {
3714                crate::natural::ModifyDependencyError::AlreadyExists => {
3715                    ModifyDependencyError::ALREADY_EXISTS
3716                }
3717
3718                crate::natural::ModifyDependencyError::Invalid => ModifyDependencyError::INVALID,
3719
3720                crate::natural::ModifyDependencyError::NotAuthorized => {
3721                    ModifyDependencyError::NOT_AUTHORIZED
3722                }
3723
3724                crate::natural::ModifyDependencyError::NotFound => ModifyDependencyError::NOT_FOUND,
3725
3726                crate::natural::ModifyDependencyError::UnknownOrdinal_(value) => {
3727                    ModifyDependencyError { value: ::fidl_next::wire::Uint32::from(value) }
3728                }
3729            }
3730        }
3731    }
3732
3733    impl ::fidl_next::IntoNatural for ModifyDependencyError {
3734        type Natural = crate::natural::ModifyDependencyError;
3735    }
3736
3737    /// The wire type corresponding to [`Permissions`](crate::natural::Permissions).
3738    #[derive(Clone, Copy, Debug)]
3739    #[repr(transparent)]
3740    pub struct Permissions {
3741        pub(crate) value: ::fidl_next::wire::Uint32,
3742    }
3743
3744    impl ::fidl_next::Constrained for Permissions {
3745        type Constraint = ();
3746
3747        fn validate(
3748            _: ::fidl_next::Slot<'_, Self>,
3749            _: Self::Constraint,
3750        ) -> Result<(), ::fidl_next::ValidationError> {
3751            Ok(())
3752        }
3753    }
3754
3755    unsafe impl ::fidl_next::Wire for Permissions {
3756        type Narrowed<'de> = Self;
3757
3758        #[inline]
3759        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3760            // Wire bits have no padding
3761        }
3762    }
3763
3764    unsafe impl<___D> ::fidl_next::Decode<___D> for Permissions
3765    where
3766        ___D: ?Sized,
3767    {
3768        fn decode(
3769            slot: ::fidl_next::Slot<'_, Self>,
3770            _: &mut ___D,
3771            _: (),
3772        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3773            ::fidl_next::munge!(let Self { value } = slot);
3774            let set = u32::from(*value);
3775            if set & !crate::natural::Permissions::all().bits() != 0 {
3776                return Err(::fidl_next::DecodeError::InvalidBits {
3777                    expected: crate::natural::Permissions::all().bits() as usize,
3778                    actual: set as usize,
3779                });
3780            }
3781
3782            Ok(())
3783        }
3784    }
3785
3786    impl ::core::convert::From<crate::natural::Permissions> for Permissions {
3787        fn from(natural: crate::natural::Permissions) -> Self {
3788            Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
3789        }
3790    }
3791
3792    impl ::fidl_next::IntoNatural for Permissions {
3793        type Natural = crate::natural::Permissions;
3794    }
3795
3796    /// The wire type corresponding to [`StatusError`].
3797    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3798    #[repr(transparent)]
3799    pub struct StatusError {
3800        pub(crate) value: ::fidl_next::wire::Uint32,
3801    }
3802
3803    impl ::fidl_next::Constrained for StatusError {
3804        type Constraint = ();
3805
3806        fn validate(
3807            _: ::fidl_next::Slot<'_, Self>,
3808            _: Self::Constraint,
3809        ) -> Result<(), ::fidl_next::ValidationError> {
3810            Ok(())
3811        }
3812    }
3813
3814    unsafe impl ::fidl_next::Wire for StatusError {
3815        type Narrowed<'de> = Self;
3816
3817        #[inline]
3818        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3819            // Wire enums have no padding
3820        }
3821    }
3822
3823    impl StatusError {
3824        pub const UNKNOWN: StatusError = StatusError { value: ::fidl_next::wire::Uint32(1) };
3825    }
3826
3827    unsafe impl<___D> ::fidl_next::Decode<___D> for StatusError
3828    where
3829        ___D: ?Sized,
3830    {
3831        fn decode(
3832            slot: ::fidl_next::Slot<'_, Self>,
3833            _: &mut ___D,
3834            _: (),
3835        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3836            Ok(())
3837        }
3838    }
3839
3840    impl ::core::convert::From<crate::natural::StatusError> for StatusError {
3841        fn from(natural: crate::natural::StatusError) -> Self {
3842            match natural {
3843                crate::natural::StatusError::Unknown => StatusError::UNKNOWN,
3844
3845                crate::natural::StatusError::UnknownOrdinal_(value) => {
3846                    StatusError { value: ::fidl_next::wire::Uint32::from(value) }
3847                }
3848            }
3849        }
3850    }
3851
3852    impl ::fidl_next::IntoNatural for StatusError {
3853        type Natural = crate::natural::StatusError;
3854    }
3855
3856    /// The wire type corresponding to [`TopologyAddElementResponse`].
3857    #[derive(Clone, Debug)]
3858    #[repr(C)]
3859    pub struct TopologyAddElementResponse {
3860        pub(crate) _empty: fidl_next::wire::EmptyStruct,
3861    }
3862
3863    static_assertions::const_assert_eq!(std::mem::size_of::<TopologyAddElementResponse>(), 1);
3864    static_assertions::const_assert_eq!(std::mem::align_of::<TopologyAddElementResponse>(), 1);
3865
3866    impl ::fidl_next::Constrained for TopologyAddElementResponse {
3867        type Constraint = ();
3868
3869        fn validate(
3870            _: ::fidl_next::Slot<'_, Self>,
3871            _: Self::Constraint,
3872        ) -> Result<(), ::fidl_next::ValidationError> {
3873            Ok(())
3874        }
3875    }
3876
3877    unsafe impl ::fidl_next::Wire for TopologyAddElementResponse {
3878        type Narrowed<'de> = TopologyAddElementResponse;
3879
3880        #[inline]
3881        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3882            ::fidl_next::munge! {
3883                let Self {
3884
3885                        _empty,
3886
3887
3888                } = &mut *out_;
3889            }
3890        }
3891    }
3892
3893    unsafe impl<___D> ::fidl_next::Decode<___D> for TopologyAddElementResponse
3894    where
3895        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3896    {
3897        fn decode(
3898            slot_: ::fidl_next::Slot<'_, Self>,
3899            decoder_: &mut ___D,
3900            _: (),
3901        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3902            ::fidl_next::munge! {
3903                let Self {
3904
3905                        mut _empty,
3906
3907
3908                } = slot_;
3909            }
3910
3911            if _empty.as_bytes() != &[0u8] {
3912                return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
3913            }
3914
3915            Ok(())
3916        }
3917    }
3918
3919    impl ::fidl_next::IntoNatural for TopologyAddElementResponse {
3920        type Natural = crate::natural::TopologyAddElementResponse;
3921    }
3922
3923    /// The wire type corresponding to [`TopologyLeaseResponse`].
3924    #[derive(Clone, Debug)]
3925    #[repr(C)]
3926    pub struct TopologyLeaseResponse {
3927        pub(crate) _empty: fidl_next::wire::EmptyStruct,
3928    }
3929
3930    static_assertions::const_assert_eq!(std::mem::size_of::<TopologyLeaseResponse>(), 1);
3931    static_assertions::const_assert_eq!(std::mem::align_of::<TopologyLeaseResponse>(), 1);
3932
3933    impl ::fidl_next::Constrained for TopologyLeaseResponse {
3934        type Constraint = ();
3935
3936        fn validate(
3937            _: ::fidl_next::Slot<'_, Self>,
3938            _: Self::Constraint,
3939        ) -> Result<(), ::fidl_next::ValidationError> {
3940            Ok(())
3941        }
3942    }
3943
3944    unsafe impl ::fidl_next::Wire for TopologyLeaseResponse {
3945        type Narrowed<'de> = TopologyLeaseResponse;
3946
3947        #[inline]
3948        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3949            ::fidl_next::munge! {
3950                let Self {
3951
3952                        _empty,
3953
3954
3955                } = &mut *out_;
3956            }
3957        }
3958    }
3959
3960    unsafe impl<___D> ::fidl_next::Decode<___D> for TopologyLeaseResponse
3961    where
3962        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3963    {
3964        fn decode(
3965            slot_: ::fidl_next::Slot<'_, Self>,
3966            decoder_: &mut ___D,
3967            _: (),
3968        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3969            ::fidl_next::munge! {
3970                let Self {
3971
3972                        mut _empty,
3973
3974
3975                } = slot_;
3976            }
3977
3978            if _empty.as_bytes() != &[0u8] {
3979                return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
3980            }
3981
3982            Ok(())
3983        }
3984    }
3985
3986    impl ::fidl_next::IntoNatural for TopologyLeaseResponse {
3987        type Natural = crate::natural::TopologyLeaseResponse;
3988    }
3989}
3990
3991pub mod wire_optional {}
3992
3993pub mod generic {
3994
3995    pub struct ElementRunnerSetLevelRequest<T0> {
3996        pub level: T0,
3997    }
3998
3999    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>
4000        for ElementRunnerSetLevelRequest<T0>
4001    where
4002        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4003        T0: ::fidl_next::Encode<u8, ___E>,
4004    {
4005        #[inline]
4006        fn encode(
4007            self,
4008            encoder_: &mut ___E,
4009            out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelRequest>,
4010            _: (),
4011        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4012            ::fidl_next::munge! {
4013                let crate::wire::ElementRunnerSetLevelRequest {
4014
4015                    level,
4016
4017                } = out_;
4018            }
4019
4020            ::fidl_next::Encode::encode(self.level, encoder_, level, ())?;
4021
4022            Ok(())
4023        }
4024    }
4025
4026    pub struct LeaseControlWatchStatusRequest<T0> {
4027        pub last_status: T0,
4028    }
4029
4030    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>
4031        for LeaseControlWatchStatusRequest<T0>
4032    where
4033        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4034        T0: ::fidl_next::Encode<crate::wire::LeaseStatus, ___E>,
4035    {
4036        #[inline]
4037        fn encode(
4038            self,
4039            encoder_: &mut ___E,
4040            out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusRequest>,
4041            _: (),
4042        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4043            ::fidl_next::munge! {
4044                let crate::wire::LeaseControlWatchStatusRequest {
4045
4046                    last_status,
4047
4048                } = out_;
4049            }
4050
4051            ::fidl_next::Encode::encode(self.last_status, encoder_, last_status, ())?;
4052
4053            Ok(())
4054        }
4055    }
4056
4057    pub struct LeaseControlWatchStatusResponse<T0> {
4058        pub status: T0,
4059    }
4060
4061    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>
4062        for LeaseControlWatchStatusResponse<T0>
4063    where
4064        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4065        T0: ::fidl_next::Encode<crate::wire::LeaseStatus, ___E>,
4066    {
4067        #[inline]
4068        fn encode(
4069            self,
4070            encoder_: &mut ___E,
4071            out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusResponse>,
4072            _: (),
4073        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4074            ::fidl_next::munge! {
4075                let crate::wire::LeaseControlWatchStatusResponse {
4076
4077                    status,
4078
4079                } = out_;
4080            }
4081
4082            ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
4083
4084            Ok(())
4085        }
4086    }
4087}
4088
4089pub use self::natural::*;
4090
4091pub const MAX_ELEMENT_NAME_LEN: u8 = 64 as u8;
4092
4093#[doc = " PowerLevel name lengths are limited to reduce Inspect space usage\n"]
4094pub const MAX_LEVEL_NAME_LEN: u16 = 16 as u16;
4095
4096pub const MAX_VALID_POWER_LEVELS: u16 = 256 as u16;
4097
4098/// The type corresponding to the ElementRunner protocol.
4099#[doc = " The runner or operator of an element.\n This should be implemented by all element owners.\n The client end is passed to Power Broker via ElementSchema.element_runner.\n Power Broker calls SetLevel initially, and then whenever the required level\n of the element changes.\n"]
4100#[derive(PartialEq, Debug)]
4101pub struct ElementRunner;
4102
4103impl ::fidl_next::Discoverable for ElementRunner {
4104    const PROTOCOL_NAME: &'static str = "fuchsia.power.broker.ElementRunner";
4105}
4106
4107#[cfg(target_os = "fuchsia")]
4108impl ::fidl_next::HasTransport for ElementRunner {
4109    type Transport = ::fidl_next::fuchsia::zx::Channel;
4110}
4111
4112pub mod element_runner {
4113    pub mod prelude {
4114        pub use crate::{
4115            ElementRunner, ElementRunnerClientHandler, ElementRunnerServerHandler, element_runner,
4116        };
4117
4118        pub use crate::natural::ElementRunnerSetLevelRequest;
4119
4120        pub use crate::natural::ElementRunnerSetLevelResponse;
4121    }
4122
4123    pub struct SetLevel;
4124
4125    impl ::fidl_next::Method for SetLevel {
4126        const ORDINAL: u64 = 79537611020078859;
4127        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4128            ::fidl_next::protocol::Flexibility::Flexible;
4129
4130        type Protocol = crate::ElementRunner;
4131
4132        type Request = crate::wire::ElementRunnerSetLevelRequest;
4133    }
4134
4135    impl ::fidl_next::TwoWayMethod for SetLevel {
4136        type Response =
4137            ::fidl_next::wire::Flexible<'static, crate::wire::ElementRunnerSetLevelResponse>;
4138    }
4139
4140    impl<___R> ::fidl_next::Respond<___R> for SetLevel {
4141        type Output = ___R;
4142
4143        fn respond(response: ___R) -> Self::Output {
4144            response
4145        }
4146    }
4147
4148    mod ___detail {
4149        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ElementRunner
4150        where
4151            ___T: ::fidl_next::Transport,
4152        {
4153            type Client = ElementRunnerClient<___T>;
4154            type Server = ElementRunnerServer<___T>;
4155        }
4156
4157        /// The client for the `ElementRunner` protocol.
4158        #[repr(transparent)]
4159        pub struct ElementRunnerClient<___T: ::fidl_next::Transport> {
4160            #[allow(dead_code)]
4161            client: ::fidl_next::protocol::Client<___T>,
4162        }
4163
4164        impl<___T> ElementRunnerClient<___T>
4165        where
4166            ___T: ::fidl_next::Transport,
4167        {
4168            #[doc = " Sets the level of the power element.\n\n The server blocks while making the level transition. It returns\n once the transition to the new required level is complete.\n If the element cannot transition to the new required level and\n it cannot retry, the channel will be closed.\n"]
4169            pub fn set_level(
4170                &self,
4171
4172                level: impl ::fidl_next::Encode<u8, <___T as ::fidl_next::Transport>::SendBuffer>,
4173            ) -> ::fidl_next::TwoWayFuture<'_, super::SetLevel, ___T>
4174            where
4175                <___T as ::fidl_next::Transport>::SendBuffer:
4176                    ::fidl_next::encoder::InternalHandleEncoder,
4177            {
4178                self.set_level_with(crate::generic::ElementRunnerSetLevelRequest { level })
4179            }
4180
4181            #[doc = " Sets the level of the power element.\n\n The server blocks while making the level transition. It returns\n once the transition to the new required level is complete.\n If the element cannot transition to the new required level and\n it cannot retry, the channel will be closed.\n"]
4182            pub fn set_level_with<___R>(
4183                &self,
4184                request: ___R,
4185            ) -> ::fidl_next::TwoWayFuture<'_, super::SetLevel, ___T>
4186            where
4187                ___R: ::fidl_next::Encode<
4188                        crate::wire::ElementRunnerSetLevelRequest,
4189                        <___T as ::fidl_next::Transport>::SendBuffer,
4190                    >,
4191            {
4192                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4193                    79537611020078859,
4194                    <super::SetLevel as ::fidl_next::Method>::FLEXIBILITY,
4195                    request,
4196                ))
4197            }
4198        }
4199
4200        /// The server for the `ElementRunner` protocol.
4201        #[repr(transparent)]
4202        pub struct ElementRunnerServer<___T: ::fidl_next::Transport> {
4203            server: ::fidl_next::protocol::Server<___T>,
4204        }
4205
4206        impl<___T> ElementRunnerServer<___T> where ___T: ::fidl_next::Transport {}
4207    }
4208}
4209
4210/// A client handler for the ElementRunner protocol.
4211///
4212/// See [`ElementRunner`] for more details.
4213pub trait ElementRunnerClientHandler<
4214    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4215    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4216>
4217{
4218    fn on_unknown_interaction(
4219        &mut self,
4220        ordinal: u64,
4221    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4222        ::core::future::ready(())
4223    }
4224}
4225
4226impl<___T> ElementRunnerClientHandler<___T> for ::fidl_next::IgnoreEvents
4227where
4228    ___T: ::fidl_next::Transport,
4229{
4230    async fn on_unknown_interaction(&mut self, _: u64) {}
4231}
4232
4233impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ElementRunner
4234where
4235    ___H: ElementRunnerClientHandler<___T> + ::core::marker::Send,
4236    ___T: ::fidl_next::Transport,
4237{
4238    async fn on_event(
4239        handler: &mut ___H,
4240        ordinal: u64,
4241        flexibility: ::fidl_next::protocol::Flexibility,
4242        body: ::fidl_next::Body<___T>,
4243    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4244        match ordinal {
4245            ordinal => {
4246                handler.on_unknown_interaction(ordinal).await;
4247                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4248                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4249                } else {
4250                    Ok(())
4251                }
4252            }
4253        }
4254    }
4255}
4256
4257/// A server handler for the ElementRunner protocol.
4258///
4259/// See [`ElementRunner`] for more details.
4260pub trait ElementRunnerServerHandler<
4261    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4262    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4263>
4264{
4265    #[doc = " Sets the level of the power element.\n\n The server blocks while making the level transition. It returns\n once the transition to the new required level is complete.\n If the element cannot transition to the new required level and\n it cannot retry, the channel will be closed.\n"]
4266    fn set_level(
4267        &mut self,
4268
4269        request: ::fidl_next::Request<element_runner::SetLevel, ___T>,
4270
4271        responder: ::fidl_next::Responder<element_runner::SetLevel, ___T>,
4272    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4273
4274    fn on_unknown_interaction(
4275        &mut self,
4276        ordinal: u64,
4277    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4278        ::core::future::ready(())
4279    }
4280}
4281
4282impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ElementRunner
4283where
4284    ___H: ElementRunnerServerHandler<___T> + ::core::marker::Send,
4285    ___T: ::fidl_next::Transport,
4286    for<'de> crate::wire::ElementRunnerSetLevelRequest: ::fidl_next::Decode<
4287            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4288            Constraint = (),
4289        >,
4290{
4291    async fn on_one_way(
4292        handler: &mut ___H,
4293        ordinal: u64,
4294        flexibility: ::fidl_next::protocol::Flexibility,
4295        body: ::fidl_next::Body<___T>,
4296    ) -> ::core::result::Result<
4297        (),
4298        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4299    > {
4300        match ordinal {
4301            ordinal => {
4302                handler.on_unknown_interaction(ordinal).await;
4303                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4304                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4305                } else {
4306                    Ok(())
4307                }
4308            }
4309        }
4310    }
4311
4312    async fn on_two_way(
4313        handler: &mut ___H,
4314        ordinal: u64,
4315        flexibility: ::fidl_next::protocol::Flexibility,
4316        body: ::fidl_next::Body<___T>,
4317        responder: ::fidl_next::protocol::Responder<___T>,
4318    ) -> ::core::result::Result<
4319        (),
4320        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4321    > {
4322        match ordinal {
4323            79537611020078859 => {
4324                let responder = ::fidl_next::Responder::from_untyped(responder);
4325
4326                match ::fidl_next::AsDecoderExt::into_decoded(body) {
4327                    Ok(decoded) => {
4328                        handler
4329                            .set_level(::fidl_next::Request::from_decoded(decoded), responder)
4330                            .await;
4331                        Ok(())
4332                    }
4333                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4334                        ordinal: 79537611020078859,
4335                        error,
4336                    }),
4337                }
4338            }
4339
4340            ordinal => {
4341                handler.on_unknown_interaction(ordinal).await;
4342                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4343                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4344                } else {
4345                    responder
4346                        .respond(
4347                            ordinal,
4348                            flexibility,
4349                            ::fidl_next::Flexible::<()>::FrameworkErr(
4350                                ::fidl_next::FrameworkError::UnknownMethod,
4351                            ),
4352                        )
4353                        .expect("encoding a framework error should never fail")
4354                        .await?;
4355                    Ok(())
4356                }
4357            }
4358        }
4359    }
4360}
4361
4362pub const MAX_DEPENDENCIES_IN_ADD_ELEMENT: u16 = 128 as u16;
4363
4364#[doc = " Signal sent by Power Broker on the LeaseToken when the lease is satisfied.\n"]
4365pub const LEASE_SIGNAL_SATISFIED: u32 = 16777216 as u32;
4366
4367/// The type corresponding to the LeaseControl protocol.
4368#[doc = " Provides lease-scoped access to actions that can be taken on a lease\n previously acquired via Lessor.Lease. Closing this control channel drops\n the lease.\n TODO(https://fxbug.dev/339474151): Switch from a protocol to an eventpair.\n"]
4369#[derive(PartialEq, Debug)]
4370pub struct LeaseControl;
4371
4372#[cfg(target_os = "fuchsia")]
4373impl ::fidl_next::HasTransport for LeaseControl {
4374    type Transport = ::fidl_next::fuchsia::zx::Channel;
4375}
4376
4377pub mod lease_control {
4378    pub mod prelude {
4379        pub use crate::{
4380            LeaseControl, LeaseControlClientHandler, LeaseControlServerHandler, lease_control,
4381        };
4382
4383        pub use crate::natural::LeaseControlWatchStatusRequest;
4384
4385        pub use crate::natural::LeaseControlWatchStatusResponse;
4386    }
4387
4388    pub struct WatchStatus;
4389
4390    impl ::fidl_next::Method for WatchStatus {
4391        const ORDINAL: u64 = 2970891070576830593;
4392        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4393            ::fidl_next::protocol::Flexibility::Flexible;
4394
4395        type Protocol = crate::LeaseControl;
4396
4397        type Request = crate::wire::LeaseControlWatchStatusRequest;
4398    }
4399
4400    impl ::fidl_next::TwoWayMethod for WatchStatus {
4401        type Response =
4402            ::fidl_next::wire::Flexible<'static, crate::wire::LeaseControlWatchStatusResponse>;
4403    }
4404
4405    impl<___R> ::fidl_next::Respond<___R> for WatchStatus {
4406        type Output = ::fidl_next::Flexible<crate::generic::LeaseControlWatchStatusResponse<___R>>;
4407
4408        fn respond(response: ___R) -> Self::Output {
4409            ::fidl_next::Flexible::Ok(crate::generic::LeaseControlWatchStatusResponse {
4410                status: response,
4411            })
4412        }
4413    }
4414
4415    mod ___detail {
4416        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LeaseControl
4417        where
4418            ___T: ::fidl_next::Transport,
4419        {
4420            type Client = LeaseControlClient<___T>;
4421            type Server = LeaseControlServer<___T>;
4422        }
4423
4424        /// The client for the `LeaseControl` protocol.
4425        #[repr(transparent)]
4426        pub struct LeaseControlClient<___T: ::fidl_next::Transport> {
4427            #[allow(dead_code)]
4428            client: ::fidl_next::protocol::Client<___T>,
4429        }
4430
4431        impl<___T> LeaseControlClient<___T>
4432        where
4433            ___T: ::fidl_next::Transport,
4434        {
4435            #[doc = " Get the current status of the lease.\n If last_status is UNKNOWN, the call will return immediately\n with the current status. Otherwise, the call will block\n until the current status differs from last_status.\n"]
4436            pub fn watch_status(
4437                &self,
4438
4439                last_status: impl ::fidl_next::Encode<
4440                    crate::wire::LeaseStatus,
4441                    <___T as ::fidl_next::Transport>::SendBuffer,
4442                >,
4443            ) -> ::fidl_next::TwoWayFuture<'_, super::WatchStatus, ___T>
4444            where
4445                <___T as ::fidl_next::Transport>::SendBuffer:
4446                    ::fidl_next::encoder::InternalHandleEncoder,
4447            {
4448                self.watch_status_with(crate::generic::LeaseControlWatchStatusRequest {
4449                    last_status,
4450                })
4451            }
4452
4453            #[doc = " Get the current status of the lease.\n If last_status is UNKNOWN, the call will return immediately\n with the current status. Otherwise, the call will block\n until the current status differs from last_status.\n"]
4454            pub fn watch_status_with<___R>(
4455                &self,
4456                request: ___R,
4457            ) -> ::fidl_next::TwoWayFuture<'_, super::WatchStatus, ___T>
4458            where
4459                ___R: ::fidl_next::Encode<
4460                        crate::wire::LeaseControlWatchStatusRequest,
4461                        <___T as ::fidl_next::Transport>::SendBuffer,
4462                    >,
4463            {
4464                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4465                    2970891070576830593,
4466                    <super::WatchStatus as ::fidl_next::Method>::FLEXIBILITY,
4467                    request,
4468                ))
4469            }
4470        }
4471
4472        /// The server for the `LeaseControl` protocol.
4473        #[repr(transparent)]
4474        pub struct LeaseControlServer<___T: ::fidl_next::Transport> {
4475            server: ::fidl_next::protocol::Server<___T>,
4476        }
4477
4478        impl<___T> LeaseControlServer<___T> where ___T: ::fidl_next::Transport {}
4479    }
4480}
4481
4482/// A client handler for the LeaseControl protocol.
4483///
4484/// See [`LeaseControl`] for more details.
4485pub trait LeaseControlClientHandler<
4486    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4487    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4488>
4489{
4490    fn on_unknown_interaction(
4491        &mut self,
4492        ordinal: u64,
4493    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4494        ::core::future::ready(())
4495    }
4496}
4497
4498impl<___T> LeaseControlClientHandler<___T> for ::fidl_next::IgnoreEvents
4499where
4500    ___T: ::fidl_next::Transport,
4501{
4502    async fn on_unknown_interaction(&mut self, _: u64) {}
4503}
4504
4505impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LeaseControl
4506where
4507    ___H: LeaseControlClientHandler<___T> + ::core::marker::Send,
4508    ___T: ::fidl_next::Transport,
4509{
4510    async fn on_event(
4511        handler: &mut ___H,
4512        ordinal: u64,
4513        flexibility: ::fidl_next::protocol::Flexibility,
4514        body: ::fidl_next::Body<___T>,
4515    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4516        match ordinal {
4517            ordinal => {
4518                handler.on_unknown_interaction(ordinal).await;
4519                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4520                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4521                } else {
4522                    Ok(())
4523                }
4524            }
4525        }
4526    }
4527}
4528
4529/// A server handler for the LeaseControl protocol.
4530///
4531/// See [`LeaseControl`] for more details.
4532pub trait LeaseControlServerHandler<
4533    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4534    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4535>
4536{
4537    #[doc = " Get the current status of the lease.\n If last_status is UNKNOWN, the call will return immediately\n with the current status. Otherwise, the call will block\n until the current status differs from last_status.\n"]
4538    fn watch_status(
4539        &mut self,
4540
4541        request: ::fidl_next::Request<lease_control::WatchStatus, ___T>,
4542
4543        responder: ::fidl_next::Responder<lease_control::WatchStatus, ___T>,
4544    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4545
4546    fn on_unknown_interaction(
4547        &mut self,
4548        ordinal: u64,
4549    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4550        ::core::future::ready(())
4551    }
4552}
4553
4554impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LeaseControl
4555where
4556    ___H: LeaseControlServerHandler<___T> + ::core::marker::Send,
4557    ___T: ::fidl_next::Transport,
4558    for<'de> crate::wire::LeaseControlWatchStatusRequest: ::fidl_next::Decode<
4559            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4560            Constraint = (),
4561        >,
4562{
4563    async fn on_one_way(
4564        handler: &mut ___H,
4565        ordinal: u64,
4566        flexibility: ::fidl_next::protocol::Flexibility,
4567        body: ::fidl_next::Body<___T>,
4568    ) -> ::core::result::Result<
4569        (),
4570        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4571    > {
4572        match ordinal {
4573            ordinal => {
4574                handler.on_unknown_interaction(ordinal).await;
4575                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4576                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4577                } else {
4578                    Ok(())
4579                }
4580            }
4581        }
4582    }
4583
4584    async fn on_two_way(
4585        handler: &mut ___H,
4586        ordinal: u64,
4587        flexibility: ::fidl_next::protocol::Flexibility,
4588        body: ::fidl_next::Body<___T>,
4589        responder: ::fidl_next::protocol::Responder<___T>,
4590    ) -> ::core::result::Result<
4591        (),
4592        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4593    > {
4594        match ordinal {
4595            2970891070576830593 => {
4596                let responder = ::fidl_next::Responder::from_untyped(responder);
4597
4598                match ::fidl_next::AsDecoderExt::into_decoded(body) {
4599                    Ok(decoded) => {
4600                        handler
4601                            .watch_status(::fidl_next::Request::from_decoded(decoded), responder)
4602                            .await;
4603                        Ok(())
4604                    }
4605                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4606                        ordinal: 2970891070576830593,
4607                        error,
4608                    }),
4609                }
4610            }
4611
4612            ordinal => {
4613                handler.on_unknown_interaction(ordinal).await;
4614                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4615                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4616                } else {
4617                    responder
4618                        .respond(
4619                            ordinal,
4620                            flexibility,
4621                            ::fidl_next::Flexible::<()>::FrameworkErr(
4622                                ::fidl_next::FrameworkError::UnknownMethod,
4623                            ),
4624                        )
4625                        .expect("encoding a framework error should never fail")
4626                        .await?;
4627                    Ok(())
4628                }
4629            }
4630        }
4631    }
4632}
4633
4634pub const MAX_TOKENS_IN_ADD_ELEMENT: u16 = 128 as u16;
4635
4636/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
4637pub mod compat {
4638
4639    impl ::fidl_next::CompatFrom<crate::AddElementError>
4640        for ::fidl_fuchsia_power_broker::AddElementError
4641    {
4642        fn compat_from(value: crate::AddElementError) -> Self {
4643            match value {
4644                crate::AddElementError::Invalid => Self::Invalid,
4645
4646                crate::AddElementError::NotAuthorized => Self::NotAuthorized,
4647
4648                crate::AddElementError::UnknownOrdinal_(unknown_ordinal) => {
4649                    Self::__SourceBreaking { unknown_ordinal }
4650                }
4651            }
4652        }
4653    }
4654
4655    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::AddElementError>
4656        for crate::AddElementError
4657    {
4658        fn compat_from(value: ::fidl_fuchsia_power_broker::AddElementError) -> Self {
4659            match value {
4660                ::fidl_fuchsia_power_broker::AddElementError::Invalid => Self::Invalid,
4661
4662                ::fidl_fuchsia_power_broker::AddElementError::NotAuthorized => Self::NotAuthorized,
4663
4664                ::fidl_fuchsia_power_broker::AddElementError::__SourceBreaking {
4665                    unknown_ordinal: value,
4666                } => Self::UnknownOrdinal_(value),
4667            }
4668        }
4669    }
4670
4671    impl ::fidl_next::CompatFrom<crate::BinaryPowerLevel>
4672        for ::fidl_fuchsia_power_broker::BinaryPowerLevel
4673    {
4674        fn compat_from(value: crate::BinaryPowerLevel) -> Self {
4675            match value {
4676                crate::BinaryPowerLevel::Off => Self::Off,
4677
4678                crate::BinaryPowerLevel::On => Self::On,
4679            }
4680        }
4681    }
4682
4683    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::BinaryPowerLevel>
4684        for crate::BinaryPowerLevel
4685    {
4686        fn compat_from(value: ::fidl_fuchsia_power_broker::BinaryPowerLevel) -> Self {
4687            match value {
4688                ::fidl_fuchsia_power_broker::BinaryPowerLevel::Off => Self::Off,
4689
4690                ::fidl_fuchsia_power_broker::BinaryPowerLevel::On => Self::On,
4691            }
4692        }
4693    }
4694
4695    impl ::fidl_next::CompatFrom<crate::RegisterDependencyTokenError>
4696        for ::fidl_fuchsia_power_broker::RegisterDependencyTokenError
4697    {
4698        fn compat_from(value: crate::RegisterDependencyTokenError) -> Self {
4699            match value {
4700                crate::RegisterDependencyTokenError::AlreadyInUse => Self::AlreadyInUse,
4701
4702                crate::RegisterDependencyTokenError::Internal => Self::Internal,
4703
4704                crate::RegisterDependencyTokenError::UnknownOrdinal_(unknown_ordinal) => {
4705                    Self::__SourceBreaking { unknown_ordinal }
4706                }
4707            }
4708        }
4709    }
4710
4711    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::RegisterDependencyTokenError>
4712        for crate::RegisterDependencyTokenError
4713    {
4714        fn compat_from(value: ::fidl_fuchsia_power_broker::RegisterDependencyTokenError) -> Self {
4715            match value {
4716                ::fidl_fuchsia_power_broker::RegisterDependencyTokenError::AlreadyInUse => {
4717                    Self::AlreadyInUse
4718                }
4719
4720                ::fidl_fuchsia_power_broker::RegisterDependencyTokenError::Internal => {
4721                    Self::Internal
4722                }
4723
4724                ::fidl_fuchsia_power_broker::RegisterDependencyTokenError::__SourceBreaking {
4725                    unknown_ordinal: value,
4726                } => Self::UnknownOrdinal_(value),
4727            }
4728        }
4729    }
4730
4731    impl ::fidl_next::CompatFrom<crate::UnregisterDependencyTokenError>
4732        for ::fidl_fuchsia_power_broker::UnregisterDependencyTokenError
4733    {
4734        fn compat_from(value: crate::UnregisterDependencyTokenError) -> Self {
4735            match value {
4736                crate::UnregisterDependencyTokenError::NotAuthorized => Self::NotAuthorized,
4737
4738                crate::UnregisterDependencyTokenError::NotFound => Self::NotFound,
4739
4740                crate::UnregisterDependencyTokenError::UnknownOrdinal_(unknown_ordinal) => {
4741                    Self::__SourceBreaking { unknown_ordinal }
4742                }
4743            }
4744        }
4745    }
4746
4747    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::UnregisterDependencyTokenError>
4748        for crate::UnregisterDependencyTokenError
4749    {
4750        fn compat_from(value: ::fidl_fuchsia_power_broker::UnregisterDependencyTokenError) -> Self {
4751            match value {
4752                ::fidl_fuchsia_power_broker::UnregisterDependencyTokenError::NotAuthorized => {
4753                    Self::NotAuthorized
4754                }
4755
4756                ::fidl_fuchsia_power_broker::UnregisterDependencyTokenError::NotFound => {
4757                    Self::NotFound
4758                }
4759
4760                ::fidl_fuchsia_power_broker::UnregisterDependencyTokenError::__SourceBreaking {
4761                    unknown_ordinal: value,
4762                } => Self::UnknownOrdinal_(value),
4763            }
4764        }
4765    }
4766
4767    impl ::fidl_next::CompatFrom<crate::PowerLevelName>
4768        for ::fidl_fuchsia_power_broker::PowerLevelName
4769    {
4770        fn compat_from(value: crate::PowerLevelName) -> Self {
4771            Self {
4772                level: ::fidl_next::CompatFrom::compat_from(value.level),
4773
4774                name: ::fidl_next::CompatFrom::compat_from(value.name),
4775
4776                __source_breaking: ::fidl::marker::SourceBreaking,
4777            }
4778        }
4779    }
4780
4781    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::PowerLevelName>
4782        for crate::PowerLevelName
4783    {
4784        fn compat_from(value: ::fidl_fuchsia_power_broker::PowerLevelName) -> Self {
4785            Self {
4786                level: ::fidl_next::CompatFrom::compat_from(value.level),
4787
4788                name: ::fidl_next::CompatFrom::compat_from(value.name),
4789            }
4790        }
4791    }
4792
4793    impl ::fidl_next::CompatFrom<crate::ElementPowerLevelNames>
4794        for ::fidl_fuchsia_power_broker::ElementPowerLevelNames
4795    {
4796        fn compat_from(value: crate::ElementPowerLevelNames) -> Self {
4797            Self {
4798                identifier: ::fidl_next::CompatFrom::compat_from(value.identifier),
4799
4800                levels: ::fidl_next::CompatFrom::compat_from(value.levels),
4801
4802                __source_breaking: ::fidl::marker::SourceBreaking,
4803            }
4804        }
4805    }
4806
4807    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::ElementPowerLevelNames>
4808        for crate::ElementPowerLevelNames
4809    {
4810        fn compat_from(value: ::fidl_fuchsia_power_broker::ElementPowerLevelNames) -> Self {
4811            Self {
4812                identifier: ::fidl_next::CompatFrom::compat_from(value.identifier),
4813
4814                levels: ::fidl_next::CompatFrom::compat_from(value.levels),
4815            }
4816        }
4817    }
4818
4819    impl ::fidl_next::CompatFrom<crate::ElementInfoProviderError>
4820        for ::fidl_fuchsia_power_broker::ElementInfoProviderError
4821    {
4822        fn compat_from(value: crate::ElementInfoProviderError) -> Self {
4823            match value {
4824                crate::ElementInfoProviderError::Unknown => Self::Unknown,
4825
4826                crate::ElementInfoProviderError::Failed => Self::Failed,
4827
4828                crate::ElementInfoProviderError::UnknownOrdinal_(unknown_ordinal) => {
4829                    Self::__SourceBreaking { unknown_ordinal }
4830                }
4831            }
4832        }
4833    }
4834
4835    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::ElementInfoProviderError>
4836        for crate::ElementInfoProviderError
4837    {
4838        fn compat_from(value: ::fidl_fuchsia_power_broker::ElementInfoProviderError) -> Self {
4839            match value {
4840                ::fidl_fuchsia_power_broker::ElementInfoProviderError::Unknown => Self::Unknown,
4841
4842                ::fidl_fuchsia_power_broker::ElementInfoProviderError::Failed => Self::Failed,
4843
4844                ::fidl_fuchsia_power_broker::ElementInfoProviderError::__SourceBreaking {
4845                    unknown_ordinal: value,
4846                } => Self::UnknownOrdinal_(value),
4847            }
4848        }
4849    }
4850
4851    impl ::fidl_next::CompatFrom<crate::ElementRunnerSetLevelRequest>
4852        for ::fidl_fuchsia_power_broker::ElementRunnerSetLevelRequest
4853    {
4854        #[inline]
4855        fn compat_from(value: crate::ElementRunnerSetLevelRequest) -> Self {
4856            Self { level: ::fidl_next::CompatFrom::compat_from(value.level) }
4857        }
4858    }
4859
4860    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::ElementRunnerSetLevelRequest>
4861        for crate::ElementRunnerSetLevelRequest
4862    {
4863        #[inline]
4864        fn compat_from(value: ::fidl_fuchsia_power_broker::ElementRunnerSetLevelRequest) -> Self {
4865            Self { level: ::fidl_next::CompatFrom::compat_from(value.level) }
4866        }
4867    }
4868
4869    #[cfg(target_os = "fuchsia")]
4870    /// An alias for a client over `zx::Channel` for the `ElementRunner`
4871    /// protocol.
4872    pub type ElementRunnerProxy = ::fidl_next::Client<crate::ElementRunner>;
4873
4874    impl ::fidl_next::CompatFrom<crate::ElementRunner>
4875        for ::fidl_fuchsia_power_broker::ElementRunnerMarker
4876    {
4877        fn compat_from(_: crate::ElementRunner) -> Self {
4878            Self
4879        }
4880    }
4881
4882    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::ElementRunnerMarker>
4883        for crate::ElementRunner
4884    {
4885        fn compat_from(_: ::fidl_fuchsia_power_broker::ElementRunnerMarker) -> Self {
4886            Self
4887        }
4888    }
4889
4890    #[cfg(target_os = "fuchsia")]
4891
4892    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_power_broker::ElementRunnerProxy>
4893        for crate::ElementRunner
4894    {
4895        fn client_compat_from(
4896            proxy: ::fidl_fuchsia_power_broker::ElementRunnerProxy,
4897        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
4898            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
4899            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
4900            ::fidl_next::ClientDispatcher::new(client_end)
4901        }
4902    }
4903
4904    impl ::fidl_next::CompatFrom<crate::LeaseStatus> for ::fidl_fuchsia_power_broker::LeaseStatus {
4905        fn compat_from(value: crate::LeaseStatus) -> Self {
4906            match value {
4907                crate::LeaseStatus::Unknown => Self::Unknown,
4908
4909                crate::LeaseStatus::Pending => Self::Pending,
4910
4911                crate::LeaseStatus::Satisfied => Self::Satisfied,
4912
4913                crate::LeaseStatus::UnknownOrdinal_(unknown_ordinal) => {
4914                    Self::__SourceBreaking { unknown_ordinal }
4915                }
4916            }
4917        }
4918    }
4919
4920    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::LeaseStatus> for crate::LeaseStatus {
4921        fn compat_from(value: ::fidl_fuchsia_power_broker::LeaseStatus) -> Self {
4922            match value {
4923                ::fidl_fuchsia_power_broker::LeaseStatus::Unknown => Self::Unknown,
4924
4925                ::fidl_fuchsia_power_broker::LeaseStatus::Pending => Self::Pending,
4926
4927                ::fidl_fuchsia_power_broker::LeaseStatus::Satisfied => Self::Satisfied,
4928
4929                ::fidl_fuchsia_power_broker::LeaseStatus::__SourceBreaking {
4930                    unknown_ordinal: value,
4931                } => Self::UnknownOrdinal_(value),
4932            }
4933        }
4934    }
4935
4936    impl ::fidl_next::CompatFrom<crate::LeaseControlWatchStatusRequest>
4937        for ::fidl_fuchsia_power_broker::LeaseControlWatchStatusRequest
4938    {
4939        #[inline]
4940        fn compat_from(value: crate::LeaseControlWatchStatusRequest) -> Self {
4941            Self { last_status: ::fidl_next::CompatFrom::compat_from(value.last_status) }
4942        }
4943    }
4944
4945    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::LeaseControlWatchStatusRequest>
4946        for crate::LeaseControlWatchStatusRequest
4947    {
4948        #[inline]
4949        fn compat_from(value: ::fidl_fuchsia_power_broker::LeaseControlWatchStatusRequest) -> Self {
4950            Self { last_status: ::fidl_next::CompatFrom::compat_from(value.last_status) }
4951        }
4952    }
4953
4954    impl ::fidl_next::CompatFrom<crate::LeaseControlWatchStatusResponse>
4955        for ::fidl_fuchsia_power_broker::LeaseControlWatchStatusResponse
4956    {
4957        #[inline]
4958        fn compat_from(value: crate::LeaseControlWatchStatusResponse) -> Self {
4959            Self { status: ::fidl_next::CompatFrom::compat_from(value.status) }
4960        }
4961    }
4962
4963    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::LeaseControlWatchStatusResponse>
4964        for crate::LeaseControlWatchStatusResponse
4965    {
4966        #[inline]
4967        fn compat_from(
4968            value: ::fidl_fuchsia_power_broker::LeaseControlWatchStatusResponse,
4969        ) -> Self {
4970            Self { status: ::fidl_next::CompatFrom::compat_from(value.status) }
4971        }
4972    }
4973
4974    #[cfg(target_os = "fuchsia")]
4975    /// An alias for a client over `zx::Channel` for the `LeaseControl`
4976    /// protocol.
4977    pub type LeaseControlProxy = ::fidl_next::Client<crate::LeaseControl>;
4978
4979    impl ::fidl_next::CompatFrom<crate::LeaseControl>
4980        for ::fidl_fuchsia_power_broker::LeaseControlMarker
4981    {
4982        fn compat_from(_: crate::LeaseControl) -> Self {
4983            Self
4984        }
4985    }
4986
4987    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::LeaseControlMarker>
4988        for crate::LeaseControl
4989    {
4990        fn compat_from(_: ::fidl_fuchsia_power_broker::LeaseControlMarker) -> Self {
4991            Self
4992        }
4993    }
4994
4995    #[cfg(target_os = "fuchsia")]
4996
4997    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_power_broker::LeaseControlProxy>
4998        for crate::LeaseControl
4999    {
5000        fn client_compat_from(
5001            proxy: ::fidl_fuchsia_power_broker::LeaseControlProxy,
5002        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
5003            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
5004            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
5005            ::fidl_next::ClientDispatcher::new(client_end)
5006        }
5007    }
5008
5009    impl ::fidl_next::CompatFrom<crate::LeaseError> for ::fidl_fuchsia_power_broker::LeaseError {
5010        fn compat_from(value: crate::LeaseError) -> Self {
5011            match value {
5012                crate::LeaseError::Internal => Self::Internal,
5013
5014                crate::LeaseError::NotAuthorized => Self::NotAuthorized,
5015
5016                crate::LeaseError::InvalidLevel => Self::InvalidLevel,
5017
5018                crate::LeaseError::InvalidArgument => Self::InvalidArgument,
5019
5020                crate::LeaseError::UnknownOrdinal_(unknown_ordinal) => {
5021                    Self::__SourceBreaking { unknown_ordinal }
5022                }
5023            }
5024        }
5025    }
5026
5027    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::LeaseError> for crate::LeaseError {
5028        fn compat_from(value: ::fidl_fuchsia_power_broker::LeaseError) -> Self {
5029            match value {
5030                ::fidl_fuchsia_power_broker::LeaseError::Internal => Self::Internal,
5031
5032                ::fidl_fuchsia_power_broker::LeaseError::NotAuthorized => Self::NotAuthorized,
5033
5034                ::fidl_fuchsia_power_broker::LeaseError::InvalidLevel => Self::InvalidLevel,
5035
5036                ::fidl_fuchsia_power_broker::LeaseError::InvalidArgument => Self::InvalidArgument,
5037
5038                ::fidl_fuchsia_power_broker::LeaseError::__SourceBreaking {
5039                    unknown_ordinal: value,
5040                } => Self::UnknownOrdinal_(value),
5041            }
5042        }
5043    }
5044
5045    impl ::fidl_next::CompatFrom<crate::ModifyDependencyError>
5046        for ::fidl_fuchsia_power_broker::ModifyDependencyError
5047    {
5048        fn compat_from(value: crate::ModifyDependencyError) -> Self {
5049            match value {
5050                crate::ModifyDependencyError::AlreadyExists => Self::AlreadyExists,
5051
5052                crate::ModifyDependencyError::Invalid => Self::Invalid,
5053
5054                crate::ModifyDependencyError::NotAuthorized => Self::NotAuthorized,
5055
5056                crate::ModifyDependencyError::NotFound => Self::NotFound,
5057
5058                crate::ModifyDependencyError::UnknownOrdinal_(unknown_ordinal) => {
5059                    Self::__SourceBreaking { unknown_ordinal }
5060                }
5061            }
5062        }
5063    }
5064
5065    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::ModifyDependencyError>
5066        for crate::ModifyDependencyError
5067    {
5068        fn compat_from(value: ::fidl_fuchsia_power_broker::ModifyDependencyError) -> Self {
5069            match value {
5070                ::fidl_fuchsia_power_broker::ModifyDependencyError::AlreadyExists => {
5071                    Self::AlreadyExists
5072                }
5073
5074                ::fidl_fuchsia_power_broker::ModifyDependencyError::Invalid => Self::Invalid,
5075
5076                ::fidl_fuchsia_power_broker::ModifyDependencyError::NotAuthorized => {
5077                    Self::NotAuthorized
5078                }
5079
5080                ::fidl_fuchsia_power_broker::ModifyDependencyError::NotFound => Self::NotFound,
5081
5082                ::fidl_fuchsia_power_broker::ModifyDependencyError::__SourceBreaking {
5083                    unknown_ordinal: value,
5084                } => Self::UnknownOrdinal_(value),
5085            }
5086        }
5087    }
5088
5089    impl ::fidl_next::CompatFrom<crate::Permissions> for ::fidl_fuchsia_power_broker::Permissions {
5090        fn compat_from(value: crate::Permissions) -> Self {
5091            Self::from_bits_retain(value.bits())
5092        }
5093    }
5094
5095    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::Permissions> for crate::Permissions {
5096        fn compat_from(value: ::fidl_fuchsia_power_broker::Permissions) -> Self {
5097            Self::from_bits_retain(value.bits())
5098        }
5099    }
5100
5101    impl ::fidl_next::CompatFrom<crate::StatusError> for ::fidl_fuchsia_power_broker::StatusError {
5102        fn compat_from(value: crate::StatusError) -> Self {
5103            match value {
5104                crate::StatusError::Unknown => Self::Unknown,
5105
5106                crate::StatusError::UnknownOrdinal_(unknown_ordinal) => {
5107                    Self::__SourceBreaking { unknown_ordinal }
5108                }
5109            }
5110        }
5111    }
5112
5113    impl ::fidl_next::CompatFrom<::fidl_fuchsia_power_broker::StatusError> for crate::StatusError {
5114        fn compat_from(value: ::fidl_fuchsia_power_broker::StatusError) -> Self {
5115            match value {
5116                ::fidl_fuchsia_power_broker::StatusError::Unknown => Self::Unknown,
5117
5118                ::fidl_fuchsia_power_broker::StatusError::__SourceBreaking {
5119                    unknown_ordinal: value,
5120                } => Self::UnknownOrdinal_(value),
5121            }
5122        }
5123    }
5124}