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