1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8 pub struct ChannelSendMessageRequest {
9 pub message: ::std::vec::Vec<u8>,
10 }
11
12 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChannelSendMessageRequest<'static>, ___E>
13 for ChannelSendMessageRequest
14 where
15 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16 ___E: ::fidl_next::Encoder,
17 {
18 #[inline]
19 fn encode(
20 self,
21 encoder_: &mut ___E,
22 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendMessageRequest<'static>>,
23 _: (),
24 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
25 ::fidl_next::munge! {
26 let crate::wire::ChannelSendMessageRequest {
27 message,
28
29 } = out_;
30 }
31
32 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
33
34 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
35 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
36
37 Ok(())
38 }
39 }
40
41 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ChannelSendMessageRequest<'static>, ___E>
42 for &'a ChannelSendMessageRequest
43 where
44 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
45 ___E: ::fidl_next::Encoder,
46 {
47 #[inline]
48 fn encode(
49 self,
50 encoder_: &mut ___E,
51 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendMessageRequest<'static>>,
52 _: (),
53 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
54 ::fidl_next::munge! {
55 let crate::wire::ChannelSendMessageRequest {
56 message,
57
58 } = out_;
59 }
60
61 ::fidl_next::Encode::encode(&self.message, encoder_, message, (4294967295, ()))?;
62
63 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
64 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
65
66 Ok(())
67 }
68 }
69
70 unsafe impl<___E>
71 ::fidl_next::EncodeOption<
72 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendMessageRequest<'static>>,
73 ___E,
74 > for ChannelSendMessageRequest
75 where
76 ___E: ::fidl_next::Encoder + ?Sized,
77 ChannelSendMessageRequest:
78 ::fidl_next::Encode<crate::wire::ChannelSendMessageRequest<'static>, ___E>,
79 {
80 #[inline]
81 fn encode_option(
82 this: ::core::option::Option<Self>,
83 encoder: &mut ___E,
84 out: &mut ::core::mem::MaybeUninit<
85 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendMessageRequest<'static>>,
86 >,
87 _: (),
88 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
89 if let Some(inner) = this {
90 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
91 ::fidl_next::wire::Box::encode_present(out);
92 } else {
93 ::fidl_next::wire::Box::encode_absent(out);
94 }
95
96 Ok(())
97 }
98 }
99
100 unsafe impl<'a, ___E>
101 ::fidl_next::EncodeOption<
102 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendMessageRequest<'static>>,
103 ___E,
104 > for &'a ChannelSendMessageRequest
105 where
106 ___E: ::fidl_next::Encoder + ?Sized,
107 &'a ChannelSendMessageRequest:
108 ::fidl_next::Encode<crate::wire::ChannelSendMessageRequest<'static>, ___E>,
109 {
110 #[inline]
111 fn encode_option(
112 this: ::core::option::Option<Self>,
113 encoder: &mut ___E,
114 out: &mut ::core::mem::MaybeUninit<
115 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendMessageRequest<'static>>,
116 >,
117 _: (),
118 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
119 if let Some(inner) = this {
120 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
121 ::fidl_next::wire::Box::encode_present(out);
122 } else {
123 ::fidl_next::wire::Box::encode_absent(out);
124 }
125
126 Ok(())
127 }
128 }
129
130 impl<'de> ::fidl_next::FromWire<crate::wire::ChannelSendMessageRequest<'de>>
131 for ChannelSendMessageRequest
132 {
133 #[inline]
134 fn from_wire(wire: crate::wire::ChannelSendMessageRequest<'de>) -> Self {
135 Self { message: ::fidl_next::FromWire::from_wire(wire.message) }
136 }
137 }
138
139 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChannelSendMessageRequest<'de>>
140 for ChannelSendMessageRequest
141 {
142 #[inline]
143 fn from_wire_ref(wire: &crate::wire::ChannelSendMessageRequest<'de>) -> Self {
144 Self { message: ::fidl_next::FromWireRef::from_wire_ref(&wire.message) }
145 }
146 }
147
148 pub type ChannelSendMessageResponse = ();
149
150 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
151 pub struct ChannelSendRequestRequest {
152 pub request: ::std::vec::Vec<u8>,
153 }
154
155 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChannelSendRequestRequest<'static>, ___E>
156 for ChannelSendRequestRequest
157 where
158 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
159 ___E: ::fidl_next::Encoder,
160 {
161 #[inline]
162 fn encode(
163 self,
164 encoder_: &mut ___E,
165 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendRequestRequest<'static>>,
166 _: (),
167 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
168 ::fidl_next::munge! {
169 let crate::wire::ChannelSendRequestRequest {
170 request,
171
172 } = out_;
173 }
174
175 ::fidl_next::Encode::encode(self.request, encoder_, request, (4294967295, ()))?;
176
177 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(request.as_mut_ptr()) };
178 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
179
180 Ok(())
181 }
182 }
183
184 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ChannelSendRequestRequest<'static>, ___E>
185 for &'a ChannelSendRequestRequest
186 where
187 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
188 ___E: ::fidl_next::Encoder,
189 {
190 #[inline]
191 fn encode(
192 self,
193 encoder_: &mut ___E,
194 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendRequestRequest<'static>>,
195 _: (),
196 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
197 ::fidl_next::munge! {
198 let crate::wire::ChannelSendRequestRequest {
199 request,
200
201 } = out_;
202 }
203
204 ::fidl_next::Encode::encode(&self.request, encoder_, request, (4294967295, ()))?;
205
206 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(request.as_mut_ptr()) };
207 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
208
209 Ok(())
210 }
211 }
212
213 unsafe impl<___E>
214 ::fidl_next::EncodeOption<
215 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestRequest<'static>>,
216 ___E,
217 > for ChannelSendRequestRequest
218 where
219 ___E: ::fidl_next::Encoder + ?Sized,
220 ChannelSendRequestRequest:
221 ::fidl_next::Encode<crate::wire::ChannelSendRequestRequest<'static>, ___E>,
222 {
223 #[inline]
224 fn encode_option(
225 this: ::core::option::Option<Self>,
226 encoder: &mut ___E,
227 out: &mut ::core::mem::MaybeUninit<
228 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestRequest<'static>>,
229 >,
230 _: (),
231 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
232 if let Some(inner) = this {
233 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
234 ::fidl_next::wire::Box::encode_present(out);
235 } else {
236 ::fidl_next::wire::Box::encode_absent(out);
237 }
238
239 Ok(())
240 }
241 }
242
243 unsafe impl<'a, ___E>
244 ::fidl_next::EncodeOption<
245 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestRequest<'static>>,
246 ___E,
247 > for &'a ChannelSendRequestRequest
248 where
249 ___E: ::fidl_next::Encoder + ?Sized,
250 &'a ChannelSendRequestRequest:
251 ::fidl_next::Encode<crate::wire::ChannelSendRequestRequest<'static>, ___E>,
252 {
253 #[inline]
254 fn encode_option(
255 this: ::core::option::Option<Self>,
256 encoder: &mut ___E,
257 out: &mut ::core::mem::MaybeUninit<
258 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestRequest<'static>>,
259 >,
260 _: (),
261 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
262 if let Some(inner) = this {
263 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
264 ::fidl_next::wire::Box::encode_present(out);
265 } else {
266 ::fidl_next::wire::Box::encode_absent(out);
267 }
268
269 Ok(())
270 }
271 }
272
273 impl<'de> ::fidl_next::FromWire<crate::wire::ChannelSendRequestRequest<'de>>
274 for ChannelSendRequestRequest
275 {
276 #[inline]
277 fn from_wire(wire: crate::wire::ChannelSendRequestRequest<'de>) -> Self {
278 Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
279 }
280 }
281
282 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChannelSendRequestRequest<'de>>
283 for ChannelSendRequestRequest
284 {
285 #[inline]
286 fn from_wire_ref(wire: &crate::wire::ChannelSendRequestRequest<'de>) -> Self {
287 Self { request: ::fidl_next::FromWireRef::from_wire_ref(&wire.request) }
288 }
289 }
290
291 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
292 pub struct ChannelSendRequestResponse {
293 pub response: ::std::vec::Vec<u8>,
294 }
295
296 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChannelSendRequestResponse<'static>, ___E>
297 for ChannelSendRequestResponse
298 where
299 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
300 ___E: ::fidl_next::Encoder,
301 {
302 #[inline]
303 fn encode(
304 self,
305 encoder_: &mut ___E,
306 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendRequestResponse<'static>>,
307 _: (),
308 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
309 ::fidl_next::munge! {
310 let crate::wire::ChannelSendRequestResponse {
311 response,
312
313 } = out_;
314 }
315
316 ::fidl_next::Encode::encode(self.response, encoder_, response, (4294967295, ()))?;
317
318 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
319 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
320
321 Ok(())
322 }
323 }
324
325 unsafe impl<'a, ___E>
326 ::fidl_next::Encode<crate::wire::ChannelSendRequestResponse<'static>, ___E>
327 for &'a ChannelSendRequestResponse
328 where
329 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
330 ___E: ::fidl_next::Encoder,
331 {
332 #[inline]
333 fn encode(
334 self,
335 encoder_: &mut ___E,
336 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendRequestResponse<'static>>,
337 _: (),
338 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
339 ::fidl_next::munge! {
340 let crate::wire::ChannelSendRequestResponse {
341 response,
342
343 } = out_;
344 }
345
346 ::fidl_next::Encode::encode(&self.response, encoder_, response, (4294967295, ()))?;
347
348 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
349 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
350
351 Ok(())
352 }
353 }
354
355 unsafe impl<___E>
356 ::fidl_next::EncodeOption<
357 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestResponse<'static>>,
358 ___E,
359 > for ChannelSendRequestResponse
360 where
361 ___E: ::fidl_next::Encoder + ?Sized,
362 ChannelSendRequestResponse:
363 ::fidl_next::Encode<crate::wire::ChannelSendRequestResponse<'static>, ___E>,
364 {
365 #[inline]
366 fn encode_option(
367 this: ::core::option::Option<Self>,
368 encoder: &mut ___E,
369 out: &mut ::core::mem::MaybeUninit<
370 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestResponse<'static>>,
371 >,
372 _: (),
373 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
374 if let Some(inner) = this {
375 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
376 ::fidl_next::wire::Box::encode_present(out);
377 } else {
378 ::fidl_next::wire::Box::encode_absent(out);
379 }
380
381 Ok(())
382 }
383 }
384
385 unsafe impl<'a, ___E>
386 ::fidl_next::EncodeOption<
387 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestResponse<'static>>,
388 ___E,
389 > for &'a ChannelSendRequestResponse
390 where
391 ___E: ::fidl_next::Encoder + ?Sized,
392 &'a ChannelSendRequestResponse:
393 ::fidl_next::Encode<crate::wire::ChannelSendRequestResponse<'static>, ___E>,
394 {
395 #[inline]
396 fn encode_option(
397 this: ::core::option::Option<Self>,
398 encoder: &mut ___E,
399 out: &mut ::core::mem::MaybeUninit<
400 ::fidl_next::wire::Box<'static, crate::wire::ChannelSendRequestResponse<'static>>,
401 >,
402 _: (),
403 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
404 if let Some(inner) = this {
405 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
406 ::fidl_next::wire::Box::encode_present(out);
407 } else {
408 ::fidl_next::wire::Box::encode_absent(out);
409 }
410
411 Ok(())
412 }
413 }
414
415 impl<'de> ::fidl_next::FromWire<crate::wire::ChannelSendRequestResponse<'de>>
416 for ChannelSendRequestResponse
417 {
418 #[inline]
419 fn from_wire(wire: crate::wire::ChannelSendRequestResponse<'de>) -> Self {
420 Self { response: ::fidl_next::FromWire::from_wire(wire.response) }
421 }
422 }
423
424 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChannelSendRequestResponse<'de>>
425 for ChannelSendRequestResponse
426 {
427 #[inline]
428 fn from_wire_ref(wire: &crate::wire::ChannelSendRequestResponse<'de>) -> Self {
429 Self { response: ::fidl_next::FromWireRef::from_wire_ref(&wire.response) }
430 }
431 }
432
433 pub type ChannelRegisterListenerResponse = ();
434
435 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
436 pub struct ChannelInfo {
437 pub channel: ::core::option::Option<u32>,
438
439 pub client: ::core::option::Option<u32>,
440 }
441
442 impl ChannelInfo {
443 fn __max_ordinal(&self) -> usize {
444 if self.client.is_some() {
445 return 2;
446 }
447
448 if self.channel.is_some() {
449 return 1;
450 }
451
452 0
453 }
454 }
455
456 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChannelInfo<'static>, ___E> for ChannelInfo
457 where
458 ___E: ::fidl_next::Encoder + ?Sized,
459 {
460 #[inline]
461 fn encode(
462 mut self,
463 encoder: &mut ___E,
464 out: &mut ::core::mem::MaybeUninit<crate::wire::ChannelInfo<'static>>,
465 _: (),
466 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
467 ::fidl_next::munge!(let crate::wire::ChannelInfo { table } = out);
468
469 let max_ord = self.__max_ordinal();
470
471 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
472 ::fidl_next::Wire::zero_padding(&mut out);
473
474 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
475 ::fidl_next::wire::Envelope,
476 >(encoder, max_ord);
477
478 for i in 1..=max_ord {
479 match i {
480 2 => {
481 if let Some(value) = self.client.take() {
482 ::fidl_next::wire::Envelope::encode_value::<
483 ::fidl_next::wire::Uint32,
484 ___E,
485 >(
486 value, preallocated.encoder, &mut out, ()
487 )?;
488 } else {
489 ::fidl_next::wire::Envelope::encode_zero(&mut out)
490 }
491 }
492
493 1 => {
494 if let Some(value) = self.channel.take() {
495 ::fidl_next::wire::Envelope::encode_value::<
496 ::fidl_next::wire::Uint32,
497 ___E,
498 >(
499 value, preallocated.encoder, &mut out, ()
500 )?;
501 } else {
502 ::fidl_next::wire::Envelope::encode_zero(&mut out)
503 }
504 }
505
506 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
507 }
508 unsafe {
509 preallocated.write_next(out.assume_init_ref());
510 }
511 }
512
513 ::fidl_next::wire::Table::encode_len(table, max_ord);
514
515 Ok(())
516 }
517 }
518
519 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ChannelInfo<'static>, ___E>
520 for &'a ChannelInfo
521 where
522 ___E: ::fidl_next::Encoder + ?Sized,
523 {
524 #[inline]
525 fn encode(
526 self,
527 encoder: &mut ___E,
528 out: &mut ::core::mem::MaybeUninit<crate::wire::ChannelInfo<'static>>,
529 _: (),
530 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
531 ::fidl_next::munge!(let crate::wire::ChannelInfo { table } = out);
532
533 let max_ord = self.__max_ordinal();
534
535 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
536 ::fidl_next::Wire::zero_padding(&mut out);
537
538 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
539 ::fidl_next::wire::Envelope,
540 >(encoder, max_ord);
541
542 for i in 1..=max_ord {
543 match i {
544 2 => {
545 if let Some(value) = &self.client {
546 ::fidl_next::wire::Envelope::encode_value::<
547 ::fidl_next::wire::Uint32,
548 ___E,
549 >(
550 value, preallocated.encoder, &mut out, ()
551 )?;
552 } else {
553 ::fidl_next::wire::Envelope::encode_zero(&mut out)
554 }
555 }
556
557 1 => {
558 if let Some(value) = &self.channel {
559 ::fidl_next::wire::Envelope::encode_value::<
560 ::fidl_next::wire::Uint32,
561 ___E,
562 >(
563 value, preallocated.encoder, &mut out, ()
564 )?;
565 } else {
566 ::fidl_next::wire::Envelope::encode_zero(&mut out)
567 }
568 }
569
570 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
571 }
572 unsafe {
573 preallocated.write_next(out.assume_init_ref());
574 }
575 }
576
577 ::fidl_next::wire::Table::encode_len(table, max_ord);
578
579 Ok(())
580 }
581 }
582
583 impl<'de> ::fidl_next::FromWire<crate::wire::ChannelInfo<'de>> for ChannelInfo {
584 #[inline]
585 fn from_wire(wire_: crate::wire::ChannelInfo<'de>) -> Self {
586 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
587
588 let channel = wire_.table.get(1);
589
590 let client = wire_.table.get(2);
591
592 Self {
593 channel: channel.map(|envelope| {
594 ::fidl_next::FromWire::from_wire(unsafe {
595 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
596 })
597 }),
598
599 client: client.map(|envelope| {
600 ::fidl_next::FromWire::from_wire(unsafe {
601 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
602 })
603 }),
604 }
605 }
606 }
607
608 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChannelInfo<'de>> for ChannelInfo {
609 #[inline]
610 fn from_wire_ref(wire: &crate::wire::ChannelInfo<'de>) -> Self {
611 Self {
612 channel: wire.table.get(1).map(|envelope| {
613 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
614 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
615 })
616 }),
617
618 client: wire.table.get(2).map(|envelope| {
619 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
620 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
621 })
622 }),
623 }
624 }
625 }
626
627 #[doc = " `ControllerInfo` is passed to mailbox controller drivers via metadata.\n"]
628 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
629 pub struct ControllerInfo {
630 pub id: ::core::option::Option<u32>,
631
632 pub channels: ::core::option::Option<::std::vec::Vec<crate::natural::ChannelInfo>>,
633 }
634
635 impl ControllerInfo {
636 fn __max_ordinal(&self) -> usize {
637 if self.channels.is_some() {
638 return 2;
639 }
640
641 if self.id.is_some() {
642 return 1;
643 }
644
645 0
646 }
647 }
648
649 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ControllerInfo<'static>, ___E> for ControllerInfo
650 where
651 ___E: ::fidl_next::Encoder + ?Sized,
652 {
653 #[inline]
654 fn encode(
655 mut self,
656 encoder: &mut ___E,
657 out: &mut ::core::mem::MaybeUninit<crate::wire::ControllerInfo<'static>>,
658 _: (),
659 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
660 ::fidl_next::munge!(let crate::wire::ControllerInfo { table } = out);
661
662 let max_ord = self.__max_ordinal();
663
664 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
665 ::fidl_next::Wire::zero_padding(&mut out);
666
667 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
668 ::fidl_next::wire::Envelope,
669 >(encoder, max_ord);
670
671 for i in 1..=max_ord {
672 match i {
673 2 => {
674 if let Some(value) = self.channels.take() {
675 ::fidl_next::wire::Envelope::encode_value::<
676 ::fidl_next::wire::Vector<
677 'static,
678 crate::wire::ChannelInfo<'static>,
679 >,
680 ___E,
681 >(
682 value, preallocated.encoder, &mut out, (4294967295, ())
683 )?;
684 } else {
685 ::fidl_next::wire::Envelope::encode_zero(&mut out)
686 }
687 }
688
689 1 => {
690 if let Some(value) = self.id.take() {
691 ::fidl_next::wire::Envelope::encode_value::<
692 ::fidl_next::wire::Uint32,
693 ___E,
694 >(
695 value, preallocated.encoder, &mut out, ()
696 )?;
697 } else {
698 ::fidl_next::wire::Envelope::encode_zero(&mut out)
699 }
700 }
701
702 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
703 }
704 unsafe {
705 preallocated.write_next(out.assume_init_ref());
706 }
707 }
708
709 ::fidl_next::wire::Table::encode_len(table, max_ord);
710
711 Ok(())
712 }
713 }
714
715 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ControllerInfo<'static>, ___E>
716 for &'a ControllerInfo
717 where
718 ___E: ::fidl_next::Encoder + ?Sized,
719 {
720 #[inline]
721 fn encode(
722 self,
723 encoder: &mut ___E,
724 out: &mut ::core::mem::MaybeUninit<crate::wire::ControllerInfo<'static>>,
725 _: (),
726 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
727 ::fidl_next::munge!(let crate::wire::ControllerInfo { table } = out);
728
729 let max_ord = self.__max_ordinal();
730
731 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
732 ::fidl_next::Wire::zero_padding(&mut out);
733
734 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
735 ::fidl_next::wire::Envelope,
736 >(encoder, max_ord);
737
738 for i in 1..=max_ord {
739 match i {
740 2 => {
741 if let Some(value) = &self.channels {
742 ::fidl_next::wire::Envelope::encode_value::<
743 ::fidl_next::wire::Vector<
744 'static,
745 crate::wire::ChannelInfo<'static>,
746 >,
747 ___E,
748 >(
749 value, preallocated.encoder, &mut out, (4294967295, ())
750 )?;
751 } else {
752 ::fidl_next::wire::Envelope::encode_zero(&mut out)
753 }
754 }
755
756 1 => {
757 if let Some(value) = &self.id {
758 ::fidl_next::wire::Envelope::encode_value::<
759 ::fidl_next::wire::Uint32,
760 ___E,
761 >(
762 value, preallocated.encoder, &mut out, ()
763 )?;
764 } else {
765 ::fidl_next::wire::Envelope::encode_zero(&mut out)
766 }
767 }
768
769 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
770 }
771 unsafe {
772 preallocated.write_next(out.assume_init_ref());
773 }
774 }
775
776 ::fidl_next::wire::Table::encode_len(table, max_ord);
777
778 Ok(())
779 }
780 }
781
782 impl<'de> ::fidl_next::FromWire<crate::wire::ControllerInfo<'de>> for ControllerInfo {
783 #[inline]
784 fn from_wire(wire_: crate::wire::ControllerInfo<'de>) -> Self {
785 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
786
787 let id = wire_.table.get(1);
788
789 let channels = wire_.table.get(2);
790
791 Self {
792
793
794 id: id.map(|envelope| ::fidl_next::FromWire::from_wire(
795 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
796 )),
797
798
799 channels: channels.map(|envelope| ::fidl_next::FromWire::from_wire(
800 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>() }
801 )),
802
803 }
804 }
805 }
806
807 impl<'de> ::fidl_next::FromWireRef<crate::wire::ControllerInfo<'de>> for ControllerInfo {
808 #[inline]
809 fn from_wire_ref(wire: &crate::wire::ControllerInfo<'de>) -> Self {
810 Self {
811
812
813 id: wire.table.get(1)
814 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
815 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
816 )),
817
818
819 channels: wire.table.get(2)
820 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
821 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>() }
822 )),
823
824 }
825 }
826 }
827
828 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
829 pub struct ListenerOnMessageRequest {
830 pub message: ::std::vec::Vec<u8>,
831 }
832
833 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>
834 for ListenerOnMessageRequest
835 where
836 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
837 ___E: ::fidl_next::Encoder,
838 {
839 #[inline]
840 fn encode(
841 self,
842 encoder_: &mut ___E,
843 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnMessageRequest<'static>>,
844 _: (),
845 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
846 ::fidl_next::munge! {
847 let crate::wire::ListenerOnMessageRequest {
848 message,
849
850 } = out_;
851 }
852
853 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
854
855 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
856 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
857
858 Ok(())
859 }
860 }
861
862 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>
863 for &'a ListenerOnMessageRequest
864 where
865 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
866 ___E: ::fidl_next::Encoder,
867 {
868 #[inline]
869 fn encode(
870 self,
871 encoder_: &mut ___E,
872 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnMessageRequest<'static>>,
873 _: (),
874 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
875 ::fidl_next::munge! {
876 let crate::wire::ListenerOnMessageRequest {
877 message,
878
879 } = out_;
880 }
881
882 ::fidl_next::Encode::encode(&self.message, encoder_, message, (4294967295, ()))?;
883
884 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
885 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
886
887 Ok(())
888 }
889 }
890
891 unsafe impl<___E>
892 ::fidl_next::EncodeOption<
893 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
894 ___E,
895 > for ListenerOnMessageRequest
896 where
897 ___E: ::fidl_next::Encoder + ?Sized,
898 ListenerOnMessageRequest:
899 ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>,
900 {
901 #[inline]
902 fn encode_option(
903 this: ::core::option::Option<Self>,
904 encoder: &mut ___E,
905 out: &mut ::core::mem::MaybeUninit<
906 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
907 >,
908 _: (),
909 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
910 if let Some(inner) = this {
911 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
912 ::fidl_next::wire::Box::encode_present(out);
913 } else {
914 ::fidl_next::wire::Box::encode_absent(out);
915 }
916
917 Ok(())
918 }
919 }
920
921 unsafe impl<'a, ___E>
922 ::fidl_next::EncodeOption<
923 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
924 ___E,
925 > for &'a ListenerOnMessageRequest
926 where
927 ___E: ::fidl_next::Encoder + ?Sized,
928 &'a ListenerOnMessageRequest:
929 ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>,
930 {
931 #[inline]
932 fn encode_option(
933 this: ::core::option::Option<Self>,
934 encoder: &mut ___E,
935 out: &mut ::core::mem::MaybeUninit<
936 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
937 >,
938 _: (),
939 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
940 if let Some(inner) = this {
941 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
942 ::fidl_next::wire::Box::encode_present(out);
943 } else {
944 ::fidl_next::wire::Box::encode_absent(out);
945 }
946
947 Ok(())
948 }
949 }
950
951 impl<'de> ::fidl_next::FromWire<crate::wire::ListenerOnMessageRequest<'de>>
952 for ListenerOnMessageRequest
953 {
954 #[inline]
955 fn from_wire(wire: crate::wire::ListenerOnMessageRequest<'de>) -> Self {
956 Self { message: ::fidl_next::FromWire::from_wire(wire.message) }
957 }
958 }
959
960 impl<'de> ::fidl_next::FromWireRef<crate::wire::ListenerOnMessageRequest<'de>>
961 for ListenerOnMessageRequest
962 {
963 #[inline]
964 fn from_wire_ref(wire: &crate::wire::ListenerOnMessageRequest<'de>) -> Self {
965 Self { message: ::fidl_next::FromWireRef::from_wire_ref(&wire.message) }
966 }
967 }
968
969 pub type ListenerOnMessageResponse = ();
970
971 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
972 pub struct ListenerOnRequestRequest {
973 pub message: ::std::vec::Vec<u8>,
974 }
975
976 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>
977 for ListenerOnRequestRequest
978 where
979 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
980 ___E: ::fidl_next::Encoder,
981 {
982 #[inline]
983 fn encode(
984 self,
985 encoder_: &mut ___E,
986 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestRequest<'static>>,
987 _: (),
988 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
989 ::fidl_next::munge! {
990 let crate::wire::ListenerOnRequestRequest {
991 message,
992
993 } = out_;
994 }
995
996 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
997
998 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
999 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1000
1001 Ok(())
1002 }
1003 }
1004
1005 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>
1006 for &'a ListenerOnRequestRequest
1007 where
1008 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1009 ___E: ::fidl_next::Encoder,
1010 {
1011 #[inline]
1012 fn encode(
1013 self,
1014 encoder_: &mut ___E,
1015 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestRequest<'static>>,
1016 _: (),
1017 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1018 ::fidl_next::munge! {
1019 let crate::wire::ListenerOnRequestRequest {
1020 message,
1021
1022 } = out_;
1023 }
1024
1025 ::fidl_next::Encode::encode(&self.message, encoder_, message, (4294967295, ()))?;
1026
1027 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
1028 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1029
1030 Ok(())
1031 }
1032 }
1033
1034 unsafe impl<___E>
1035 ::fidl_next::EncodeOption<
1036 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1037 ___E,
1038 > for ListenerOnRequestRequest
1039 where
1040 ___E: ::fidl_next::Encoder + ?Sized,
1041 ListenerOnRequestRequest:
1042 ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>,
1043 {
1044 #[inline]
1045 fn encode_option(
1046 this: ::core::option::Option<Self>,
1047 encoder: &mut ___E,
1048 out: &mut ::core::mem::MaybeUninit<
1049 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1050 >,
1051 _: (),
1052 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1053 if let Some(inner) = this {
1054 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1055 ::fidl_next::wire::Box::encode_present(out);
1056 } else {
1057 ::fidl_next::wire::Box::encode_absent(out);
1058 }
1059
1060 Ok(())
1061 }
1062 }
1063
1064 unsafe impl<'a, ___E>
1065 ::fidl_next::EncodeOption<
1066 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1067 ___E,
1068 > for &'a ListenerOnRequestRequest
1069 where
1070 ___E: ::fidl_next::Encoder + ?Sized,
1071 &'a ListenerOnRequestRequest:
1072 ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>,
1073 {
1074 #[inline]
1075 fn encode_option(
1076 this: ::core::option::Option<Self>,
1077 encoder: &mut ___E,
1078 out: &mut ::core::mem::MaybeUninit<
1079 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1080 >,
1081 _: (),
1082 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1083 if let Some(inner) = this {
1084 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1085 ::fidl_next::wire::Box::encode_present(out);
1086 } else {
1087 ::fidl_next::wire::Box::encode_absent(out);
1088 }
1089
1090 Ok(())
1091 }
1092 }
1093
1094 impl<'de> ::fidl_next::FromWire<crate::wire::ListenerOnRequestRequest<'de>>
1095 for ListenerOnRequestRequest
1096 {
1097 #[inline]
1098 fn from_wire(wire: crate::wire::ListenerOnRequestRequest<'de>) -> Self {
1099 Self { message: ::fidl_next::FromWire::from_wire(wire.message) }
1100 }
1101 }
1102
1103 impl<'de> ::fidl_next::FromWireRef<crate::wire::ListenerOnRequestRequest<'de>>
1104 for ListenerOnRequestRequest
1105 {
1106 #[inline]
1107 fn from_wire_ref(wire: &crate::wire::ListenerOnRequestRequest<'de>) -> Self {
1108 Self { message: ::fidl_next::FromWireRef::from_wire_ref(&wire.message) }
1109 }
1110 }
1111
1112 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1113 pub struct ListenerOnRequestResponse {
1114 pub response: ::std::vec::Vec<u8>,
1115 }
1116
1117 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>
1118 for ListenerOnRequestResponse
1119 where
1120 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1121 ___E: ::fidl_next::Encoder,
1122 {
1123 #[inline]
1124 fn encode(
1125 self,
1126 encoder_: &mut ___E,
1127 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestResponse<'static>>,
1128 _: (),
1129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1130 ::fidl_next::munge! {
1131 let crate::wire::ListenerOnRequestResponse {
1132 response,
1133
1134 } = out_;
1135 }
1136
1137 ::fidl_next::Encode::encode(self.response, encoder_, response, (4294967295, ()))?;
1138
1139 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
1140 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1141
1142 Ok(())
1143 }
1144 }
1145
1146 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>
1147 for &'a ListenerOnRequestResponse
1148 where
1149 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1150 ___E: ::fidl_next::Encoder,
1151 {
1152 #[inline]
1153 fn encode(
1154 self,
1155 encoder_: &mut ___E,
1156 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestResponse<'static>>,
1157 _: (),
1158 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1159 ::fidl_next::munge! {
1160 let crate::wire::ListenerOnRequestResponse {
1161 response,
1162
1163 } = out_;
1164 }
1165
1166 ::fidl_next::Encode::encode(&self.response, encoder_, response, (4294967295, ()))?;
1167
1168 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
1169 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1170
1171 Ok(())
1172 }
1173 }
1174
1175 unsafe impl<___E>
1176 ::fidl_next::EncodeOption<
1177 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1178 ___E,
1179 > for ListenerOnRequestResponse
1180 where
1181 ___E: ::fidl_next::Encoder + ?Sized,
1182 ListenerOnRequestResponse:
1183 ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>,
1184 {
1185 #[inline]
1186 fn encode_option(
1187 this: ::core::option::Option<Self>,
1188 encoder: &mut ___E,
1189 out: &mut ::core::mem::MaybeUninit<
1190 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1191 >,
1192 _: (),
1193 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1194 if let Some(inner) = this {
1195 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1196 ::fidl_next::wire::Box::encode_present(out);
1197 } else {
1198 ::fidl_next::wire::Box::encode_absent(out);
1199 }
1200
1201 Ok(())
1202 }
1203 }
1204
1205 unsafe impl<'a, ___E>
1206 ::fidl_next::EncodeOption<
1207 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1208 ___E,
1209 > for &'a ListenerOnRequestResponse
1210 where
1211 ___E: ::fidl_next::Encoder + ?Sized,
1212 &'a ListenerOnRequestResponse:
1213 ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>,
1214 {
1215 #[inline]
1216 fn encode_option(
1217 this: ::core::option::Option<Self>,
1218 encoder: &mut ___E,
1219 out: &mut ::core::mem::MaybeUninit<
1220 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1221 >,
1222 _: (),
1223 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1224 if let Some(inner) = this {
1225 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1226 ::fidl_next::wire::Box::encode_present(out);
1227 } else {
1228 ::fidl_next::wire::Box::encode_absent(out);
1229 }
1230
1231 Ok(())
1232 }
1233 }
1234
1235 impl<'de> ::fidl_next::FromWire<crate::wire::ListenerOnRequestResponse<'de>>
1236 for ListenerOnRequestResponse
1237 {
1238 #[inline]
1239 fn from_wire(wire: crate::wire::ListenerOnRequestResponse<'de>) -> Self {
1240 Self { response: ::fidl_next::FromWire::from_wire(wire.response) }
1241 }
1242 }
1243
1244 impl<'de> ::fidl_next::FromWireRef<crate::wire::ListenerOnRequestResponse<'de>>
1245 for ListenerOnRequestResponse
1246 {
1247 #[inline]
1248 fn from_wire_ref(wire: &crate::wire::ListenerOnRequestResponse<'de>) -> Self {
1249 Self { response: ::fidl_next::FromWireRef::from_wire_ref(&wire.response) }
1250 }
1251 }
1252}
1253
1254pub mod wire {
1255
1256 #[derive(Debug)]
1258 #[repr(C)]
1259 pub struct ChannelSendMessageRequest<'de> {
1260 pub message: ::fidl_next::wire::Vector<'de, u8>,
1261 }
1262
1263 static_assertions::const_assert_eq!(std::mem::size_of::<ChannelSendMessageRequest<'_>>(), 16);
1264 static_assertions::const_assert_eq!(std::mem::align_of::<ChannelSendMessageRequest<'_>>(), 8);
1265
1266 static_assertions::const_assert_eq!(
1267 std::mem::offset_of!(ChannelSendMessageRequest<'_>, message),
1268 0
1269 );
1270
1271 impl ::fidl_next::Constrained for ChannelSendMessageRequest<'_> {
1272 type Constraint = ();
1273
1274 fn validate(
1275 _: ::fidl_next::Slot<'_, Self>,
1276 _: Self::Constraint,
1277 ) -> Result<(), ::fidl_next::ValidationError> {
1278 Ok(())
1279 }
1280 }
1281
1282 unsafe impl ::fidl_next::Wire for ChannelSendMessageRequest<'static> {
1283 type Narrowed<'de> = ChannelSendMessageRequest<'de>;
1284
1285 #[inline]
1286 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1287 ::fidl_next::munge! {
1288 let Self {
1289 message,
1290
1291 } = &mut *out_;
1292 }
1293
1294 ::fidl_next::Wire::zero_padding(message);
1295 }
1296 }
1297
1298 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelSendMessageRequest<'de>
1299 where
1300 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1301 ___D: ::fidl_next::Decoder<'de>,
1302 {
1303 fn decode(
1304 slot_: ::fidl_next::Slot<'_, Self>,
1305 decoder_: &mut ___D,
1306 _: (),
1307 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1308 ::fidl_next::munge! {
1309 let Self {
1310 mut message,
1311
1312 } = slot_;
1313 }
1314
1315 let _field = message.as_mut();
1316 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1317 ::fidl_next::Decode::decode(message.as_mut(), decoder_, (4294967295, ()))?;
1318
1319 Ok(())
1320 }
1321 }
1322
1323 impl<'de> ::fidl_next::IntoNatural for ChannelSendMessageRequest<'de> {
1324 type Natural = crate::natural::ChannelSendMessageRequest;
1325 }
1326
1327 pub type ChannelSendMessageResponse = ::fidl_next::wire::Unit;
1329
1330 #[derive(Debug)]
1332 #[repr(C)]
1333 pub struct ChannelSendRequestRequest<'de> {
1334 pub request: ::fidl_next::wire::Vector<'de, u8>,
1335 }
1336
1337 static_assertions::const_assert_eq!(std::mem::size_of::<ChannelSendRequestRequest<'_>>(), 16);
1338 static_assertions::const_assert_eq!(std::mem::align_of::<ChannelSendRequestRequest<'_>>(), 8);
1339
1340 static_assertions::const_assert_eq!(
1341 std::mem::offset_of!(ChannelSendRequestRequest<'_>, request),
1342 0
1343 );
1344
1345 impl ::fidl_next::Constrained for ChannelSendRequestRequest<'_> {
1346 type Constraint = ();
1347
1348 fn validate(
1349 _: ::fidl_next::Slot<'_, Self>,
1350 _: Self::Constraint,
1351 ) -> Result<(), ::fidl_next::ValidationError> {
1352 Ok(())
1353 }
1354 }
1355
1356 unsafe impl ::fidl_next::Wire for ChannelSendRequestRequest<'static> {
1357 type Narrowed<'de> = ChannelSendRequestRequest<'de>;
1358
1359 #[inline]
1360 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1361 ::fidl_next::munge! {
1362 let Self {
1363 request,
1364
1365 } = &mut *out_;
1366 }
1367
1368 ::fidl_next::Wire::zero_padding(request);
1369 }
1370 }
1371
1372 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelSendRequestRequest<'de>
1373 where
1374 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1375 ___D: ::fidl_next::Decoder<'de>,
1376 {
1377 fn decode(
1378 slot_: ::fidl_next::Slot<'_, Self>,
1379 decoder_: &mut ___D,
1380 _: (),
1381 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1382 ::fidl_next::munge! {
1383 let Self {
1384 mut request,
1385
1386 } = slot_;
1387 }
1388
1389 let _field = request.as_mut();
1390 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1391 ::fidl_next::Decode::decode(request.as_mut(), decoder_, (4294967295, ()))?;
1392
1393 Ok(())
1394 }
1395 }
1396
1397 impl<'de> ::fidl_next::IntoNatural for ChannelSendRequestRequest<'de> {
1398 type Natural = crate::natural::ChannelSendRequestRequest;
1399 }
1400
1401 #[derive(Debug)]
1403 #[repr(C)]
1404 pub struct ChannelSendRequestResponse<'de> {
1405 pub response: ::fidl_next::wire::Vector<'de, u8>,
1406 }
1407
1408 static_assertions::const_assert_eq!(std::mem::size_of::<ChannelSendRequestResponse<'_>>(), 16);
1409 static_assertions::const_assert_eq!(std::mem::align_of::<ChannelSendRequestResponse<'_>>(), 8);
1410
1411 static_assertions::const_assert_eq!(
1412 std::mem::offset_of!(ChannelSendRequestResponse<'_>, response),
1413 0
1414 );
1415
1416 impl ::fidl_next::Constrained for ChannelSendRequestResponse<'_> {
1417 type Constraint = ();
1418
1419 fn validate(
1420 _: ::fidl_next::Slot<'_, Self>,
1421 _: Self::Constraint,
1422 ) -> Result<(), ::fidl_next::ValidationError> {
1423 Ok(())
1424 }
1425 }
1426
1427 unsafe impl ::fidl_next::Wire for ChannelSendRequestResponse<'static> {
1428 type Narrowed<'de> = ChannelSendRequestResponse<'de>;
1429
1430 #[inline]
1431 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1432 ::fidl_next::munge! {
1433 let Self {
1434 response,
1435
1436 } = &mut *out_;
1437 }
1438
1439 ::fidl_next::Wire::zero_padding(response);
1440 }
1441 }
1442
1443 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelSendRequestResponse<'de>
1444 where
1445 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1446 ___D: ::fidl_next::Decoder<'de>,
1447 {
1448 fn decode(
1449 slot_: ::fidl_next::Slot<'_, Self>,
1450 decoder_: &mut ___D,
1451 _: (),
1452 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1453 ::fidl_next::munge! {
1454 let Self {
1455 mut response,
1456
1457 } = slot_;
1458 }
1459
1460 let _field = response.as_mut();
1461 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1462 ::fidl_next::Decode::decode(response.as_mut(), decoder_, (4294967295, ()))?;
1463
1464 Ok(())
1465 }
1466 }
1467
1468 impl<'de> ::fidl_next::IntoNatural for ChannelSendRequestResponse<'de> {
1469 type Natural = crate::natural::ChannelSendRequestResponse;
1470 }
1471
1472 pub type ChannelRegisterListenerResponse = ::fidl_next::wire::Unit;
1474
1475 #[repr(C)]
1477 pub struct ChannelInfo<'de> {
1478 pub(crate) table: ::fidl_next::wire::Table<'de>,
1479 }
1480
1481 impl<'de> Drop for ChannelInfo<'de> {
1482 fn drop(&mut self) {
1483 let _ = self
1484 .table
1485 .get(1)
1486 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1487
1488 let _ = self
1489 .table
1490 .get(2)
1491 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1492 }
1493 }
1494
1495 impl ::fidl_next::Constrained for ChannelInfo<'_> {
1496 type Constraint = ();
1497
1498 fn validate(
1499 _: ::fidl_next::Slot<'_, Self>,
1500 _: Self::Constraint,
1501 ) -> Result<(), ::fidl_next::ValidationError> {
1502 Ok(())
1503 }
1504 }
1505
1506 unsafe impl ::fidl_next::Wire for ChannelInfo<'static> {
1507 type Narrowed<'de> = ChannelInfo<'de>;
1508
1509 #[inline]
1510 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1511 ::fidl_next::munge!(let Self { table } = out);
1512 ::fidl_next::wire::Table::zero_padding(table);
1513 }
1514 }
1515
1516 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelInfo<'de>
1517 where
1518 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1519 {
1520 fn decode(
1521 slot: ::fidl_next::Slot<'_, Self>,
1522 decoder: &mut ___D,
1523 _: (),
1524 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1525 ::fidl_next::munge!(let Self { table } = slot);
1526
1527 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1528 match ordinal {
1529 0 => unsafe { ::core::hint::unreachable_unchecked() },
1530
1531 1 => {
1532 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1533 slot.as_mut(),
1534 decoder,
1535 (),
1536 )?;
1537
1538 Ok(())
1539 }
1540
1541 2 => {
1542 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1543 slot.as_mut(),
1544 decoder,
1545 (),
1546 )?;
1547
1548 Ok(())
1549 }
1550
1551 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1552 }
1553 })
1554 }
1555 }
1556
1557 impl<'de> ChannelInfo<'de> {
1558 pub fn channel(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1559 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1560 }
1561
1562 pub fn take_channel(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1563 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1564 }
1565
1566 pub fn client(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1567 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1568 }
1569
1570 pub fn take_client(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1571 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1572 }
1573 }
1574
1575 impl<'de> ::core::fmt::Debug for ChannelInfo<'de> {
1576 fn fmt(
1577 &self,
1578 f: &mut ::core::fmt::Formatter<'_>,
1579 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1580 f.debug_struct("ChannelInfo")
1581 .field("channel", &self.channel())
1582 .field("client", &self.client())
1583 .finish()
1584 }
1585 }
1586
1587 impl<'de> ::fidl_next::IntoNatural for ChannelInfo<'de> {
1588 type Natural = crate::natural::ChannelInfo;
1589 }
1590
1591 #[repr(C)]
1593 pub struct ControllerInfo<'de> {
1594 pub(crate) table: ::fidl_next::wire::Table<'de>,
1595 }
1596
1597 impl<'de> Drop for ControllerInfo<'de> {
1598 fn drop(&mut self) {
1599 let _ = self
1600 .table
1601 .get(1)
1602 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1603
1604 let _ = self.table.get(2)
1605 .map(|envelope| unsafe {
1606 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>()
1607 });
1608 }
1609 }
1610
1611 impl ::fidl_next::Constrained for ControllerInfo<'_> {
1612 type Constraint = ();
1613
1614 fn validate(
1615 _: ::fidl_next::Slot<'_, Self>,
1616 _: Self::Constraint,
1617 ) -> Result<(), ::fidl_next::ValidationError> {
1618 Ok(())
1619 }
1620 }
1621
1622 unsafe impl ::fidl_next::Wire for ControllerInfo<'static> {
1623 type Narrowed<'de> = ControllerInfo<'de>;
1624
1625 #[inline]
1626 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1627 ::fidl_next::munge!(let Self { table } = out);
1628 ::fidl_next::wire::Table::zero_padding(table);
1629 }
1630 }
1631
1632 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ControllerInfo<'de>
1633 where
1634 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1635 {
1636 fn decode(
1637 slot: ::fidl_next::Slot<'_, Self>,
1638 decoder: &mut ___D,
1639 _: (),
1640 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1641 ::fidl_next::munge!(let Self { table } = slot);
1642
1643 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1644 match ordinal {
1645 0 => unsafe { ::core::hint::unreachable_unchecked() },
1646
1647 1 => {
1648 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1649 slot.as_mut(),
1650 decoder,
1651 (),
1652 )?;
1653
1654 Ok(())
1655 }
1656
1657 2 => {
1658 ::fidl_next::wire::Envelope::decode_as::<
1659 ___D,
1660 ::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>,
1661 >(slot.as_mut(), decoder, (4294967295, ()))?;
1662
1663 Ok(())
1664 }
1665
1666 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1667 }
1668 })
1669 }
1670 }
1671
1672 impl<'de> ControllerInfo<'de> {
1673 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1674 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1675 }
1676
1677 pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1678 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1679 }
1680
1681 pub fn channels(
1682 &self,
1683 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>
1684 {
1685 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1686 }
1687
1688 pub fn take_channels(
1689 &mut self,
1690 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>
1691 {
1692 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1693 }
1694 }
1695
1696 impl<'de> ::core::fmt::Debug for ControllerInfo<'de> {
1697 fn fmt(
1698 &self,
1699 f: &mut ::core::fmt::Formatter<'_>,
1700 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1701 f.debug_struct("ControllerInfo")
1702 .field("id", &self.id())
1703 .field("channels", &self.channels())
1704 .finish()
1705 }
1706 }
1707
1708 impl<'de> ::fidl_next::IntoNatural for ControllerInfo<'de> {
1709 type Natural = crate::natural::ControllerInfo;
1710 }
1711
1712 #[derive(Debug)]
1714 #[repr(C)]
1715 pub struct ListenerOnMessageRequest<'de> {
1716 pub message: ::fidl_next::wire::Vector<'de, u8>,
1717 }
1718
1719 static_assertions::const_assert_eq!(std::mem::size_of::<ListenerOnMessageRequest<'_>>(), 16);
1720 static_assertions::const_assert_eq!(std::mem::align_of::<ListenerOnMessageRequest<'_>>(), 8);
1721
1722 static_assertions::const_assert_eq!(
1723 std::mem::offset_of!(ListenerOnMessageRequest<'_>, message),
1724 0
1725 );
1726
1727 impl ::fidl_next::Constrained for ListenerOnMessageRequest<'_> {
1728 type Constraint = ();
1729
1730 fn validate(
1731 _: ::fidl_next::Slot<'_, Self>,
1732 _: Self::Constraint,
1733 ) -> Result<(), ::fidl_next::ValidationError> {
1734 Ok(())
1735 }
1736 }
1737
1738 unsafe impl ::fidl_next::Wire for ListenerOnMessageRequest<'static> {
1739 type Narrowed<'de> = ListenerOnMessageRequest<'de>;
1740
1741 #[inline]
1742 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1743 ::fidl_next::munge! {
1744 let Self {
1745 message,
1746
1747 } = &mut *out_;
1748 }
1749
1750 ::fidl_next::Wire::zero_padding(message);
1751 }
1752 }
1753
1754 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ListenerOnMessageRequest<'de>
1755 where
1756 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1757 ___D: ::fidl_next::Decoder<'de>,
1758 {
1759 fn decode(
1760 slot_: ::fidl_next::Slot<'_, Self>,
1761 decoder_: &mut ___D,
1762 _: (),
1763 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1764 ::fidl_next::munge! {
1765 let Self {
1766 mut message,
1767
1768 } = slot_;
1769 }
1770
1771 let _field = message.as_mut();
1772 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1773 ::fidl_next::Decode::decode(message.as_mut(), decoder_, (4294967295, ()))?;
1774
1775 Ok(())
1776 }
1777 }
1778
1779 impl<'de> ::fidl_next::IntoNatural for ListenerOnMessageRequest<'de> {
1780 type Natural = crate::natural::ListenerOnMessageRequest;
1781 }
1782
1783 pub type ListenerOnMessageResponse = ::fidl_next::wire::Unit;
1785
1786 #[derive(Debug)]
1788 #[repr(C)]
1789 pub struct ListenerOnRequestRequest<'de> {
1790 pub message: ::fidl_next::wire::Vector<'de, u8>,
1791 }
1792
1793 static_assertions::const_assert_eq!(std::mem::size_of::<ListenerOnRequestRequest<'_>>(), 16);
1794 static_assertions::const_assert_eq!(std::mem::align_of::<ListenerOnRequestRequest<'_>>(), 8);
1795
1796 static_assertions::const_assert_eq!(
1797 std::mem::offset_of!(ListenerOnRequestRequest<'_>, message),
1798 0
1799 );
1800
1801 impl ::fidl_next::Constrained for ListenerOnRequestRequest<'_> {
1802 type Constraint = ();
1803
1804 fn validate(
1805 _: ::fidl_next::Slot<'_, Self>,
1806 _: Self::Constraint,
1807 ) -> Result<(), ::fidl_next::ValidationError> {
1808 Ok(())
1809 }
1810 }
1811
1812 unsafe impl ::fidl_next::Wire for ListenerOnRequestRequest<'static> {
1813 type Narrowed<'de> = ListenerOnRequestRequest<'de>;
1814
1815 #[inline]
1816 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1817 ::fidl_next::munge! {
1818 let Self {
1819 message,
1820
1821 } = &mut *out_;
1822 }
1823
1824 ::fidl_next::Wire::zero_padding(message);
1825 }
1826 }
1827
1828 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ListenerOnRequestRequest<'de>
1829 where
1830 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1831 ___D: ::fidl_next::Decoder<'de>,
1832 {
1833 fn decode(
1834 slot_: ::fidl_next::Slot<'_, Self>,
1835 decoder_: &mut ___D,
1836 _: (),
1837 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1838 ::fidl_next::munge! {
1839 let Self {
1840 mut message,
1841
1842 } = slot_;
1843 }
1844
1845 let _field = message.as_mut();
1846 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1847 ::fidl_next::Decode::decode(message.as_mut(), decoder_, (4294967295, ()))?;
1848
1849 Ok(())
1850 }
1851 }
1852
1853 impl<'de> ::fidl_next::IntoNatural for ListenerOnRequestRequest<'de> {
1854 type Natural = crate::natural::ListenerOnRequestRequest;
1855 }
1856
1857 #[derive(Debug)]
1859 #[repr(C)]
1860 pub struct ListenerOnRequestResponse<'de> {
1861 pub response: ::fidl_next::wire::Vector<'de, u8>,
1862 }
1863
1864 static_assertions::const_assert_eq!(std::mem::size_of::<ListenerOnRequestResponse<'_>>(), 16);
1865 static_assertions::const_assert_eq!(std::mem::align_of::<ListenerOnRequestResponse<'_>>(), 8);
1866
1867 static_assertions::const_assert_eq!(
1868 std::mem::offset_of!(ListenerOnRequestResponse<'_>, response),
1869 0
1870 );
1871
1872 impl ::fidl_next::Constrained for ListenerOnRequestResponse<'_> {
1873 type Constraint = ();
1874
1875 fn validate(
1876 _: ::fidl_next::Slot<'_, Self>,
1877 _: Self::Constraint,
1878 ) -> Result<(), ::fidl_next::ValidationError> {
1879 Ok(())
1880 }
1881 }
1882
1883 unsafe impl ::fidl_next::Wire for ListenerOnRequestResponse<'static> {
1884 type Narrowed<'de> = ListenerOnRequestResponse<'de>;
1885
1886 #[inline]
1887 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1888 ::fidl_next::munge! {
1889 let Self {
1890 response,
1891
1892 } = &mut *out_;
1893 }
1894
1895 ::fidl_next::Wire::zero_padding(response);
1896 }
1897 }
1898
1899 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ListenerOnRequestResponse<'de>
1900 where
1901 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1902 ___D: ::fidl_next::Decoder<'de>,
1903 {
1904 fn decode(
1905 slot_: ::fidl_next::Slot<'_, Self>,
1906 decoder_: &mut ___D,
1907 _: (),
1908 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1909 ::fidl_next::munge! {
1910 let Self {
1911 mut response,
1912
1913 } = slot_;
1914 }
1915
1916 let _field = response.as_mut();
1917 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1918 ::fidl_next::Decode::decode(response.as_mut(), decoder_, (4294967295, ()))?;
1919
1920 Ok(())
1921 }
1922 }
1923
1924 impl<'de> ::fidl_next::IntoNatural for ListenerOnRequestResponse<'de> {
1925 type Natural = crate::natural::ListenerOnRequestResponse;
1926 }
1927}
1928
1929pub mod wire_optional {}
1930
1931pub mod generic {
1932
1933 pub struct ChannelSendMessageRequest<T0> {
1935 pub message: T0,
1936 }
1937
1938 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ChannelSendMessageRequest<'static>, ___E>
1939 for ChannelSendMessageRequest<T0>
1940 where
1941 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1942 ___E: ::fidl_next::Encoder,
1943 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1944 {
1945 #[inline]
1946 fn encode(
1947 self,
1948 encoder_: &mut ___E,
1949 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendMessageRequest<'static>>,
1950 _: (),
1951 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1952 ::fidl_next::munge! {
1953 let crate::wire::ChannelSendMessageRequest {
1954 message,
1955
1956 } = out_;
1957 }
1958
1959 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
1960
1961 Ok(())
1962 }
1963 }
1964
1965 pub type ChannelSendMessageResponse = ();
1967
1968 pub struct ChannelSendRequestRequest<T0> {
1970 pub request: T0,
1971 }
1972
1973 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ChannelSendRequestRequest<'static>, ___E>
1974 for ChannelSendRequestRequest<T0>
1975 where
1976 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1977 ___E: ::fidl_next::Encoder,
1978 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1979 {
1980 #[inline]
1981 fn encode(
1982 self,
1983 encoder_: &mut ___E,
1984 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendRequestRequest<'static>>,
1985 _: (),
1986 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1987 ::fidl_next::munge! {
1988 let crate::wire::ChannelSendRequestRequest {
1989 request,
1990
1991 } = out_;
1992 }
1993
1994 ::fidl_next::Encode::encode(self.request, encoder_, request, (4294967295, ()))?;
1995
1996 Ok(())
1997 }
1998 }
1999
2000 pub struct ChannelSendRequestResponse<T0> {
2002 pub response: T0,
2003 }
2004
2005 unsafe impl<___E, T0>
2006 ::fidl_next::Encode<crate::wire::ChannelSendRequestResponse<'static>, ___E>
2007 for ChannelSendRequestResponse<T0>
2008 where
2009 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2010 ___E: ::fidl_next::Encoder,
2011 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2012 {
2013 #[inline]
2014 fn encode(
2015 self,
2016 encoder_: &mut ___E,
2017 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendRequestResponse<'static>>,
2018 _: (),
2019 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2020 ::fidl_next::munge! {
2021 let crate::wire::ChannelSendRequestResponse {
2022 response,
2023
2024 } = out_;
2025 }
2026
2027 ::fidl_next::Encode::encode(self.response, encoder_, response, (4294967295, ()))?;
2028
2029 Ok(())
2030 }
2031 }
2032
2033 pub type ChannelRegisterListenerResponse = ();
2035
2036 pub struct ListenerOnMessageRequest<T0> {
2038 pub message: T0,
2039 }
2040
2041 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>
2042 for ListenerOnMessageRequest<T0>
2043 where
2044 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2045 ___E: ::fidl_next::Encoder,
2046 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2047 {
2048 #[inline]
2049 fn encode(
2050 self,
2051 encoder_: &mut ___E,
2052 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnMessageRequest<'static>>,
2053 _: (),
2054 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2055 ::fidl_next::munge! {
2056 let crate::wire::ListenerOnMessageRequest {
2057 message,
2058
2059 } = out_;
2060 }
2061
2062 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
2063
2064 Ok(())
2065 }
2066 }
2067
2068 pub type ListenerOnMessageResponse = ();
2070
2071 pub struct ListenerOnRequestRequest<T0> {
2073 pub message: T0,
2074 }
2075
2076 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>
2077 for ListenerOnRequestRequest<T0>
2078 where
2079 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2080 ___E: ::fidl_next::Encoder,
2081 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2082 {
2083 #[inline]
2084 fn encode(
2085 self,
2086 encoder_: &mut ___E,
2087 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestRequest<'static>>,
2088 _: (),
2089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2090 ::fidl_next::munge! {
2091 let crate::wire::ListenerOnRequestRequest {
2092 message,
2093
2094 } = out_;
2095 }
2096
2097 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
2098
2099 Ok(())
2100 }
2101 }
2102
2103 pub struct ListenerOnRequestResponse<T0> {
2105 pub response: T0,
2106 }
2107
2108 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>
2109 for ListenerOnRequestResponse<T0>
2110 where
2111 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2112 ___E: ::fidl_next::Encoder,
2113 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2114 {
2115 #[inline]
2116 fn encode(
2117 self,
2118 encoder_: &mut ___E,
2119 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestResponse<'static>>,
2120 _: (),
2121 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2122 ::fidl_next::munge! {
2123 let crate::wire::ListenerOnRequestResponse {
2124 response,
2125
2126 } = out_;
2127 }
2128
2129 ::fidl_next::Encode::encode(self.response, encoder_, response, (4294967295, ()))?;
2130
2131 Ok(())
2132 }
2133 }
2134}
2135
2136pub use self::natural::*;
2137
2138#[doc = " `Listener` is used to receive messages from a mailbox channel.\n\n The server end of this is held by the mailbox client.\n"]
2140#[derive(PartialEq, Debug)]
2141pub struct Listener;
2142
2143#[cfg(target_os = "fuchsia")]
2144impl ::fidl_next::HasTransport for Listener {
2145 type Transport = ::fidl_next::fuchsia::zx::Channel;
2146}
2147
2148pub mod listener {
2149 pub mod prelude {
2150 pub use crate::{
2151 Listener, ListenerClientHandler, ListenerLocalClientHandler,
2152 ListenerLocalServerHandler, ListenerServerHandler, listener,
2153 };
2154
2155 pub use crate::natural::ListenerOnMessageRequest;
2156
2157 pub use crate::natural::ListenerOnRequestRequest;
2158
2159 pub use crate::natural::ListenerOnMessageResponse;
2160
2161 pub use crate::natural::ListenerOnRequestResponse;
2162 }
2163
2164 pub struct OnMessage;
2165
2166 impl ::fidl_next::Method for OnMessage {
2167 const ORDINAL: u64 = 3132544944554375052;
2168 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2169 ::fidl_next::protocol::Flexibility::Flexible;
2170
2171 type Protocol = crate::Listener;
2172
2173 type Request = crate::wire::ListenerOnMessageRequest<'static>;
2174 }
2175
2176 impl ::fidl_next::TwoWayMethod for OnMessage {
2177 type Response = ::fidl_next::wire::Result<
2178 'static,
2179 crate::wire::ListenerOnMessageResponse,
2180 ::fidl_next::wire::fuchsia::Status,
2181 >;
2182 }
2183
2184 impl<___R> ::fidl_next::Respond<___R> for OnMessage {
2185 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2186
2187 fn respond(response: ___R) -> Self::Output {
2188 ::core::result::Result::Ok(response)
2189 }
2190 }
2191
2192 impl<___R> ::fidl_next::RespondErr<___R> for OnMessage {
2193 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2194
2195 fn respond_err(response: ___R) -> Self::Output {
2196 ::core::result::Result::Err(response)
2197 }
2198 }
2199
2200 pub struct OnRequest;
2201
2202 impl ::fidl_next::Method for OnRequest {
2203 const ORDINAL: u64 = 6226805799602931743;
2204 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2205 ::fidl_next::protocol::Flexibility::Flexible;
2206
2207 type Protocol = crate::Listener;
2208
2209 type Request = crate::wire::ListenerOnRequestRequest<'static>;
2210 }
2211
2212 impl ::fidl_next::TwoWayMethod for OnRequest {
2213 type Response = ::fidl_next::wire::Result<
2214 'static,
2215 crate::wire::ListenerOnRequestResponse<'static>,
2216 ::fidl_next::wire::fuchsia::Status,
2217 >;
2218 }
2219
2220 impl<___R> ::fidl_next::Respond<___R> for OnRequest {
2221 type Output = ::core::result::Result<
2222 crate::generic::ListenerOnRequestResponse<___R>,
2223 ::fidl_next::never::Never,
2224 >;
2225
2226 fn respond(response: ___R) -> Self::Output {
2227 ::core::result::Result::Ok(crate::generic::ListenerOnRequestResponse {
2228 response: response,
2229 })
2230 }
2231 }
2232
2233 impl<___R> ::fidl_next::RespondErr<___R> for OnRequest {
2234 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2235
2236 fn respond_err(response: ___R) -> Self::Output {
2237 ::core::result::Result::Err(response)
2238 }
2239 }
2240
2241 mod ___detail {
2242 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Listener
2243 where
2244 ___T: ::fidl_next::Transport,
2245 {
2246 type Client = ListenerClient<___T>;
2247 type Server = ListenerServer<___T>;
2248 }
2249
2250 #[repr(transparent)]
2252 pub struct ListenerClient<___T: ::fidl_next::Transport> {
2253 #[allow(dead_code)]
2254 client: ::fidl_next::protocol::Client<___T>,
2255 }
2256
2257 impl<___T> ListenerClient<___T>
2258 where
2259 ___T: ::fidl_next::Transport,
2260 {
2261 #[doc = " Called when a message is received on the mailbox channel.\n\n The mailbox driver will not call `OnMessage` concurrently. It will wait\n for the previous call to complete before sending another message.\n\n If the client fails to respond to `OnMessage` in a timely manner, the\n mailbox driver may run out of memory and drop subsequent messages.\n"]
2262 pub fn on_message(
2263 &self,
2264
2265 message: impl ::fidl_next::Encode<
2266 ::fidl_next::wire::Vector<'static, u8>,
2267 <___T as ::fidl_next::Transport>::SendBuffer,
2268 >,
2269 ) -> ::fidl_next::TwoWayFuture<'_, super::OnMessage, ___T>
2270 where
2271 <___T as ::fidl_next::Transport>::SendBuffer:
2272 ::fidl_next::encoder::InternalHandleEncoder,
2273 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2274 {
2275 self.on_message_with(crate::generic::ListenerOnMessageRequest { message })
2276 }
2277
2278 #[doc = " Called when a message is received on the mailbox channel.\n\n The mailbox driver will not call `OnMessage` concurrently. It will wait\n for the previous call to complete before sending another message.\n\n If the client fails to respond to `OnMessage` in a timely manner, the\n mailbox driver may run out of memory and drop subsequent messages.\n"]
2279 pub fn on_message_with<___R>(
2280 &self,
2281 request: ___R,
2282 ) -> ::fidl_next::TwoWayFuture<'_, super::OnMessage, ___T>
2283 where
2284 ___R: ::fidl_next::Encode<
2285 crate::wire::ListenerOnMessageRequest<'static>,
2286 <___T as ::fidl_next::Transport>::SendBuffer,
2287 >,
2288 {
2289 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2290 3132544944554375052,
2291 <super::OnMessage as ::fidl_next::Method>::FLEXIBILITY,
2292 request,
2293 ))
2294 }
2295
2296 #[doc = " Called when a request is received on the mailbox channel.\n\n The client should process the request and return the response payload based\n on what was requested. The response will be returned to the remote core by\n the mailbox driver.\n\n If the listener returns an error, the error is logged by the mailbox driver\n and no response is returned to the remote core.\n\n The same concurrency rules as `OnMessage` apply.\n"]
2297 pub fn on_request(
2298 &self,
2299
2300 message: impl ::fidl_next::Encode<
2301 ::fidl_next::wire::Vector<'static, u8>,
2302 <___T as ::fidl_next::Transport>::SendBuffer,
2303 >,
2304 ) -> ::fidl_next::TwoWayFuture<'_, super::OnRequest, ___T>
2305 where
2306 <___T as ::fidl_next::Transport>::SendBuffer:
2307 ::fidl_next::encoder::InternalHandleEncoder,
2308 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2309 {
2310 self.on_request_with(crate::generic::ListenerOnRequestRequest { message })
2311 }
2312
2313 #[doc = " Called when a request is received on the mailbox channel.\n\n The client should process the request and return the response payload based\n on what was requested. The response will be returned to the remote core by\n the mailbox driver.\n\n If the listener returns an error, the error is logged by the mailbox driver\n and no response is returned to the remote core.\n\n The same concurrency rules as `OnMessage` apply.\n"]
2314 pub fn on_request_with<___R>(
2315 &self,
2316 request: ___R,
2317 ) -> ::fidl_next::TwoWayFuture<'_, super::OnRequest, ___T>
2318 where
2319 ___R: ::fidl_next::Encode<
2320 crate::wire::ListenerOnRequestRequest<'static>,
2321 <___T as ::fidl_next::Transport>::SendBuffer,
2322 >,
2323 {
2324 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2325 6226805799602931743,
2326 <super::OnRequest as ::fidl_next::Method>::FLEXIBILITY,
2327 request,
2328 ))
2329 }
2330 }
2331
2332 #[repr(transparent)]
2334 pub struct ListenerServer<___T: ::fidl_next::Transport> {
2335 server: ::fidl_next::protocol::Server<___T>,
2336 }
2337
2338 impl<___T> ListenerServer<___T> where ___T: ::fidl_next::Transport {}
2339 }
2340}
2341
2342#[diagnostic::on_unimplemented(
2343 note = "If {Self} implements the non-local ListenerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2344)]
2345
2346pub trait ListenerLocalClientHandler<
2350 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2351 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2352>
2353{
2354 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2355 ::core::future::ready(())
2356 }
2357}
2358
2359impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Listener
2360where
2361 ___H: ListenerLocalClientHandler<___T>,
2362 ___T: ::fidl_next::Transport,
2363{
2364 async fn on_event(
2365 handler: &mut ___H,
2366 mut message: ::fidl_next::Message<___T>,
2367 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2368 match *message.header().ordinal {
2369 ordinal => {
2370 handler.on_unknown_interaction(ordinal).await;
2371 if ::core::matches!(
2372 message.header().flexibility(),
2373 ::fidl_next::protocol::Flexibility::Strict
2374 ) {
2375 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2376 } else {
2377 Ok(())
2378 }
2379 }
2380 }
2381 }
2382}
2383
2384#[diagnostic::on_unimplemented(
2385 note = "If {Self} implements the non-local ListenerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2386)]
2387
2388pub trait ListenerLocalServerHandler<
2392 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2393 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2394>
2395{
2396 #[doc = " Called when a message is received on the mailbox channel.\n\n The mailbox driver will not call `OnMessage` concurrently. It will wait\n for the previous call to complete before sending another message.\n\n If the client fails to respond to `OnMessage` in a timely manner, the\n mailbox driver may run out of memory and drop subsequent messages.\n"]
2397 fn on_message(
2398 &mut self,
2399
2400 request: ::fidl_next::Request<listener::OnMessage, ___T>,
2401
2402 responder: ::fidl_next::Responder<listener::OnMessage, ___T>,
2403 ) -> impl ::core::future::Future<Output = ()>;
2404
2405 #[doc = " Called when a request is received on the mailbox channel.\n\n The client should process the request and return the response payload based\n on what was requested. The response will be returned to the remote core by\n the mailbox driver.\n\n If the listener returns an error, the error is logged by the mailbox driver\n and no response is returned to the remote core.\n\n The same concurrency rules as `OnMessage` apply.\n"]
2406 fn on_request(
2407 &mut self,
2408
2409 request: ::fidl_next::Request<listener::OnRequest, ___T>,
2410
2411 responder: ::fidl_next::Responder<listener::OnRequest, ___T>,
2412 ) -> impl ::core::future::Future<Output = ()>;
2413
2414 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2415 ::core::future::ready(())
2416 }
2417}
2418
2419impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Listener
2420where
2421 ___H: ListenerLocalServerHandler<___T>,
2422 ___T: ::fidl_next::Transport,
2423 for<'de> crate::wire::ListenerOnMessageRequest<'de>: ::fidl_next::Decode<
2424 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2425 Constraint = (),
2426 >,
2427 for<'de> crate::wire::ListenerOnRequestRequest<'de>: ::fidl_next::Decode<
2428 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2429 Constraint = (),
2430 >,
2431{
2432 async fn on_one_way(
2433 handler: &mut ___H,
2434 mut message: ::fidl_next::Message<___T>,
2435 ) -> ::core::result::Result<
2436 (),
2437 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2438 > {
2439 match *message.header().ordinal {
2440 ordinal => {
2441 handler.on_unknown_interaction(ordinal).await;
2442 if ::core::matches!(
2443 message.header().flexibility(),
2444 ::fidl_next::protocol::Flexibility::Strict
2445 ) {
2446 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2447 } else {
2448 Ok(())
2449 }
2450 }
2451 }
2452 }
2453
2454 async fn on_two_way(
2455 handler: &mut ___H,
2456 mut message: ::fidl_next::Message<___T>,
2457 responder: ::fidl_next::protocol::Responder<___T>,
2458 ) -> ::core::result::Result<
2459 (),
2460 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2461 > {
2462 match *message.header().ordinal {
2463 3132544944554375052 => {
2464 let responder = ::fidl_next::Responder::from_untyped(responder);
2465
2466 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2467 Ok(decoded) => {
2468 handler
2469 .on_message(::fidl_next::Request::from_decoded(decoded), responder)
2470 .await;
2471 Ok(())
2472 }
2473 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2474 ordinal: 3132544944554375052,
2475 error,
2476 }),
2477 }
2478 }
2479
2480 6226805799602931743 => {
2481 let responder = ::fidl_next::Responder::from_untyped(responder);
2482
2483 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2484 Ok(decoded) => {
2485 handler
2486 .on_request(::fidl_next::Request::from_decoded(decoded), responder)
2487 .await;
2488 Ok(())
2489 }
2490 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2491 ordinal: 6226805799602931743,
2492 error,
2493 }),
2494 }
2495 }
2496
2497 ordinal => {
2498 handler.on_unknown_interaction(ordinal).await;
2499 if ::core::matches!(
2500 message.header().flexibility(),
2501 ::fidl_next::protocol::Flexibility::Strict
2502 ) {
2503 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2504 } else {
2505 responder
2506 .respond_framework_error(
2507 ordinal,
2508 ::fidl_next::FrameworkError::UnknownMethod,
2509 )
2510 .expect("encoding a framework error should never fail")
2511 .await?;
2512 Ok(())
2513 }
2514 }
2515 }
2516 }
2517}
2518
2519pub trait ListenerClientHandler<
2523 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2524 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2525>
2526{
2527 fn on_unknown_interaction(
2528 &mut self,
2529 ordinal: u64,
2530 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2531 ::core::future::ready(())
2532 }
2533}
2534
2535impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Listener
2536where
2537 ___H: ListenerClientHandler<___T> + ::core::marker::Send,
2538 ___T: ::fidl_next::Transport,
2539{
2540 async fn on_event(
2541 handler: &mut ___H,
2542 mut message: ::fidl_next::Message<___T>,
2543 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2544 match *message.header().ordinal {
2545 ordinal => {
2546 handler.on_unknown_interaction(ordinal).await;
2547 if ::core::matches!(
2548 message.header().flexibility(),
2549 ::fidl_next::protocol::Flexibility::Strict
2550 ) {
2551 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2552 } else {
2553 Ok(())
2554 }
2555 }
2556 }
2557 }
2558}
2559
2560pub trait ListenerServerHandler<
2564 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2565 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2566>
2567{
2568 #[doc = " Called when a message is received on the mailbox channel.\n\n The mailbox driver will not call `OnMessage` concurrently. It will wait\n for the previous call to complete before sending another message.\n\n If the client fails to respond to `OnMessage` in a timely manner, the\n mailbox driver may run out of memory and drop subsequent messages.\n"]
2569 fn on_message(
2570 &mut self,
2571
2572 request: ::fidl_next::Request<listener::OnMessage, ___T>,
2573
2574 responder: ::fidl_next::Responder<listener::OnMessage, ___T>,
2575 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2576
2577 #[doc = " Called when a request is received on the mailbox channel.\n\n The client should process the request and return the response payload based\n on what was requested. The response will be returned to the remote core by\n the mailbox driver.\n\n If the listener returns an error, the error is logged by the mailbox driver\n and no response is returned to the remote core.\n\n The same concurrency rules as `OnMessage` apply.\n"]
2578 fn on_request(
2579 &mut self,
2580
2581 request: ::fidl_next::Request<listener::OnRequest, ___T>,
2582
2583 responder: ::fidl_next::Responder<listener::OnRequest, ___T>,
2584 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2585
2586 fn on_unknown_interaction(
2587 &mut self,
2588 ordinal: u64,
2589 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2590 ::core::future::ready(())
2591 }
2592}
2593
2594impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Listener
2595where
2596 ___H: ListenerServerHandler<___T> + ::core::marker::Send,
2597 ___T: ::fidl_next::Transport,
2598 for<'de> crate::wire::ListenerOnMessageRequest<'de>: ::fidl_next::Decode<
2599 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2600 Constraint = (),
2601 >,
2602 for<'de> crate::wire::ListenerOnRequestRequest<'de>: ::fidl_next::Decode<
2603 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2604 Constraint = (),
2605 >,
2606{
2607 async fn on_one_way(
2608 handler: &mut ___H,
2609 mut message: ::fidl_next::Message<___T>,
2610 ) -> ::core::result::Result<
2611 (),
2612 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2613 > {
2614 match *message.header().ordinal {
2615 ordinal => {
2616 handler.on_unknown_interaction(ordinal).await;
2617 if ::core::matches!(
2618 message.header().flexibility(),
2619 ::fidl_next::protocol::Flexibility::Strict
2620 ) {
2621 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2622 } else {
2623 Ok(())
2624 }
2625 }
2626 }
2627 }
2628
2629 async fn on_two_way(
2630 handler: &mut ___H,
2631 mut message: ::fidl_next::Message<___T>,
2632 responder: ::fidl_next::protocol::Responder<___T>,
2633 ) -> ::core::result::Result<
2634 (),
2635 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2636 > {
2637 match *message.header().ordinal {
2638 3132544944554375052 => {
2639 let responder = ::fidl_next::Responder::from_untyped(responder);
2640
2641 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2642 Ok(decoded) => {
2643 handler
2644 .on_message(::fidl_next::Request::from_decoded(decoded), responder)
2645 .await;
2646 Ok(())
2647 }
2648 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2649 ordinal: 3132544944554375052,
2650 error,
2651 }),
2652 }
2653 }
2654
2655 6226805799602931743 => {
2656 let responder = ::fidl_next::Responder::from_untyped(responder);
2657
2658 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2659 Ok(decoded) => {
2660 handler
2661 .on_request(::fidl_next::Request::from_decoded(decoded), responder)
2662 .await;
2663 Ok(())
2664 }
2665 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2666 ordinal: 6226805799602931743,
2667 error,
2668 }),
2669 }
2670 }
2671
2672 ordinal => {
2673 handler.on_unknown_interaction(ordinal).await;
2674 if ::core::matches!(
2675 message.header().flexibility(),
2676 ::fidl_next::protocol::Flexibility::Strict
2677 ) {
2678 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2679 } else {
2680 responder
2681 .respond_framework_error(
2682 ordinal,
2683 ::fidl_next::FrameworkError::UnknownMethod,
2684 )
2685 .expect("encoding a framework error should never fail")
2686 .await?;
2687 Ok(())
2688 }
2689 }
2690 }
2691 }
2692}
2693
2694impl<___T> ListenerClientHandler<___T> for ::fidl_next::IgnoreEvents
2695where
2696 ___T: ::fidl_next::Transport,
2697{
2698 async fn on_unknown_interaction(&mut self, _: u64) {}
2699}
2700
2701impl<___H, ___T> ListenerLocalClientHandler<___T> for ::fidl_next::Local<___H>
2702where
2703 ___H: ListenerClientHandler<___T>,
2704 ___T: ::fidl_next::Transport,
2705{
2706 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2707 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2708 }
2709}
2710
2711impl<___H, ___T> ListenerLocalServerHandler<___T> for ::fidl_next::Local<___H>
2712where
2713 ___H: ListenerServerHandler<___T>,
2714 ___T: ::fidl_next::Transport,
2715{
2716 async fn on_message(
2717 &mut self,
2718
2719 request: ::fidl_next::Request<listener::OnMessage, ___T>,
2720
2721 responder: ::fidl_next::Responder<listener::OnMessage, ___T>,
2722 ) {
2723 ___H::on_message(&mut self.0, request, responder).await
2724 }
2725
2726 async fn on_request(
2727 &mut self,
2728
2729 request: ::fidl_next::Request<listener::OnRequest, ___T>,
2730
2731 responder: ::fidl_next::Responder<listener::OnRequest, ___T>,
2732 ) {
2733 ___H::on_request(&mut self.0, request, responder).await
2734 }
2735
2736 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2737 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2738 }
2739}