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