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