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