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