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