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