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