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