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 pub id: ::core::option::Option<u32>,
442 }
443
444 impl ChannelInfo {
445 fn __max_ordinal(&self) -> usize {
446 if self.id.is_some() {
447 return 3;
448 }
449
450 if self.client.is_some() {
451 return 2;
452 }
453
454 if self.channel.is_some() {
455 return 1;
456 }
457
458 0
459 }
460 }
461
462 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChannelInfo<'static>, ___E> for ChannelInfo
463 where
464 ___E: ::fidl_next::Encoder + ?Sized,
465 {
466 #[inline]
467 fn encode(
468 mut self,
469 encoder: &mut ___E,
470 out: &mut ::core::mem::MaybeUninit<crate::wire::ChannelInfo<'static>>,
471 _: (),
472 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
473 ::fidl_next::munge!(let crate::wire::ChannelInfo { table } = out);
474
475 let max_ord = self.__max_ordinal();
476
477 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
478 ::fidl_next::Wire::zero_padding(&mut out);
479
480 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
481 ::fidl_next::wire::Envelope,
482 >(encoder, max_ord);
483
484 for i in 1..=max_ord {
485 match i {
486 3 => {
487 if let Some(value) = self.id.take() {
488 ::fidl_next::wire::Envelope::encode_value::<
489 ::fidl_next::wire::Uint32,
490 ___E,
491 >(
492 value, preallocated.encoder, &mut out, ()
493 )?;
494 } else {
495 ::fidl_next::wire::Envelope::encode_zero(&mut out)
496 }
497 }
498
499 2 => {
500 if let Some(value) = self.client.take() {
501 ::fidl_next::wire::Envelope::encode_value::<
502 ::fidl_next::wire::Uint32,
503 ___E,
504 >(
505 value, preallocated.encoder, &mut out, ()
506 )?;
507 } else {
508 ::fidl_next::wire::Envelope::encode_zero(&mut out)
509 }
510 }
511
512 1 => {
513 if let Some(value) = self.channel.take() {
514 ::fidl_next::wire::Envelope::encode_value::<
515 ::fidl_next::wire::Uint32,
516 ___E,
517 >(
518 value, preallocated.encoder, &mut out, ()
519 )?;
520 } else {
521 ::fidl_next::wire::Envelope::encode_zero(&mut out)
522 }
523 }
524
525 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
526 }
527 unsafe {
528 preallocated.write_next(out.assume_init_ref());
529 }
530 }
531
532 ::fidl_next::wire::Table::encode_len(table, max_ord);
533
534 Ok(())
535 }
536 }
537
538 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ChannelInfo<'static>, ___E>
539 for &'a ChannelInfo
540 where
541 ___E: ::fidl_next::Encoder + ?Sized,
542 {
543 #[inline]
544 fn encode(
545 self,
546 encoder: &mut ___E,
547 out: &mut ::core::mem::MaybeUninit<crate::wire::ChannelInfo<'static>>,
548 _: (),
549 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
550 ::fidl_next::munge!(let crate::wire::ChannelInfo { table } = out);
551
552 let max_ord = self.__max_ordinal();
553
554 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
555 ::fidl_next::Wire::zero_padding(&mut out);
556
557 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
558 ::fidl_next::wire::Envelope,
559 >(encoder, max_ord);
560
561 for i in 1..=max_ord {
562 match i {
563 3 => {
564 if let Some(value) = &self.id {
565 ::fidl_next::wire::Envelope::encode_value::<
566 ::fidl_next::wire::Uint32,
567 ___E,
568 >(
569 value, preallocated.encoder, &mut out, ()
570 )?;
571 } else {
572 ::fidl_next::wire::Envelope::encode_zero(&mut out)
573 }
574 }
575
576 2 => {
577 if let Some(value) = &self.client {
578 ::fidl_next::wire::Envelope::encode_value::<
579 ::fidl_next::wire::Uint32,
580 ___E,
581 >(
582 value, preallocated.encoder, &mut out, ()
583 )?;
584 } else {
585 ::fidl_next::wire::Envelope::encode_zero(&mut out)
586 }
587 }
588
589 1 => {
590 if let Some(value) = &self.channel {
591 ::fidl_next::wire::Envelope::encode_value::<
592 ::fidl_next::wire::Uint32,
593 ___E,
594 >(
595 value, preallocated.encoder, &mut out, ()
596 )?;
597 } else {
598 ::fidl_next::wire::Envelope::encode_zero(&mut out)
599 }
600 }
601
602 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
603 }
604 unsafe {
605 preallocated.write_next(out.assume_init_ref());
606 }
607 }
608
609 ::fidl_next::wire::Table::encode_len(table, max_ord);
610
611 Ok(())
612 }
613 }
614
615 impl<'de> ::fidl_next::FromWire<crate::wire::ChannelInfo<'de>> for ChannelInfo {
616 #[inline]
617 fn from_wire(wire_: crate::wire::ChannelInfo<'de>) -> Self {
618 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
619
620 let channel = wire_.table.get(1);
621
622 let client = wire_.table.get(2);
623
624 let id = wire_.table.get(3);
625
626 Self {
627 channel: channel.map(|envelope| {
628 ::fidl_next::FromWire::from_wire(unsafe {
629 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
630 })
631 }),
632
633 client: client.map(|envelope| {
634 ::fidl_next::FromWire::from_wire(unsafe {
635 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
636 })
637 }),
638
639 id: id.map(|envelope| {
640 ::fidl_next::FromWire::from_wire(unsafe {
641 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
642 })
643 }),
644 }
645 }
646 }
647
648 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChannelInfo<'de>> for ChannelInfo {
649 #[inline]
650 fn from_wire_ref(wire: &crate::wire::ChannelInfo<'de>) -> Self {
651 Self {
652 channel: wire.table.get(1).map(|envelope| {
653 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
654 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
655 })
656 }),
657
658 client: wire.table.get(2).map(|envelope| {
659 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
660 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
661 })
662 }),
663
664 id: wire.table.get(3).map(|envelope| {
665 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
666 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
667 })
668 }),
669 }
670 }
671 }
672
673 #[doc = " `ControllerInfo` is passed to mailbox controller drivers via metadata.\n"]
674 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
675 pub struct ControllerInfo {
676 pub id: ::core::option::Option<u32>,
677
678 pub channels: ::core::option::Option<::std::vec::Vec<crate::natural::ChannelInfo>>,
679 }
680
681 impl ControllerInfo {
682 fn __max_ordinal(&self) -> usize {
683 if self.channels.is_some() {
684 return 2;
685 }
686
687 if self.id.is_some() {
688 return 1;
689 }
690
691 0
692 }
693 }
694
695 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ControllerInfo<'static>, ___E> for ControllerInfo
696 where
697 ___E: ::fidl_next::Encoder + ?Sized,
698 {
699 #[inline]
700 fn encode(
701 mut self,
702 encoder: &mut ___E,
703 out: &mut ::core::mem::MaybeUninit<crate::wire::ControllerInfo<'static>>,
704 _: (),
705 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
706 ::fidl_next::munge!(let crate::wire::ControllerInfo { table } = out);
707
708 let max_ord = self.__max_ordinal();
709
710 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
711 ::fidl_next::Wire::zero_padding(&mut out);
712
713 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
714 ::fidl_next::wire::Envelope,
715 >(encoder, max_ord);
716
717 for i in 1..=max_ord {
718 match i {
719 2 => {
720 if let Some(value) = self.channels.take() {
721 ::fidl_next::wire::Envelope::encode_value::<
722 ::fidl_next::wire::Vector<
723 'static,
724 crate::wire::ChannelInfo<'static>,
725 >,
726 ___E,
727 >(
728 value, preallocated.encoder, &mut out, (4294967295, ())
729 )?;
730 } else {
731 ::fidl_next::wire::Envelope::encode_zero(&mut out)
732 }
733 }
734
735 1 => {
736 if let Some(value) = self.id.take() {
737 ::fidl_next::wire::Envelope::encode_value::<
738 ::fidl_next::wire::Uint32,
739 ___E,
740 >(
741 value, preallocated.encoder, &mut out, ()
742 )?;
743 } else {
744 ::fidl_next::wire::Envelope::encode_zero(&mut out)
745 }
746 }
747
748 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
749 }
750 unsafe {
751 preallocated.write_next(out.assume_init_ref());
752 }
753 }
754
755 ::fidl_next::wire::Table::encode_len(table, max_ord);
756
757 Ok(())
758 }
759 }
760
761 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ControllerInfo<'static>, ___E>
762 for &'a ControllerInfo
763 where
764 ___E: ::fidl_next::Encoder + ?Sized,
765 {
766 #[inline]
767 fn encode(
768 self,
769 encoder: &mut ___E,
770 out: &mut ::core::mem::MaybeUninit<crate::wire::ControllerInfo<'static>>,
771 _: (),
772 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
773 ::fidl_next::munge!(let crate::wire::ControllerInfo { table } = out);
774
775 let max_ord = self.__max_ordinal();
776
777 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
778 ::fidl_next::Wire::zero_padding(&mut out);
779
780 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
781 ::fidl_next::wire::Envelope,
782 >(encoder, max_ord);
783
784 for i in 1..=max_ord {
785 match i {
786 2 => {
787 if let Some(value) = &self.channels {
788 ::fidl_next::wire::Envelope::encode_value::<
789 ::fidl_next::wire::Vector<
790 'static,
791 crate::wire::ChannelInfo<'static>,
792 >,
793 ___E,
794 >(
795 value, preallocated.encoder, &mut out, (4294967295, ())
796 )?;
797 } else {
798 ::fidl_next::wire::Envelope::encode_zero(&mut out)
799 }
800 }
801
802 1 => {
803 if let Some(value) = &self.id {
804 ::fidl_next::wire::Envelope::encode_value::<
805 ::fidl_next::wire::Uint32,
806 ___E,
807 >(
808 value, preallocated.encoder, &mut out, ()
809 )?;
810 } else {
811 ::fidl_next::wire::Envelope::encode_zero(&mut out)
812 }
813 }
814
815 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
816 }
817 unsafe {
818 preallocated.write_next(out.assume_init_ref());
819 }
820 }
821
822 ::fidl_next::wire::Table::encode_len(table, max_ord);
823
824 Ok(())
825 }
826 }
827
828 impl<'de> ::fidl_next::FromWire<crate::wire::ControllerInfo<'de>> for ControllerInfo {
829 #[inline]
830 fn from_wire(wire_: crate::wire::ControllerInfo<'de>) -> Self {
831 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
832
833 let id = wire_.table.get(1);
834
835 let channels = wire_.table.get(2);
836
837 Self {
838
839
840 id: id.map(|envelope| ::fidl_next::FromWire::from_wire(
841 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
842 )),
843
844
845 channels: channels.map(|envelope| ::fidl_next::FromWire::from_wire(
846 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>() }
847 )),
848
849 }
850 }
851 }
852
853 impl<'de> ::fidl_next::FromWireRef<crate::wire::ControllerInfo<'de>> for ControllerInfo {
854 #[inline]
855 fn from_wire_ref(wire: &crate::wire::ControllerInfo<'de>) -> Self {
856 Self {
857
858
859 id: wire.table.get(1)
860 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
861 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
862 )),
863
864
865 channels: wire.table.get(2)
866 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
867 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>() }
868 )),
869
870 }
871 }
872 }
873
874 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
875 pub struct ListenerOnMessageRequest {
876 pub message: ::std::vec::Vec<u8>,
877 }
878
879 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>
880 for ListenerOnMessageRequest
881 where
882 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
883 ___E: ::fidl_next::Encoder,
884 {
885 #[inline]
886 fn encode(
887 self,
888 encoder_: &mut ___E,
889 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnMessageRequest<'static>>,
890 _: (),
891 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
892 ::fidl_next::munge! {
893 let crate::wire::ListenerOnMessageRequest {
894 message,
895
896 } = out_;
897 }
898
899 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
900
901 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
902 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
903
904 Ok(())
905 }
906 }
907
908 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>
909 for &'a ListenerOnMessageRequest
910 where
911 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
912 ___E: ::fidl_next::Encoder,
913 {
914 #[inline]
915 fn encode(
916 self,
917 encoder_: &mut ___E,
918 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnMessageRequest<'static>>,
919 _: (),
920 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
921 ::fidl_next::munge! {
922 let crate::wire::ListenerOnMessageRequest {
923 message,
924
925 } = out_;
926 }
927
928 ::fidl_next::Encode::encode(&self.message, encoder_, message, (4294967295, ()))?;
929
930 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
931 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
932
933 Ok(())
934 }
935 }
936
937 unsafe impl<___E>
938 ::fidl_next::EncodeOption<
939 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
940 ___E,
941 > for ListenerOnMessageRequest
942 where
943 ___E: ::fidl_next::Encoder + ?Sized,
944 ListenerOnMessageRequest:
945 ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>,
946 {
947 #[inline]
948 fn encode_option(
949 this: ::core::option::Option<Self>,
950 encoder: &mut ___E,
951 out: &mut ::core::mem::MaybeUninit<
952 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
953 >,
954 _: (),
955 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
956 if let Some(inner) = this {
957 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
958 ::fidl_next::wire::Box::encode_present(out);
959 } else {
960 ::fidl_next::wire::Box::encode_absent(out);
961 }
962
963 Ok(())
964 }
965 }
966
967 unsafe impl<'a, ___E>
968 ::fidl_next::EncodeOption<
969 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
970 ___E,
971 > for &'a ListenerOnMessageRequest
972 where
973 ___E: ::fidl_next::Encoder + ?Sized,
974 &'a ListenerOnMessageRequest:
975 ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>,
976 {
977 #[inline]
978 fn encode_option(
979 this: ::core::option::Option<Self>,
980 encoder: &mut ___E,
981 out: &mut ::core::mem::MaybeUninit<
982 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnMessageRequest<'static>>,
983 >,
984 _: (),
985 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
986 if let Some(inner) = this {
987 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
988 ::fidl_next::wire::Box::encode_present(out);
989 } else {
990 ::fidl_next::wire::Box::encode_absent(out);
991 }
992
993 Ok(())
994 }
995 }
996
997 impl<'de> ::fidl_next::FromWire<crate::wire::ListenerOnMessageRequest<'de>>
998 for ListenerOnMessageRequest
999 {
1000 #[inline]
1001 fn from_wire(wire: crate::wire::ListenerOnMessageRequest<'de>) -> Self {
1002 Self { message: ::fidl_next::FromWire::from_wire(wire.message) }
1003 }
1004 }
1005
1006 impl<'de> ::fidl_next::FromWireRef<crate::wire::ListenerOnMessageRequest<'de>>
1007 for ListenerOnMessageRequest
1008 {
1009 #[inline]
1010 fn from_wire_ref(wire: &crate::wire::ListenerOnMessageRequest<'de>) -> Self {
1011 Self { message: ::fidl_next::FromWireRef::from_wire_ref(&wire.message) }
1012 }
1013 }
1014
1015 pub type ListenerOnMessageResponse = ();
1016
1017 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1018 pub struct ListenerOnRequestRequest {
1019 pub message: ::std::vec::Vec<u8>,
1020 }
1021
1022 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>
1023 for ListenerOnRequestRequest
1024 where
1025 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1026 ___E: ::fidl_next::Encoder,
1027 {
1028 #[inline]
1029 fn encode(
1030 self,
1031 encoder_: &mut ___E,
1032 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestRequest<'static>>,
1033 _: (),
1034 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1035 ::fidl_next::munge! {
1036 let crate::wire::ListenerOnRequestRequest {
1037 message,
1038
1039 } = out_;
1040 }
1041
1042 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
1043
1044 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
1045 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1046
1047 Ok(())
1048 }
1049 }
1050
1051 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>
1052 for &'a ListenerOnRequestRequest
1053 where
1054 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1055 ___E: ::fidl_next::Encoder,
1056 {
1057 #[inline]
1058 fn encode(
1059 self,
1060 encoder_: &mut ___E,
1061 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestRequest<'static>>,
1062 _: (),
1063 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1064 ::fidl_next::munge! {
1065 let crate::wire::ListenerOnRequestRequest {
1066 message,
1067
1068 } = out_;
1069 }
1070
1071 ::fidl_next::Encode::encode(&self.message, encoder_, message, (4294967295, ()))?;
1072
1073 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(message.as_mut_ptr()) };
1074 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1075
1076 Ok(())
1077 }
1078 }
1079
1080 unsafe impl<___E>
1081 ::fidl_next::EncodeOption<
1082 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1083 ___E,
1084 > for ListenerOnRequestRequest
1085 where
1086 ___E: ::fidl_next::Encoder + ?Sized,
1087 ListenerOnRequestRequest:
1088 ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>,
1089 {
1090 #[inline]
1091 fn encode_option(
1092 this: ::core::option::Option<Self>,
1093 encoder: &mut ___E,
1094 out: &mut ::core::mem::MaybeUninit<
1095 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1096 >,
1097 _: (),
1098 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1099 if let Some(inner) = this {
1100 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1101 ::fidl_next::wire::Box::encode_present(out);
1102 } else {
1103 ::fidl_next::wire::Box::encode_absent(out);
1104 }
1105
1106 Ok(())
1107 }
1108 }
1109
1110 unsafe impl<'a, ___E>
1111 ::fidl_next::EncodeOption<
1112 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1113 ___E,
1114 > for &'a ListenerOnRequestRequest
1115 where
1116 ___E: ::fidl_next::Encoder + ?Sized,
1117 &'a ListenerOnRequestRequest:
1118 ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>,
1119 {
1120 #[inline]
1121 fn encode_option(
1122 this: ::core::option::Option<Self>,
1123 encoder: &mut ___E,
1124 out: &mut ::core::mem::MaybeUninit<
1125 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestRequest<'static>>,
1126 >,
1127 _: (),
1128 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1129 if let Some(inner) = this {
1130 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1131 ::fidl_next::wire::Box::encode_present(out);
1132 } else {
1133 ::fidl_next::wire::Box::encode_absent(out);
1134 }
1135
1136 Ok(())
1137 }
1138 }
1139
1140 impl<'de> ::fidl_next::FromWire<crate::wire::ListenerOnRequestRequest<'de>>
1141 for ListenerOnRequestRequest
1142 {
1143 #[inline]
1144 fn from_wire(wire: crate::wire::ListenerOnRequestRequest<'de>) -> Self {
1145 Self { message: ::fidl_next::FromWire::from_wire(wire.message) }
1146 }
1147 }
1148
1149 impl<'de> ::fidl_next::FromWireRef<crate::wire::ListenerOnRequestRequest<'de>>
1150 for ListenerOnRequestRequest
1151 {
1152 #[inline]
1153 fn from_wire_ref(wire: &crate::wire::ListenerOnRequestRequest<'de>) -> Self {
1154 Self { message: ::fidl_next::FromWireRef::from_wire_ref(&wire.message) }
1155 }
1156 }
1157
1158 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1159 pub struct ListenerOnRequestResponse {
1160 pub response: ::std::vec::Vec<u8>,
1161 }
1162
1163 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>
1164 for ListenerOnRequestResponse
1165 where
1166 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1167 ___E: ::fidl_next::Encoder,
1168 {
1169 #[inline]
1170 fn encode(
1171 self,
1172 encoder_: &mut ___E,
1173 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestResponse<'static>>,
1174 _: (),
1175 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1176 ::fidl_next::munge! {
1177 let crate::wire::ListenerOnRequestResponse {
1178 response,
1179
1180 } = out_;
1181 }
1182
1183 ::fidl_next::Encode::encode(self.response, encoder_, response, (4294967295, ()))?;
1184
1185 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
1186 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1187
1188 Ok(())
1189 }
1190 }
1191
1192 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>
1193 for &'a ListenerOnRequestResponse
1194 where
1195 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1196 ___E: ::fidl_next::Encoder,
1197 {
1198 #[inline]
1199 fn encode(
1200 self,
1201 encoder_: &mut ___E,
1202 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestResponse<'static>>,
1203 _: (),
1204 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1205 ::fidl_next::munge! {
1206 let crate::wire::ListenerOnRequestResponse {
1207 response,
1208
1209 } = out_;
1210 }
1211
1212 ::fidl_next::Encode::encode(&self.response, encoder_, response, (4294967295, ()))?;
1213
1214 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
1215 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1216
1217 Ok(())
1218 }
1219 }
1220
1221 unsafe impl<___E>
1222 ::fidl_next::EncodeOption<
1223 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1224 ___E,
1225 > for ListenerOnRequestResponse
1226 where
1227 ___E: ::fidl_next::Encoder + ?Sized,
1228 ListenerOnRequestResponse:
1229 ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>,
1230 {
1231 #[inline]
1232 fn encode_option(
1233 this: ::core::option::Option<Self>,
1234 encoder: &mut ___E,
1235 out: &mut ::core::mem::MaybeUninit<
1236 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1237 >,
1238 _: (),
1239 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1240 if let Some(inner) = this {
1241 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1242 ::fidl_next::wire::Box::encode_present(out);
1243 } else {
1244 ::fidl_next::wire::Box::encode_absent(out);
1245 }
1246
1247 Ok(())
1248 }
1249 }
1250
1251 unsafe impl<'a, ___E>
1252 ::fidl_next::EncodeOption<
1253 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1254 ___E,
1255 > for &'a ListenerOnRequestResponse
1256 where
1257 ___E: ::fidl_next::Encoder + ?Sized,
1258 &'a ListenerOnRequestResponse:
1259 ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>,
1260 {
1261 #[inline]
1262 fn encode_option(
1263 this: ::core::option::Option<Self>,
1264 encoder: &mut ___E,
1265 out: &mut ::core::mem::MaybeUninit<
1266 ::fidl_next::wire::Box<'static, crate::wire::ListenerOnRequestResponse<'static>>,
1267 >,
1268 _: (),
1269 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1270 if let Some(inner) = this {
1271 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1272 ::fidl_next::wire::Box::encode_present(out);
1273 } else {
1274 ::fidl_next::wire::Box::encode_absent(out);
1275 }
1276
1277 Ok(())
1278 }
1279 }
1280
1281 impl<'de> ::fidl_next::FromWire<crate::wire::ListenerOnRequestResponse<'de>>
1282 for ListenerOnRequestResponse
1283 {
1284 #[inline]
1285 fn from_wire(wire: crate::wire::ListenerOnRequestResponse<'de>) -> Self {
1286 Self { response: ::fidl_next::FromWire::from_wire(wire.response) }
1287 }
1288 }
1289
1290 impl<'de> ::fidl_next::FromWireRef<crate::wire::ListenerOnRequestResponse<'de>>
1291 for ListenerOnRequestResponse
1292 {
1293 #[inline]
1294 fn from_wire_ref(wire: &crate::wire::ListenerOnRequestResponse<'de>) -> Self {
1295 Self { response: ::fidl_next::FromWireRef::from_wire_ref(&wire.response) }
1296 }
1297 }
1298}
1299
1300pub mod wire {
1301
1302 #[derive(Debug)]
1304 #[repr(C)]
1305 pub struct ChannelSendMessageRequest<'de> {
1306 pub message: ::fidl_next::wire::Vector<'de, u8>,
1307 }
1308
1309 static_assertions::const_assert_eq!(std::mem::size_of::<ChannelSendMessageRequest<'_>>(), 16);
1310 static_assertions::const_assert_eq!(std::mem::align_of::<ChannelSendMessageRequest<'_>>(), 8);
1311
1312 static_assertions::const_assert_eq!(
1313 std::mem::offset_of!(ChannelSendMessageRequest<'_>, message),
1314 0
1315 );
1316
1317 impl ::fidl_next::Constrained for ChannelSendMessageRequest<'_> {
1318 type Constraint = ();
1319
1320 fn validate(
1321 _: ::fidl_next::Slot<'_, Self>,
1322 _: Self::Constraint,
1323 ) -> Result<(), ::fidl_next::ValidationError> {
1324 Ok(())
1325 }
1326 }
1327
1328 unsafe impl ::fidl_next::Wire for ChannelSendMessageRequest<'static> {
1329 type Narrowed<'de> = ChannelSendMessageRequest<'de>;
1330
1331 #[inline]
1332 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1333 ::fidl_next::munge! {
1334 let Self {
1335 message,
1336
1337 } = &mut *out_;
1338 }
1339
1340 ::fidl_next::Wire::zero_padding(message);
1341 }
1342 }
1343
1344 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelSendMessageRequest<'de>
1345 where
1346 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1347 ___D: ::fidl_next::Decoder<'de>,
1348 {
1349 fn decode(
1350 slot_: ::fidl_next::Slot<'_, Self>,
1351 decoder_: &mut ___D,
1352 _: (),
1353 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1354 ::fidl_next::munge! {
1355 let Self {
1356 mut message,
1357
1358 } = slot_;
1359 }
1360
1361 let _field = message.as_mut();
1362 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1363 ::fidl_next::Decode::decode(message.as_mut(), decoder_, (4294967295, ()))?;
1364
1365 Ok(())
1366 }
1367 }
1368
1369 impl<'de> ::fidl_next::IntoNatural for ChannelSendMessageRequest<'de> {
1370 type Natural = crate::natural::ChannelSendMessageRequest;
1371 }
1372
1373 pub type ChannelSendMessageResponse = ::fidl_next::wire::Unit;
1375
1376 #[derive(Debug)]
1378 #[repr(C)]
1379 pub struct ChannelSendRequestRequest<'de> {
1380 pub request: ::fidl_next::wire::Vector<'de, u8>,
1381 }
1382
1383 static_assertions::const_assert_eq!(std::mem::size_of::<ChannelSendRequestRequest<'_>>(), 16);
1384 static_assertions::const_assert_eq!(std::mem::align_of::<ChannelSendRequestRequest<'_>>(), 8);
1385
1386 static_assertions::const_assert_eq!(
1387 std::mem::offset_of!(ChannelSendRequestRequest<'_>, request),
1388 0
1389 );
1390
1391 impl ::fidl_next::Constrained for ChannelSendRequestRequest<'_> {
1392 type Constraint = ();
1393
1394 fn validate(
1395 _: ::fidl_next::Slot<'_, Self>,
1396 _: Self::Constraint,
1397 ) -> Result<(), ::fidl_next::ValidationError> {
1398 Ok(())
1399 }
1400 }
1401
1402 unsafe impl ::fidl_next::Wire for ChannelSendRequestRequest<'static> {
1403 type Narrowed<'de> = ChannelSendRequestRequest<'de>;
1404
1405 #[inline]
1406 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1407 ::fidl_next::munge! {
1408 let Self {
1409 request,
1410
1411 } = &mut *out_;
1412 }
1413
1414 ::fidl_next::Wire::zero_padding(request);
1415 }
1416 }
1417
1418 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelSendRequestRequest<'de>
1419 where
1420 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1421 ___D: ::fidl_next::Decoder<'de>,
1422 {
1423 fn decode(
1424 slot_: ::fidl_next::Slot<'_, Self>,
1425 decoder_: &mut ___D,
1426 _: (),
1427 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1428 ::fidl_next::munge! {
1429 let Self {
1430 mut request,
1431
1432 } = slot_;
1433 }
1434
1435 let _field = request.as_mut();
1436 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1437 ::fidl_next::Decode::decode(request.as_mut(), decoder_, (4294967295, ()))?;
1438
1439 Ok(())
1440 }
1441 }
1442
1443 impl<'de> ::fidl_next::IntoNatural for ChannelSendRequestRequest<'de> {
1444 type Natural = crate::natural::ChannelSendRequestRequest;
1445 }
1446
1447 #[derive(Debug)]
1449 #[repr(C)]
1450 pub struct ChannelSendRequestResponse<'de> {
1451 pub response: ::fidl_next::wire::Vector<'de, u8>,
1452 }
1453
1454 static_assertions::const_assert_eq!(std::mem::size_of::<ChannelSendRequestResponse<'_>>(), 16);
1455 static_assertions::const_assert_eq!(std::mem::align_of::<ChannelSendRequestResponse<'_>>(), 8);
1456
1457 static_assertions::const_assert_eq!(
1458 std::mem::offset_of!(ChannelSendRequestResponse<'_>, response),
1459 0
1460 );
1461
1462 impl ::fidl_next::Constrained for ChannelSendRequestResponse<'_> {
1463 type Constraint = ();
1464
1465 fn validate(
1466 _: ::fidl_next::Slot<'_, Self>,
1467 _: Self::Constraint,
1468 ) -> Result<(), ::fidl_next::ValidationError> {
1469 Ok(())
1470 }
1471 }
1472
1473 unsafe impl ::fidl_next::Wire for ChannelSendRequestResponse<'static> {
1474 type Narrowed<'de> = ChannelSendRequestResponse<'de>;
1475
1476 #[inline]
1477 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1478 ::fidl_next::munge! {
1479 let Self {
1480 response,
1481
1482 } = &mut *out_;
1483 }
1484
1485 ::fidl_next::Wire::zero_padding(response);
1486 }
1487 }
1488
1489 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelSendRequestResponse<'de>
1490 where
1491 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1492 ___D: ::fidl_next::Decoder<'de>,
1493 {
1494 fn decode(
1495 slot_: ::fidl_next::Slot<'_, Self>,
1496 decoder_: &mut ___D,
1497 _: (),
1498 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1499 ::fidl_next::munge! {
1500 let Self {
1501 mut response,
1502
1503 } = slot_;
1504 }
1505
1506 let _field = response.as_mut();
1507 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1508 ::fidl_next::Decode::decode(response.as_mut(), decoder_, (4294967295, ()))?;
1509
1510 Ok(())
1511 }
1512 }
1513
1514 impl<'de> ::fidl_next::IntoNatural for ChannelSendRequestResponse<'de> {
1515 type Natural = crate::natural::ChannelSendRequestResponse;
1516 }
1517
1518 pub type ChannelRegisterListenerResponse = ::fidl_next::wire::Unit;
1520
1521 #[repr(C)]
1523 pub struct ChannelInfo<'de> {
1524 pub(crate) table: ::fidl_next::wire::Table<'de>,
1525 }
1526
1527 impl<'de> Drop for ChannelInfo<'de> {
1528 fn drop(&mut self) {
1529 let _ = self
1530 .table
1531 .get(1)
1532 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1533
1534 let _ = self
1535 .table
1536 .get(2)
1537 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1538
1539 let _ = self
1540 .table
1541 .get(3)
1542 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1543 }
1544 }
1545
1546 impl ::fidl_next::Constrained for ChannelInfo<'_> {
1547 type Constraint = ();
1548
1549 fn validate(
1550 _: ::fidl_next::Slot<'_, Self>,
1551 _: Self::Constraint,
1552 ) -> Result<(), ::fidl_next::ValidationError> {
1553 Ok(())
1554 }
1555 }
1556
1557 unsafe impl ::fidl_next::Wire for ChannelInfo<'static> {
1558 type Narrowed<'de> = ChannelInfo<'de>;
1559
1560 #[inline]
1561 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1562 ::fidl_next::munge!(let Self { table } = out);
1563 ::fidl_next::wire::Table::zero_padding(table);
1564 }
1565 }
1566
1567 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChannelInfo<'de>
1568 where
1569 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1570 {
1571 fn decode(
1572 slot: ::fidl_next::Slot<'_, Self>,
1573 decoder: &mut ___D,
1574 _: (),
1575 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1576 ::fidl_next::munge!(let Self { table } = slot);
1577
1578 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1579 match ordinal {
1580 0 => unsafe { ::core::hint::unreachable_unchecked() },
1581
1582 1 => {
1583 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1584 slot.as_mut(),
1585 decoder,
1586 (),
1587 )?;
1588
1589 Ok(())
1590 }
1591
1592 2 => {
1593 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1594 slot.as_mut(),
1595 decoder,
1596 (),
1597 )?;
1598
1599 Ok(())
1600 }
1601
1602 3 => {
1603 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1604 slot.as_mut(),
1605 decoder,
1606 (),
1607 )?;
1608
1609 Ok(())
1610 }
1611
1612 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1613 }
1614 })
1615 }
1616 }
1617
1618 impl<'de> ChannelInfo<'de> {
1619 pub fn channel(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1620 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1621 }
1622
1623 pub fn take_channel(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1624 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1625 }
1626
1627 pub fn client(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1628 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1629 }
1630
1631 pub fn take_client(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1632 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1633 }
1634
1635 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1636 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1637 }
1638
1639 pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1640 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
1641 }
1642 }
1643
1644 impl<'de> ::core::fmt::Debug for ChannelInfo<'de> {
1645 fn fmt(
1646 &self,
1647 f: &mut ::core::fmt::Formatter<'_>,
1648 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1649 f.debug_struct("ChannelInfo")
1650 .field("channel", &self.channel())
1651 .field("client", &self.client())
1652 .field("id", &self.id())
1653 .finish()
1654 }
1655 }
1656
1657 impl<'de> ::fidl_next::IntoNatural for ChannelInfo<'de> {
1658 type Natural = crate::natural::ChannelInfo;
1659 }
1660
1661 #[repr(C)]
1663 pub struct ControllerInfo<'de> {
1664 pub(crate) table: ::fidl_next::wire::Table<'de>,
1665 }
1666
1667 impl<'de> Drop for ControllerInfo<'de> {
1668 fn drop(&mut self) {
1669 let _ = self
1670 .table
1671 .get(1)
1672 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1673
1674 let _ = self.table.get(2)
1675 .map(|envelope| unsafe {
1676 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>()
1677 });
1678 }
1679 }
1680
1681 impl ::fidl_next::Constrained for ControllerInfo<'_> {
1682 type Constraint = ();
1683
1684 fn validate(
1685 _: ::fidl_next::Slot<'_, Self>,
1686 _: Self::Constraint,
1687 ) -> Result<(), ::fidl_next::ValidationError> {
1688 Ok(())
1689 }
1690 }
1691
1692 unsafe impl ::fidl_next::Wire for ControllerInfo<'static> {
1693 type Narrowed<'de> = ControllerInfo<'de>;
1694
1695 #[inline]
1696 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1697 ::fidl_next::munge!(let Self { table } = out);
1698 ::fidl_next::wire::Table::zero_padding(table);
1699 }
1700 }
1701
1702 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ControllerInfo<'de>
1703 where
1704 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1705 {
1706 fn decode(
1707 slot: ::fidl_next::Slot<'_, Self>,
1708 decoder: &mut ___D,
1709 _: (),
1710 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1711 ::fidl_next::munge!(let Self { table } = slot);
1712
1713 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1714 match ordinal {
1715 0 => unsafe { ::core::hint::unreachable_unchecked() },
1716
1717 1 => {
1718 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1719 slot.as_mut(),
1720 decoder,
1721 (),
1722 )?;
1723
1724 Ok(())
1725 }
1726
1727 2 => {
1728 ::fidl_next::wire::Envelope::decode_as::<
1729 ___D,
1730 ::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>,
1731 >(slot.as_mut(), decoder, (4294967295, ()))?;
1732
1733 Ok(())
1734 }
1735
1736 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1737 }
1738 })
1739 }
1740 }
1741
1742 impl<'de> ControllerInfo<'de> {
1743 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1744 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1745 }
1746
1747 pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1748 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1749 }
1750
1751 pub fn channels(
1752 &self,
1753 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>
1754 {
1755 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1756 }
1757
1758 pub fn take_channels(
1759 &mut self,
1760 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::ChannelInfo<'de>>>
1761 {
1762 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1763 }
1764 }
1765
1766 impl<'de> ::core::fmt::Debug for ControllerInfo<'de> {
1767 fn fmt(
1768 &self,
1769 f: &mut ::core::fmt::Formatter<'_>,
1770 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1771 f.debug_struct("ControllerInfo")
1772 .field("id", &self.id())
1773 .field("channels", &self.channels())
1774 .finish()
1775 }
1776 }
1777
1778 impl<'de> ::fidl_next::IntoNatural for ControllerInfo<'de> {
1779 type Natural = crate::natural::ControllerInfo;
1780 }
1781
1782 #[derive(Debug)]
1784 #[repr(C)]
1785 pub struct ListenerOnMessageRequest<'de> {
1786 pub message: ::fidl_next::wire::Vector<'de, u8>,
1787 }
1788
1789 static_assertions::const_assert_eq!(std::mem::size_of::<ListenerOnMessageRequest<'_>>(), 16);
1790 static_assertions::const_assert_eq!(std::mem::align_of::<ListenerOnMessageRequest<'_>>(), 8);
1791
1792 static_assertions::const_assert_eq!(
1793 std::mem::offset_of!(ListenerOnMessageRequest<'_>, message),
1794 0
1795 );
1796
1797 impl ::fidl_next::Constrained for ListenerOnMessageRequest<'_> {
1798 type Constraint = ();
1799
1800 fn validate(
1801 _: ::fidl_next::Slot<'_, Self>,
1802 _: Self::Constraint,
1803 ) -> Result<(), ::fidl_next::ValidationError> {
1804 Ok(())
1805 }
1806 }
1807
1808 unsafe impl ::fidl_next::Wire for ListenerOnMessageRequest<'static> {
1809 type Narrowed<'de> = ListenerOnMessageRequest<'de>;
1810
1811 #[inline]
1812 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1813 ::fidl_next::munge! {
1814 let Self {
1815 message,
1816
1817 } = &mut *out_;
1818 }
1819
1820 ::fidl_next::Wire::zero_padding(message);
1821 }
1822 }
1823
1824 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ListenerOnMessageRequest<'de>
1825 where
1826 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1827 ___D: ::fidl_next::Decoder<'de>,
1828 {
1829 fn decode(
1830 slot_: ::fidl_next::Slot<'_, Self>,
1831 decoder_: &mut ___D,
1832 _: (),
1833 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1834 ::fidl_next::munge! {
1835 let Self {
1836 mut message,
1837
1838 } = slot_;
1839 }
1840
1841 let _field = message.as_mut();
1842 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1843 ::fidl_next::Decode::decode(message.as_mut(), decoder_, (4294967295, ()))?;
1844
1845 Ok(())
1846 }
1847 }
1848
1849 impl<'de> ::fidl_next::IntoNatural for ListenerOnMessageRequest<'de> {
1850 type Natural = crate::natural::ListenerOnMessageRequest;
1851 }
1852
1853 pub type ListenerOnMessageResponse = ::fidl_next::wire::Unit;
1855
1856 #[derive(Debug)]
1858 #[repr(C)]
1859 pub struct ListenerOnRequestRequest<'de> {
1860 pub message: ::fidl_next::wire::Vector<'de, u8>,
1861 }
1862
1863 static_assertions::const_assert_eq!(std::mem::size_of::<ListenerOnRequestRequest<'_>>(), 16);
1864 static_assertions::const_assert_eq!(std::mem::align_of::<ListenerOnRequestRequest<'_>>(), 8);
1865
1866 static_assertions::const_assert_eq!(
1867 std::mem::offset_of!(ListenerOnRequestRequest<'_>, message),
1868 0
1869 );
1870
1871 impl ::fidl_next::Constrained for ListenerOnRequestRequest<'_> {
1872 type Constraint = ();
1873
1874 fn validate(
1875 _: ::fidl_next::Slot<'_, Self>,
1876 _: Self::Constraint,
1877 ) -> Result<(), ::fidl_next::ValidationError> {
1878 Ok(())
1879 }
1880 }
1881
1882 unsafe impl ::fidl_next::Wire for ListenerOnRequestRequest<'static> {
1883 type Narrowed<'de> = ListenerOnRequestRequest<'de>;
1884
1885 #[inline]
1886 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1887 ::fidl_next::munge! {
1888 let Self {
1889 message,
1890
1891 } = &mut *out_;
1892 }
1893
1894 ::fidl_next::Wire::zero_padding(message);
1895 }
1896 }
1897
1898 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ListenerOnRequestRequest<'de>
1899 where
1900 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1901 ___D: ::fidl_next::Decoder<'de>,
1902 {
1903 fn decode(
1904 slot_: ::fidl_next::Slot<'_, Self>,
1905 decoder_: &mut ___D,
1906 _: (),
1907 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1908 ::fidl_next::munge! {
1909 let Self {
1910 mut message,
1911
1912 } = slot_;
1913 }
1914
1915 let _field = message.as_mut();
1916 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1917 ::fidl_next::Decode::decode(message.as_mut(), decoder_, (4294967295, ()))?;
1918
1919 Ok(())
1920 }
1921 }
1922
1923 impl<'de> ::fidl_next::IntoNatural for ListenerOnRequestRequest<'de> {
1924 type Natural = crate::natural::ListenerOnRequestRequest;
1925 }
1926
1927 #[derive(Debug)]
1929 #[repr(C)]
1930 pub struct ListenerOnRequestResponse<'de> {
1931 pub response: ::fidl_next::wire::Vector<'de, u8>,
1932 }
1933
1934 static_assertions::const_assert_eq!(std::mem::size_of::<ListenerOnRequestResponse<'_>>(), 16);
1935 static_assertions::const_assert_eq!(std::mem::align_of::<ListenerOnRequestResponse<'_>>(), 8);
1936
1937 static_assertions::const_assert_eq!(
1938 std::mem::offset_of!(ListenerOnRequestResponse<'_>, response),
1939 0
1940 );
1941
1942 impl ::fidl_next::Constrained for ListenerOnRequestResponse<'_> {
1943 type Constraint = ();
1944
1945 fn validate(
1946 _: ::fidl_next::Slot<'_, Self>,
1947 _: Self::Constraint,
1948 ) -> Result<(), ::fidl_next::ValidationError> {
1949 Ok(())
1950 }
1951 }
1952
1953 unsafe impl ::fidl_next::Wire for ListenerOnRequestResponse<'static> {
1954 type Narrowed<'de> = ListenerOnRequestResponse<'de>;
1955
1956 #[inline]
1957 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1958 ::fidl_next::munge! {
1959 let Self {
1960 response,
1961
1962 } = &mut *out_;
1963 }
1964
1965 ::fidl_next::Wire::zero_padding(response);
1966 }
1967 }
1968
1969 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ListenerOnRequestResponse<'de>
1970 where
1971 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1972 ___D: ::fidl_next::Decoder<'de>,
1973 {
1974 fn decode(
1975 slot_: ::fidl_next::Slot<'_, Self>,
1976 decoder_: &mut ___D,
1977 _: (),
1978 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1979 ::fidl_next::munge! {
1980 let Self {
1981 mut response,
1982
1983 } = slot_;
1984 }
1985
1986 let _field = response.as_mut();
1987 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1988 ::fidl_next::Decode::decode(response.as_mut(), decoder_, (4294967295, ()))?;
1989
1990 Ok(())
1991 }
1992 }
1993
1994 impl<'de> ::fidl_next::IntoNatural for ListenerOnRequestResponse<'de> {
1995 type Natural = crate::natural::ListenerOnRequestResponse;
1996 }
1997}
1998
1999pub mod wire_optional {}
2000
2001pub mod generic {
2002
2003 pub struct ChannelSendMessageRequest<T0> {
2005 pub message: T0,
2006 }
2007
2008 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ChannelSendMessageRequest<'static>, ___E>
2009 for ChannelSendMessageRequest<T0>
2010 where
2011 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2012 ___E: ::fidl_next::Encoder,
2013 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2014 {
2015 #[inline]
2016 fn encode(
2017 self,
2018 encoder_: &mut ___E,
2019 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendMessageRequest<'static>>,
2020 _: (),
2021 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2022 ::fidl_next::munge! {
2023 let crate::wire::ChannelSendMessageRequest {
2024 message,
2025
2026 } = out_;
2027 }
2028
2029 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
2030
2031 Ok(())
2032 }
2033 }
2034
2035 pub type ChannelSendMessageResponse = ();
2037
2038 pub struct ChannelSendRequestRequest<T0> {
2040 pub request: T0,
2041 }
2042
2043 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ChannelSendRequestRequest<'static>, ___E>
2044 for ChannelSendRequestRequest<T0>
2045 where
2046 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2047 ___E: ::fidl_next::Encoder,
2048 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2049 {
2050 #[inline]
2051 fn encode(
2052 self,
2053 encoder_: &mut ___E,
2054 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChannelSendRequestRequest<'static>>,
2055 _: (),
2056 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2057 ::fidl_next::munge! {
2058 let crate::wire::ChannelSendRequestRequest {
2059 request,
2060
2061 } = out_;
2062 }
2063
2064 ::fidl_next::Encode::encode(self.request, encoder_, request, (4294967295, ()))?;
2065
2066 Ok(())
2067 }
2068 }
2069
2070 pub struct ChannelSendRequestResponse<T0> {
2072 pub response: T0,
2073 }
2074
2075 unsafe impl<___E, T0>
2076 ::fidl_next::Encode<crate::wire::ChannelSendRequestResponse<'static>, ___E>
2077 for ChannelSendRequestResponse<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::ChannelSendRequestResponse<'static>>,
2088 _: (),
2089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2090 ::fidl_next::munge! {
2091 let crate::wire::ChannelSendRequestResponse {
2092 response,
2093
2094 } = out_;
2095 }
2096
2097 ::fidl_next::Encode::encode(self.response, encoder_, response, (4294967295, ()))?;
2098
2099 Ok(())
2100 }
2101 }
2102
2103 pub type ChannelRegisterListenerResponse = ();
2105
2106 pub struct ListenerOnMessageRequest<T0> {
2108 pub message: T0,
2109 }
2110
2111 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ListenerOnMessageRequest<'static>, ___E>
2112 for ListenerOnMessageRequest<T0>
2113 where
2114 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2115 ___E: ::fidl_next::Encoder,
2116 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2117 {
2118 #[inline]
2119 fn encode(
2120 self,
2121 encoder_: &mut ___E,
2122 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnMessageRequest<'static>>,
2123 _: (),
2124 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2125 ::fidl_next::munge! {
2126 let crate::wire::ListenerOnMessageRequest {
2127 message,
2128
2129 } = out_;
2130 }
2131
2132 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
2133
2134 Ok(())
2135 }
2136 }
2137
2138 pub type ListenerOnMessageResponse = ();
2140
2141 pub struct ListenerOnRequestRequest<T0> {
2143 pub message: T0,
2144 }
2145
2146 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ListenerOnRequestRequest<'static>, ___E>
2147 for ListenerOnRequestRequest<T0>
2148 where
2149 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2150 ___E: ::fidl_next::Encoder,
2151 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2152 {
2153 #[inline]
2154 fn encode(
2155 self,
2156 encoder_: &mut ___E,
2157 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestRequest<'static>>,
2158 _: (),
2159 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2160 ::fidl_next::munge! {
2161 let crate::wire::ListenerOnRequestRequest {
2162 message,
2163
2164 } = out_;
2165 }
2166
2167 ::fidl_next::Encode::encode(self.message, encoder_, message, (4294967295, ()))?;
2168
2169 Ok(())
2170 }
2171 }
2172
2173 pub struct ListenerOnRequestResponse<T0> {
2175 pub response: T0,
2176 }
2177
2178 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ListenerOnRequestResponse<'static>, ___E>
2179 for ListenerOnRequestResponse<T0>
2180 where
2181 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2182 ___E: ::fidl_next::Encoder,
2183 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2184 {
2185 #[inline]
2186 fn encode(
2187 self,
2188 encoder_: &mut ___E,
2189 out_: &mut ::core::mem::MaybeUninit<crate::wire::ListenerOnRequestResponse<'static>>,
2190 _: (),
2191 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2192 ::fidl_next::munge! {
2193 let crate::wire::ListenerOnRequestResponse {
2194 response,
2195
2196 } = out_;
2197 }
2198
2199 ::fidl_next::Encode::encode(self.response, encoder_, response, (4294967295, ()))?;
2200
2201 Ok(())
2202 }
2203 }
2204}
2205
2206pub use self::natural::*;
2207
2208#[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"]
2210#[derive(PartialEq, Debug)]
2211pub struct Listener;
2212
2213#[cfg(target_os = "fuchsia")]
2214impl ::fidl_next::HasTransport for Listener {
2215 type Transport = ::fidl_next::fuchsia::zx::Channel;
2216}
2217
2218pub mod listener {
2219 pub mod prelude {
2220 pub use crate::{
2221 Listener, ListenerClientHandler, ListenerLocalClientHandler,
2222 ListenerLocalServerHandler, ListenerServerHandler, listener,
2223 };
2224
2225 pub use crate::natural::ListenerOnMessageRequest;
2226
2227 pub use crate::natural::ListenerOnRequestRequest;
2228
2229 pub use crate::natural::ListenerOnMessageResponse;
2230
2231 pub use crate::natural::ListenerOnRequestResponse;
2232 }
2233
2234 pub struct OnMessage;
2235
2236 impl ::fidl_next::Method for OnMessage {
2237 const ORDINAL: u64 = 3132544944554375052;
2238 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2239 ::fidl_next::protocol::Flexibility::Flexible;
2240
2241 type Protocol = crate::Listener;
2242
2243 type Request = crate::wire::ListenerOnMessageRequest<'static>;
2244 }
2245
2246 impl ::fidl_next::TwoWayMethod for OnMessage {
2247 type Response = ::fidl_next::wire::Result<
2248 'static,
2249 crate::wire::ListenerOnMessageResponse,
2250 ::fidl_next::wire::fuchsia::StatusResult,
2251 >;
2252 }
2253
2254 impl<___R> ::fidl_next::Respond<___R> for OnMessage {
2255 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2256
2257 fn respond(response: ___R) -> Self::Output {
2258 ::core::result::Result::Ok(response)
2259 }
2260 }
2261
2262 impl<___R> ::fidl_next::RespondErr<___R> for OnMessage {
2263 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2264
2265 fn respond_err(response: ___R) -> Self::Output {
2266 ::core::result::Result::Err(response)
2267 }
2268 }
2269
2270 pub struct OnRequest;
2271
2272 impl ::fidl_next::Method for OnRequest {
2273 const ORDINAL: u64 = 6226805799602931743;
2274 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2275 ::fidl_next::protocol::Flexibility::Flexible;
2276
2277 type Protocol = crate::Listener;
2278
2279 type Request = crate::wire::ListenerOnRequestRequest<'static>;
2280 }
2281
2282 impl ::fidl_next::TwoWayMethod for OnRequest {
2283 type Response = ::fidl_next::wire::Result<
2284 'static,
2285 crate::wire::ListenerOnRequestResponse<'static>,
2286 ::fidl_next::wire::fuchsia::StatusResult,
2287 >;
2288 }
2289
2290 impl<___R> ::fidl_next::Respond<___R> for OnRequest {
2291 type Output = ::core::result::Result<
2292 crate::generic::ListenerOnRequestResponse<___R>,
2293 ::fidl_next::never::Never,
2294 >;
2295
2296 fn respond(response: ___R) -> Self::Output {
2297 ::core::result::Result::Ok(crate::generic::ListenerOnRequestResponse {
2298 response: response,
2299 })
2300 }
2301 }
2302
2303 impl<___R> ::fidl_next::RespondErr<___R> for OnRequest {
2304 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2305
2306 fn respond_err(response: ___R) -> Self::Output {
2307 ::core::result::Result::Err(response)
2308 }
2309 }
2310
2311 mod ___detail {
2312 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Listener
2313 where
2314 ___T: ::fidl_next::Transport,
2315 {
2316 type Client = ListenerClient<___T>;
2317 type Server = ListenerServer<___T>;
2318 }
2319
2320 #[repr(transparent)]
2322 pub struct ListenerClient<___T: ::fidl_next::Transport> {
2323 #[allow(dead_code)]
2324 client: ::fidl_next::protocol::Client<___T>,
2325 }
2326
2327 impl<___T> ListenerClient<___T>
2328 where
2329 ___T: ::fidl_next::Transport,
2330 {
2331 #[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"]
2332 pub fn on_message(
2333 &self,
2334
2335 message: impl ::fidl_next::Encode<
2336 ::fidl_next::wire::Vector<'static, u8>,
2337 <___T as ::fidl_next::Transport>::SendBuffer,
2338 >,
2339 ) -> ::fidl_next::TwoWayFuture<'_, super::OnMessage, ___T>
2340 where
2341 <___T as ::fidl_next::Transport>::SendBuffer:
2342 ::fidl_next::encoder::InternalHandleEncoder,
2343 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2344 {
2345 self.on_message_with(crate::generic::ListenerOnMessageRequest { message })
2346 }
2347
2348 #[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"]
2349 pub fn on_message_with<___R>(
2350 &self,
2351 request: ___R,
2352 ) -> ::fidl_next::TwoWayFuture<'_, super::OnMessage, ___T>
2353 where
2354 ___R: ::fidl_next::Encode<
2355 crate::wire::ListenerOnMessageRequest<'static>,
2356 <___T as ::fidl_next::Transport>::SendBuffer,
2357 >,
2358 {
2359 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2360 3132544944554375052,
2361 <super::OnMessage as ::fidl_next::Method>::FLEXIBILITY,
2362 request,
2363 ))
2364 }
2365
2366 #[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"]
2367 pub fn on_request(
2368 &self,
2369
2370 message: impl ::fidl_next::Encode<
2371 ::fidl_next::wire::Vector<'static, u8>,
2372 <___T as ::fidl_next::Transport>::SendBuffer,
2373 >,
2374 ) -> ::fidl_next::TwoWayFuture<'_, super::OnRequest, ___T>
2375 where
2376 <___T as ::fidl_next::Transport>::SendBuffer:
2377 ::fidl_next::encoder::InternalHandleEncoder,
2378 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2379 {
2380 self.on_request_with(crate::generic::ListenerOnRequestRequest { message })
2381 }
2382
2383 #[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"]
2384 pub fn on_request_with<___R>(
2385 &self,
2386 request: ___R,
2387 ) -> ::fidl_next::TwoWayFuture<'_, super::OnRequest, ___T>
2388 where
2389 ___R: ::fidl_next::Encode<
2390 crate::wire::ListenerOnRequestRequest<'static>,
2391 <___T as ::fidl_next::Transport>::SendBuffer,
2392 >,
2393 {
2394 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2395 6226805799602931743,
2396 <super::OnRequest as ::fidl_next::Method>::FLEXIBILITY,
2397 request,
2398 ))
2399 }
2400 }
2401
2402 #[repr(transparent)]
2404 pub struct ListenerServer<___T: ::fidl_next::Transport> {
2405 server: ::fidl_next::protocol::Server<___T>,
2406 }
2407
2408 impl<___T> ListenerServer<___T> where ___T: ::fidl_next::Transport {}
2409 }
2410}
2411
2412#[diagnostic::on_unimplemented(
2413 note = "If {Self} implements the non-local ListenerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2414)]
2415
2416pub trait ListenerLocalClientHandler<
2420 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2421 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2422>
2423{
2424 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2425 ::core::future::ready(())
2426 }
2427}
2428
2429impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Listener
2430where
2431 ___H: ListenerLocalClientHandler<___T>,
2432 ___T: ::fidl_next::Transport,
2433{
2434 async fn on_event(
2435 handler: &mut ___H,
2436 mut message: ::fidl_next::Message<___T>,
2437 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2438 match *message.header().ordinal {
2439 ordinal => {
2440 handler.on_unknown_interaction(ordinal).await;
2441 if ::core::matches!(
2442 message.header().flexibility(),
2443 ::fidl_next::protocol::Flexibility::Strict
2444 ) {
2445 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2446 } else {
2447 Ok(())
2448 }
2449 }
2450 }
2451 }
2452}
2453
2454#[diagnostic::on_unimplemented(
2455 note = "If {Self} implements the non-local ListenerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2456)]
2457
2458pub trait ListenerLocalServerHandler<
2462 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2463 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2464>
2465{
2466 #[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"]
2467 fn on_message(
2468 &mut self,
2469
2470 request: ::fidl_next::Request<listener::OnMessage, ___T>,
2471
2472 responder: ::fidl_next::Responder<listener::OnMessage, ___T>,
2473 ) -> impl ::core::future::Future<Output = ()>;
2474
2475 #[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"]
2476 fn on_request(
2477 &mut self,
2478
2479 request: ::fidl_next::Request<listener::OnRequest, ___T>,
2480
2481 responder: ::fidl_next::Responder<listener::OnRequest, ___T>,
2482 ) -> impl ::core::future::Future<Output = ()>;
2483
2484 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2485 ::core::future::ready(())
2486 }
2487}
2488
2489impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Listener
2490where
2491 ___H: ListenerLocalServerHandler<___T>,
2492 ___T: ::fidl_next::Transport,
2493 for<'de> crate::wire::ListenerOnMessageRequest<'de>: ::fidl_next::Decode<
2494 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2495 Constraint = (),
2496 >,
2497 for<'de> crate::wire::ListenerOnRequestRequest<'de>: ::fidl_next::Decode<
2498 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2499 Constraint = (),
2500 >,
2501{
2502 async fn on_one_way(
2503 handler: &mut ___H,
2504 mut message: ::fidl_next::Message<___T>,
2505 ) -> ::core::result::Result<
2506 (),
2507 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2508 > {
2509 match *message.header().ordinal {
2510 ordinal => {
2511 handler.on_unknown_interaction(ordinal).await;
2512 if ::core::matches!(
2513 message.header().flexibility(),
2514 ::fidl_next::protocol::Flexibility::Strict
2515 ) {
2516 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2517 } else {
2518 Ok(())
2519 }
2520 }
2521 }
2522 }
2523
2524 async fn on_two_way(
2525 handler: &mut ___H,
2526 mut message: ::fidl_next::Message<___T>,
2527 responder: ::fidl_next::protocol::Responder<___T>,
2528 ) -> ::core::result::Result<
2529 (),
2530 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2531 > {
2532 match *message.header().ordinal {
2533 3132544944554375052 => {
2534 let responder = ::fidl_next::Responder::from_untyped(responder);
2535
2536 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2537 Ok(decoded) => {
2538 handler
2539 .on_message(::fidl_next::Request::from_decoded(decoded), responder)
2540 .await;
2541 Ok(())
2542 }
2543 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2544 ordinal: 3132544944554375052,
2545 error,
2546 }),
2547 }
2548 }
2549
2550 6226805799602931743 => {
2551 let responder = ::fidl_next::Responder::from_untyped(responder);
2552
2553 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2554 Ok(decoded) => {
2555 handler
2556 .on_request(::fidl_next::Request::from_decoded(decoded), responder)
2557 .await;
2558 Ok(())
2559 }
2560 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2561 ordinal: 6226805799602931743,
2562 error,
2563 }),
2564 }
2565 }
2566
2567 ordinal => {
2568 handler.on_unknown_interaction(ordinal).await;
2569 if ::core::matches!(
2570 message.header().flexibility(),
2571 ::fidl_next::protocol::Flexibility::Strict
2572 ) {
2573 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2574 } else {
2575 responder
2576 .respond_framework_error(
2577 ordinal,
2578 ::fidl_next::FrameworkError::UnknownMethod,
2579 )
2580 .expect("encoding a framework error should never fail")
2581 .await?;
2582 Ok(())
2583 }
2584 }
2585 }
2586 }
2587}
2588
2589pub trait ListenerClientHandler<
2593 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2594 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2595>
2596{
2597 fn on_unknown_interaction(
2598 &mut self,
2599 ordinal: u64,
2600 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2601 ::core::future::ready(())
2602 }
2603}
2604
2605impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Listener
2606where
2607 ___H: ListenerClientHandler<___T> + ::core::marker::Send,
2608 ___T: ::fidl_next::Transport,
2609{
2610 async fn on_event(
2611 handler: &mut ___H,
2612 mut message: ::fidl_next::Message<___T>,
2613 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
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
2630pub trait ListenerServerHandler<
2634 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2635 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2636>
2637{
2638 #[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"]
2639 fn on_message(
2640 &mut self,
2641
2642 request: ::fidl_next::Request<listener::OnMessage, ___T>,
2643
2644 responder: ::fidl_next::Responder<listener::OnMessage, ___T>,
2645 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2646
2647 #[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"]
2648 fn on_request(
2649 &mut self,
2650
2651 request: ::fidl_next::Request<listener::OnRequest, ___T>,
2652
2653 responder: ::fidl_next::Responder<listener::OnRequest, ___T>,
2654 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2655
2656 fn on_unknown_interaction(
2657 &mut self,
2658 ordinal: u64,
2659 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2660 ::core::future::ready(())
2661 }
2662}
2663
2664impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Listener
2665where
2666 ___H: ListenerServerHandler<___T> + ::core::marker::Send,
2667 ___T: ::fidl_next::Transport,
2668 for<'de> crate::wire::ListenerOnMessageRequest<'de>: ::fidl_next::Decode<
2669 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2670 Constraint = (),
2671 >,
2672 for<'de> crate::wire::ListenerOnRequestRequest<'de>: ::fidl_next::Decode<
2673 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2674 Constraint = (),
2675 >,
2676{
2677 async fn on_one_way(
2678 handler: &mut ___H,
2679 mut message: ::fidl_next::Message<___T>,
2680 ) -> ::core::result::Result<
2681 (),
2682 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2683 > {
2684 match *message.header().ordinal {
2685 ordinal => {
2686 handler.on_unknown_interaction(ordinal).await;
2687 if ::core::matches!(
2688 message.header().flexibility(),
2689 ::fidl_next::protocol::Flexibility::Strict
2690 ) {
2691 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2692 } else {
2693 Ok(())
2694 }
2695 }
2696 }
2697 }
2698
2699 async fn on_two_way(
2700 handler: &mut ___H,
2701 mut message: ::fidl_next::Message<___T>,
2702 responder: ::fidl_next::protocol::Responder<___T>,
2703 ) -> ::core::result::Result<
2704 (),
2705 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2706 > {
2707 match *message.header().ordinal {
2708 3132544944554375052 => {
2709 let responder = ::fidl_next::Responder::from_untyped(responder);
2710
2711 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2712 Ok(decoded) => {
2713 handler
2714 .on_message(::fidl_next::Request::from_decoded(decoded), responder)
2715 .await;
2716 Ok(())
2717 }
2718 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2719 ordinal: 3132544944554375052,
2720 error,
2721 }),
2722 }
2723 }
2724
2725 6226805799602931743 => {
2726 let responder = ::fidl_next::Responder::from_untyped(responder);
2727
2728 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2729 Ok(decoded) => {
2730 handler
2731 .on_request(::fidl_next::Request::from_decoded(decoded), responder)
2732 .await;
2733 Ok(())
2734 }
2735 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2736 ordinal: 6226805799602931743,
2737 error,
2738 }),
2739 }
2740 }
2741
2742 ordinal => {
2743 handler.on_unknown_interaction(ordinal).await;
2744 if ::core::matches!(
2745 message.header().flexibility(),
2746 ::fidl_next::protocol::Flexibility::Strict
2747 ) {
2748 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2749 } else {
2750 responder
2751 .respond_framework_error(
2752 ordinal,
2753 ::fidl_next::FrameworkError::UnknownMethod,
2754 )
2755 .expect("encoding a framework error should never fail")
2756 .await?;
2757 Ok(())
2758 }
2759 }
2760 }
2761 }
2762}
2763
2764impl<___T> ListenerClientHandler<___T> for ::fidl_next::IgnoreEvents
2765where
2766 ___T: ::fidl_next::Transport,
2767{
2768 async fn on_unknown_interaction(&mut self, _: u64) {}
2769}
2770
2771impl<___H, ___T> ListenerLocalClientHandler<___T> for ::fidl_next::Local<___H>
2772where
2773 ___H: ListenerClientHandler<___T>,
2774 ___T: ::fidl_next::Transport,
2775{
2776 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2777 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2778 }
2779}
2780
2781impl<___H, ___T> ListenerLocalServerHandler<___T> for ::fidl_next::Local<___H>
2782where
2783 ___H: ListenerServerHandler<___T>,
2784 ___T: ::fidl_next::Transport,
2785{
2786 async fn on_message(
2787 &mut self,
2788
2789 request: ::fidl_next::Request<listener::OnMessage, ___T>,
2790
2791 responder: ::fidl_next::Responder<listener::OnMessage, ___T>,
2792 ) {
2793 ___H::on_message(&mut self.0, request, responder).await
2794 }
2795
2796 async fn on_request(
2797 &mut self,
2798
2799 request: ::fidl_next::Request<listener::OnRequest, ___T>,
2800
2801 responder: ::fidl_next::Responder<listener::OnRequest, ___T>,
2802 ) {
2803 ___H::on_request(&mut self.0, request, responder).await
2804 }
2805
2806 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2807 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2808 }
2809}