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 impl ::std::convert::From<AddElementError> for u32 {
26 fn from(value: AddElementError) -> Self {
27 match value {
28 AddElementError::Invalid => 1,
29 AddElementError::NotAuthorized => 2,
30
31 AddElementError::UnknownOrdinal_(value) => value,
32 }
33 }
34 }
35
36 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AddElementError, ___E> for AddElementError
37 where
38 ___E: ?Sized,
39 {
40 #[inline]
41 fn encode(
42 self,
43 encoder: &mut ___E,
44 out: &mut ::core::mem::MaybeUninit<crate::wire::AddElementError>,
45 _: (),
46 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
47 ::fidl_next::Encode::encode(&self, encoder, out, ())
48 }
49 }
50
51 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AddElementError, ___E>
52 for &'a AddElementError
53 where
54 ___E: ?Sized,
55 {
56 #[inline]
57 fn encode(
58 self,
59 encoder: &mut ___E,
60 out: &mut ::core::mem::MaybeUninit<crate::wire::AddElementError>,
61 _: (),
62 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
63 ::fidl_next::munge!(let crate::wire::AddElementError { value } = out);
64 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
65 AddElementError::Invalid => 1,
66
67 AddElementError::NotAuthorized => 2,
68
69 AddElementError::UnknownOrdinal_(value) => value,
70 }));
71
72 Ok(())
73 }
74 }
75
76 impl ::core::convert::From<crate::wire::AddElementError> for AddElementError {
77 fn from(wire: crate::wire::AddElementError) -> Self {
78 match u32::from(wire.value) {
79 1 => Self::Invalid,
80
81 2 => Self::NotAuthorized,
82
83 value => Self::UnknownOrdinal_(value),
84 }
85 }
86 }
87
88 impl ::fidl_next::FromWire<crate::wire::AddElementError> for AddElementError {
89 #[inline]
90 fn from_wire(wire: crate::wire::AddElementError) -> Self {
91 Self::from(wire)
92 }
93 }
94
95 impl ::fidl_next::FromWireRef<crate::wire::AddElementError> for AddElementError {
96 #[inline]
97 fn from_wire_ref(wire: &crate::wire::AddElementError) -> Self {
98 Self::from(*wire)
99 }
100 }
101
102 #[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"]
103 pub type PowerLevel = u8;
104
105 #[doc = " BinaryPowerLevel is a well-known set of PowerLevels with only two\n states: OFF and ON.\n"]
106 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
107 #[repr(u8)]
108 pub enum BinaryPowerLevel {
109 Off = 0,
110 On = 1,
111 }
112 impl ::core::convert::TryFrom<u8> for BinaryPowerLevel {
113 type Error = ::fidl_next::UnknownStrictEnumMemberError;
114 fn try_from(
115 value: u8,
116 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
117 match value {
118 0 => Ok(Self::Off),
119 1 => Ok(Self::On),
120
121 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
122 }
123 }
124 }
125
126 impl ::std::convert::From<BinaryPowerLevel> for u8 {
127 fn from(value: BinaryPowerLevel) -> Self {
128 match value {
129 BinaryPowerLevel::Off => 0,
130 BinaryPowerLevel::On => 1,
131 }
132 }
133 }
134
135 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BinaryPowerLevel, ___E> for BinaryPowerLevel
136 where
137 ___E: ?Sized,
138 {
139 #[inline]
140 fn encode(
141 self,
142 encoder: &mut ___E,
143 out: &mut ::core::mem::MaybeUninit<crate::wire::BinaryPowerLevel>,
144 _: (),
145 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
146 ::fidl_next::Encode::encode(&self, encoder, out, ())
147 }
148 }
149
150 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BinaryPowerLevel, ___E>
151 for &'a BinaryPowerLevel
152 where
153 ___E: ?Sized,
154 {
155 #[inline]
156 fn encode(
157 self,
158 encoder: &mut ___E,
159 out: &mut ::core::mem::MaybeUninit<crate::wire::BinaryPowerLevel>,
160 _: (),
161 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
162 ::fidl_next::munge!(let crate::wire::BinaryPowerLevel { value } = out);
163 let _ = value.write(u8::from(match *self {
164 BinaryPowerLevel::Off => 0,
165
166 BinaryPowerLevel::On => 1,
167 }));
168
169 Ok(())
170 }
171 }
172
173 impl ::core::convert::From<crate::wire::BinaryPowerLevel> for BinaryPowerLevel {
174 fn from(wire: crate::wire::BinaryPowerLevel) -> Self {
175 match u8::from(wire.value) {
176 0 => Self::Off,
177
178 1 => Self::On,
179
180 _ => unsafe { ::core::hint::unreachable_unchecked() },
181 }
182 }
183 }
184
185 impl ::fidl_next::FromWire<crate::wire::BinaryPowerLevel> for BinaryPowerLevel {
186 #[inline]
187 fn from_wire(wire: crate::wire::BinaryPowerLevel) -> Self {
188 Self::from(wire)
189 }
190 }
191
192 impl ::fidl_next::FromWireRef<crate::wire::BinaryPowerLevel> for BinaryPowerLevel {
193 #[inline]
194 fn from_wire_ref(wire: &crate::wire::BinaryPowerLevel) -> Self {
195 Self::from(*wire)
196 }
197 }
198
199 pub type ElementControlRegisterDependencyTokenResponse = ();
200
201 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
202 #[repr(u32)]
203 pub enum RegisterDependencyTokenError {
204 AlreadyInUse = 1,
205 Internal = 2,
206 UnknownOrdinal_(u32) = 3,
207 }
208 impl ::std::convert::From<u32> for RegisterDependencyTokenError {
209 fn from(value: u32) -> Self {
210 match value {
211 1 => Self::AlreadyInUse,
212 2 => Self::Internal,
213
214 _ => Self::UnknownOrdinal_(value),
215 }
216 }
217 }
218
219 impl ::std::convert::From<RegisterDependencyTokenError> for u32 {
220 fn from(value: RegisterDependencyTokenError) -> Self {
221 match value {
222 RegisterDependencyTokenError::AlreadyInUse => 1,
223 RegisterDependencyTokenError::Internal => 2,
224
225 RegisterDependencyTokenError::UnknownOrdinal_(value) => value,
226 }
227 }
228 }
229
230 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RegisterDependencyTokenError, ___E>
231 for RegisterDependencyTokenError
232 where
233 ___E: ?Sized,
234 {
235 #[inline]
236 fn encode(
237 self,
238 encoder: &mut ___E,
239 out: &mut ::core::mem::MaybeUninit<crate::wire::RegisterDependencyTokenError>,
240 _: (),
241 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
242 ::fidl_next::Encode::encode(&self, encoder, out, ())
243 }
244 }
245
246 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RegisterDependencyTokenError, ___E>
247 for &'a RegisterDependencyTokenError
248 where
249 ___E: ?Sized,
250 {
251 #[inline]
252 fn encode(
253 self,
254 encoder: &mut ___E,
255 out: &mut ::core::mem::MaybeUninit<crate::wire::RegisterDependencyTokenError>,
256 _: (),
257 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
258 ::fidl_next::munge!(let crate::wire::RegisterDependencyTokenError { value } = out);
259 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
260 RegisterDependencyTokenError::AlreadyInUse => 1,
261
262 RegisterDependencyTokenError::Internal => 2,
263
264 RegisterDependencyTokenError::UnknownOrdinal_(value) => value,
265 }));
266
267 Ok(())
268 }
269 }
270
271 impl ::core::convert::From<crate::wire::RegisterDependencyTokenError>
272 for RegisterDependencyTokenError
273 {
274 fn from(wire: crate::wire::RegisterDependencyTokenError) -> Self {
275 match u32::from(wire.value) {
276 1 => Self::AlreadyInUse,
277
278 2 => Self::Internal,
279
280 value => Self::UnknownOrdinal_(value),
281 }
282 }
283 }
284
285 impl ::fidl_next::FromWire<crate::wire::RegisterDependencyTokenError>
286 for RegisterDependencyTokenError
287 {
288 #[inline]
289 fn from_wire(wire: crate::wire::RegisterDependencyTokenError) -> Self {
290 Self::from(wire)
291 }
292 }
293
294 impl ::fidl_next::FromWireRef<crate::wire::RegisterDependencyTokenError>
295 for RegisterDependencyTokenError
296 {
297 #[inline]
298 fn from_wire_ref(wire: &crate::wire::RegisterDependencyTokenError) -> Self {
299 Self::from(*wire)
300 }
301 }
302
303 pub type ElementControlUnregisterDependencyTokenResponse = ();
304
305 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
306 #[repr(u32)]
307 pub enum UnregisterDependencyTokenError {
308 NotAuthorized = 1,
309 NotFound = 2,
310 UnknownOrdinal_(u32) = 3,
311 }
312 impl ::std::convert::From<u32> for UnregisterDependencyTokenError {
313 fn from(value: u32) -> Self {
314 match value {
315 1 => Self::NotAuthorized,
316 2 => Self::NotFound,
317
318 _ => Self::UnknownOrdinal_(value),
319 }
320 }
321 }
322
323 impl ::std::convert::From<UnregisterDependencyTokenError> for u32 {
324 fn from(value: UnregisterDependencyTokenError) -> Self {
325 match value {
326 UnregisterDependencyTokenError::NotAuthorized => 1,
327 UnregisterDependencyTokenError::NotFound => 2,
328
329 UnregisterDependencyTokenError::UnknownOrdinal_(value) => value,
330 }
331 }
332 }
333
334 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UnregisterDependencyTokenError, ___E>
335 for UnregisterDependencyTokenError
336 where
337 ___E: ?Sized,
338 {
339 #[inline]
340 fn encode(
341 self,
342 encoder: &mut ___E,
343 out: &mut ::core::mem::MaybeUninit<crate::wire::UnregisterDependencyTokenError>,
344 _: (),
345 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
346 ::fidl_next::Encode::encode(&self, encoder, out, ())
347 }
348 }
349
350 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UnregisterDependencyTokenError, ___E>
351 for &'a UnregisterDependencyTokenError
352 where
353 ___E: ?Sized,
354 {
355 #[inline]
356 fn encode(
357 self,
358 encoder: &mut ___E,
359 out: &mut ::core::mem::MaybeUninit<crate::wire::UnregisterDependencyTokenError>,
360 _: (),
361 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
362 ::fidl_next::munge!(let crate::wire::UnregisterDependencyTokenError { value } = out);
363 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
364 UnregisterDependencyTokenError::NotAuthorized => 1,
365
366 UnregisterDependencyTokenError::NotFound => 2,
367
368 UnregisterDependencyTokenError::UnknownOrdinal_(value) => value,
369 }));
370
371 Ok(())
372 }
373 }
374
375 impl ::core::convert::From<crate::wire::UnregisterDependencyTokenError>
376 for UnregisterDependencyTokenError
377 {
378 fn from(wire: crate::wire::UnregisterDependencyTokenError) -> Self {
379 match u32::from(wire.value) {
380 1 => Self::NotAuthorized,
381
382 2 => Self::NotFound,
383
384 value => Self::UnknownOrdinal_(value),
385 }
386 }
387 }
388
389 impl ::fidl_next::FromWire<crate::wire::UnregisterDependencyTokenError>
390 for UnregisterDependencyTokenError
391 {
392 #[inline]
393 fn from_wire(wire: crate::wire::UnregisterDependencyTokenError) -> Self {
394 Self::from(wire)
395 }
396 }
397
398 impl ::fidl_next::FromWireRef<crate::wire::UnregisterDependencyTokenError>
399 for UnregisterDependencyTokenError
400 {
401 #[inline]
402 fn from_wire_ref(wire: &crate::wire::UnregisterDependencyTokenError) -> Self {
403 Self::from(*wire)
404 }
405 }
406
407 pub type ElementControlAddDependencyResponse = ();
408
409 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
410 #[repr(u32)]
411 pub enum ModifyDependencyError {
412 AlreadyExists = 1,
413 Invalid = 2,
414 NotAuthorized = 3,
415 NotFound = 4,
416 UnknownOrdinal_(u32) = 5,
417 }
418 impl ::std::convert::From<u32> for ModifyDependencyError {
419 fn from(value: u32) -> Self {
420 match value {
421 1 => Self::AlreadyExists,
422 2 => Self::Invalid,
423 3 => Self::NotAuthorized,
424 4 => Self::NotFound,
425
426 _ => Self::UnknownOrdinal_(value),
427 }
428 }
429 }
430
431 impl ::std::convert::From<ModifyDependencyError> for u32 {
432 fn from(value: ModifyDependencyError) -> Self {
433 match value {
434 ModifyDependencyError::AlreadyExists => 1,
435 ModifyDependencyError::Invalid => 2,
436 ModifyDependencyError::NotAuthorized => 3,
437 ModifyDependencyError::NotFound => 4,
438
439 ModifyDependencyError::UnknownOrdinal_(value) => value,
440 }
441 }
442 }
443
444 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ModifyDependencyError, ___E>
445 for ModifyDependencyError
446 where
447 ___E: ?Sized,
448 {
449 #[inline]
450 fn encode(
451 self,
452 encoder: &mut ___E,
453 out: &mut ::core::mem::MaybeUninit<crate::wire::ModifyDependencyError>,
454 _: (),
455 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
456 ::fidl_next::Encode::encode(&self, encoder, out, ())
457 }
458 }
459
460 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ModifyDependencyError, ___E>
461 for &'a ModifyDependencyError
462 where
463 ___E: ?Sized,
464 {
465 #[inline]
466 fn encode(
467 self,
468 encoder: &mut ___E,
469 out: &mut ::core::mem::MaybeUninit<crate::wire::ModifyDependencyError>,
470 _: (),
471 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
472 ::fidl_next::munge!(let crate::wire::ModifyDependencyError { value } = out);
473 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
474 ModifyDependencyError::AlreadyExists => 1,
475
476 ModifyDependencyError::Invalid => 2,
477
478 ModifyDependencyError::NotAuthorized => 3,
479
480 ModifyDependencyError::NotFound => 4,
481
482 ModifyDependencyError::UnknownOrdinal_(value) => value,
483 }));
484
485 Ok(())
486 }
487 }
488
489 impl ::core::convert::From<crate::wire::ModifyDependencyError> for ModifyDependencyError {
490 fn from(wire: crate::wire::ModifyDependencyError) -> Self {
491 match u32::from(wire.value) {
492 1 => Self::AlreadyExists,
493
494 2 => Self::Invalid,
495
496 3 => Self::NotAuthorized,
497
498 4 => Self::NotFound,
499
500 value => Self::UnknownOrdinal_(value),
501 }
502 }
503 }
504
505 impl ::fidl_next::FromWire<crate::wire::ModifyDependencyError> for ModifyDependencyError {
506 #[inline]
507 fn from_wire(wire: crate::wire::ModifyDependencyError) -> Self {
508 Self::from(wire)
509 }
510 }
511
512 impl ::fidl_next::FromWireRef<crate::wire::ModifyDependencyError> for ModifyDependencyError {
513 #[inline]
514 fn from_wire_ref(wire: &crate::wire::ModifyDependencyError) -> Self {
515 Self::from(*wire)
516 }
517 }
518
519 #[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"]
520 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
521 pub struct PowerLevelName {
522 pub level: ::core::option::Option<u8>,
523
524 pub name: ::core::option::Option<::std::string::String>,
525 }
526
527 impl PowerLevelName {
528 fn __max_ordinal(&self) -> usize {
529 if self.name.is_some() {
530 return 2;
531 }
532
533 if self.level.is_some() {
534 return 1;
535 }
536
537 0
538 }
539 }
540
541 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerLevelName<'static>, ___E> for PowerLevelName
542 where
543 ___E: ::fidl_next::Encoder + ?Sized,
544 {
545 #[inline]
546 fn encode(
547 mut self,
548 encoder: &mut ___E,
549 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerLevelName<'static>>,
550 _: (),
551 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
552 ::fidl_next::munge!(let crate::wire::PowerLevelName { table } = out);
553
554 let max_ord = self.__max_ordinal();
555
556 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
557 ::fidl_next::Wire::zero_padding(&mut out);
558
559 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
560 ::fidl_next::wire::Envelope,
561 >(encoder, max_ord);
562
563 for i in 1..=max_ord {
564 match i {
565 2 => {
566 if let Some(value) = self.name.take() {
567 ::fidl_next::wire::Envelope::encode_value::<
568 ::fidl_next::wire::String<'static>,
569 ___E,
570 >(
571 value, preallocated.encoder, &mut out, 16
572 )?;
573 } else {
574 ::fidl_next::wire::Envelope::encode_zero(&mut out)
575 }
576 }
577
578 1 => {
579 if let Some(value) = self.level.take() {
580 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
581 value,
582 preallocated.encoder,
583 &mut out,
584 (),
585 )?;
586 } else {
587 ::fidl_next::wire::Envelope::encode_zero(&mut out)
588 }
589 }
590
591 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
592 }
593 unsafe {
594 preallocated.write_next(out.assume_init_ref());
595 }
596 }
597
598 ::fidl_next::wire::Table::encode_len(table, max_ord);
599
600 Ok(())
601 }
602 }
603
604 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PowerLevelName<'static>, ___E>
605 for &'a PowerLevelName
606 where
607 ___E: ::fidl_next::Encoder + ?Sized,
608 {
609 #[inline]
610 fn encode(
611 self,
612 encoder: &mut ___E,
613 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerLevelName<'static>>,
614 _: (),
615 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
616 ::fidl_next::munge!(let crate::wire::PowerLevelName { table } = out);
617
618 let max_ord = self.__max_ordinal();
619
620 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
621 ::fidl_next::Wire::zero_padding(&mut out);
622
623 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
624 ::fidl_next::wire::Envelope,
625 >(encoder, max_ord);
626
627 for i in 1..=max_ord {
628 match i {
629 2 => {
630 if let Some(value) = &self.name {
631 ::fidl_next::wire::Envelope::encode_value::<
632 ::fidl_next::wire::String<'static>,
633 ___E,
634 >(
635 value, preallocated.encoder, &mut out, 16
636 )?;
637 } else {
638 ::fidl_next::wire::Envelope::encode_zero(&mut out)
639 }
640 }
641
642 1 => {
643 if let Some(value) = &self.level {
644 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
645 value,
646 preallocated.encoder,
647 &mut out,
648 (),
649 )?;
650 } else {
651 ::fidl_next::wire::Envelope::encode_zero(&mut out)
652 }
653 }
654
655 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
656 }
657 unsafe {
658 preallocated.write_next(out.assume_init_ref());
659 }
660 }
661
662 ::fidl_next::wire::Table::encode_len(table, max_ord);
663
664 Ok(())
665 }
666 }
667
668 impl<'de> ::fidl_next::FromWire<crate::wire::PowerLevelName<'de>> for PowerLevelName {
669 #[inline]
670 fn from_wire(wire_: crate::wire::PowerLevelName<'de>) -> Self {
671 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
672
673 let level = wire_.table.get(1);
674
675 let name = wire_.table.get(2);
676
677 Self {
678 level: level.map(|envelope| {
679 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
680 }),
681
682 name: name.map(|envelope| {
683 ::fidl_next::FromWire::from_wire(unsafe {
684 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
685 })
686 }),
687 }
688 }
689 }
690
691 impl<'de> ::fidl_next::FromWireRef<crate::wire::PowerLevelName<'de>> for PowerLevelName {
692 #[inline]
693 fn from_wire_ref(wire: &crate::wire::PowerLevelName<'de>) -> Self {
694 Self {
695 level: wire.table.get(1).map(|envelope| {
696 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
697 envelope.deref_unchecked::<u8>()
698 })
699 }),
700
701 name: wire.table.get(2).map(|envelope| {
702 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
703 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
704 })
705 }),
706 }
707 }
708 }
709
710 #[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"]
711 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
712 pub struct ElementPowerLevelNames {
713 pub identifier: ::core::option::Option<::std::string::String>,
714
715 pub levels: ::core::option::Option<::std::vec::Vec<crate::natural::PowerLevelName>>,
716 }
717
718 impl ElementPowerLevelNames {
719 fn __max_ordinal(&self) -> usize {
720 if self.levels.is_some() {
721 return 2;
722 }
723
724 if self.identifier.is_some() {
725 return 1;
726 }
727
728 0
729 }
730 }
731
732 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ElementPowerLevelNames<'static>, ___E>
733 for ElementPowerLevelNames
734 where
735 ___E: ::fidl_next::Encoder + ?Sized,
736 {
737 #[inline]
738 fn encode(
739 mut self,
740 encoder: &mut ___E,
741 out: &mut ::core::mem::MaybeUninit<crate::wire::ElementPowerLevelNames<'static>>,
742 _: (),
743 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
744 ::fidl_next::munge!(let crate::wire::ElementPowerLevelNames { table } = out);
745
746 let max_ord = self.__max_ordinal();
747
748 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
749 ::fidl_next::Wire::zero_padding(&mut out);
750
751 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
752 ::fidl_next::wire::Envelope,
753 >(encoder, max_ord);
754
755 for i in 1..=max_ord {
756 match i {
757 2 => {
758 if let Some(value) = self.levels.take() {
759 ::fidl_next::wire::Envelope::encode_value::<
760 ::fidl_next::wire::Vector<
761 'static,
762 crate::wire::PowerLevelName<'static>,
763 >,
764 ___E,
765 >(
766 value, preallocated.encoder, &mut out, (256, ())
767 )?;
768 } else {
769 ::fidl_next::wire::Envelope::encode_zero(&mut out)
770 }
771 }
772
773 1 => {
774 if let Some(value) = self.identifier.take() {
775 ::fidl_next::wire::Envelope::encode_value::<
776 ::fidl_next::wire::String<'static>,
777 ___E,
778 >(
779 value, preallocated.encoder, &mut out, 64
780 )?;
781 } else {
782 ::fidl_next::wire::Envelope::encode_zero(&mut out)
783 }
784 }
785
786 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
787 }
788 unsafe {
789 preallocated.write_next(out.assume_init_ref());
790 }
791 }
792
793 ::fidl_next::wire::Table::encode_len(table, max_ord);
794
795 Ok(())
796 }
797 }
798
799 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ElementPowerLevelNames<'static>, ___E>
800 for &'a ElementPowerLevelNames
801 where
802 ___E: ::fidl_next::Encoder + ?Sized,
803 {
804 #[inline]
805 fn encode(
806 self,
807 encoder: &mut ___E,
808 out: &mut ::core::mem::MaybeUninit<crate::wire::ElementPowerLevelNames<'static>>,
809 _: (),
810 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
811 ::fidl_next::munge!(let crate::wire::ElementPowerLevelNames { table } = out);
812
813 let max_ord = self.__max_ordinal();
814
815 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
816 ::fidl_next::Wire::zero_padding(&mut out);
817
818 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
819 ::fidl_next::wire::Envelope,
820 >(encoder, max_ord);
821
822 for i in 1..=max_ord {
823 match i {
824 2 => {
825 if let Some(value) = &self.levels {
826 ::fidl_next::wire::Envelope::encode_value::<
827 ::fidl_next::wire::Vector<
828 'static,
829 crate::wire::PowerLevelName<'static>,
830 >,
831 ___E,
832 >(
833 value, preallocated.encoder, &mut out, (256, ())
834 )?;
835 } else {
836 ::fidl_next::wire::Envelope::encode_zero(&mut out)
837 }
838 }
839
840 1 => {
841 if let Some(value) = &self.identifier {
842 ::fidl_next::wire::Envelope::encode_value::<
843 ::fidl_next::wire::String<'static>,
844 ___E,
845 >(
846 value, preallocated.encoder, &mut out, 64
847 )?;
848 } else {
849 ::fidl_next::wire::Envelope::encode_zero(&mut out)
850 }
851 }
852
853 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
854 }
855 unsafe {
856 preallocated.write_next(out.assume_init_ref());
857 }
858 }
859
860 ::fidl_next::wire::Table::encode_len(table, max_ord);
861
862 Ok(())
863 }
864 }
865
866 impl<'de> ::fidl_next::FromWire<crate::wire::ElementPowerLevelNames<'de>>
867 for ElementPowerLevelNames
868 {
869 #[inline]
870 fn from_wire(wire_: crate::wire::ElementPowerLevelNames<'de>) -> Self {
871 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
872
873 let identifier = wire_.table.get(1);
874
875 let levels = wire_.table.get(2);
876
877 Self {
878
879
880 identifier: identifier.map(|envelope| ::fidl_next::FromWire::from_wire(
881 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
882 )),
883
884
885 levels: levels.map(|envelope| ::fidl_next::FromWire::from_wire(
886 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>() }
887 )),
888
889 }
890 }
891 }
892
893 impl<'de> ::fidl_next::FromWireRef<crate::wire::ElementPowerLevelNames<'de>>
894 for ElementPowerLevelNames
895 {
896 #[inline]
897 fn from_wire_ref(wire: &crate::wire::ElementPowerLevelNames<'de>) -> Self {
898 Self {
899
900
901 identifier: wire.table.get(1)
902 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
903 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
904 )),
905
906
907 levels: wire.table.get(2)
908 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
909 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>() }
910 )),
911
912 }
913 }
914 }
915
916 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
917 #[repr(u32)]
918 pub enum ElementInfoProviderError {
919 Unknown = 0,
920 Failed = 1,
921 UnknownOrdinal_(u32) = 2,
922 }
923 impl ::std::convert::From<u32> for ElementInfoProviderError {
924 fn from(value: u32) -> Self {
925 match value {
926 0 => Self::Unknown,
927 1 => Self::Failed,
928
929 _ => Self::UnknownOrdinal_(value),
930 }
931 }
932 }
933
934 impl ::std::convert::From<ElementInfoProviderError> for u32 {
935 fn from(value: ElementInfoProviderError) -> Self {
936 match value {
937 ElementInfoProviderError::Unknown => 0,
938 ElementInfoProviderError::Failed => 1,
939
940 ElementInfoProviderError::UnknownOrdinal_(value) => value,
941 }
942 }
943 }
944
945 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ElementInfoProviderError, ___E>
946 for ElementInfoProviderError
947 where
948 ___E: ?Sized,
949 {
950 #[inline]
951 fn encode(
952 self,
953 encoder: &mut ___E,
954 out: &mut ::core::mem::MaybeUninit<crate::wire::ElementInfoProviderError>,
955 _: (),
956 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
957 ::fidl_next::Encode::encode(&self, encoder, out, ())
958 }
959 }
960
961 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ElementInfoProviderError, ___E>
962 for &'a ElementInfoProviderError
963 where
964 ___E: ?Sized,
965 {
966 #[inline]
967 fn encode(
968 self,
969 encoder: &mut ___E,
970 out: &mut ::core::mem::MaybeUninit<crate::wire::ElementInfoProviderError>,
971 _: (),
972 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
973 ::fidl_next::munge!(let crate::wire::ElementInfoProviderError { value } = out);
974 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
975 ElementInfoProviderError::Unknown => 0,
976
977 ElementInfoProviderError::Failed => 1,
978
979 ElementInfoProviderError::UnknownOrdinal_(value) => value,
980 }));
981
982 Ok(())
983 }
984 }
985
986 impl ::core::convert::From<crate::wire::ElementInfoProviderError> for ElementInfoProviderError {
987 fn from(wire: crate::wire::ElementInfoProviderError) -> Self {
988 match u32::from(wire.value) {
989 0 => Self::Unknown,
990
991 1 => Self::Failed,
992
993 value => Self::UnknownOrdinal_(value),
994 }
995 }
996 }
997
998 impl ::fidl_next::FromWire<crate::wire::ElementInfoProviderError> for ElementInfoProviderError {
999 #[inline]
1000 fn from_wire(wire: crate::wire::ElementInfoProviderError) -> Self {
1001 Self::from(wire)
1002 }
1003 }
1004
1005 impl ::fidl_next::FromWireRef<crate::wire::ElementInfoProviderError> for ElementInfoProviderError {
1006 #[inline]
1007 fn from_wire_ref(wire: &crate::wire::ElementInfoProviderError) -> Self {
1008 Self::from(*wire)
1009 }
1010 }
1011
1012 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1013 #[repr(C)]
1014 pub struct ElementRunnerSetLevelRequest {
1015 pub level: u8,
1016 }
1017
1018 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>
1019 for ElementRunnerSetLevelRequest
1020 where
1021 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1022 {
1023 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1024 Self,
1025 crate::wire::ElementRunnerSetLevelRequest,
1026 > = unsafe {
1027 ::fidl_next::CopyOptimization::enable_if(
1028 true && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(),
1029 )
1030 };
1031
1032 #[inline]
1033 fn encode(
1034 self,
1035 encoder_: &mut ___E,
1036 out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelRequest>,
1037 _: (),
1038 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1039 ::fidl_next::munge! {
1040 let crate::wire::ElementRunnerSetLevelRequest {
1041 level,
1042
1043 } = out_;
1044 }
1045
1046 ::fidl_next::Encode::encode(self.level, encoder_, level, ())?;
1047
1048 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(level.as_mut_ptr()) };
1049
1050 Ok(())
1051 }
1052 }
1053
1054 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>
1055 for &'a ElementRunnerSetLevelRequest
1056 where
1057 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1058 {
1059 #[inline]
1060 fn encode(
1061 self,
1062 encoder_: &mut ___E,
1063 out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelRequest>,
1064 _: (),
1065 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1066 ::fidl_next::munge! {
1067 let crate::wire::ElementRunnerSetLevelRequest {
1068 level,
1069
1070 } = out_;
1071 }
1072
1073 ::fidl_next::Encode::encode(&self.level, encoder_, level, ())?;
1074
1075 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(level.as_mut_ptr()) };
1076
1077 Ok(())
1078 }
1079 }
1080
1081 unsafe impl<___E>
1082 ::fidl_next::EncodeOption<
1083 ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1084 ___E,
1085 > for ElementRunnerSetLevelRequest
1086 where
1087 ___E: ::fidl_next::Encoder + ?Sized,
1088 ElementRunnerSetLevelRequest:
1089 ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>,
1090 {
1091 #[inline]
1092 fn encode_option(
1093 this: ::core::option::Option<Self>,
1094 encoder: &mut ___E,
1095 out: &mut ::core::mem::MaybeUninit<
1096 ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1097 >,
1098 _: (),
1099 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1100 if let Some(inner) = this {
1101 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1102 ::fidl_next::wire::Box::encode_present(out);
1103 } else {
1104 ::fidl_next::wire::Box::encode_absent(out);
1105 }
1106
1107 Ok(())
1108 }
1109 }
1110
1111 unsafe impl<'a, ___E>
1112 ::fidl_next::EncodeOption<
1113 ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1114 ___E,
1115 > for &'a ElementRunnerSetLevelRequest
1116 where
1117 ___E: ::fidl_next::Encoder + ?Sized,
1118 &'a ElementRunnerSetLevelRequest:
1119 ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>,
1120 {
1121 #[inline]
1122 fn encode_option(
1123 this: ::core::option::Option<Self>,
1124 encoder: &mut ___E,
1125 out: &mut ::core::mem::MaybeUninit<
1126 ::fidl_next::wire::Box<'static, crate::wire::ElementRunnerSetLevelRequest>,
1127 >,
1128 _: (),
1129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1130 if let Some(inner) = this {
1131 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1132 ::fidl_next::wire::Box::encode_present(out);
1133 } else {
1134 ::fidl_next::wire::Box::encode_absent(out);
1135 }
1136
1137 Ok(())
1138 }
1139 }
1140
1141 impl ::fidl_next::FromWire<crate::wire::ElementRunnerSetLevelRequest>
1142 for ElementRunnerSetLevelRequest
1143 {
1144 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1145 crate::wire::ElementRunnerSetLevelRequest,
1146 Self,
1147 > = unsafe {
1148 ::fidl_next::CopyOptimization::enable_if(
1149 true && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(),
1150 )
1151 };
1152
1153 #[inline]
1154 fn from_wire(wire: crate::wire::ElementRunnerSetLevelRequest) -> Self {
1155 Self { level: ::fidl_next::FromWire::from_wire(wire.level) }
1156 }
1157 }
1158
1159 impl ::fidl_next::FromWireRef<crate::wire::ElementRunnerSetLevelRequest>
1160 for ElementRunnerSetLevelRequest
1161 {
1162 #[inline]
1163 fn from_wire_ref(wire: &crate::wire::ElementRunnerSetLevelRequest) -> Self {
1164 Self { level: ::fidl_next::FromWireRef::from_wire_ref(&wire.level) }
1165 }
1166 }
1167
1168 pub type ElementRunnerSetLevelResponse = ();
1169
1170 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1171 #[repr(u32)]
1172 pub enum LeaseStatus {
1173 Unknown = 0,
1174 Pending = 1,
1175 Satisfied = 2,
1176 PoweringDown = 3,
1177 Vacated = 4,
1178 UnknownOrdinal_(u32) = 5,
1179 }
1180 impl ::std::convert::From<u32> for LeaseStatus {
1181 fn from(value: u32) -> Self {
1182 match value {
1183 0 => Self::Unknown,
1184 1 => Self::Pending,
1185 2 => Self::Satisfied,
1186 3 => Self::PoweringDown,
1187 4 => Self::Vacated,
1188
1189 _ => Self::UnknownOrdinal_(value),
1190 }
1191 }
1192 }
1193
1194 impl ::std::convert::From<LeaseStatus> for u32 {
1195 fn from(value: LeaseStatus) -> Self {
1196 match value {
1197 LeaseStatus::Unknown => 0,
1198 LeaseStatus::Pending => 1,
1199 LeaseStatus::Satisfied => 2,
1200 LeaseStatus::PoweringDown => 3,
1201 LeaseStatus::Vacated => 4,
1202
1203 LeaseStatus::UnknownOrdinal_(value) => value,
1204 }
1205 }
1206 }
1207
1208 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseStatus, ___E> for LeaseStatus
1209 where
1210 ___E: ?Sized,
1211 {
1212 #[inline]
1213 fn encode(
1214 self,
1215 encoder: &mut ___E,
1216 out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseStatus>,
1217 _: (),
1218 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1219 ::fidl_next::Encode::encode(&self, encoder, out, ())
1220 }
1221 }
1222
1223 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseStatus, ___E> for &'a LeaseStatus
1224 where
1225 ___E: ?Sized,
1226 {
1227 #[inline]
1228 fn encode(
1229 self,
1230 encoder: &mut ___E,
1231 out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseStatus>,
1232 _: (),
1233 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1234 ::fidl_next::munge!(let crate::wire::LeaseStatus { value } = out);
1235 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1236 LeaseStatus::Unknown => 0,
1237
1238 LeaseStatus::Pending => 1,
1239
1240 LeaseStatus::Satisfied => 2,
1241
1242 LeaseStatus::PoweringDown => 3,
1243
1244 LeaseStatus::Vacated => 4,
1245
1246 LeaseStatus::UnknownOrdinal_(value) => value,
1247 }));
1248
1249 Ok(())
1250 }
1251 }
1252
1253 impl ::core::convert::From<crate::wire::LeaseStatus> for LeaseStatus {
1254 fn from(wire: crate::wire::LeaseStatus) -> Self {
1255 match u32::from(wire.value) {
1256 0 => Self::Unknown,
1257
1258 1 => Self::Pending,
1259
1260 2 => Self::Satisfied,
1261
1262 3 => Self::PoweringDown,
1263
1264 4 => Self::Vacated,
1265
1266 value => Self::UnknownOrdinal_(value),
1267 }
1268 }
1269 }
1270
1271 impl ::fidl_next::FromWire<crate::wire::LeaseStatus> for LeaseStatus {
1272 #[inline]
1273 fn from_wire(wire: crate::wire::LeaseStatus) -> Self {
1274 Self::from(wire)
1275 }
1276 }
1277
1278 impl ::fidl_next::FromWireRef<crate::wire::LeaseStatus> for LeaseStatus {
1279 #[inline]
1280 fn from_wire_ref(wire: &crate::wire::LeaseStatus) -> Self {
1281 Self::from(*wire)
1282 }
1283 }
1284
1285 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1286 #[repr(C)]
1287 pub struct LeaseControlWatchStatusRequest {
1288 pub last_status: crate::natural::LeaseStatus,
1289 }
1290
1291 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>
1292 for LeaseControlWatchStatusRequest
1293 where
1294 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1295 {
1296 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1297 Self,
1298 crate::wire::LeaseControlWatchStatusRequest,
1299 > = unsafe {
1300 ::fidl_next::CopyOptimization::enable_if(
1301 true && <crate::natural::LeaseStatus as ::fidl_next::Encode<
1302 crate::wire::LeaseStatus,
1303 ___E,
1304 >>::COPY_OPTIMIZATION
1305 .is_enabled(),
1306 )
1307 };
1308
1309 #[inline]
1310 fn encode(
1311 self,
1312 encoder_: &mut ___E,
1313 out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusRequest>,
1314 _: (),
1315 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1316 ::fidl_next::munge! {
1317 let crate::wire::LeaseControlWatchStatusRequest {
1318 last_status,
1319
1320 } = out_;
1321 }
1322
1323 ::fidl_next::Encode::encode(self.last_status, encoder_, last_status, ())?;
1324
1325 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(last_status.as_mut_ptr()) };
1326
1327 Ok(())
1328 }
1329 }
1330
1331 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>
1332 for &'a LeaseControlWatchStatusRequest
1333 where
1334 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1335 {
1336 #[inline]
1337 fn encode(
1338 self,
1339 encoder_: &mut ___E,
1340 out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusRequest>,
1341 _: (),
1342 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1343 ::fidl_next::munge! {
1344 let crate::wire::LeaseControlWatchStatusRequest {
1345 last_status,
1346
1347 } = out_;
1348 }
1349
1350 ::fidl_next::Encode::encode(&self.last_status, encoder_, last_status, ())?;
1351
1352 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(last_status.as_mut_ptr()) };
1353
1354 Ok(())
1355 }
1356 }
1357
1358 unsafe impl<___E>
1359 ::fidl_next::EncodeOption<
1360 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1361 ___E,
1362 > for LeaseControlWatchStatusRequest
1363 where
1364 ___E: ::fidl_next::Encoder + ?Sized,
1365 LeaseControlWatchStatusRequest:
1366 ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>,
1367 {
1368 #[inline]
1369 fn encode_option(
1370 this: ::core::option::Option<Self>,
1371 encoder: &mut ___E,
1372 out: &mut ::core::mem::MaybeUninit<
1373 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1374 >,
1375 _: (),
1376 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1377 if let Some(inner) = this {
1378 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1379 ::fidl_next::wire::Box::encode_present(out);
1380 } else {
1381 ::fidl_next::wire::Box::encode_absent(out);
1382 }
1383
1384 Ok(())
1385 }
1386 }
1387
1388 unsafe impl<'a, ___E>
1389 ::fidl_next::EncodeOption<
1390 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1391 ___E,
1392 > for &'a LeaseControlWatchStatusRequest
1393 where
1394 ___E: ::fidl_next::Encoder + ?Sized,
1395 &'a LeaseControlWatchStatusRequest:
1396 ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>,
1397 {
1398 #[inline]
1399 fn encode_option(
1400 this: ::core::option::Option<Self>,
1401 encoder: &mut ___E,
1402 out: &mut ::core::mem::MaybeUninit<
1403 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusRequest>,
1404 >,
1405 _: (),
1406 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1407 if let Some(inner) = this {
1408 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1409 ::fidl_next::wire::Box::encode_present(out);
1410 } else {
1411 ::fidl_next::wire::Box::encode_absent(out);
1412 }
1413
1414 Ok(())
1415 }
1416 }
1417
1418 impl ::fidl_next::FromWire<crate::wire::LeaseControlWatchStatusRequest>
1419 for LeaseControlWatchStatusRequest
1420 {
1421 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1422 crate::wire::LeaseControlWatchStatusRequest,
1423 Self,
1424 > = unsafe {
1425 ::fidl_next::CopyOptimization::enable_if(
1426 true && <crate::natural::LeaseStatus as ::fidl_next::FromWire<
1427 crate::wire::LeaseStatus,
1428 >>::COPY_OPTIMIZATION
1429 .is_enabled(),
1430 )
1431 };
1432
1433 #[inline]
1434 fn from_wire(wire: crate::wire::LeaseControlWatchStatusRequest) -> Self {
1435 Self { last_status: ::fidl_next::FromWire::from_wire(wire.last_status) }
1436 }
1437 }
1438
1439 impl ::fidl_next::FromWireRef<crate::wire::LeaseControlWatchStatusRequest>
1440 for LeaseControlWatchStatusRequest
1441 {
1442 #[inline]
1443 fn from_wire_ref(wire: &crate::wire::LeaseControlWatchStatusRequest) -> Self {
1444 Self { last_status: ::fidl_next::FromWireRef::from_wire_ref(&wire.last_status) }
1445 }
1446 }
1447
1448 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1449 #[repr(C)]
1450 pub struct LeaseControlWatchStatusResponse {
1451 pub status: crate::natural::LeaseStatus,
1452 }
1453
1454 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>
1455 for LeaseControlWatchStatusResponse
1456 where
1457 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1458 {
1459 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1460 Self,
1461 crate::wire::LeaseControlWatchStatusResponse,
1462 > = unsafe {
1463 ::fidl_next::CopyOptimization::enable_if(
1464 true && <crate::natural::LeaseStatus as ::fidl_next::Encode<
1465 crate::wire::LeaseStatus,
1466 ___E,
1467 >>::COPY_OPTIMIZATION
1468 .is_enabled(),
1469 )
1470 };
1471
1472 #[inline]
1473 fn encode(
1474 self,
1475 encoder_: &mut ___E,
1476 out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusResponse>,
1477 _: (),
1478 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1479 ::fidl_next::munge! {
1480 let crate::wire::LeaseControlWatchStatusResponse {
1481 status,
1482
1483 } = out_;
1484 }
1485
1486 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
1487
1488 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1489
1490 Ok(())
1491 }
1492 }
1493
1494 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>
1495 for &'a LeaseControlWatchStatusResponse
1496 where
1497 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1498 {
1499 #[inline]
1500 fn encode(
1501 self,
1502 encoder_: &mut ___E,
1503 out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusResponse>,
1504 _: (),
1505 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1506 ::fidl_next::munge! {
1507 let crate::wire::LeaseControlWatchStatusResponse {
1508 status,
1509
1510 } = out_;
1511 }
1512
1513 ::fidl_next::Encode::encode(&self.status, encoder_, status, ())?;
1514
1515 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1516
1517 Ok(())
1518 }
1519 }
1520
1521 unsafe impl<___E>
1522 ::fidl_next::EncodeOption<
1523 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1524 ___E,
1525 > for LeaseControlWatchStatusResponse
1526 where
1527 ___E: ::fidl_next::Encoder + ?Sized,
1528 LeaseControlWatchStatusResponse:
1529 ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>,
1530 {
1531 #[inline]
1532 fn encode_option(
1533 this: ::core::option::Option<Self>,
1534 encoder: &mut ___E,
1535 out: &mut ::core::mem::MaybeUninit<
1536 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1537 >,
1538 _: (),
1539 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1540 if let Some(inner) = this {
1541 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1542 ::fidl_next::wire::Box::encode_present(out);
1543 } else {
1544 ::fidl_next::wire::Box::encode_absent(out);
1545 }
1546
1547 Ok(())
1548 }
1549 }
1550
1551 unsafe impl<'a, ___E>
1552 ::fidl_next::EncodeOption<
1553 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1554 ___E,
1555 > for &'a LeaseControlWatchStatusResponse
1556 where
1557 ___E: ::fidl_next::Encoder + ?Sized,
1558 &'a LeaseControlWatchStatusResponse:
1559 ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>,
1560 {
1561 #[inline]
1562 fn encode_option(
1563 this: ::core::option::Option<Self>,
1564 encoder: &mut ___E,
1565 out: &mut ::core::mem::MaybeUninit<
1566 ::fidl_next::wire::Box<'static, crate::wire::LeaseControlWatchStatusResponse>,
1567 >,
1568 _: (),
1569 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1570 if let Some(inner) = this {
1571 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1572 ::fidl_next::wire::Box::encode_present(out);
1573 } else {
1574 ::fidl_next::wire::Box::encode_absent(out);
1575 }
1576
1577 Ok(())
1578 }
1579 }
1580
1581 impl ::fidl_next::FromWire<crate::wire::LeaseControlWatchStatusResponse>
1582 for LeaseControlWatchStatusResponse
1583 {
1584 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1585 crate::wire::LeaseControlWatchStatusResponse,
1586 Self,
1587 > = unsafe {
1588 ::fidl_next::CopyOptimization::enable_if(
1589 true && <crate::natural::LeaseStatus as ::fidl_next::FromWire<
1590 crate::wire::LeaseStatus,
1591 >>::COPY_OPTIMIZATION
1592 .is_enabled(),
1593 )
1594 };
1595
1596 #[inline]
1597 fn from_wire(wire: crate::wire::LeaseControlWatchStatusResponse) -> Self {
1598 Self { status: ::fidl_next::FromWire::from_wire(wire.status) }
1599 }
1600 }
1601
1602 impl ::fidl_next::FromWireRef<crate::wire::LeaseControlWatchStatusResponse>
1603 for LeaseControlWatchStatusResponse
1604 {
1605 #[inline]
1606 fn from_wire_ref(wire: &crate::wire::LeaseControlWatchStatusResponse) -> Self {
1607 Self { status: ::fidl_next::FromWireRef::from_wire_ref(&wire.status) }
1608 }
1609 }
1610
1611 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1612 #[repr(u32)]
1613 pub enum LeaseError {
1614 Internal = 1,
1615 NotAuthorized = 2,
1616 InvalidLevel = 3,
1617 InvalidArgument = 4,
1618 UnknownOrdinal_(u32) = 5,
1619 }
1620 impl ::std::convert::From<u32> for LeaseError {
1621 fn from(value: u32) -> Self {
1622 match value {
1623 1 => Self::Internal,
1624 2 => Self::NotAuthorized,
1625 3 => Self::InvalidLevel,
1626 4 => Self::InvalidArgument,
1627
1628 _ => Self::UnknownOrdinal_(value),
1629 }
1630 }
1631 }
1632
1633 impl ::std::convert::From<LeaseError> for u32 {
1634 fn from(value: LeaseError) -> Self {
1635 match value {
1636 LeaseError::Internal => 1,
1637 LeaseError::NotAuthorized => 2,
1638 LeaseError::InvalidLevel => 3,
1639 LeaseError::InvalidArgument => 4,
1640
1641 LeaseError::UnknownOrdinal_(value) => value,
1642 }
1643 }
1644 }
1645
1646 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LeaseError, ___E> for LeaseError
1647 where
1648 ___E: ?Sized,
1649 {
1650 #[inline]
1651 fn encode(
1652 self,
1653 encoder: &mut ___E,
1654 out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseError>,
1655 _: (),
1656 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1657 ::fidl_next::Encode::encode(&self, encoder, out, ())
1658 }
1659 }
1660
1661 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LeaseError, ___E> for &'a LeaseError
1662 where
1663 ___E: ?Sized,
1664 {
1665 #[inline]
1666 fn encode(
1667 self,
1668 encoder: &mut ___E,
1669 out: &mut ::core::mem::MaybeUninit<crate::wire::LeaseError>,
1670 _: (),
1671 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1672 ::fidl_next::munge!(let crate::wire::LeaseError { value } = out);
1673 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1674 LeaseError::Internal => 1,
1675
1676 LeaseError::NotAuthorized => 2,
1677
1678 LeaseError::InvalidLevel => 3,
1679
1680 LeaseError::InvalidArgument => 4,
1681
1682 LeaseError::UnknownOrdinal_(value) => value,
1683 }));
1684
1685 Ok(())
1686 }
1687 }
1688
1689 impl ::core::convert::From<crate::wire::LeaseError> for LeaseError {
1690 fn from(wire: crate::wire::LeaseError) -> Self {
1691 match u32::from(wire.value) {
1692 1 => Self::Internal,
1693
1694 2 => Self::NotAuthorized,
1695
1696 3 => Self::InvalidLevel,
1697
1698 4 => Self::InvalidArgument,
1699
1700 value => Self::UnknownOrdinal_(value),
1701 }
1702 }
1703 }
1704
1705 impl ::fidl_next::FromWire<crate::wire::LeaseError> for LeaseError {
1706 #[inline]
1707 fn from_wire(wire: crate::wire::LeaseError) -> Self {
1708 Self::from(wire)
1709 }
1710 }
1711
1712 impl ::fidl_next::FromWireRef<crate::wire::LeaseError> for LeaseError {
1713 #[inline]
1714 fn from_wire_ref(wire: &crate::wire::LeaseError) -> Self {
1715 Self::from(*wire)
1716 }
1717 }
1718
1719 ::fidl_next::bitflags::bitflags! {
1720 #[doc = " Element Permissions\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct Permissions: u32 {
1721 const MODIFY_DEPENDENT = 1;
1722 const MODIFY_DEPENDENCY = 4;
1723
1724 }
1725 }
1726
1727 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Permissions, ___E> for Permissions
1728 where
1729 ___E: ?Sized,
1730 {
1731 #[inline]
1732 fn encode(
1733 self,
1734 encoder: &mut ___E,
1735 out: &mut ::core::mem::MaybeUninit<crate::wire::Permissions>,
1736 _: (),
1737 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1738 ::fidl_next::Encode::encode(&self, encoder, out, ())
1739 }
1740 }
1741
1742 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Permissions, ___E> for &'a Permissions
1743 where
1744 ___E: ?Sized,
1745 {
1746 #[inline]
1747 fn encode(
1748 self,
1749 _: &mut ___E,
1750 out: &mut ::core::mem::MaybeUninit<crate::wire::Permissions>,
1751 _: (),
1752 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1753 ::fidl_next::munge!(let crate::wire::Permissions { value } = out);
1754
1755 if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
1756 return Err(::fidl_next::EncodeError::InvalidStrictBits);
1757 }
1758
1759 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
1760 Ok(())
1761 }
1762 }
1763
1764 impl ::core::convert::From<crate::wire::Permissions> for Permissions {
1765 fn from(wire: crate::wire::Permissions) -> Self {
1766 Self::from_bits_retain(u32::from(wire.value))
1767 }
1768 }
1769
1770 impl ::fidl_next::FromWire<crate::wire::Permissions> for Permissions {
1771 #[inline]
1772 fn from_wire(wire: crate::wire::Permissions) -> Self {
1773 Self::from(wire)
1774 }
1775 }
1776
1777 impl ::fidl_next::FromWireRef<crate::wire::Permissions> for Permissions {
1778 #[inline]
1779 fn from_wire_ref(wire: &crate::wire::Permissions) -> Self {
1780 Self::from(*wire)
1781 }
1782 }
1783
1784 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1785 #[repr(u32)]
1786 pub enum StatusError {
1787 Unknown = 1,
1788 UnknownOrdinal_(u32) = 2,
1789 }
1790 impl ::std::convert::From<u32> for StatusError {
1791 fn from(value: u32) -> Self {
1792 match value {
1793 1 => Self::Unknown,
1794
1795 _ => Self::UnknownOrdinal_(value),
1796 }
1797 }
1798 }
1799
1800 impl ::std::convert::From<StatusError> for u32 {
1801 fn from(value: StatusError) -> Self {
1802 match value {
1803 StatusError::Unknown => 1,
1804
1805 StatusError::UnknownOrdinal_(value) => value,
1806 }
1807 }
1808 }
1809
1810 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StatusError, ___E> for StatusError
1811 where
1812 ___E: ?Sized,
1813 {
1814 #[inline]
1815 fn encode(
1816 self,
1817 encoder: &mut ___E,
1818 out: &mut ::core::mem::MaybeUninit<crate::wire::StatusError>,
1819 _: (),
1820 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1821 ::fidl_next::Encode::encode(&self, encoder, out, ())
1822 }
1823 }
1824
1825 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StatusError, ___E> for &'a StatusError
1826 where
1827 ___E: ?Sized,
1828 {
1829 #[inline]
1830 fn encode(
1831 self,
1832 encoder: &mut ___E,
1833 out: &mut ::core::mem::MaybeUninit<crate::wire::StatusError>,
1834 _: (),
1835 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1836 ::fidl_next::munge!(let crate::wire::StatusError { value } = out);
1837 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1838 StatusError::Unknown => 1,
1839
1840 StatusError::UnknownOrdinal_(value) => value,
1841 }));
1842
1843 Ok(())
1844 }
1845 }
1846
1847 impl ::core::convert::From<crate::wire::StatusError> for StatusError {
1848 fn from(wire: crate::wire::StatusError) -> Self {
1849 match u32::from(wire.value) {
1850 1 => Self::Unknown,
1851
1852 value => Self::UnknownOrdinal_(value),
1853 }
1854 }
1855 }
1856
1857 impl ::fidl_next::FromWire<crate::wire::StatusError> for StatusError {
1858 #[inline]
1859 fn from_wire(wire: crate::wire::StatusError) -> Self {
1860 Self::from(wire)
1861 }
1862 }
1863
1864 impl ::fidl_next::FromWireRef<crate::wire::StatusError> for StatusError {
1865 #[inline]
1866 fn from_wire_ref(wire: &crate::wire::StatusError) -> Self {
1867 Self::from(*wire)
1868 }
1869 }
1870
1871 pub type TopologyAddElementResponse = ();
1872
1873 pub type TopologyLeaseResponse = ();
1874}
1875
1876pub mod wire {
1877
1878 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1880 #[repr(transparent)]
1881 pub struct AddElementError {
1882 pub(crate) value: ::fidl_next::wire::Uint32,
1883 }
1884
1885 impl ::fidl_next::Constrained for AddElementError {
1886 type Constraint = ();
1887
1888 fn validate(
1889 _: ::fidl_next::Slot<'_, Self>,
1890 _: Self::Constraint,
1891 ) -> Result<(), ::fidl_next::ValidationError> {
1892 Ok(())
1893 }
1894 }
1895
1896 unsafe impl ::fidl_next::Wire for AddElementError {
1897 type Narrowed<'de> = Self;
1898
1899 #[inline]
1900 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1901 }
1903 }
1904
1905 impl AddElementError {
1906 pub const INVALID: AddElementError =
1907 AddElementError { value: ::fidl_next::wire::Uint32(1) };
1908
1909 pub const NOT_AUTHORIZED: AddElementError =
1910 AddElementError { value: ::fidl_next::wire::Uint32(2) };
1911 }
1912
1913 unsafe impl<___D> ::fidl_next::Decode<___D> for AddElementError
1914 where
1915 ___D: ?Sized,
1916 {
1917 fn decode(
1918 slot: ::fidl_next::Slot<'_, Self>,
1919 _: &mut ___D,
1920 _: (),
1921 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1922 Ok(())
1923 }
1924 }
1925
1926 impl ::core::convert::From<crate::natural::AddElementError> for AddElementError {
1927 fn from(natural: crate::natural::AddElementError) -> Self {
1928 match natural {
1929 crate::natural::AddElementError::Invalid => AddElementError::INVALID,
1930
1931 crate::natural::AddElementError::NotAuthorized => AddElementError::NOT_AUTHORIZED,
1932
1933 crate::natural::AddElementError::UnknownOrdinal_(value) => {
1934 AddElementError { value: ::fidl_next::wire::Uint32::from(value) }
1935 }
1936 }
1937 }
1938 }
1939
1940 impl ::fidl_next::IntoNatural for AddElementError {
1941 type Natural = crate::natural::AddElementError;
1942 }
1943
1944 pub type PowerLevel = u8;
1946
1947 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1949 #[repr(transparent)]
1950 pub struct BinaryPowerLevel {
1951 pub(crate) value: u8,
1952 }
1953
1954 impl ::fidl_next::Constrained for BinaryPowerLevel {
1955 type Constraint = ();
1956
1957 fn validate(
1958 _: ::fidl_next::Slot<'_, Self>,
1959 _: Self::Constraint,
1960 ) -> Result<(), ::fidl_next::ValidationError> {
1961 Ok(())
1962 }
1963 }
1964
1965 unsafe impl ::fidl_next::Wire for BinaryPowerLevel {
1966 type Narrowed<'de> = Self;
1967
1968 #[inline]
1969 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1970 }
1972 }
1973
1974 impl BinaryPowerLevel {
1975 pub const OFF: BinaryPowerLevel = BinaryPowerLevel { value: 0 };
1976
1977 pub const ON: BinaryPowerLevel = BinaryPowerLevel { value: 1 };
1978 }
1979
1980 unsafe impl<___D> ::fidl_next::Decode<___D> for BinaryPowerLevel
1981 where
1982 ___D: ?Sized,
1983 {
1984 fn decode(
1985 slot: ::fidl_next::Slot<'_, Self>,
1986 _: &mut ___D,
1987 _: (),
1988 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1989 ::fidl_next::munge!(let Self { value } = slot);
1990
1991 match u8::from(*value) {
1992 0 | 1 => (),
1993 unknown => {
1994 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1995 }
1996 }
1997
1998 Ok(())
1999 }
2000 }
2001
2002 impl ::core::convert::From<crate::natural::BinaryPowerLevel> for BinaryPowerLevel {
2003 fn from(natural: crate::natural::BinaryPowerLevel) -> Self {
2004 match natural {
2005 crate::natural::BinaryPowerLevel::Off => BinaryPowerLevel::OFF,
2006
2007 crate::natural::BinaryPowerLevel::On => BinaryPowerLevel::ON,
2008 }
2009 }
2010 }
2011
2012 impl ::fidl_next::IntoNatural for BinaryPowerLevel {
2013 type Natural = crate::natural::BinaryPowerLevel;
2014 }
2015
2016 pub type ElementControlRegisterDependencyTokenResponse = ::fidl_next::wire::Unit;
2018
2019 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2021 #[repr(transparent)]
2022 pub struct RegisterDependencyTokenError {
2023 pub(crate) value: ::fidl_next::wire::Uint32,
2024 }
2025
2026 impl ::fidl_next::Constrained for RegisterDependencyTokenError {
2027 type Constraint = ();
2028
2029 fn validate(
2030 _: ::fidl_next::Slot<'_, Self>,
2031 _: Self::Constraint,
2032 ) -> Result<(), ::fidl_next::ValidationError> {
2033 Ok(())
2034 }
2035 }
2036
2037 unsafe impl ::fidl_next::Wire for RegisterDependencyTokenError {
2038 type Narrowed<'de> = Self;
2039
2040 #[inline]
2041 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2042 }
2044 }
2045
2046 impl RegisterDependencyTokenError {
2047 pub const ALREADY_IN_USE: RegisterDependencyTokenError =
2048 RegisterDependencyTokenError { value: ::fidl_next::wire::Uint32(1) };
2049
2050 pub const INTERNAL: RegisterDependencyTokenError =
2051 RegisterDependencyTokenError { value: ::fidl_next::wire::Uint32(2) };
2052 }
2053
2054 unsafe impl<___D> ::fidl_next::Decode<___D> for RegisterDependencyTokenError
2055 where
2056 ___D: ?Sized,
2057 {
2058 fn decode(
2059 slot: ::fidl_next::Slot<'_, Self>,
2060 _: &mut ___D,
2061 _: (),
2062 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2063 Ok(())
2064 }
2065 }
2066
2067 impl ::core::convert::From<crate::natural::RegisterDependencyTokenError>
2068 for RegisterDependencyTokenError
2069 {
2070 fn from(natural: crate::natural::RegisterDependencyTokenError) -> Self {
2071 match natural {
2072 crate::natural::RegisterDependencyTokenError::AlreadyInUse => {
2073 RegisterDependencyTokenError::ALREADY_IN_USE
2074 }
2075
2076 crate::natural::RegisterDependencyTokenError::Internal => {
2077 RegisterDependencyTokenError::INTERNAL
2078 }
2079
2080 crate::natural::RegisterDependencyTokenError::UnknownOrdinal_(value) => {
2081 RegisterDependencyTokenError { value: ::fidl_next::wire::Uint32::from(value) }
2082 }
2083 }
2084 }
2085 }
2086
2087 impl ::fidl_next::IntoNatural for RegisterDependencyTokenError {
2088 type Natural = crate::natural::RegisterDependencyTokenError;
2089 }
2090
2091 pub type ElementControlUnregisterDependencyTokenResponse = ::fidl_next::wire::Unit;
2093
2094 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2096 #[repr(transparent)]
2097 pub struct UnregisterDependencyTokenError {
2098 pub(crate) value: ::fidl_next::wire::Uint32,
2099 }
2100
2101 impl ::fidl_next::Constrained for UnregisterDependencyTokenError {
2102 type Constraint = ();
2103
2104 fn validate(
2105 _: ::fidl_next::Slot<'_, Self>,
2106 _: Self::Constraint,
2107 ) -> Result<(), ::fidl_next::ValidationError> {
2108 Ok(())
2109 }
2110 }
2111
2112 unsafe impl ::fidl_next::Wire for UnregisterDependencyTokenError {
2113 type Narrowed<'de> = Self;
2114
2115 #[inline]
2116 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2117 }
2119 }
2120
2121 impl UnregisterDependencyTokenError {
2122 pub const NOT_AUTHORIZED: UnregisterDependencyTokenError =
2123 UnregisterDependencyTokenError { value: ::fidl_next::wire::Uint32(1) };
2124
2125 pub const NOT_FOUND: UnregisterDependencyTokenError =
2126 UnregisterDependencyTokenError { value: ::fidl_next::wire::Uint32(2) };
2127 }
2128
2129 unsafe impl<___D> ::fidl_next::Decode<___D> for UnregisterDependencyTokenError
2130 where
2131 ___D: ?Sized,
2132 {
2133 fn decode(
2134 slot: ::fidl_next::Slot<'_, Self>,
2135 _: &mut ___D,
2136 _: (),
2137 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2138 Ok(())
2139 }
2140 }
2141
2142 impl ::core::convert::From<crate::natural::UnregisterDependencyTokenError>
2143 for UnregisterDependencyTokenError
2144 {
2145 fn from(natural: crate::natural::UnregisterDependencyTokenError) -> Self {
2146 match natural {
2147 crate::natural::UnregisterDependencyTokenError::NotAuthorized => {
2148 UnregisterDependencyTokenError::NOT_AUTHORIZED
2149 }
2150
2151 crate::natural::UnregisterDependencyTokenError::NotFound => {
2152 UnregisterDependencyTokenError::NOT_FOUND
2153 }
2154
2155 crate::natural::UnregisterDependencyTokenError::UnknownOrdinal_(value) => {
2156 UnregisterDependencyTokenError { value: ::fidl_next::wire::Uint32::from(value) }
2157 }
2158 }
2159 }
2160 }
2161
2162 impl ::fidl_next::IntoNatural for UnregisterDependencyTokenError {
2163 type Natural = crate::natural::UnregisterDependencyTokenError;
2164 }
2165
2166 pub type ElementControlAddDependencyResponse = ::fidl_next::wire::Unit;
2168
2169 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2171 #[repr(transparent)]
2172 pub struct ModifyDependencyError {
2173 pub(crate) value: ::fidl_next::wire::Uint32,
2174 }
2175
2176 impl ::fidl_next::Constrained for ModifyDependencyError {
2177 type Constraint = ();
2178
2179 fn validate(
2180 _: ::fidl_next::Slot<'_, Self>,
2181 _: Self::Constraint,
2182 ) -> Result<(), ::fidl_next::ValidationError> {
2183 Ok(())
2184 }
2185 }
2186
2187 unsafe impl ::fidl_next::Wire for ModifyDependencyError {
2188 type Narrowed<'de> = Self;
2189
2190 #[inline]
2191 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2192 }
2194 }
2195
2196 impl ModifyDependencyError {
2197 pub const ALREADY_EXISTS: ModifyDependencyError =
2198 ModifyDependencyError { value: ::fidl_next::wire::Uint32(1) };
2199
2200 pub const INVALID: ModifyDependencyError =
2201 ModifyDependencyError { value: ::fidl_next::wire::Uint32(2) };
2202
2203 pub const NOT_AUTHORIZED: ModifyDependencyError =
2204 ModifyDependencyError { value: ::fidl_next::wire::Uint32(3) };
2205
2206 pub const NOT_FOUND: ModifyDependencyError =
2207 ModifyDependencyError { value: ::fidl_next::wire::Uint32(4) };
2208 }
2209
2210 unsafe impl<___D> ::fidl_next::Decode<___D> for ModifyDependencyError
2211 where
2212 ___D: ?Sized,
2213 {
2214 fn decode(
2215 slot: ::fidl_next::Slot<'_, Self>,
2216 _: &mut ___D,
2217 _: (),
2218 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2219 Ok(())
2220 }
2221 }
2222
2223 impl ::core::convert::From<crate::natural::ModifyDependencyError> for ModifyDependencyError {
2224 fn from(natural: crate::natural::ModifyDependencyError) -> Self {
2225 match natural {
2226 crate::natural::ModifyDependencyError::AlreadyExists => {
2227 ModifyDependencyError::ALREADY_EXISTS
2228 }
2229
2230 crate::natural::ModifyDependencyError::Invalid => ModifyDependencyError::INVALID,
2231
2232 crate::natural::ModifyDependencyError::NotAuthorized => {
2233 ModifyDependencyError::NOT_AUTHORIZED
2234 }
2235
2236 crate::natural::ModifyDependencyError::NotFound => ModifyDependencyError::NOT_FOUND,
2237
2238 crate::natural::ModifyDependencyError::UnknownOrdinal_(value) => {
2239 ModifyDependencyError { value: ::fidl_next::wire::Uint32::from(value) }
2240 }
2241 }
2242 }
2243 }
2244
2245 impl ::fidl_next::IntoNatural for ModifyDependencyError {
2246 type Natural = crate::natural::ModifyDependencyError;
2247 }
2248
2249 #[repr(C)]
2251 pub struct PowerLevelName<'de> {
2252 pub(crate) table: ::fidl_next::wire::Table<'de>,
2253 }
2254
2255 impl<'de> Drop for PowerLevelName<'de> {
2256 fn drop(&mut self) {
2257 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2258
2259 let _ = self.table.get(2).map(|envelope| unsafe {
2260 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2261 });
2262 }
2263 }
2264
2265 impl ::fidl_next::Constrained for PowerLevelName<'_> {
2266 type Constraint = ();
2267
2268 fn validate(
2269 _: ::fidl_next::Slot<'_, Self>,
2270 _: Self::Constraint,
2271 ) -> Result<(), ::fidl_next::ValidationError> {
2272 Ok(())
2273 }
2274 }
2275
2276 unsafe impl ::fidl_next::Wire for PowerLevelName<'static> {
2277 type Narrowed<'de> = PowerLevelName<'de>;
2278
2279 #[inline]
2280 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2281 ::fidl_next::munge!(let Self { table } = out);
2282 ::fidl_next::wire::Table::zero_padding(table);
2283 }
2284 }
2285
2286 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerLevelName<'de>
2287 where
2288 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2289 {
2290 fn decode(
2291 slot: ::fidl_next::Slot<'_, Self>,
2292 decoder: &mut ___D,
2293 _: (),
2294 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2295 ::fidl_next::munge!(let Self { table } = slot);
2296
2297 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2298 match ordinal {
2299 0 => unsafe { ::core::hint::unreachable_unchecked() },
2300
2301 1 => {
2302 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2303 slot.as_mut(),
2304 decoder,
2305 (),
2306 )?;
2307
2308 Ok(())
2309 }
2310
2311 2 => {
2312 ::fidl_next::wire::Envelope::decode_as::<
2313 ___D,
2314 ::fidl_next::wire::String<'de>,
2315 >(slot.as_mut(), decoder, 16)?;
2316
2317 let value = unsafe {
2318 slot.deref_unchecked()
2319 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2320 };
2321
2322 if value.len() > 16 {
2323 return Err(::fidl_next::DecodeError::VectorTooLong {
2324 size: value.len() as u64,
2325 limit: 16,
2326 });
2327 }
2328
2329 Ok(())
2330 }
2331
2332 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2333 }
2334 })
2335 }
2336 }
2337
2338 impl<'de> PowerLevelName<'de> {
2339 pub fn level(&self) -> ::core::option::Option<&u8> {
2340 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2341 }
2342
2343 pub fn take_level(&mut self) -> ::core::option::Option<u8> {
2344 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2345 }
2346
2347 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2348 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2349 }
2350
2351 pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2352 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2353 }
2354 }
2355
2356 impl<'de> ::core::fmt::Debug for PowerLevelName<'de> {
2357 fn fmt(
2358 &self,
2359 f: &mut ::core::fmt::Formatter<'_>,
2360 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2361 f.debug_struct("PowerLevelName")
2362 .field("level", &self.level())
2363 .field("name", &self.name())
2364 .finish()
2365 }
2366 }
2367
2368 impl<'de> ::fidl_next::IntoNatural for PowerLevelName<'de> {
2369 type Natural = crate::natural::PowerLevelName;
2370 }
2371
2372 #[repr(C)]
2374 pub struct ElementPowerLevelNames<'de> {
2375 pub(crate) table: ::fidl_next::wire::Table<'de>,
2376 }
2377
2378 impl<'de> Drop for ElementPowerLevelNames<'de> {
2379 fn drop(&mut self) {
2380 let _ = self.table.get(1).map(|envelope| unsafe {
2381 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2382 });
2383
2384 let _ = self.table.get(2)
2385 .map(|envelope| unsafe {
2386 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>()
2387 });
2388 }
2389 }
2390
2391 impl ::fidl_next::Constrained for ElementPowerLevelNames<'_> {
2392 type Constraint = ();
2393
2394 fn validate(
2395 _: ::fidl_next::Slot<'_, Self>,
2396 _: Self::Constraint,
2397 ) -> Result<(), ::fidl_next::ValidationError> {
2398 Ok(())
2399 }
2400 }
2401
2402 unsafe impl ::fidl_next::Wire for ElementPowerLevelNames<'static> {
2403 type Narrowed<'de> = ElementPowerLevelNames<'de>;
2404
2405 #[inline]
2406 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2407 ::fidl_next::munge!(let Self { table } = out);
2408 ::fidl_next::wire::Table::zero_padding(table);
2409 }
2410 }
2411
2412 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ElementPowerLevelNames<'de>
2413 where
2414 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2415 {
2416 fn decode(
2417 slot: ::fidl_next::Slot<'_, Self>,
2418 decoder: &mut ___D,
2419 _: (),
2420 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2421 ::fidl_next::munge!(let Self { table } = slot);
2422
2423 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2424 match ordinal {
2425 0 => unsafe { ::core::hint::unreachable_unchecked() },
2426
2427 1 => {
2428 ::fidl_next::wire::Envelope::decode_as::<
2429 ___D,
2430 ::fidl_next::wire::String<'de>,
2431 >(slot.as_mut(), decoder, 64)?;
2432
2433 let value = unsafe {
2434 slot.deref_unchecked()
2435 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2436 };
2437
2438 if value.len() > 64 {
2439 return Err(::fidl_next::DecodeError::VectorTooLong {
2440 size: value.len() as u64,
2441 limit: 64,
2442 });
2443 }
2444
2445 Ok(())
2446 }
2447
2448 2 => {
2449 ::fidl_next::wire::Envelope::decode_as::<
2450 ___D,
2451 ::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>,
2452 >(slot.as_mut(), decoder, (256, ()))?;
2453
2454 let value = unsafe {
2455 slot
2456 .deref_unchecked()
2457 .deref_unchecked::<
2458 ::fidl_next::wire::Vector<'_, crate::wire::PowerLevelName<'_>>
2459 >()
2460 };
2461
2462 if value.len() > 256 {
2463 return Err(::fidl_next::DecodeError::VectorTooLong {
2464 size: value.len() as u64,
2465 limit: 256,
2466 });
2467 }
2468
2469 Ok(())
2470 }
2471
2472 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2473 }
2474 })
2475 }
2476 }
2477
2478 impl<'de> ElementPowerLevelNames<'de> {
2479 pub fn identifier(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2480 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2481 }
2482
2483 pub fn take_identifier(
2484 &mut self,
2485 ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2486 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2487 }
2488
2489 pub fn levels(
2490 &self,
2491 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>
2492 {
2493 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2494 }
2495
2496 pub fn take_levels(
2497 &mut self,
2498 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::PowerLevelName<'de>>>
2499 {
2500 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2501 }
2502 }
2503
2504 impl<'de> ::core::fmt::Debug for ElementPowerLevelNames<'de> {
2505 fn fmt(
2506 &self,
2507 f: &mut ::core::fmt::Formatter<'_>,
2508 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2509 f.debug_struct("ElementPowerLevelNames")
2510 .field("identifier", &self.identifier())
2511 .field("levels", &self.levels())
2512 .finish()
2513 }
2514 }
2515
2516 impl<'de> ::fidl_next::IntoNatural for ElementPowerLevelNames<'de> {
2517 type Natural = crate::natural::ElementPowerLevelNames;
2518 }
2519
2520 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2522 #[repr(transparent)]
2523 pub struct ElementInfoProviderError {
2524 pub(crate) value: ::fidl_next::wire::Uint32,
2525 }
2526
2527 impl ::fidl_next::Constrained for ElementInfoProviderError {
2528 type Constraint = ();
2529
2530 fn validate(
2531 _: ::fidl_next::Slot<'_, Self>,
2532 _: Self::Constraint,
2533 ) -> Result<(), ::fidl_next::ValidationError> {
2534 Ok(())
2535 }
2536 }
2537
2538 unsafe impl ::fidl_next::Wire for ElementInfoProviderError {
2539 type Narrowed<'de> = Self;
2540
2541 #[inline]
2542 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2543 }
2545 }
2546
2547 impl ElementInfoProviderError {
2548 pub const UNKNOWN: ElementInfoProviderError =
2549 ElementInfoProviderError { value: ::fidl_next::wire::Uint32(0) };
2550
2551 pub const FAILED: ElementInfoProviderError =
2552 ElementInfoProviderError { value: ::fidl_next::wire::Uint32(1) };
2553 }
2554
2555 unsafe impl<___D> ::fidl_next::Decode<___D> for ElementInfoProviderError
2556 where
2557 ___D: ?Sized,
2558 {
2559 fn decode(
2560 slot: ::fidl_next::Slot<'_, Self>,
2561 _: &mut ___D,
2562 _: (),
2563 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2564 Ok(())
2565 }
2566 }
2567
2568 impl ::core::convert::From<crate::natural::ElementInfoProviderError> for ElementInfoProviderError {
2569 fn from(natural: crate::natural::ElementInfoProviderError) -> Self {
2570 match natural {
2571 crate::natural::ElementInfoProviderError::Unknown => {
2572 ElementInfoProviderError::UNKNOWN
2573 }
2574
2575 crate::natural::ElementInfoProviderError::Failed => {
2576 ElementInfoProviderError::FAILED
2577 }
2578
2579 crate::natural::ElementInfoProviderError::UnknownOrdinal_(value) => {
2580 ElementInfoProviderError { value: ::fidl_next::wire::Uint32::from(value) }
2581 }
2582 }
2583 }
2584 }
2585
2586 impl ::fidl_next::IntoNatural for ElementInfoProviderError {
2587 type Natural = crate::natural::ElementInfoProviderError;
2588 }
2589
2590 #[derive(Clone, Debug)]
2592 #[repr(C)]
2593 pub struct ElementRunnerSetLevelRequest {
2594 pub level: u8,
2595 }
2596
2597 static_assertions::const_assert_eq!(std::mem::size_of::<ElementRunnerSetLevelRequest>(), 1);
2598 static_assertions::const_assert_eq!(std::mem::align_of::<ElementRunnerSetLevelRequest>(), 1);
2599
2600 static_assertions::const_assert_eq!(
2601 std::mem::offset_of!(ElementRunnerSetLevelRequest, level),
2602 0
2603 );
2604
2605 impl ::fidl_next::Constrained for ElementRunnerSetLevelRequest {
2606 type Constraint = ();
2607
2608 fn validate(
2609 _: ::fidl_next::Slot<'_, Self>,
2610 _: Self::Constraint,
2611 ) -> Result<(), ::fidl_next::ValidationError> {
2612 Ok(())
2613 }
2614 }
2615
2616 unsafe impl ::fidl_next::Wire for ElementRunnerSetLevelRequest {
2617 type Narrowed<'de> = ElementRunnerSetLevelRequest;
2618
2619 #[inline]
2620 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2621 ::fidl_next::munge! {
2622 let Self {
2623 level,
2624
2625 } = &mut *out_;
2626 }
2627
2628 ::fidl_next::Wire::zero_padding(level);
2629 }
2630 }
2631
2632 unsafe impl<___D> ::fidl_next::Decode<___D> for ElementRunnerSetLevelRequest
2633 where
2634 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2635 {
2636 fn decode(
2637 slot_: ::fidl_next::Slot<'_, Self>,
2638 decoder_: &mut ___D,
2639 _: (),
2640 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2641 ::fidl_next::munge! {
2642 let Self {
2643 mut level,
2644
2645 } = slot_;
2646 }
2647
2648 let _field = level.as_mut();
2649
2650 ::fidl_next::Decode::decode(level.as_mut(), decoder_, ())?;
2651
2652 Ok(())
2653 }
2654 }
2655
2656 impl ::fidl_next::IntoNatural for ElementRunnerSetLevelRequest {
2657 type Natural = crate::natural::ElementRunnerSetLevelRequest;
2658 }
2659
2660 pub type ElementRunnerSetLevelResponse = ::fidl_next::wire::Unit;
2662
2663 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2665 #[repr(transparent)]
2666 pub struct LeaseStatus {
2667 pub(crate) value: ::fidl_next::wire::Uint32,
2668 }
2669
2670 impl ::fidl_next::Constrained for LeaseStatus {
2671 type Constraint = ();
2672
2673 fn validate(
2674 _: ::fidl_next::Slot<'_, Self>,
2675 _: Self::Constraint,
2676 ) -> Result<(), ::fidl_next::ValidationError> {
2677 Ok(())
2678 }
2679 }
2680
2681 unsafe impl ::fidl_next::Wire for LeaseStatus {
2682 type Narrowed<'de> = Self;
2683
2684 #[inline]
2685 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2686 }
2688 }
2689
2690 impl LeaseStatus {
2691 pub const UNKNOWN: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(0) };
2692
2693 pub const PENDING: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(1) };
2694
2695 pub const SATISFIED: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(2) };
2696
2697 pub const POWERING_DOWN: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(3) };
2698
2699 pub const VACATED: LeaseStatus = LeaseStatus { value: ::fidl_next::wire::Uint32(4) };
2700 }
2701
2702 unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseStatus
2703 where
2704 ___D: ?Sized,
2705 {
2706 fn decode(
2707 slot: ::fidl_next::Slot<'_, Self>,
2708 _: &mut ___D,
2709 _: (),
2710 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2711 Ok(())
2712 }
2713 }
2714
2715 impl ::core::convert::From<crate::natural::LeaseStatus> for LeaseStatus {
2716 fn from(natural: crate::natural::LeaseStatus) -> Self {
2717 match natural {
2718 crate::natural::LeaseStatus::Unknown => LeaseStatus::UNKNOWN,
2719
2720 crate::natural::LeaseStatus::Pending => LeaseStatus::PENDING,
2721
2722 crate::natural::LeaseStatus::Satisfied => LeaseStatus::SATISFIED,
2723
2724 crate::natural::LeaseStatus::PoweringDown => LeaseStatus::POWERING_DOWN,
2725
2726 crate::natural::LeaseStatus::Vacated => LeaseStatus::VACATED,
2727
2728 crate::natural::LeaseStatus::UnknownOrdinal_(value) => {
2729 LeaseStatus { value: ::fidl_next::wire::Uint32::from(value) }
2730 }
2731 }
2732 }
2733 }
2734
2735 impl ::fidl_next::IntoNatural for LeaseStatus {
2736 type Natural = crate::natural::LeaseStatus;
2737 }
2738
2739 #[derive(Clone, Debug)]
2741 #[repr(C)]
2742 pub struct LeaseControlWatchStatusRequest {
2743 pub last_status: crate::wire::LeaseStatus,
2744 }
2745
2746 static_assertions::const_assert_eq!(std::mem::size_of::<LeaseControlWatchStatusRequest>(), 4);
2747 static_assertions::const_assert_eq!(std::mem::align_of::<LeaseControlWatchStatusRequest>(), 4);
2748
2749 static_assertions::const_assert_eq!(
2750 std::mem::offset_of!(LeaseControlWatchStatusRequest, last_status),
2751 0
2752 );
2753
2754 impl ::fidl_next::Constrained for LeaseControlWatchStatusRequest {
2755 type Constraint = ();
2756
2757 fn validate(
2758 _: ::fidl_next::Slot<'_, Self>,
2759 _: Self::Constraint,
2760 ) -> Result<(), ::fidl_next::ValidationError> {
2761 Ok(())
2762 }
2763 }
2764
2765 unsafe impl ::fidl_next::Wire for LeaseControlWatchStatusRequest {
2766 type Narrowed<'de> = LeaseControlWatchStatusRequest;
2767
2768 #[inline]
2769 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2770 ::fidl_next::munge! {
2771 let Self {
2772 last_status,
2773
2774 } = &mut *out_;
2775 }
2776
2777 ::fidl_next::Wire::zero_padding(last_status);
2778 }
2779 }
2780
2781 unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseControlWatchStatusRequest
2782 where
2783 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2784 {
2785 fn decode(
2786 slot_: ::fidl_next::Slot<'_, Self>,
2787 decoder_: &mut ___D,
2788 _: (),
2789 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2790 ::fidl_next::munge! {
2791 let Self {
2792 mut last_status,
2793
2794 } = slot_;
2795 }
2796
2797 let _field = last_status.as_mut();
2798
2799 ::fidl_next::Decode::decode(last_status.as_mut(), decoder_, ())?;
2800
2801 Ok(())
2802 }
2803 }
2804
2805 impl ::fidl_next::IntoNatural for LeaseControlWatchStatusRequest {
2806 type Natural = crate::natural::LeaseControlWatchStatusRequest;
2807 }
2808
2809 #[derive(Clone, Debug)]
2811 #[repr(C)]
2812 pub struct LeaseControlWatchStatusResponse {
2813 pub status: crate::wire::LeaseStatus,
2814 }
2815
2816 static_assertions::const_assert_eq!(std::mem::size_of::<LeaseControlWatchStatusResponse>(), 4);
2817 static_assertions::const_assert_eq!(std::mem::align_of::<LeaseControlWatchStatusResponse>(), 4);
2818
2819 static_assertions::const_assert_eq!(
2820 std::mem::offset_of!(LeaseControlWatchStatusResponse, status),
2821 0
2822 );
2823
2824 impl ::fidl_next::Constrained for LeaseControlWatchStatusResponse {
2825 type Constraint = ();
2826
2827 fn validate(
2828 _: ::fidl_next::Slot<'_, Self>,
2829 _: Self::Constraint,
2830 ) -> Result<(), ::fidl_next::ValidationError> {
2831 Ok(())
2832 }
2833 }
2834
2835 unsafe impl ::fidl_next::Wire for LeaseControlWatchStatusResponse {
2836 type Narrowed<'de> = LeaseControlWatchStatusResponse;
2837
2838 #[inline]
2839 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2840 ::fidl_next::munge! {
2841 let Self {
2842 status,
2843
2844 } = &mut *out_;
2845 }
2846
2847 ::fidl_next::Wire::zero_padding(status);
2848 }
2849 }
2850
2851 unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseControlWatchStatusResponse
2852 where
2853 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2854 {
2855 fn decode(
2856 slot_: ::fidl_next::Slot<'_, Self>,
2857 decoder_: &mut ___D,
2858 _: (),
2859 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2860 ::fidl_next::munge! {
2861 let Self {
2862 mut status,
2863
2864 } = slot_;
2865 }
2866
2867 let _field = status.as_mut();
2868
2869 ::fidl_next::Decode::decode(status.as_mut(), decoder_, ())?;
2870
2871 Ok(())
2872 }
2873 }
2874
2875 impl ::fidl_next::IntoNatural for LeaseControlWatchStatusResponse {
2876 type Natural = crate::natural::LeaseControlWatchStatusResponse;
2877 }
2878
2879 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2881 #[repr(transparent)]
2882 pub struct LeaseError {
2883 pub(crate) value: ::fidl_next::wire::Uint32,
2884 }
2885
2886 impl ::fidl_next::Constrained for LeaseError {
2887 type Constraint = ();
2888
2889 fn validate(
2890 _: ::fidl_next::Slot<'_, Self>,
2891 _: Self::Constraint,
2892 ) -> Result<(), ::fidl_next::ValidationError> {
2893 Ok(())
2894 }
2895 }
2896
2897 unsafe impl ::fidl_next::Wire for LeaseError {
2898 type Narrowed<'de> = Self;
2899
2900 #[inline]
2901 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2902 }
2904 }
2905
2906 impl LeaseError {
2907 pub const INTERNAL: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(1) };
2908
2909 pub const NOT_AUTHORIZED: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(2) };
2910
2911 pub const INVALID_LEVEL: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(3) };
2912
2913 pub const INVALID_ARGUMENT: LeaseError = LeaseError { value: ::fidl_next::wire::Uint32(4) };
2914 }
2915
2916 unsafe impl<___D> ::fidl_next::Decode<___D> for LeaseError
2917 where
2918 ___D: ?Sized,
2919 {
2920 fn decode(
2921 slot: ::fidl_next::Slot<'_, Self>,
2922 _: &mut ___D,
2923 _: (),
2924 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2925 Ok(())
2926 }
2927 }
2928
2929 impl ::core::convert::From<crate::natural::LeaseError> for LeaseError {
2930 fn from(natural: crate::natural::LeaseError) -> Self {
2931 match natural {
2932 crate::natural::LeaseError::Internal => LeaseError::INTERNAL,
2933
2934 crate::natural::LeaseError::NotAuthorized => LeaseError::NOT_AUTHORIZED,
2935
2936 crate::natural::LeaseError::InvalidLevel => LeaseError::INVALID_LEVEL,
2937
2938 crate::natural::LeaseError::InvalidArgument => LeaseError::INVALID_ARGUMENT,
2939
2940 crate::natural::LeaseError::UnknownOrdinal_(value) => {
2941 LeaseError { value: ::fidl_next::wire::Uint32::from(value) }
2942 }
2943 }
2944 }
2945 }
2946
2947 impl ::fidl_next::IntoNatural for LeaseError {
2948 type Natural = crate::natural::LeaseError;
2949 }
2950
2951 #[derive(Clone, Copy, Debug)]
2953 #[repr(transparent)]
2954 pub struct Permissions {
2955 pub(crate) value: ::fidl_next::wire::Uint32,
2956 }
2957
2958 impl ::fidl_next::Constrained for Permissions {
2959 type Constraint = ();
2960
2961 fn validate(
2962 _: ::fidl_next::Slot<'_, Self>,
2963 _: Self::Constraint,
2964 ) -> Result<(), ::fidl_next::ValidationError> {
2965 Ok(())
2966 }
2967 }
2968
2969 unsafe impl ::fidl_next::Wire for Permissions {
2970 type Narrowed<'de> = Self;
2971
2972 #[inline]
2973 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2974 }
2976 }
2977
2978 unsafe impl<___D> ::fidl_next::Decode<___D> for Permissions
2979 where
2980 ___D: ?Sized,
2981 {
2982 fn decode(
2983 slot: ::fidl_next::Slot<'_, Self>,
2984 _: &mut ___D,
2985 _: (),
2986 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2987 ::fidl_next::munge!(let Self { value } = slot);
2988 let set = u32::from(*value);
2989 if set & !crate::natural::Permissions::all().bits() != 0 {
2990 return Err(::fidl_next::DecodeError::InvalidBits {
2991 expected: crate::natural::Permissions::all().bits() as usize,
2992 actual: set as usize,
2993 });
2994 }
2995
2996 Ok(())
2997 }
2998 }
2999
3000 impl ::core::convert::From<crate::natural::Permissions> for Permissions {
3001 fn from(natural: crate::natural::Permissions) -> Self {
3002 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
3003 }
3004 }
3005
3006 impl ::fidl_next::IntoNatural for Permissions {
3007 type Natural = crate::natural::Permissions;
3008 }
3009
3010 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3012 #[repr(transparent)]
3013 pub struct StatusError {
3014 pub(crate) value: ::fidl_next::wire::Uint32,
3015 }
3016
3017 impl ::fidl_next::Constrained for StatusError {
3018 type Constraint = ();
3019
3020 fn validate(
3021 _: ::fidl_next::Slot<'_, Self>,
3022 _: Self::Constraint,
3023 ) -> Result<(), ::fidl_next::ValidationError> {
3024 Ok(())
3025 }
3026 }
3027
3028 unsafe impl ::fidl_next::Wire for StatusError {
3029 type Narrowed<'de> = Self;
3030
3031 #[inline]
3032 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3033 }
3035 }
3036
3037 impl StatusError {
3038 pub const UNKNOWN: StatusError = StatusError { value: ::fidl_next::wire::Uint32(1) };
3039 }
3040
3041 unsafe impl<___D> ::fidl_next::Decode<___D> for StatusError
3042 where
3043 ___D: ?Sized,
3044 {
3045 fn decode(
3046 slot: ::fidl_next::Slot<'_, Self>,
3047 _: &mut ___D,
3048 _: (),
3049 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3050 Ok(())
3051 }
3052 }
3053
3054 impl ::core::convert::From<crate::natural::StatusError> for StatusError {
3055 fn from(natural: crate::natural::StatusError) -> Self {
3056 match natural {
3057 crate::natural::StatusError::Unknown => StatusError::UNKNOWN,
3058
3059 crate::natural::StatusError::UnknownOrdinal_(value) => {
3060 StatusError { value: ::fidl_next::wire::Uint32::from(value) }
3061 }
3062 }
3063 }
3064 }
3065
3066 impl ::fidl_next::IntoNatural for StatusError {
3067 type Natural = crate::natural::StatusError;
3068 }
3069
3070 pub type TopologyAddElementResponse = ::fidl_next::wire::Unit;
3072
3073 pub type TopologyLeaseResponse = ::fidl_next::wire::Unit;
3075}
3076
3077pub mod wire_optional {}
3078
3079pub mod generic {
3080
3081 pub type ElementControlRegisterDependencyTokenResponse = ();
3083
3084 pub type ElementControlUnregisterDependencyTokenResponse = ();
3086
3087 pub type ElementControlAddDependencyResponse = ();
3089
3090 pub struct ElementRunnerSetLevelRequest<T0> {
3092 pub level: T0,
3093 }
3094
3095 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ElementRunnerSetLevelRequest, ___E>
3096 for ElementRunnerSetLevelRequest<T0>
3097 where
3098 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3099 T0: ::fidl_next::Encode<u8, ___E>,
3100 {
3101 #[inline]
3102 fn encode(
3103 self,
3104 encoder_: &mut ___E,
3105 out_: &mut ::core::mem::MaybeUninit<crate::wire::ElementRunnerSetLevelRequest>,
3106 _: (),
3107 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3108 ::fidl_next::munge! {
3109 let crate::wire::ElementRunnerSetLevelRequest {
3110 level,
3111
3112 } = out_;
3113 }
3114
3115 ::fidl_next::Encode::encode(self.level, encoder_, level, ())?;
3116
3117 Ok(())
3118 }
3119 }
3120
3121 pub type ElementRunnerSetLevelResponse = ();
3123
3124 pub struct LeaseControlWatchStatusRequest<T0> {
3126 pub last_status: T0,
3127 }
3128
3129 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusRequest, ___E>
3130 for LeaseControlWatchStatusRequest<T0>
3131 where
3132 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3133 T0: ::fidl_next::Encode<crate::wire::LeaseStatus, ___E>,
3134 {
3135 #[inline]
3136 fn encode(
3137 self,
3138 encoder_: &mut ___E,
3139 out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusRequest>,
3140 _: (),
3141 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3142 ::fidl_next::munge! {
3143 let crate::wire::LeaseControlWatchStatusRequest {
3144 last_status,
3145
3146 } = out_;
3147 }
3148
3149 ::fidl_next::Encode::encode(self.last_status, encoder_, last_status, ())?;
3150
3151 Ok(())
3152 }
3153 }
3154
3155 pub struct LeaseControlWatchStatusResponse<T0> {
3157 pub status: T0,
3158 }
3159
3160 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LeaseControlWatchStatusResponse, ___E>
3161 for LeaseControlWatchStatusResponse<T0>
3162 where
3163 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3164 T0: ::fidl_next::Encode<crate::wire::LeaseStatus, ___E>,
3165 {
3166 #[inline]
3167 fn encode(
3168 self,
3169 encoder_: &mut ___E,
3170 out_: &mut ::core::mem::MaybeUninit<crate::wire::LeaseControlWatchStatusResponse>,
3171 _: (),
3172 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3173 ::fidl_next::munge! {
3174 let crate::wire::LeaseControlWatchStatusResponse {
3175 status,
3176
3177 } = out_;
3178 }
3179
3180 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
3181
3182 Ok(())
3183 }
3184 }
3185
3186 pub type TopologyAddElementResponse = ();
3188
3189 pub type TopologyLeaseResponse = ();
3191}
3192
3193pub use self::natural::*;
3194
3195pub const MAX_VALID_POWER_LEVELS: u16 = 256 as u16;
3196
3197pub const MAX_ELEMENT_NAME_LEN: u8 = 64 as u8;
3198
3199#[doc = " PowerLevel name lengths are limited to reduce Inspect space usage\n"]
3200pub const MAX_LEVEL_NAME_LEN: u16 = 16 as u16;
3201
3202#[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"]
3204#[derive(PartialEq, Debug)]
3205pub struct ElementRunner;
3206
3207impl ::fidl_next::Discoverable for ElementRunner {
3208 const PROTOCOL_NAME: &'static str = "fuchsia.power.broker.ElementRunner";
3209}
3210
3211#[cfg(target_os = "fuchsia")]
3212impl ::fidl_next::HasTransport for ElementRunner {
3213 type Transport = ::fidl_next::fuchsia::zx::Channel;
3214}
3215
3216pub mod element_runner {
3217 pub mod prelude {
3218 pub use crate::{
3219 ElementRunner, ElementRunnerClientHandler, ElementRunnerLocalClientHandler,
3220 ElementRunnerLocalServerHandler, ElementRunnerServerHandler, element_runner,
3221 };
3222
3223 pub use crate::natural::ElementRunnerSetLevelRequest;
3224
3225 pub use crate::natural::ElementRunnerSetLevelResponse;
3226 }
3227
3228 pub struct SetLevel;
3229
3230 impl ::fidl_next::Method for SetLevel {
3231 const ORDINAL: u64 = 79537611020078859;
3232 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3233 ::fidl_next::protocol::Flexibility::Flexible;
3234
3235 type Protocol = crate::ElementRunner;
3236
3237 type Request = crate::wire::ElementRunnerSetLevelRequest;
3238 }
3239
3240 impl ::fidl_next::TwoWayMethod for SetLevel {
3241 type Response =
3242 ::fidl_next::wire::Flexible<'static, crate::wire::ElementRunnerSetLevelResponse>;
3243 }
3244
3245 impl<___R> ::fidl_next::Respond<___R> for SetLevel {
3246 type Output = ::fidl_next::Flexible<___R>;
3247
3248 fn respond(response: ___R) -> Self::Output {
3249 ::fidl_next::Flexible(response)
3250 }
3251 }
3252
3253 mod ___detail {
3254 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ElementRunner
3255 where
3256 ___T: ::fidl_next::Transport,
3257 {
3258 type Client = ElementRunnerClient<___T>;
3259 type Server = ElementRunnerServer<___T>;
3260 }
3261
3262 #[repr(transparent)]
3264 pub struct ElementRunnerClient<___T: ::fidl_next::Transport> {
3265 #[allow(dead_code)]
3266 client: ::fidl_next::protocol::Client<___T>,
3267 }
3268
3269 impl<___T> ElementRunnerClient<___T>
3270 where
3271 ___T: ::fidl_next::Transport,
3272 {
3273 #[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"]
3274 pub fn set_level(
3275 &self,
3276
3277 level: impl ::fidl_next::Encode<u8, <___T as ::fidl_next::Transport>::SendBuffer>,
3278 ) -> ::fidl_next::TwoWayFuture<'_, super::SetLevel, ___T>
3279 where
3280 <___T as ::fidl_next::Transport>::SendBuffer:
3281 ::fidl_next::encoder::InternalHandleEncoder,
3282 {
3283 self.set_level_with(crate::generic::ElementRunnerSetLevelRequest { level })
3284 }
3285
3286 #[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"]
3287 pub fn set_level_with<___R>(
3288 &self,
3289 request: ___R,
3290 ) -> ::fidl_next::TwoWayFuture<'_, super::SetLevel, ___T>
3291 where
3292 ___R: ::fidl_next::Encode<
3293 crate::wire::ElementRunnerSetLevelRequest,
3294 <___T as ::fidl_next::Transport>::SendBuffer,
3295 >,
3296 {
3297 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3298 79537611020078859,
3299 <super::SetLevel as ::fidl_next::Method>::FLEXIBILITY,
3300 request,
3301 ))
3302 }
3303 }
3304
3305 #[repr(transparent)]
3307 pub struct ElementRunnerServer<___T: ::fidl_next::Transport> {
3308 server: ::fidl_next::protocol::Server<___T>,
3309 }
3310
3311 impl<___T> ElementRunnerServer<___T> where ___T: ::fidl_next::Transport {}
3312 }
3313}
3314
3315#[diagnostic::on_unimplemented(
3316 note = "If {Self} implements the non-local ElementRunnerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3317)]
3318
3319pub trait ElementRunnerLocalClientHandler<
3323 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3324 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3325>
3326{
3327 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3328 ::core::future::ready(())
3329 }
3330}
3331
3332impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ElementRunner
3333where
3334 ___H: ElementRunnerLocalClientHandler<___T>,
3335 ___T: ::fidl_next::Transport,
3336{
3337 async fn on_event(
3338 handler: &mut ___H,
3339 mut message: ::fidl_next::Message<___T>,
3340 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3341 match *message.header().ordinal {
3342 ordinal => {
3343 handler.on_unknown_interaction(ordinal).await;
3344 if ::core::matches!(
3345 message.header().flexibility(),
3346 ::fidl_next::protocol::Flexibility::Strict
3347 ) {
3348 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3349 } else {
3350 Ok(())
3351 }
3352 }
3353 }
3354 }
3355}
3356
3357#[diagnostic::on_unimplemented(
3358 note = "If {Self} implements the non-local ElementRunnerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3359)]
3360
3361pub trait ElementRunnerLocalServerHandler<
3365 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3366 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3367>
3368{
3369 #[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"]
3370 fn set_level(
3371 &mut self,
3372
3373 request: ::fidl_next::Request<element_runner::SetLevel, ___T>,
3374
3375 responder: ::fidl_next::Responder<element_runner::SetLevel, ___T>,
3376 ) -> impl ::core::future::Future<Output = ()>;
3377
3378 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3379 ::core::future::ready(())
3380 }
3381}
3382
3383impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ElementRunner
3384where
3385 ___H: ElementRunnerLocalServerHandler<___T>,
3386 ___T: ::fidl_next::Transport,
3387 for<'de> crate::wire::ElementRunnerSetLevelRequest: ::fidl_next::Decode<
3388 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3389 Constraint = (),
3390 >,
3391{
3392 async fn on_one_way(
3393 handler: &mut ___H,
3394 mut message: ::fidl_next::Message<___T>,
3395 ) -> ::core::result::Result<
3396 (),
3397 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3398 > {
3399 match *message.header().ordinal {
3400 ordinal => {
3401 handler.on_unknown_interaction(ordinal).await;
3402 if ::core::matches!(
3403 message.header().flexibility(),
3404 ::fidl_next::protocol::Flexibility::Strict
3405 ) {
3406 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3407 } else {
3408 Ok(())
3409 }
3410 }
3411 }
3412 }
3413
3414 async fn on_two_way(
3415 handler: &mut ___H,
3416 mut message: ::fidl_next::Message<___T>,
3417 responder: ::fidl_next::protocol::Responder<___T>,
3418 ) -> ::core::result::Result<
3419 (),
3420 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3421 > {
3422 match *message.header().ordinal {
3423 79537611020078859 => {
3424 let responder = ::fidl_next::Responder::from_untyped(responder);
3425
3426 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3427 Ok(decoded) => {
3428 handler
3429 .set_level(::fidl_next::Request::from_decoded(decoded), responder)
3430 .await;
3431 Ok(())
3432 }
3433 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3434 ordinal: 79537611020078859,
3435 error,
3436 }),
3437 }
3438 }
3439
3440 ordinal => {
3441 handler.on_unknown_interaction(ordinal).await;
3442 if ::core::matches!(
3443 message.header().flexibility(),
3444 ::fidl_next::protocol::Flexibility::Strict
3445 ) {
3446 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3447 } else {
3448 responder
3449 .respond_framework_error(
3450 ordinal,
3451 ::fidl_next::FrameworkError::UnknownMethod,
3452 )
3453 .expect("encoding a framework error should never fail")
3454 .await?;
3455 Ok(())
3456 }
3457 }
3458 }
3459 }
3460}
3461
3462pub trait ElementRunnerClientHandler<
3466 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3467 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3468>
3469{
3470 fn on_unknown_interaction(
3471 &mut self,
3472 ordinal: u64,
3473 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3474 ::core::future::ready(())
3475 }
3476}
3477
3478impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ElementRunner
3479where
3480 ___H: ElementRunnerClientHandler<___T> + ::core::marker::Send,
3481 ___T: ::fidl_next::Transport,
3482{
3483 async fn on_event(
3484 handler: &mut ___H,
3485 mut message: ::fidl_next::Message<___T>,
3486 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3487 match *message.header().ordinal {
3488 ordinal => {
3489 handler.on_unknown_interaction(ordinal).await;
3490 if ::core::matches!(
3491 message.header().flexibility(),
3492 ::fidl_next::protocol::Flexibility::Strict
3493 ) {
3494 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3495 } else {
3496 Ok(())
3497 }
3498 }
3499 }
3500 }
3501}
3502
3503pub trait ElementRunnerServerHandler<
3507 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3508 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3509>
3510{
3511 #[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"]
3512 fn set_level(
3513 &mut self,
3514
3515 request: ::fidl_next::Request<element_runner::SetLevel, ___T>,
3516
3517 responder: ::fidl_next::Responder<element_runner::SetLevel, ___T>,
3518 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3519
3520 fn on_unknown_interaction(
3521 &mut self,
3522 ordinal: u64,
3523 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3524 ::core::future::ready(())
3525 }
3526}
3527
3528impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ElementRunner
3529where
3530 ___H: ElementRunnerServerHandler<___T> + ::core::marker::Send,
3531 ___T: ::fidl_next::Transport,
3532 for<'de> crate::wire::ElementRunnerSetLevelRequest: ::fidl_next::Decode<
3533 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3534 Constraint = (),
3535 >,
3536{
3537 async fn on_one_way(
3538 handler: &mut ___H,
3539 mut message: ::fidl_next::Message<___T>,
3540 ) -> ::core::result::Result<
3541 (),
3542 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3543 > {
3544 match *message.header().ordinal {
3545 ordinal => {
3546 handler.on_unknown_interaction(ordinal).await;
3547 if ::core::matches!(
3548 message.header().flexibility(),
3549 ::fidl_next::protocol::Flexibility::Strict
3550 ) {
3551 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3552 } else {
3553 Ok(())
3554 }
3555 }
3556 }
3557 }
3558
3559 async fn on_two_way(
3560 handler: &mut ___H,
3561 mut message: ::fidl_next::Message<___T>,
3562 responder: ::fidl_next::protocol::Responder<___T>,
3563 ) -> ::core::result::Result<
3564 (),
3565 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3566 > {
3567 match *message.header().ordinal {
3568 79537611020078859 => {
3569 let responder = ::fidl_next::Responder::from_untyped(responder);
3570
3571 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3572 Ok(decoded) => {
3573 handler
3574 .set_level(::fidl_next::Request::from_decoded(decoded), responder)
3575 .await;
3576 Ok(())
3577 }
3578 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3579 ordinal: 79537611020078859,
3580 error,
3581 }),
3582 }
3583 }
3584
3585 ordinal => {
3586 handler.on_unknown_interaction(ordinal).await;
3587 if ::core::matches!(
3588 message.header().flexibility(),
3589 ::fidl_next::protocol::Flexibility::Strict
3590 ) {
3591 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3592 } else {
3593 responder
3594 .respond_framework_error(
3595 ordinal,
3596 ::fidl_next::FrameworkError::UnknownMethod,
3597 )
3598 .expect("encoding a framework error should never fail")
3599 .await?;
3600 Ok(())
3601 }
3602 }
3603 }
3604 }
3605}
3606
3607impl<___T> ElementRunnerClientHandler<___T> for ::fidl_next::IgnoreEvents
3608where
3609 ___T: ::fidl_next::Transport,
3610{
3611 async fn on_unknown_interaction(&mut self, _: u64) {}
3612}
3613
3614impl<___H, ___T> ElementRunnerLocalClientHandler<___T> for ::fidl_next::Local<___H>
3615where
3616 ___H: ElementRunnerClientHandler<___T>,
3617 ___T: ::fidl_next::Transport,
3618{
3619 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3620 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3621 }
3622}
3623
3624impl<___H, ___T> ElementRunnerLocalServerHandler<___T> for ::fidl_next::Local<___H>
3625where
3626 ___H: ElementRunnerServerHandler<___T>,
3627 ___T: ::fidl_next::Transport,
3628{
3629 async fn set_level(
3630 &mut self,
3631
3632 request: ::fidl_next::Request<element_runner::SetLevel, ___T>,
3633
3634 responder: ::fidl_next::Responder<element_runner::SetLevel, ___T>,
3635 ) {
3636 ___H::set_level(&mut self.0, request, responder).await
3637 }
3638
3639 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3640 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3641 }
3642}
3643
3644pub const MAX_DEPENDENCIES_IN_ADD_ELEMENT: u16 = 128 as u16;
3645
3646#[doc = " A token that represents an open lease. The client\'s handle should be\n dropped to indicate the lease should be closed. This handle may be\n duplicated if the lease will be shared; the lease will remain open\n until the last handle is dropped.\n"]
3647pub const LEASE_TOKEN_RIGHTS: ::fidl_next::fuchsia::zx::Rights =
3648 ::fidl_next::fuchsia::zx::Rights::from_bits_retain(24579);
3649
3650#[doc = " Signal sent by Power Broker on the LeaseToken when the lease is satisfied.\n"]
3651pub const LEASE_SIGNAL_SATISFIED: u32 = 16777216 as u32;
3652
3653#[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"]
3655#[derive(PartialEq, Debug)]
3656pub struct LeaseControl;
3657
3658#[cfg(target_os = "fuchsia")]
3659impl ::fidl_next::HasTransport for LeaseControl {
3660 type Transport = ::fidl_next::fuchsia::zx::Channel;
3661}
3662
3663pub mod lease_control {
3664 pub mod prelude {
3665 pub use crate::{
3666 LeaseControl, LeaseControlClientHandler, LeaseControlLocalClientHandler,
3667 LeaseControlLocalServerHandler, LeaseControlServerHandler, lease_control,
3668 };
3669
3670 pub use crate::natural::LeaseControlWatchStatusRequest;
3671
3672 pub use crate::natural::LeaseControlWatchStatusResponse;
3673 }
3674
3675 pub struct WatchStatus;
3676
3677 impl ::fidl_next::Method for WatchStatus {
3678 const ORDINAL: u64 = 2970891070576830593;
3679 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3680 ::fidl_next::protocol::Flexibility::Flexible;
3681
3682 type Protocol = crate::LeaseControl;
3683
3684 type Request = crate::wire::LeaseControlWatchStatusRequest;
3685 }
3686
3687 impl ::fidl_next::TwoWayMethod for WatchStatus {
3688 type Response =
3689 ::fidl_next::wire::Flexible<'static, crate::wire::LeaseControlWatchStatusResponse>;
3690 }
3691
3692 impl<___R> ::fidl_next::Respond<___R> for WatchStatus {
3693 type Output = ::fidl_next::Flexible<crate::generic::LeaseControlWatchStatusResponse<___R>>;
3694
3695 fn respond(response: ___R) -> Self::Output {
3696 ::fidl_next::Flexible(crate::generic::LeaseControlWatchStatusResponse {
3697 status: response,
3698 })
3699 }
3700 }
3701
3702 mod ___detail {
3703 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LeaseControl
3704 where
3705 ___T: ::fidl_next::Transport,
3706 {
3707 type Client = LeaseControlClient<___T>;
3708 type Server = LeaseControlServer<___T>;
3709 }
3710
3711 #[repr(transparent)]
3713 pub struct LeaseControlClient<___T: ::fidl_next::Transport> {
3714 #[allow(dead_code)]
3715 client: ::fidl_next::protocol::Client<___T>,
3716 }
3717
3718 impl<___T> LeaseControlClient<___T>
3719 where
3720 ___T: ::fidl_next::Transport,
3721 {
3722 #[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"]
3723 pub fn watch_status(
3724 &self,
3725
3726 last_status: impl ::fidl_next::Encode<
3727 crate::wire::LeaseStatus,
3728 <___T as ::fidl_next::Transport>::SendBuffer,
3729 >,
3730 ) -> ::fidl_next::TwoWayFuture<'_, super::WatchStatus, ___T>
3731 where
3732 <___T as ::fidl_next::Transport>::SendBuffer:
3733 ::fidl_next::encoder::InternalHandleEncoder,
3734 {
3735 self.watch_status_with(crate::generic::LeaseControlWatchStatusRequest {
3736 last_status,
3737 })
3738 }
3739
3740 #[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"]
3741 pub fn watch_status_with<___R>(
3742 &self,
3743 request: ___R,
3744 ) -> ::fidl_next::TwoWayFuture<'_, super::WatchStatus, ___T>
3745 where
3746 ___R: ::fidl_next::Encode<
3747 crate::wire::LeaseControlWatchStatusRequest,
3748 <___T as ::fidl_next::Transport>::SendBuffer,
3749 >,
3750 {
3751 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3752 2970891070576830593,
3753 <super::WatchStatus as ::fidl_next::Method>::FLEXIBILITY,
3754 request,
3755 ))
3756 }
3757 }
3758
3759 #[repr(transparent)]
3761 pub struct LeaseControlServer<___T: ::fidl_next::Transport> {
3762 server: ::fidl_next::protocol::Server<___T>,
3763 }
3764
3765 impl<___T> LeaseControlServer<___T> where ___T: ::fidl_next::Transport {}
3766 }
3767}
3768
3769#[diagnostic::on_unimplemented(
3770 note = "If {Self} implements the non-local LeaseControlClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3771)]
3772
3773pub trait LeaseControlLocalClientHandler<
3777 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3778 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3779>
3780{
3781 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3782 ::core::future::ready(())
3783 }
3784}
3785
3786impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LeaseControl
3787where
3788 ___H: LeaseControlLocalClientHandler<___T>,
3789 ___T: ::fidl_next::Transport,
3790{
3791 async fn on_event(
3792 handler: &mut ___H,
3793 mut message: ::fidl_next::Message<___T>,
3794 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3795 match *message.header().ordinal {
3796 ordinal => {
3797 handler.on_unknown_interaction(ordinal).await;
3798 if ::core::matches!(
3799 message.header().flexibility(),
3800 ::fidl_next::protocol::Flexibility::Strict
3801 ) {
3802 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3803 } else {
3804 Ok(())
3805 }
3806 }
3807 }
3808 }
3809}
3810
3811#[diagnostic::on_unimplemented(
3812 note = "If {Self} implements the non-local LeaseControlServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3813)]
3814
3815pub trait LeaseControlLocalServerHandler<
3819 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3820 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3821>
3822{
3823 #[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"]
3824 fn watch_status(
3825 &mut self,
3826
3827 request: ::fidl_next::Request<lease_control::WatchStatus, ___T>,
3828
3829 responder: ::fidl_next::Responder<lease_control::WatchStatus, ___T>,
3830 ) -> impl ::core::future::Future<Output = ()>;
3831
3832 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3833 ::core::future::ready(())
3834 }
3835}
3836
3837impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LeaseControl
3838where
3839 ___H: LeaseControlLocalServerHandler<___T>,
3840 ___T: ::fidl_next::Transport,
3841 for<'de> crate::wire::LeaseControlWatchStatusRequest: ::fidl_next::Decode<
3842 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3843 Constraint = (),
3844 >,
3845{
3846 async fn on_one_way(
3847 handler: &mut ___H,
3848 mut message: ::fidl_next::Message<___T>,
3849 ) -> ::core::result::Result<
3850 (),
3851 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3852 > {
3853 match *message.header().ordinal {
3854 ordinal => {
3855 handler.on_unknown_interaction(ordinal).await;
3856 if ::core::matches!(
3857 message.header().flexibility(),
3858 ::fidl_next::protocol::Flexibility::Strict
3859 ) {
3860 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3861 } else {
3862 Ok(())
3863 }
3864 }
3865 }
3866 }
3867
3868 async fn on_two_way(
3869 handler: &mut ___H,
3870 mut message: ::fidl_next::Message<___T>,
3871 responder: ::fidl_next::protocol::Responder<___T>,
3872 ) -> ::core::result::Result<
3873 (),
3874 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3875 > {
3876 match *message.header().ordinal {
3877 2970891070576830593 => {
3878 let responder = ::fidl_next::Responder::from_untyped(responder);
3879
3880 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3881 Ok(decoded) => {
3882 handler
3883 .watch_status(::fidl_next::Request::from_decoded(decoded), responder)
3884 .await;
3885 Ok(())
3886 }
3887 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3888 ordinal: 2970891070576830593,
3889 error,
3890 }),
3891 }
3892 }
3893
3894 ordinal => {
3895 handler.on_unknown_interaction(ordinal).await;
3896 if ::core::matches!(
3897 message.header().flexibility(),
3898 ::fidl_next::protocol::Flexibility::Strict
3899 ) {
3900 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3901 } else {
3902 responder
3903 .respond_framework_error(
3904 ordinal,
3905 ::fidl_next::FrameworkError::UnknownMethod,
3906 )
3907 .expect("encoding a framework error should never fail")
3908 .await?;
3909 Ok(())
3910 }
3911 }
3912 }
3913 }
3914}
3915
3916pub trait LeaseControlClientHandler<
3920 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3921 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3922>
3923{
3924 fn on_unknown_interaction(
3925 &mut self,
3926 ordinal: u64,
3927 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3928 ::core::future::ready(())
3929 }
3930}
3931
3932impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LeaseControl
3933where
3934 ___H: LeaseControlClientHandler<___T> + ::core::marker::Send,
3935 ___T: ::fidl_next::Transport,
3936{
3937 async fn on_event(
3938 handler: &mut ___H,
3939 mut message: ::fidl_next::Message<___T>,
3940 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3941 match *message.header().ordinal {
3942 ordinal => {
3943 handler.on_unknown_interaction(ordinal).await;
3944 if ::core::matches!(
3945 message.header().flexibility(),
3946 ::fidl_next::protocol::Flexibility::Strict
3947 ) {
3948 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3949 } else {
3950 Ok(())
3951 }
3952 }
3953 }
3954 }
3955}
3956
3957pub trait LeaseControlServerHandler<
3961 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3962 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3963>
3964{
3965 #[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"]
3966 fn watch_status(
3967 &mut self,
3968
3969 request: ::fidl_next::Request<lease_control::WatchStatus, ___T>,
3970
3971 responder: ::fidl_next::Responder<lease_control::WatchStatus, ___T>,
3972 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3973
3974 fn on_unknown_interaction(
3975 &mut self,
3976 ordinal: u64,
3977 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3978 ::core::future::ready(())
3979 }
3980}
3981
3982impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LeaseControl
3983where
3984 ___H: LeaseControlServerHandler<___T> + ::core::marker::Send,
3985 ___T: ::fidl_next::Transport,
3986 for<'de> crate::wire::LeaseControlWatchStatusRequest: ::fidl_next::Decode<
3987 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3988 Constraint = (),
3989 >,
3990{
3991 async fn on_one_way(
3992 handler: &mut ___H,
3993 mut message: ::fidl_next::Message<___T>,
3994 ) -> ::core::result::Result<
3995 (),
3996 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3997 > {
3998 match *message.header().ordinal {
3999 ordinal => {
4000 handler.on_unknown_interaction(ordinal).await;
4001 if ::core::matches!(
4002 message.header().flexibility(),
4003 ::fidl_next::protocol::Flexibility::Strict
4004 ) {
4005 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4006 } else {
4007 Ok(())
4008 }
4009 }
4010 }
4011 }
4012
4013 async fn on_two_way(
4014 handler: &mut ___H,
4015 mut message: ::fidl_next::Message<___T>,
4016 responder: ::fidl_next::protocol::Responder<___T>,
4017 ) -> ::core::result::Result<
4018 (),
4019 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4020 > {
4021 match *message.header().ordinal {
4022 2970891070576830593 => {
4023 let responder = ::fidl_next::Responder::from_untyped(responder);
4024
4025 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4026 Ok(decoded) => {
4027 handler
4028 .watch_status(::fidl_next::Request::from_decoded(decoded), responder)
4029 .await;
4030 Ok(())
4031 }
4032 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4033 ordinal: 2970891070576830593,
4034 error,
4035 }),
4036 }
4037 }
4038
4039 ordinal => {
4040 handler.on_unknown_interaction(ordinal).await;
4041 if ::core::matches!(
4042 message.header().flexibility(),
4043 ::fidl_next::protocol::Flexibility::Strict
4044 ) {
4045 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4046 } else {
4047 responder
4048 .respond_framework_error(
4049 ordinal,
4050 ::fidl_next::FrameworkError::UnknownMethod,
4051 )
4052 .expect("encoding a framework error should never fail")
4053 .await?;
4054 Ok(())
4055 }
4056 }
4057 }
4058 }
4059}
4060
4061impl<___T> LeaseControlClientHandler<___T> for ::fidl_next::IgnoreEvents
4062where
4063 ___T: ::fidl_next::Transport,
4064{
4065 async fn on_unknown_interaction(&mut self, _: u64) {}
4066}
4067
4068impl<___H, ___T> LeaseControlLocalClientHandler<___T> for ::fidl_next::Local<___H>
4069where
4070 ___H: LeaseControlClientHandler<___T>,
4071 ___T: ::fidl_next::Transport,
4072{
4073 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4074 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4075 }
4076}
4077
4078impl<___H, ___T> LeaseControlLocalServerHandler<___T> for ::fidl_next::Local<___H>
4079where
4080 ___H: LeaseControlServerHandler<___T>,
4081 ___T: ::fidl_next::Transport,
4082{
4083 async fn watch_status(
4084 &mut self,
4085
4086 request: ::fidl_next::Request<lease_control::WatchStatus, ___T>,
4087
4088 responder: ::fidl_next::Responder<lease_control::WatchStatus, ___T>,
4089 ) {
4090 ___H::watch_status(&mut self.0, request, responder).await
4091 }
4092
4093 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4094 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4095 }
4096}
4097
4098pub const MAX_TOKENS_IN_ADD_ELEMENT: u16 = 128 as u16;