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