1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " A point in 2D space.\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(C)]
10 pub struct Point {
11 pub x: i64,
12
13 pub y: i64,
14 }
15
16 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Point, ___E> for Point
17 where
18 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19 {
20 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::Point> = unsafe {
21 ::fidl_next::CopyOptimization::enable_if(
22 true
23
24 && <
25 i64 as ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>
26 >::COPY_OPTIMIZATION.is_enabled()
27
28 && <
29 i64 as ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>
30 >::COPY_OPTIMIZATION.is_enabled()
31
32 )
33 };
34
35 #[inline]
36 fn encode(
37 self,
38 encoder_: &mut ___E,
39 out_: &mut ::core::mem::MaybeUninit<crate::wire::Point>,
40 _: (),
41 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
42 ::fidl_next::munge! {
43 let crate::wire::Point {
44 x,
45 y,
46
47 } = out_;
48 }
49
50 ::fidl_next::Encode::encode(self.x, encoder_, x, ())?;
51
52 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(x.as_mut_ptr()) };
53
54 ::fidl_next::Encode::encode(self.y, encoder_, y, ())?;
55
56 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(y.as_mut_ptr()) };
57
58 Ok(())
59 }
60 }
61
62 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Point, ___E> for &'a Point
63 where
64 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
65 {
66 #[inline]
67 fn encode(
68 self,
69 encoder_: &mut ___E,
70 out_: &mut ::core::mem::MaybeUninit<crate::wire::Point>,
71 _: (),
72 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
73 ::fidl_next::munge! {
74 let crate::wire::Point {
75 x,
76 y,
77
78 } = out_;
79 }
80
81 ::fidl_next::Encode::encode(&self.x, encoder_, x, ())?;
82
83 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(x.as_mut_ptr()) };
84
85 ::fidl_next::Encode::encode(&self.y, encoder_, y, ())?;
86
87 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(y.as_mut_ptr()) };
88
89 Ok(())
90 }
91 }
92
93 unsafe impl<___E>
94 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Point>, ___E>
95 for Point
96 where
97 ___E: ::fidl_next::Encoder + ?Sized,
98 Point: ::fidl_next::Encode<crate::wire::Point, ___E>,
99 {
100 #[inline]
101 fn encode_option(
102 this: ::core::option::Option<Self>,
103 encoder: &mut ___E,
104 out: &mut ::core::mem::MaybeUninit<::fidl_next::wire::Box<'static, crate::wire::Point>>,
105 _: (),
106 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
107 if let Some(inner) = this {
108 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
109 ::fidl_next::wire::Box::encode_present(out);
110 } else {
111 ::fidl_next::wire::Box::encode_absent(out);
112 }
113
114 Ok(())
115 }
116 }
117
118 unsafe impl<'a, ___E>
119 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Point>, ___E>
120 for &'a Point
121 where
122 ___E: ::fidl_next::Encoder + ?Sized,
123 &'a Point: ::fidl_next::Encode<crate::wire::Point, ___E>,
124 {
125 #[inline]
126 fn encode_option(
127 this: ::core::option::Option<Self>,
128 encoder: &mut ___E,
129 out: &mut ::core::mem::MaybeUninit<::fidl_next::wire::Box<'static, crate::wire::Point>>,
130 _: (),
131 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
132 if let Some(inner) = this {
133 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
134 ::fidl_next::wire::Box::encode_present(out);
135 } else {
136 ::fidl_next::wire::Box::encode_absent(out);
137 }
138
139 Ok(())
140 }
141 }
142
143 impl ::fidl_next::FromWire<crate::wire::Point> for Point {
144 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::Point, Self> = unsafe {
145 ::fidl_next::CopyOptimization::enable_if(
146 true && <i64 as ::fidl_next::FromWire<::fidl_next::wire::Int64>>::COPY_OPTIMIZATION
147 .is_enabled()
148 && <i64 as ::fidl_next::FromWire<::fidl_next::wire::Int64>>::COPY_OPTIMIZATION
149 .is_enabled(),
150 )
151 };
152
153 #[inline]
154 fn from_wire(wire: crate::wire::Point) -> Self {
155 Self {
156 x: ::fidl_next::FromWire::from_wire(wire.x),
157
158 y: ::fidl_next::FromWire::from_wire(wire.y),
159 }
160 }
161 }
162
163 impl ::fidl_next::FromWireRef<crate::wire::Point> for Point {
164 #[inline]
165 fn from_wire_ref(wire: &crate::wire::Point) -> Self {
166 Self {
167 x: ::fidl_next::FromWireRef::from_wire_ref(&wire.x),
168
169 y: ::fidl_next::FromWireRef::from_wire_ref(&wire.y),
170 }
171 }
172 }
173
174 #[doc = " A bounding box in 2D space. This is the result of \"drawing\" operations on our canvas, and what\n the server reports back to the client. These bounds are sufficient to contain all of the\n lines (inclusive) on a canvas at a given time.\n"]
175 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
176 #[repr(C)]
177 pub struct BoundingBox {
178 pub top_left: crate::natural::Point,
179
180 pub bottom_right: crate::natural::Point,
181 }
182
183 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BoundingBox, ___E> for BoundingBox
184 where
185 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
186 {
187 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::BoundingBox> = unsafe {
188 ::fidl_next::CopyOptimization::enable_if(
189 true
190
191 && <
192 crate::natural::Point as ::fidl_next::Encode<crate::wire::Point, ___E>
193 >::COPY_OPTIMIZATION.is_enabled()
194
195 && <
196 crate::natural::Point as ::fidl_next::Encode<crate::wire::Point, ___E>
197 >::COPY_OPTIMIZATION.is_enabled()
198
199 )
200 };
201
202 #[inline]
203 fn encode(
204 self,
205 encoder_: &mut ___E,
206 out_: &mut ::core::mem::MaybeUninit<crate::wire::BoundingBox>,
207 _: (),
208 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
209 ::fidl_next::munge! {
210 let crate::wire::BoundingBox {
211 top_left,
212 bottom_right,
213
214 } = out_;
215 }
216
217 ::fidl_next::Encode::encode(self.top_left, encoder_, top_left, ())?;
218
219 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(top_left.as_mut_ptr()) };
220
221 ::fidl_next::Encode::encode(self.bottom_right, encoder_, bottom_right, ())?;
222
223 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bottom_right.as_mut_ptr()) };
224
225 Ok(())
226 }
227 }
228
229 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BoundingBox, ___E> for &'a BoundingBox
230 where
231 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
232 {
233 #[inline]
234 fn encode(
235 self,
236 encoder_: &mut ___E,
237 out_: &mut ::core::mem::MaybeUninit<crate::wire::BoundingBox>,
238 _: (),
239 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
240 ::fidl_next::munge! {
241 let crate::wire::BoundingBox {
242 top_left,
243 bottom_right,
244
245 } = out_;
246 }
247
248 ::fidl_next::Encode::encode(&self.top_left, encoder_, top_left, ())?;
249
250 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(top_left.as_mut_ptr()) };
251
252 ::fidl_next::Encode::encode(&self.bottom_right, encoder_, bottom_right, ())?;
253
254 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bottom_right.as_mut_ptr()) };
255
256 Ok(())
257 }
258 }
259
260 unsafe impl<___E>
261 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::BoundingBox>, ___E>
262 for BoundingBox
263 where
264 ___E: ::fidl_next::Encoder + ?Sized,
265 BoundingBox: ::fidl_next::Encode<crate::wire::BoundingBox, ___E>,
266 {
267 #[inline]
268 fn encode_option(
269 this: ::core::option::Option<Self>,
270 encoder: &mut ___E,
271 out: &mut ::core::mem::MaybeUninit<
272 ::fidl_next::wire::Box<'static, crate::wire::BoundingBox>,
273 >,
274 _: (),
275 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
276 if let Some(inner) = this {
277 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
278 ::fidl_next::wire::Box::encode_present(out);
279 } else {
280 ::fidl_next::wire::Box::encode_absent(out);
281 }
282
283 Ok(())
284 }
285 }
286
287 unsafe impl<'a, ___E>
288 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::BoundingBox>, ___E>
289 for &'a BoundingBox
290 where
291 ___E: ::fidl_next::Encoder + ?Sized,
292 &'a BoundingBox: ::fidl_next::Encode<crate::wire::BoundingBox, ___E>,
293 {
294 #[inline]
295 fn encode_option(
296 this: ::core::option::Option<Self>,
297 encoder: &mut ___E,
298 out: &mut ::core::mem::MaybeUninit<
299 ::fidl_next::wire::Box<'static, crate::wire::BoundingBox>,
300 >,
301 _: (),
302 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
303 if let Some(inner) = this {
304 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
305 ::fidl_next::wire::Box::encode_present(out);
306 } else {
307 ::fidl_next::wire::Box::encode_absent(out);
308 }
309
310 Ok(())
311 }
312 }
313
314 impl ::fidl_next::FromWire<crate::wire::BoundingBox> for BoundingBox {
315 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::BoundingBox, Self> = unsafe {
316 ::fidl_next::CopyOptimization::enable_if(
317 true
318
319 && <
320 crate::natural::Point as ::fidl_next::FromWire<crate::wire::Point>
321 >::COPY_OPTIMIZATION.is_enabled()
322
323 && <
324 crate::natural::Point as ::fidl_next::FromWire<crate::wire::Point>
325 >::COPY_OPTIMIZATION.is_enabled()
326
327 )
328 };
329
330 #[inline]
331 fn from_wire(wire: crate::wire::BoundingBox) -> Self {
332 Self {
333 top_left: ::fidl_next::FromWire::from_wire(wire.top_left),
334
335 bottom_right: ::fidl_next::FromWire::from_wire(wire.bottom_right),
336 }
337 }
338 }
339
340 impl ::fidl_next::FromWireRef<crate::wire::BoundingBox> for BoundingBox {
341 #[inline]
342 fn from_wire_ref(wire: &crate::wire::BoundingBox) -> Self {
343 Self {
344 top_left: ::fidl_next::FromWireRef::from_wire_ref(&wire.top_left),
345
346 bottom_right: ::fidl_next::FromWireRef::from_wire_ref(&wire.bottom_right),
347 }
348 }
349 }
350
351 #[doc = " A line in 2D space.\n"]
352 pub type Line = [crate::natural::Point; 2];
353
354 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
355 #[repr(C)]
356 pub struct InstanceAddLineRequest {
357 pub line: [crate::natural::Point; 2],
358 }
359
360 unsafe impl<___E> ::fidl_next::Encode<crate::wire::InstanceAddLineRequest, ___E>
361 for InstanceAddLineRequest
362 where
363 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
364 {
365 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
366 Self,
367 crate::wire::InstanceAddLineRequest,
368 > = unsafe {
369 ::fidl_next::CopyOptimization::enable_if(
370 true && <[crate::natural::Point; 2] as ::fidl_next::Encode<
371 [crate::wire::Point; 2],
372 ___E,
373 >>::COPY_OPTIMIZATION
374 .is_enabled(),
375 )
376 };
377
378 #[inline]
379 fn encode(
380 self,
381 encoder_: &mut ___E,
382 out_: &mut ::core::mem::MaybeUninit<crate::wire::InstanceAddLineRequest>,
383 _: (),
384 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
385 ::fidl_next::munge! {
386 let crate::wire::InstanceAddLineRequest {
387 line,
388
389 } = out_;
390 }
391
392 ::fidl_next::Encode::encode(self.line, encoder_, line, ())?;
393
394 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(line.as_mut_ptr()) };
395
396 Ok(())
397 }
398 }
399
400 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::InstanceAddLineRequest, ___E>
401 for &'a InstanceAddLineRequest
402 where
403 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
404 {
405 #[inline]
406 fn encode(
407 self,
408 encoder_: &mut ___E,
409 out_: &mut ::core::mem::MaybeUninit<crate::wire::InstanceAddLineRequest>,
410 _: (),
411 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
412 ::fidl_next::munge! {
413 let crate::wire::InstanceAddLineRequest {
414 line,
415
416 } = out_;
417 }
418
419 ::fidl_next::Encode::encode(&self.line, encoder_, line, ())?;
420
421 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(line.as_mut_ptr()) };
422
423 Ok(())
424 }
425 }
426
427 unsafe impl<___E>
428 ::fidl_next::EncodeOption<
429 ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLineRequest>,
430 ___E,
431 > for InstanceAddLineRequest
432 where
433 ___E: ::fidl_next::Encoder + ?Sized,
434 InstanceAddLineRequest: ::fidl_next::Encode<crate::wire::InstanceAddLineRequest, ___E>,
435 {
436 #[inline]
437 fn encode_option(
438 this: ::core::option::Option<Self>,
439 encoder: &mut ___E,
440 out: &mut ::core::mem::MaybeUninit<
441 ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLineRequest>,
442 >,
443 _: (),
444 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
445 if let Some(inner) = this {
446 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
447 ::fidl_next::wire::Box::encode_present(out);
448 } else {
449 ::fidl_next::wire::Box::encode_absent(out);
450 }
451
452 Ok(())
453 }
454 }
455
456 unsafe impl<'a, ___E>
457 ::fidl_next::EncodeOption<
458 ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLineRequest>,
459 ___E,
460 > for &'a InstanceAddLineRequest
461 where
462 ___E: ::fidl_next::Encoder + ?Sized,
463 &'a InstanceAddLineRequest: ::fidl_next::Encode<crate::wire::InstanceAddLineRequest, ___E>,
464 {
465 #[inline]
466 fn encode_option(
467 this: ::core::option::Option<Self>,
468 encoder: &mut ___E,
469 out: &mut ::core::mem::MaybeUninit<
470 ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLineRequest>,
471 >,
472 _: (),
473 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
474 if let Some(inner) = this {
475 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
476 ::fidl_next::wire::Box::encode_present(out);
477 } else {
478 ::fidl_next::wire::Box::encode_absent(out);
479 }
480
481 Ok(())
482 }
483 }
484
485 impl ::fidl_next::FromWire<crate::wire::InstanceAddLineRequest> for InstanceAddLineRequest {
486 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
487 crate::wire::InstanceAddLineRequest,
488 Self,
489 > = unsafe {
490 ::fidl_next::CopyOptimization::enable_if(
491 true && <[crate::natural::Point; 2] as ::fidl_next::FromWire<
492 [crate::wire::Point; 2],
493 >>::COPY_OPTIMIZATION
494 .is_enabled(),
495 )
496 };
497
498 #[inline]
499 fn from_wire(wire: crate::wire::InstanceAddLineRequest) -> Self {
500 Self { line: ::fidl_next::FromWire::from_wire(wire.line) }
501 }
502 }
503
504 impl ::fidl_next::FromWireRef<crate::wire::InstanceAddLineRequest> for InstanceAddLineRequest {
505 #[inline]
506 fn from_wire_ref(wire: &crate::wire::InstanceAddLineRequest) -> Self {
507 Self { line: ::fidl_next::FromWireRef::from_wire_ref(&wire.line) }
508 }
509 }
510}
511
512pub mod wire {
513
514 #[derive(Clone, Debug)]
516 #[repr(C)]
517 pub struct Point {
518 pub x: ::fidl_next::wire::Int64,
519
520 pub y: ::fidl_next::wire::Int64,
521 }
522
523 static_assertions::const_assert_eq!(std::mem::size_of::<Point>(), 16);
524 static_assertions::const_assert_eq!(std::mem::align_of::<Point>(), 8);
525
526 static_assertions::const_assert_eq!(std::mem::offset_of!(Point, x), 0);
527
528 static_assertions::const_assert_eq!(std::mem::offset_of!(Point, y), 8);
529
530 impl ::fidl_next::Constrained for Point {
531 type Constraint = ();
532
533 fn validate(
534 _: ::fidl_next::Slot<'_, Self>,
535 _: Self::Constraint,
536 ) -> Result<(), ::fidl_next::ValidationError> {
537 Ok(())
538 }
539 }
540
541 unsafe impl ::fidl_next::Wire for Point {
542 type Narrowed<'de> = Point;
543
544 #[inline]
545 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
546 ::fidl_next::munge! {
547 let Self {
548 x,
549 y,
550
551 } = &mut *out_;
552 }
553
554 ::fidl_next::Wire::zero_padding(x);
555
556 ::fidl_next::Wire::zero_padding(y);
557 }
558 }
559
560 unsafe impl<___D> ::fidl_next::Decode<___D> for Point
561 where
562 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
563 {
564 fn decode(
565 slot_: ::fidl_next::Slot<'_, Self>,
566 decoder_: &mut ___D,
567 _: (),
568 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
569 ::fidl_next::munge! {
570 let Self {
571 mut x,
572 mut y,
573
574 } = slot_;
575 }
576
577 let _field = x.as_mut();
578
579 ::fidl_next::Decode::decode(x.as_mut(), decoder_, ())?;
580
581 let _field = y.as_mut();
582
583 ::fidl_next::Decode::decode(y.as_mut(), decoder_, ())?;
584
585 Ok(())
586 }
587 }
588
589 impl ::fidl_next::IntoNatural for Point {
590 type Natural = crate::natural::Point;
591 }
592
593 #[derive(Clone, Debug)]
595 #[repr(C)]
596 pub struct BoundingBox {
597 pub top_left: crate::wire::Point,
598
599 pub bottom_right: crate::wire::Point,
600 }
601
602 static_assertions::const_assert_eq!(std::mem::size_of::<BoundingBox>(), 32);
603 static_assertions::const_assert_eq!(std::mem::align_of::<BoundingBox>(), 8);
604
605 static_assertions::const_assert_eq!(std::mem::offset_of!(BoundingBox, top_left), 0);
606
607 static_assertions::const_assert_eq!(std::mem::offset_of!(BoundingBox, bottom_right), 16);
608
609 impl ::fidl_next::Constrained for BoundingBox {
610 type Constraint = ();
611
612 fn validate(
613 _: ::fidl_next::Slot<'_, Self>,
614 _: Self::Constraint,
615 ) -> Result<(), ::fidl_next::ValidationError> {
616 Ok(())
617 }
618 }
619
620 unsafe impl ::fidl_next::Wire for BoundingBox {
621 type Narrowed<'de> = BoundingBox;
622
623 #[inline]
624 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
625 ::fidl_next::munge! {
626 let Self {
627 top_left,
628 bottom_right,
629
630 } = &mut *out_;
631 }
632
633 ::fidl_next::Wire::zero_padding(top_left);
634
635 ::fidl_next::Wire::zero_padding(bottom_right);
636 }
637 }
638
639 unsafe impl<___D> ::fidl_next::Decode<___D> for BoundingBox
640 where
641 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
642 {
643 fn decode(
644 slot_: ::fidl_next::Slot<'_, Self>,
645 decoder_: &mut ___D,
646 _: (),
647 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
648 ::fidl_next::munge! {
649 let Self {
650 mut top_left,
651 mut bottom_right,
652
653 } = slot_;
654 }
655
656 let _field = top_left.as_mut();
657
658 ::fidl_next::Decode::decode(top_left.as_mut(), decoder_, ())?;
659
660 let _field = bottom_right.as_mut();
661
662 ::fidl_next::Decode::decode(bottom_right.as_mut(), decoder_, ())?;
663
664 Ok(())
665 }
666 }
667
668 impl ::fidl_next::IntoNatural for BoundingBox {
669 type Natural = crate::natural::BoundingBox;
670 }
671
672 pub type Line = [crate::wire::Point; 2];
674
675 #[derive(Clone, Debug)]
677 #[repr(C)]
678 pub struct InstanceAddLineRequest {
679 pub line: [crate::wire::Point; 2],
680 }
681
682 static_assertions::const_assert_eq!(std::mem::size_of::<InstanceAddLineRequest>(), 32);
683 static_assertions::const_assert_eq!(std::mem::align_of::<InstanceAddLineRequest>(), 8);
684
685 static_assertions::const_assert_eq!(std::mem::offset_of!(InstanceAddLineRequest, line), 0);
686
687 impl ::fidl_next::Constrained for InstanceAddLineRequest {
688 type Constraint = ();
689
690 fn validate(
691 _: ::fidl_next::Slot<'_, Self>,
692 _: Self::Constraint,
693 ) -> Result<(), ::fidl_next::ValidationError> {
694 Ok(())
695 }
696 }
697
698 unsafe impl ::fidl_next::Wire for InstanceAddLineRequest {
699 type Narrowed<'de> = InstanceAddLineRequest;
700
701 #[inline]
702 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
703 ::fidl_next::munge! {
704 let Self {
705 line,
706
707 } = &mut *out_;
708 }
709
710 ::fidl_next::Wire::zero_padding(line);
711 }
712 }
713
714 unsafe impl<___D> ::fidl_next::Decode<___D> for InstanceAddLineRequest
715 where
716 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
717 {
718 fn decode(
719 slot_: ::fidl_next::Slot<'_, Self>,
720 decoder_: &mut ___D,
721 _: (),
722 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
723 ::fidl_next::munge! {
724 let Self {
725 mut line,
726
727 } = slot_;
728 }
729
730 let _field = line.as_mut();
731
732 ::fidl_next::Decode::decode(line.as_mut(), decoder_, ())?;
733
734 Ok(())
735 }
736 }
737
738 impl ::fidl_next::IntoNatural for InstanceAddLineRequest {
739 type Natural = crate::natural::InstanceAddLineRequest;
740 }
741}
742
743pub mod wire_optional {}
744
745pub mod generic {
746
747 pub struct Point<T0, T1> {
749 pub x: T0,
750
751 pub y: T1,
752 }
753
754 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Point, ___E> for Point<T0, T1>
755 where
756 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
757 T0: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
758 T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
759 {
760 #[inline]
761 fn encode(
762 self,
763 encoder_: &mut ___E,
764 out_: &mut ::core::mem::MaybeUninit<crate::wire::Point>,
765 _: (),
766 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
767 ::fidl_next::munge! {
768 let crate::wire::Point {
769 x,
770 y,
771
772 } = out_;
773 }
774
775 ::fidl_next::Encode::encode(self.x, encoder_, x, ())?;
776
777 ::fidl_next::Encode::encode(self.y, encoder_, y, ())?;
778
779 Ok(())
780 }
781 }
782
783 unsafe impl<'a, ___E, T0, T1> ::fidl_next::Encode<crate::wire::Point, ___E> for &'a Point<T0, T1>
784 where
785 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
786 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
787 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
788 {
789 #[inline]
790 fn encode(
791 self,
792 encoder_: &mut ___E,
793 out_: &mut ::core::mem::MaybeUninit<crate::wire::Point>,
794 _: (),
795 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
796 ::fidl_next::munge! {
797 let crate::wire::Point {
798 x,
799 y,
800
801 } = out_;
802 }
803
804 ::fidl_next::Encode::encode(&self.x, encoder_, x, ())?;
805
806 ::fidl_next::Encode::encode(&self.y, encoder_, y, ())?;
807
808 Ok(())
809 }
810 }
811
812 pub struct BoundingBox<T0, T1> {
814 pub top_left: T0,
815
816 pub bottom_right: T1,
817 }
818
819 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::BoundingBox, ___E>
820 for BoundingBox<T0, T1>
821 where
822 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
823 T0: ::fidl_next::Encode<crate::wire::Point, ___E>,
824 T1: ::fidl_next::Encode<crate::wire::Point, ___E>,
825 {
826 #[inline]
827 fn encode(
828 self,
829 encoder_: &mut ___E,
830 out_: &mut ::core::mem::MaybeUninit<crate::wire::BoundingBox>,
831 _: (),
832 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
833 ::fidl_next::munge! {
834 let crate::wire::BoundingBox {
835 top_left,
836 bottom_right,
837
838 } = out_;
839 }
840
841 ::fidl_next::Encode::encode(self.top_left, encoder_, top_left, ())?;
842
843 ::fidl_next::Encode::encode(self.bottom_right, encoder_, bottom_right, ())?;
844
845 Ok(())
846 }
847 }
848
849 unsafe impl<'a, ___E, T0, T1> ::fidl_next::Encode<crate::wire::BoundingBox, ___E>
850 for &'a BoundingBox<T0, T1>
851 where
852 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
853 &'a T0: ::fidl_next::Encode<crate::wire::Point, ___E>,
854 &'a T1: ::fidl_next::Encode<crate::wire::Point, ___E>,
855 {
856 #[inline]
857 fn encode(
858 self,
859 encoder_: &mut ___E,
860 out_: &mut ::core::mem::MaybeUninit<crate::wire::BoundingBox>,
861 _: (),
862 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
863 ::fidl_next::munge! {
864 let crate::wire::BoundingBox {
865 top_left,
866 bottom_right,
867
868 } = out_;
869 }
870
871 ::fidl_next::Encode::encode(&self.top_left, encoder_, top_left, ())?;
872
873 ::fidl_next::Encode::encode(&self.bottom_right, encoder_, bottom_right, ())?;
874
875 Ok(())
876 }
877 }
878
879 pub struct InstanceAddLineRequest<T0> {
881 pub line: T0,
882 }
883
884 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::InstanceAddLineRequest, ___E>
885 for InstanceAddLineRequest<T0>
886 where
887 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
888 T0: ::fidl_next::Encode<[crate::wire::Point; 2], ___E>,
889 {
890 #[inline]
891 fn encode(
892 self,
893 encoder_: &mut ___E,
894 out_: &mut ::core::mem::MaybeUninit<crate::wire::InstanceAddLineRequest>,
895 _: (),
896 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
897 ::fidl_next::munge! {
898 let crate::wire::InstanceAddLineRequest {
899 line,
900
901 } = out_;
902 }
903
904 ::fidl_next::Encode::encode(self.line, encoder_, line, ())?;
905
906 Ok(())
907 }
908 }
909
910 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::InstanceAddLineRequest, ___E>
911 for &'a InstanceAddLineRequest<T0>
912 where
913 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
914 &'a T0: ::fidl_next::Encode<[crate::wire::Point; 2], ___E>,
915 {
916 #[inline]
917 fn encode(
918 self,
919 encoder_: &mut ___E,
920 out_: &mut ::core::mem::MaybeUninit<crate::wire::InstanceAddLineRequest>,
921 _: (),
922 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
923 ::fidl_next::munge! {
924 let crate::wire::InstanceAddLineRequest {
925 line,
926
927 } = out_;
928 }
929
930 ::fidl_next::Encode::encode(&self.line, encoder_, line, ())?;
931
932 Ok(())
933 }
934 }
935}
936
937pub use self::natural::*;
938
939#[doc = " Manages a single instance of a canvas. Each session of this protocol is responsible for a new\n canvas.\n"]
941#[derive(PartialEq, Debug)]
942pub struct Instance;
943
944impl ::fidl_next::Discoverable for Instance {
945 const PROTOCOL_NAME: &'static str = "examples.canvas.baseline.Instance";
946}
947
948#[cfg(target_os = "fuchsia")]
949impl ::fidl_next::HasTransport for Instance {
950 type Transport = ::fidl_next::fuchsia::zx::Channel;
951}
952
953pub mod instance {
954 pub mod prelude {
955 pub use crate::{
956 Instance, InstanceClientHandler, InstanceLocalClientHandler,
957 InstanceLocalServerHandler, InstanceServerHandler, instance,
958 };
959
960 pub use crate::natural::BoundingBox;
961
962 pub use crate::natural::InstanceAddLineRequest;
963 }
964
965 pub struct AddLine;
966
967 impl ::fidl_next::Method for AddLine {
968 const ORDINAL: u64 = 285336022744255136;
969 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
970 ::fidl_next::protocol::Flexibility::Flexible;
971
972 type Protocol = crate::Instance;
973
974 type Request = crate::wire::InstanceAddLineRequest;
975 }
976
977 pub struct OnDrawn;
978
979 impl ::fidl_next::Method for OnDrawn {
980 const ORDINAL: u64 = 3380696926713300365;
981 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
982 ::fidl_next::protocol::Flexibility::Flexible;
983
984 type Protocol = crate::Instance;
985
986 type Request = crate::wire::BoundingBox;
987 }
988
989 mod ___detail {
990 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Instance
991 where
992 ___T: ::fidl_next::Transport,
993 {
994 type Client = InstanceClient<___T>;
995 type Server = InstanceServer<___T>;
996 }
997
998 #[repr(transparent)]
1000 pub struct InstanceClient<___T: ::fidl_next::Transport> {
1001 #[allow(dead_code)]
1002 client: ::fidl_next::protocol::Client<___T>,
1003 }
1004
1005 impl<___T> InstanceClient<___T>
1006 where
1007 ___T: ::fidl_next::Transport,
1008 {
1009 #[doc = " Add a line to the canvas.\n"]
1010 pub fn add_line(
1011 &self,
1012
1013 line: impl ::fidl_next::Encode<
1014 [crate::wire::Point; 2],
1015 <___T as ::fidl_next::Transport>::SendBuffer,
1016 >,
1017 ) -> ::fidl_next::SendFuture<'_, ___T>
1018 where
1019 <___T as ::fidl_next::Transport>::SendBuffer:
1020 ::fidl_next::encoder::InternalHandleEncoder,
1021 {
1022 self.add_line_with(crate::generic::InstanceAddLineRequest { line })
1023 }
1024
1025 #[doc = " Add a line to the canvas.\n"]
1026 pub fn add_line_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1027 where
1028 ___R: ::fidl_next::Encode<
1029 crate::wire::InstanceAddLineRequest,
1030 <___T as ::fidl_next::Transport>::SendBuffer,
1031 >,
1032 {
1033 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
1034 285336022744255136,
1035 <super::AddLine as ::fidl_next::Method>::FLEXIBILITY,
1036 request,
1037 ))
1038 }
1039 }
1040
1041 #[repr(transparent)]
1043 pub struct InstanceServer<___T: ::fidl_next::Transport> {
1044 server: ::fidl_next::protocol::Server<___T>,
1045 }
1046
1047 impl<___T> InstanceServer<___T>
1048 where
1049 ___T: ::fidl_next::Transport,
1050 {
1051 #[doc = " Update the client with the latest drawing state. The server makes no guarantees about how\n often this event occurs - it could occur multiple times per board state, for example.\n"]
1052 pub fn on_drawn(
1053 &self,
1054
1055 top_left: impl ::fidl_next::Encode<
1056 crate::wire::Point,
1057 <___T as ::fidl_next::Transport>::SendBuffer,
1058 >,
1059
1060 bottom_right: impl ::fidl_next::Encode<
1061 crate::wire::Point,
1062 <___T as ::fidl_next::Transport>::SendBuffer,
1063 >,
1064 ) -> ::fidl_next::SendFuture<'_, ___T>
1065 where
1066 <___T as ::fidl_next::Transport>::SendBuffer:
1067 ::fidl_next::encoder::InternalHandleEncoder,
1068 {
1069 self.on_drawn_with(crate::generic::BoundingBox { top_left, bottom_right })
1070 }
1071
1072 #[doc = " Update the client with the latest drawing state. The server makes no guarantees about how\n often this event occurs - it could occur multiple times per board state, for example.\n"]
1073
1074 pub fn on_drawn_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1075 where
1076 ___R: ::fidl_next::Encode<
1077 <super::OnDrawn as ::fidl_next::Method>::Request,
1078 <___T as ::fidl_next::Transport>::SendBuffer,
1079 >,
1080 {
1081 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
1082 3380696926713300365,
1083 <super::OnDrawn as ::fidl_next::Method>::FLEXIBILITY,
1084 request,
1085 ))
1086 }
1087 }
1088 }
1089}
1090
1091#[diagnostic::on_unimplemented(
1092 note = "If {Self} implements the non-local InstanceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1093)]
1094
1095pub trait InstanceLocalClientHandler<
1099 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1100 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1101>
1102{
1103 #[doc = " Update the client with the latest drawing state. The server makes no guarantees about how\n often this event occurs - it could occur multiple times per board state, for example.\n"]
1104 fn on_drawn(
1105 &mut self,
1106
1107 request: ::fidl_next::Request<instance::OnDrawn, ___T>,
1108 ) -> impl ::core::future::Future<Output = ()>;
1109
1110 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1111 ::core::future::ready(())
1112 }
1113}
1114
1115impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Instance
1116where
1117 ___H: InstanceLocalClientHandler<___T>,
1118 ___T: ::fidl_next::Transport,
1119 for<'de> crate::wire::BoundingBox: ::fidl_next::Decode<
1120 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1121 Constraint = (),
1122 >,
1123{
1124 async fn on_event(
1125 handler: &mut ___H,
1126 mut message: ::fidl_next::Message<___T>,
1127 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1128 match *message.header().ordinal {
1129 3380696926713300365 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1130 Ok(decoded) => {
1131 handler.on_drawn(::fidl_next::Request::from_decoded(decoded)).await;
1132 Ok(())
1133 }
1134 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1135 ordinal: 3380696926713300365,
1136 error,
1137 }),
1138 },
1139
1140 ordinal => {
1141 handler.on_unknown_interaction(ordinal).await;
1142 if ::core::matches!(
1143 message.header().flexibility(),
1144 ::fidl_next::protocol::Flexibility::Strict
1145 ) {
1146 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1147 } else {
1148 Ok(())
1149 }
1150 }
1151 }
1152 }
1153}
1154
1155#[diagnostic::on_unimplemented(
1156 note = "If {Self} implements the non-local InstanceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1157)]
1158
1159pub trait InstanceLocalServerHandler<
1163 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1164 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1165>
1166{
1167 #[doc = " Add a line to the canvas.\n"]
1168 fn add_line(
1169 &mut self,
1170
1171 request: ::fidl_next::Request<instance::AddLine, ___T>,
1172 ) -> impl ::core::future::Future<Output = ()>;
1173
1174 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1175 ::core::future::ready(())
1176 }
1177}
1178
1179impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Instance
1180where
1181 ___H: InstanceLocalServerHandler<___T>,
1182 ___T: ::fidl_next::Transport,
1183 for<'de> crate::wire::InstanceAddLineRequest: ::fidl_next::Decode<
1184 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1185 Constraint = (),
1186 >,
1187{
1188 async fn on_one_way(
1189 handler: &mut ___H,
1190 mut message: ::fidl_next::Message<___T>,
1191 ) -> ::core::result::Result<
1192 (),
1193 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1194 > {
1195 match *message.header().ordinal {
1196 285336022744255136 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1197 Ok(decoded) => {
1198 handler.add_line(::fidl_next::Request::from_decoded(decoded)).await;
1199 Ok(())
1200 }
1201 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1202 ordinal: 285336022744255136,
1203 error,
1204 }),
1205 },
1206
1207 ordinal => {
1208 handler.on_unknown_interaction(ordinal).await;
1209 if ::core::matches!(
1210 message.header().flexibility(),
1211 ::fidl_next::protocol::Flexibility::Strict
1212 ) {
1213 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1214 } else {
1215 Ok(())
1216 }
1217 }
1218 }
1219 }
1220
1221 async fn on_two_way(
1222 handler: &mut ___H,
1223 mut message: ::fidl_next::Message<___T>,
1224 responder: ::fidl_next::protocol::Responder<___T>,
1225 ) -> ::core::result::Result<
1226 (),
1227 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1228 > {
1229 match *message.header().ordinal {
1230 ordinal => {
1231 handler.on_unknown_interaction(ordinal).await;
1232 if ::core::matches!(
1233 message.header().flexibility(),
1234 ::fidl_next::protocol::Flexibility::Strict
1235 ) {
1236 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1237 } else {
1238 responder
1239 .respond_framework_error(
1240 ordinal,
1241 ::fidl_next::FrameworkError::UnknownMethod,
1242 )
1243 .expect("encoding a framework error should never fail")
1244 .await?;
1245 Ok(())
1246 }
1247 }
1248 }
1249 }
1250}
1251
1252pub trait InstanceClientHandler<
1256 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1257 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1258>
1259{
1260 #[doc = " Update the client with the latest drawing state. The server makes no guarantees about how\n often this event occurs - it could occur multiple times per board state, for example.\n"]
1261 fn on_drawn(
1262 &mut self,
1263
1264 request: ::fidl_next::Request<instance::OnDrawn, ___T>,
1265 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1266
1267 fn on_unknown_interaction(
1268 &mut self,
1269 ordinal: u64,
1270 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1271 ::core::future::ready(())
1272 }
1273}
1274
1275impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Instance
1276where
1277 ___H: InstanceClientHandler<___T> + ::core::marker::Send,
1278 ___T: ::fidl_next::Transport,
1279 for<'de> crate::wire::BoundingBox: ::fidl_next::Decode<
1280 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1281 Constraint = (),
1282 >,
1283{
1284 async fn on_event(
1285 handler: &mut ___H,
1286 mut message: ::fidl_next::Message<___T>,
1287 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1288 match *message.header().ordinal {
1289 3380696926713300365 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1290 Ok(decoded) => {
1291 handler.on_drawn(::fidl_next::Request::from_decoded(decoded)).await;
1292 Ok(())
1293 }
1294 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1295 ordinal: 3380696926713300365,
1296 error,
1297 }),
1298 },
1299
1300 ordinal => {
1301 handler.on_unknown_interaction(ordinal).await;
1302 if ::core::matches!(
1303 message.header().flexibility(),
1304 ::fidl_next::protocol::Flexibility::Strict
1305 ) {
1306 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1307 } else {
1308 Ok(())
1309 }
1310 }
1311 }
1312 }
1313}
1314
1315pub trait InstanceServerHandler<
1319 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1320 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1321>
1322{
1323 #[doc = " Add a line to the canvas.\n"]
1324 fn add_line(
1325 &mut self,
1326
1327 request: ::fidl_next::Request<instance::AddLine, ___T>,
1328 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1329
1330 fn on_unknown_interaction(
1331 &mut self,
1332 ordinal: u64,
1333 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1334 ::core::future::ready(())
1335 }
1336}
1337
1338impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Instance
1339where
1340 ___H: InstanceServerHandler<___T> + ::core::marker::Send,
1341 ___T: ::fidl_next::Transport,
1342 for<'de> crate::wire::InstanceAddLineRequest: ::fidl_next::Decode<
1343 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1344 Constraint = (),
1345 >,
1346{
1347 async fn on_one_way(
1348 handler: &mut ___H,
1349 mut message: ::fidl_next::Message<___T>,
1350 ) -> ::core::result::Result<
1351 (),
1352 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1353 > {
1354 match *message.header().ordinal {
1355 285336022744255136 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1356 Ok(decoded) => {
1357 handler.add_line(::fidl_next::Request::from_decoded(decoded)).await;
1358 Ok(())
1359 }
1360 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1361 ordinal: 285336022744255136,
1362 error,
1363 }),
1364 },
1365
1366 ordinal => {
1367 handler.on_unknown_interaction(ordinal).await;
1368 if ::core::matches!(
1369 message.header().flexibility(),
1370 ::fidl_next::protocol::Flexibility::Strict
1371 ) {
1372 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1373 } else {
1374 Ok(())
1375 }
1376 }
1377 }
1378 }
1379
1380 async fn on_two_way(
1381 handler: &mut ___H,
1382 mut message: ::fidl_next::Message<___T>,
1383 responder: ::fidl_next::protocol::Responder<___T>,
1384 ) -> ::core::result::Result<
1385 (),
1386 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1387 > {
1388 match *message.header().ordinal {
1389 ordinal => {
1390 handler.on_unknown_interaction(ordinal).await;
1391 if ::core::matches!(
1392 message.header().flexibility(),
1393 ::fidl_next::protocol::Flexibility::Strict
1394 ) {
1395 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1396 } else {
1397 responder
1398 .respond_framework_error(
1399 ordinal,
1400 ::fidl_next::FrameworkError::UnknownMethod,
1401 )
1402 .expect("encoding a framework error should never fail")
1403 .await?;
1404 Ok(())
1405 }
1406 }
1407 }
1408 }
1409}
1410
1411impl<___T> InstanceClientHandler<___T> for ::fidl_next::IgnoreEvents
1412where
1413 ___T: ::fidl_next::Transport,
1414{
1415 async fn on_drawn(&mut self, _: ::fidl_next::Request<instance::OnDrawn, ___T>) {}
1416
1417 async fn on_unknown_interaction(&mut self, _: u64) {}
1418}
1419
1420impl<___H, ___T> InstanceLocalClientHandler<___T> for ::fidl_next::Local<___H>
1421where
1422 ___H: InstanceClientHandler<___T>,
1423 ___T: ::fidl_next::Transport,
1424{
1425 async fn on_drawn(&mut self, request: ::fidl_next::Request<instance::OnDrawn, ___T>) {
1426 ___H::on_drawn(&mut self.0, request).await
1427 }
1428
1429 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1430 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1431 }
1432}
1433
1434impl<___H, ___T> InstanceLocalServerHandler<___T> for ::fidl_next::Local<___H>
1435where
1436 ___H: InstanceServerHandler<___T>,
1437 ___T: ::fidl_next::Transport,
1438{
1439 async fn add_line(&mut self, request: ::fidl_next::Request<instance::AddLine, ___T>) {
1440 ___H::add_line(&mut self.0, request).await
1441 }
1442
1443 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1444 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1445 }
1446}