Skip to main content

fidl_next_common_fuchsia_power_broker/
fidl_next_common_fuchsia_power_broker.rs

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