Skip to main content

fidl_next_common_examples_canvas_clientrequesteddraw/
fidl_next_common_examples_canvas_clientrequesteddraw.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![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, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
355    pub struct InstanceAddLinesRequest {
356        pub lines: ::std::vec::Vec<[crate::natural::Point; 2]>,
357    }
358
359    unsafe impl<___E> ::fidl_next::Encode<crate::wire::InstanceAddLinesRequest<'static>, ___E>
360        for InstanceAddLinesRequest
361    where
362        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
363        ___E: ::fidl_next::Encoder,
364    {
365        #[inline]
366        fn encode(
367            self,
368            encoder_: &mut ___E,
369            out_: &mut ::core::mem::MaybeUninit<crate::wire::InstanceAddLinesRequest<'static>>,
370            _: (),
371        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
372            ::fidl_next::munge! {
373                let crate::wire::InstanceAddLinesRequest {
374                    lines,
375
376                } = out_;
377            }
378
379            ::fidl_next::Encode::encode(self.lines, encoder_, lines, (4294967295, ()))?;
380
381            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(lines.as_mut_ptr()) };
382            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
383
384            Ok(())
385        }
386    }
387
388    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::InstanceAddLinesRequest<'static>, ___E>
389        for &'a InstanceAddLinesRequest
390    where
391        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
392        ___E: ::fidl_next::Encoder,
393    {
394        #[inline]
395        fn encode(
396            self,
397            encoder_: &mut ___E,
398            out_: &mut ::core::mem::MaybeUninit<crate::wire::InstanceAddLinesRequest<'static>>,
399            _: (),
400        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
401            ::fidl_next::munge! {
402                let crate::wire::InstanceAddLinesRequest {
403                    lines,
404
405                } = out_;
406            }
407
408            ::fidl_next::Encode::encode(&self.lines, encoder_, lines, (4294967295, ()))?;
409
410            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(lines.as_mut_ptr()) };
411            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
412
413            Ok(())
414        }
415    }
416
417    unsafe impl<___E>
418        ::fidl_next::EncodeOption<
419            ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLinesRequest<'static>>,
420            ___E,
421        > for InstanceAddLinesRequest
422    where
423        ___E: ::fidl_next::Encoder + ?Sized,
424        InstanceAddLinesRequest:
425            ::fidl_next::Encode<crate::wire::InstanceAddLinesRequest<'static>, ___E>,
426    {
427        #[inline]
428        fn encode_option(
429            this: ::core::option::Option<Self>,
430            encoder: &mut ___E,
431            out: &mut ::core::mem::MaybeUninit<
432                ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLinesRequest<'static>>,
433            >,
434            _: (),
435        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
436            if let Some(inner) = this {
437                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
438                ::fidl_next::wire::Box::encode_present(out);
439            } else {
440                ::fidl_next::wire::Box::encode_absent(out);
441            }
442
443            Ok(())
444        }
445    }
446
447    unsafe impl<'a, ___E>
448        ::fidl_next::EncodeOption<
449            ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLinesRequest<'static>>,
450            ___E,
451        > for &'a InstanceAddLinesRequest
452    where
453        ___E: ::fidl_next::Encoder + ?Sized,
454        &'a InstanceAddLinesRequest:
455            ::fidl_next::Encode<crate::wire::InstanceAddLinesRequest<'static>, ___E>,
456    {
457        #[inline]
458        fn encode_option(
459            this: ::core::option::Option<Self>,
460            encoder: &mut ___E,
461            out: &mut ::core::mem::MaybeUninit<
462                ::fidl_next::wire::Box<'static, crate::wire::InstanceAddLinesRequest<'static>>,
463            >,
464            _: (),
465        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
466            if let Some(inner) = this {
467                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
468                ::fidl_next::wire::Box::encode_present(out);
469            } else {
470                ::fidl_next::wire::Box::encode_absent(out);
471            }
472
473            Ok(())
474        }
475    }
476
477    impl<'de> ::fidl_next::FromWire<crate::wire::InstanceAddLinesRequest<'de>>
478        for InstanceAddLinesRequest
479    {
480        #[inline]
481        fn from_wire(wire: crate::wire::InstanceAddLinesRequest<'de>) -> Self {
482            Self { lines: ::fidl_next::FromWire::from_wire(wire.lines) }
483        }
484    }
485
486    impl<'de> ::fidl_next::FromWireRef<crate::wire::InstanceAddLinesRequest<'de>>
487        for InstanceAddLinesRequest
488    {
489        #[inline]
490        fn from_wire_ref(wire: &crate::wire::InstanceAddLinesRequest<'de>) -> Self {
491            Self { lines: ::fidl_next::FromWireRef::from_wire_ref(&wire.lines) }
492        }
493    }
494
495    pub type InstanceReadyResponse = ();
496}
497
498pub mod wire {
499
500    /// The wire type corresponding to [`Point`].
501    #[derive(Clone, Debug)]
502    #[repr(C)]
503    pub struct Point {
504        pub x: ::fidl_next::wire::Int64,
505
506        pub y: ::fidl_next::wire::Int64,
507    }
508
509    static_assertions::const_assert_eq!(std::mem::size_of::<Point>(), 16);
510    static_assertions::const_assert_eq!(std::mem::align_of::<Point>(), 8);
511
512    static_assertions::const_assert_eq!(std::mem::offset_of!(Point, x), 0);
513
514    static_assertions::const_assert_eq!(std::mem::offset_of!(Point, y), 8);
515
516    impl ::fidl_next::Constrained for Point {
517        type Constraint = ();
518
519        fn validate(
520            _: ::fidl_next::Slot<'_, Self>,
521            _: Self::Constraint,
522        ) -> Result<(), ::fidl_next::ValidationError> {
523            Ok(())
524        }
525    }
526
527    unsafe impl ::fidl_next::Wire for Point {
528        type Narrowed<'de> = Point;
529
530        #[inline]
531        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
532            ::fidl_next::munge! {
533                let Self {
534                    x,
535                    y,
536
537                } = &mut *out_;
538            }
539
540            ::fidl_next::Wire::zero_padding(x);
541
542            ::fidl_next::Wire::zero_padding(y);
543        }
544    }
545
546    unsafe impl<___D> ::fidl_next::Decode<___D> for Point
547    where
548        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
549    {
550        fn decode(
551            slot_: ::fidl_next::Slot<'_, Self>,
552            decoder_: &mut ___D,
553            _: (),
554        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
555            ::fidl_next::munge! {
556                let Self {
557                    mut x,
558                    mut y,
559
560                } = slot_;
561            }
562
563            let _field = x.as_mut();
564
565            ::fidl_next::Decode::decode(x.as_mut(), decoder_, ())?;
566
567            let _field = y.as_mut();
568
569            ::fidl_next::Decode::decode(y.as_mut(), decoder_, ())?;
570
571            Ok(())
572        }
573    }
574
575    impl ::fidl_next::IntoNatural for Point {
576        type Natural = crate::natural::Point;
577    }
578
579    /// The wire type corresponding to [`BoundingBox`].
580    #[derive(Clone, Debug)]
581    #[repr(C)]
582    pub struct BoundingBox {
583        pub top_left: crate::wire::Point,
584
585        pub bottom_right: crate::wire::Point,
586    }
587
588    static_assertions::const_assert_eq!(std::mem::size_of::<BoundingBox>(), 32);
589    static_assertions::const_assert_eq!(std::mem::align_of::<BoundingBox>(), 8);
590
591    static_assertions::const_assert_eq!(std::mem::offset_of!(BoundingBox, top_left), 0);
592
593    static_assertions::const_assert_eq!(std::mem::offset_of!(BoundingBox, bottom_right), 16);
594
595    impl ::fidl_next::Constrained for BoundingBox {
596        type Constraint = ();
597
598        fn validate(
599            _: ::fidl_next::Slot<'_, Self>,
600            _: Self::Constraint,
601        ) -> Result<(), ::fidl_next::ValidationError> {
602            Ok(())
603        }
604    }
605
606    unsafe impl ::fidl_next::Wire for BoundingBox {
607        type Narrowed<'de> = BoundingBox;
608
609        #[inline]
610        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
611            ::fidl_next::munge! {
612                let Self {
613                    top_left,
614                    bottom_right,
615
616                } = &mut *out_;
617            }
618
619            ::fidl_next::Wire::zero_padding(top_left);
620
621            ::fidl_next::Wire::zero_padding(bottom_right);
622        }
623    }
624
625    unsafe impl<___D> ::fidl_next::Decode<___D> for BoundingBox
626    where
627        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
628    {
629        fn decode(
630            slot_: ::fidl_next::Slot<'_, Self>,
631            decoder_: &mut ___D,
632            _: (),
633        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
634            ::fidl_next::munge! {
635                let Self {
636                    mut top_left,
637                    mut bottom_right,
638
639                } = slot_;
640            }
641
642            let _field = top_left.as_mut();
643
644            ::fidl_next::Decode::decode(top_left.as_mut(), decoder_, ())?;
645
646            let _field = bottom_right.as_mut();
647
648            ::fidl_next::Decode::decode(bottom_right.as_mut(), decoder_, ())?;
649
650            Ok(())
651        }
652    }
653
654    impl ::fidl_next::IntoNatural for BoundingBox {
655        type Natural = crate::natural::BoundingBox;
656    }
657
658    /// The wire type corresponding to [`Line`](crate::natural::Line).
659    pub type Line = [crate::wire::Point; 2];
660
661    /// The wire type corresponding to [`InstanceAddLinesRequest`].
662    #[derive(Debug)]
663    #[repr(C)]
664    pub struct InstanceAddLinesRequest<'de> {
665        pub lines: ::fidl_next::wire::Vector<'de, [crate::wire::Point; 2]>,
666    }
667
668    static_assertions::const_assert_eq!(std::mem::size_of::<InstanceAddLinesRequest<'_>>(), 16);
669    static_assertions::const_assert_eq!(std::mem::align_of::<InstanceAddLinesRequest<'_>>(), 8);
670
671    static_assertions::const_assert_eq!(
672        std::mem::offset_of!(InstanceAddLinesRequest<'_>, lines),
673        0
674    );
675
676    impl ::fidl_next::Constrained for InstanceAddLinesRequest<'_> {
677        type Constraint = ();
678
679        fn validate(
680            _: ::fidl_next::Slot<'_, Self>,
681            _: Self::Constraint,
682        ) -> Result<(), ::fidl_next::ValidationError> {
683            Ok(())
684        }
685    }
686
687    unsafe impl ::fidl_next::Wire for InstanceAddLinesRequest<'static> {
688        type Narrowed<'de> = InstanceAddLinesRequest<'de>;
689
690        #[inline]
691        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
692            ::fidl_next::munge! {
693                let Self {
694                    lines,
695
696                } = &mut *out_;
697            }
698
699            ::fidl_next::Wire::zero_padding(lines);
700        }
701    }
702
703    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InstanceAddLinesRequest<'de>
704    where
705        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
706        ___D: ::fidl_next::Decoder<'de>,
707    {
708        fn decode(
709            slot_: ::fidl_next::Slot<'_, Self>,
710            decoder_: &mut ___D,
711            _: (),
712        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
713            ::fidl_next::munge! {
714                let Self {
715                    mut lines,
716
717                } = slot_;
718            }
719
720            let _field = lines.as_mut();
721            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
722            ::fidl_next::Decode::decode(lines.as_mut(), decoder_, (4294967295, ()))?;
723
724            Ok(())
725        }
726    }
727
728    impl<'de> ::fidl_next::IntoNatural for InstanceAddLinesRequest<'de> {
729        type Natural = crate::natural::InstanceAddLinesRequest;
730    }
731
732    /// The wire type corresponding to [`InstanceReadyResponse`].
733    pub type InstanceReadyResponse = ::fidl_next::wire::Unit;
734}
735
736pub mod wire_optional {}
737
738pub mod generic {
739
740    /// The generic type corresponding to [`Point`].
741    pub struct Point<T0, T1> {
742        pub x: T0,
743
744        pub y: T1,
745    }
746
747    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Point, ___E> for Point<T0, T1>
748    where
749        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
750        T0: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
751        T1: ::fidl_next::Encode<::fidl_next::wire::Int64, ___E>,
752    {
753        #[inline]
754        fn encode(
755            self,
756            encoder_: &mut ___E,
757            out_: &mut ::core::mem::MaybeUninit<crate::wire::Point>,
758            _: (),
759        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
760            ::fidl_next::munge! {
761                let crate::wire::Point {
762                    x,
763                    y,
764
765                } = out_;
766            }
767
768            ::fidl_next::Encode::encode(self.x, encoder_, x, ())?;
769
770            ::fidl_next::Encode::encode(self.y, encoder_, y, ())?;
771
772            Ok(())
773        }
774    }
775
776    /// The generic type corresponding to [`BoundingBox`].
777    pub struct BoundingBox<T0, T1> {
778        pub top_left: T0,
779
780        pub bottom_right: T1,
781    }
782
783    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::BoundingBox, ___E>
784        for BoundingBox<T0, T1>
785    where
786        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
787        T0: ::fidl_next::Encode<crate::wire::Point, ___E>,
788        T1: ::fidl_next::Encode<crate::wire::Point, ___E>,
789    {
790        #[inline]
791        fn encode(
792            self,
793            encoder_: &mut ___E,
794            out_: &mut ::core::mem::MaybeUninit<crate::wire::BoundingBox>,
795            _: (),
796        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
797            ::fidl_next::munge! {
798                let crate::wire::BoundingBox {
799                    top_left,
800                    bottom_right,
801
802                } = out_;
803            }
804
805            ::fidl_next::Encode::encode(self.top_left, encoder_, top_left, ())?;
806
807            ::fidl_next::Encode::encode(self.bottom_right, encoder_, bottom_right, ())?;
808
809            Ok(())
810        }
811    }
812
813    /// The generic type corresponding to [`InstanceAddLinesRequest`].
814    pub struct InstanceAddLinesRequest<T0> {
815        pub lines: T0,
816    }
817
818    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::InstanceAddLinesRequest<'static>, ___E>
819        for InstanceAddLinesRequest<T0>
820    where
821        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
822        ___E: ::fidl_next::Encoder,
823        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, [crate::wire::Point; 2]>, ___E>,
824    {
825        #[inline]
826        fn encode(
827            self,
828            encoder_: &mut ___E,
829            out_: &mut ::core::mem::MaybeUninit<crate::wire::InstanceAddLinesRequest<'static>>,
830            _: (),
831        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
832            ::fidl_next::munge! {
833                let crate::wire::InstanceAddLinesRequest {
834                    lines,
835
836                } = out_;
837            }
838
839            ::fidl_next::Encode::encode(self.lines, encoder_, lines, (4294967295, ()))?;
840
841            Ok(())
842        }
843    }
844
845    /// The generic type corresponding to [`InstanceReadyResponse`].
846    pub type InstanceReadyResponse = ();
847}
848
849pub use self::natural::*;
850
851/// The type corresponding to the Instance protocol.
852#[doc = " Manages a single instance of a canvas. Each session of this protocol is responsible for a new\n canvas.\n"]
853#[derive(PartialEq, Debug)]
854pub struct Instance;
855
856impl ::fidl_next::Discoverable for Instance {
857    const PROTOCOL_NAME: &'static str = "examples.canvas.clientrequesteddraw.Instance";
858}
859
860#[cfg(target_os = "fuchsia")]
861impl ::fidl_next::HasTransport for Instance {
862    type Transport = ::fidl_next::fuchsia::zx::Channel;
863}
864
865pub mod instance {
866    pub mod prelude {
867        pub use crate::{
868            Instance, InstanceClientHandler, InstanceLocalClientHandler,
869            InstanceLocalServerHandler, InstanceServerHandler, instance,
870        };
871
872        pub use crate::natural::BoundingBox;
873
874        pub use crate::natural::InstanceAddLinesRequest;
875
876        pub use crate::natural::InstanceReadyResponse;
877    }
878
879    pub struct AddLines;
880
881    impl ::fidl_next::Method for AddLines {
882        const ORDINAL: u64 = 6522039862237268950;
883        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
884            ::fidl_next::protocol::Flexibility::Flexible;
885
886        type Protocol = crate::Instance;
887
888        type Request = crate::wire::InstanceAddLinesRequest<'static>;
889    }
890
891    pub struct Ready;
892
893    impl ::fidl_next::Method for Ready {
894        const ORDINAL: u64 = 3772001797641023824;
895        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
896            ::fidl_next::protocol::Flexibility::Flexible;
897
898        type Protocol = crate::Instance;
899
900        type Request = ::fidl_next::wire::EmptyMessageBody;
901    }
902
903    impl ::fidl_next::TwoWayMethod for Ready {
904        type Response = ::fidl_next::wire::Flexible<'static, crate::wire::InstanceReadyResponse>;
905    }
906
907    impl<___R> ::fidl_next::Respond<___R> for Ready {
908        type Output = ::fidl_next::Flexible<___R>;
909
910        fn respond(response: ___R) -> Self::Output {
911            ::fidl_next::Flexible(response)
912        }
913    }
914
915    pub struct OnDrawn;
916
917    impl ::fidl_next::Method for OnDrawn {
918        const ORDINAL: u64 = 2731108033267712410;
919        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
920            ::fidl_next::protocol::Flexibility::Flexible;
921
922        type Protocol = crate::Instance;
923
924        type Request = crate::wire::BoundingBox;
925    }
926
927    mod ___detail {
928        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Instance
929        where
930            ___T: ::fidl_next::Transport,
931        {
932            type Client = InstanceClient<___T>;
933            type Server = InstanceServer<___T>;
934        }
935
936        /// The client for the `Instance` protocol.
937        #[repr(transparent)]
938        pub struct InstanceClient<___T: ::fidl_next::Transport> {
939            #[allow(dead_code)]
940            client: ::fidl_next::protocol::Client<___T>,
941        }
942
943        impl<___T> InstanceClient<___T>
944        where
945            ___T: ::fidl_next::Transport,
946        {
947            #[doc = " Add multiple lines to the canvas. We are able to reduce protocol chatter and the number of\n requests needed by batching instead of calling the simpler `AddLine(...)` one line at a\n time.\n"]
948            pub fn add_lines(
949                &self,
950
951                lines: impl ::fidl_next::Encode<
952                    ::fidl_next::wire::Vector<'static, [crate::wire::Point; 2]>,
953                    <___T as ::fidl_next::Transport>::SendBuffer,
954                >,
955            ) -> ::fidl_next::SendFuture<'_, ___T>
956            where
957                <___T as ::fidl_next::Transport>::SendBuffer:
958                    ::fidl_next::encoder::InternalHandleEncoder,
959                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
960            {
961                self.add_lines_with(crate::generic::InstanceAddLinesRequest { lines })
962            }
963
964            #[doc = " Add multiple lines to the canvas. We are able to reduce protocol chatter and the number of\n requests needed by batching instead of calling the simpler `AddLine(...)` one line at a\n time.\n"]
965            pub fn add_lines_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
966            where
967                ___R: ::fidl_next::Encode<
968                        crate::wire::InstanceAddLinesRequest<'static>,
969                        <___T as ::fidl_next::Transport>::SendBuffer,
970                    >,
971            {
972                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
973                    6522039862237268950,
974                    <super::AddLines as ::fidl_next::Method>::FLEXIBILITY,
975                    request,
976                ))
977            }
978
979            #[doc = " Rather than the server randomly performing draws, or trying to guess when to do so, the\n client must explicitly ask for them. This creates a bit of extra chatter with the additional\n method invocation, but allows much greater client-side control of when the canvas is \"ready\"\n for a view update, thereby eliminating unnecessary draws.\n\n This method also has the benefit of \"throttling\" the `-> OnDrawn(...)` event - rather than\n allowing a potentially unlimited flood of `-> OnDrawn(...)` calls, we now have the runtime\n enforced semantic that each `-> OnDrawn(...)` call must follow a unique `Ready() -> ()` call\n from the client. An unprompted `-> OnDrawn(...)` is invalid, and should cause the channel to\n immediately close.\n"]
980            pub fn ready(&self) -> ::fidl_next::TwoWayFuture<'_, super::Ready, ___T> {
981                ::fidl_next::TwoWayFuture::from_untyped(
982                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
983                        3772001797641023824,
984                        <super::Ready as ::fidl_next::Method>::FLEXIBILITY,
985                        (),
986                    ),
987                )
988            }
989        }
990
991        /// The server for the `Instance` protocol.
992        #[repr(transparent)]
993        pub struct InstanceServer<___T: ::fidl_next::Transport> {
994            server: ::fidl_next::protocol::Server<___T>,
995        }
996
997        impl<___T> InstanceServer<___T>
998        where
999            ___T: ::fidl_next::Transport,
1000        {
1001            #[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"]
1002            pub fn on_drawn(
1003                &self,
1004
1005                top_left: impl ::fidl_next::Encode<
1006                    crate::wire::Point,
1007                    <___T as ::fidl_next::Transport>::SendBuffer,
1008                >,
1009
1010                bottom_right: impl ::fidl_next::Encode<
1011                    crate::wire::Point,
1012                    <___T as ::fidl_next::Transport>::SendBuffer,
1013                >,
1014            ) -> ::fidl_next::SendFuture<'_, ___T>
1015            where
1016                <___T as ::fidl_next::Transport>::SendBuffer:
1017                    ::fidl_next::encoder::InternalHandleEncoder,
1018            {
1019                self.on_drawn_with(crate::generic::BoundingBox { top_left, bottom_right })
1020            }
1021
1022            #[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"]
1023
1024            pub fn on_drawn_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1025            where
1026                ___R: ::fidl_next::Encode<
1027                        <super::OnDrawn as ::fidl_next::Method>::Request,
1028                        <___T as ::fidl_next::Transport>::SendBuffer,
1029                    >,
1030            {
1031                ::fidl_next::SendFuture::from_untyped(self.server.send_event(
1032                    2731108033267712410,
1033                    <super::OnDrawn as ::fidl_next::Method>::FLEXIBILITY,
1034                    request,
1035                ))
1036            }
1037        }
1038    }
1039}
1040
1041#[diagnostic::on_unimplemented(
1042    note = "If {Self} implements the non-local InstanceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1043)]
1044
1045/// A client handler for the Instance protocol.
1046///
1047/// See [`Instance`] for more details.
1048pub trait InstanceLocalClientHandler<
1049    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1050    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1051>
1052{
1053    #[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"]
1054    fn on_drawn(
1055        &mut self,
1056
1057        request: ::fidl_next::Request<instance::OnDrawn, ___T>,
1058    ) -> impl ::core::future::Future<Output = ()>;
1059
1060    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1061        ::core::future::ready(())
1062    }
1063}
1064
1065impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Instance
1066where
1067    ___H: InstanceLocalClientHandler<___T>,
1068    ___T: ::fidl_next::Transport,
1069    for<'de> crate::wire::BoundingBox: ::fidl_next::Decode<
1070            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1071            Constraint = (),
1072        >,
1073{
1074    async fn on_event(
1075        handler: &mut ___H,
1076        mut message: ::fidl_next::Message<___T>,
1077    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1078        match *message.header().ordinal {
1079            2731108033267712410 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1080                Ok(decoded) => {
1081                    handler.on_drawn(::fidl_next::Request::from_decoded(decoded)).await;
1082                    Ok(())
1083                }
1084                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1085                    ordinal: 2731108033267712410,
1086                    error,
1087                }),
1088            },
1089
1090            ordinal => {
1091                handler.on_unknown_interaction(ordinal).await;
1092                if ::core::matches!(
1093                    message.header().flexibility(),
1094                    ::fidl_next::protocol::Flexibility::Strict
1095                ) {
1096                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1097                } else {
1098                    Ok(())
1099                }
1100            }
1101        }
1102    }
1103}
1104
1105#[diagnostic::on_unimplemented(
1106    note = "If {Self} implements the non-local InstanceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1107)]
1108
1109/// A server handler for the Instance protocol.
1110///
1111/// See [`Instance`] for more details.
1112pub trait InstanceLocalServerHandler<
1113    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1114    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1115>
1116{
1117    #[doc = " Add multiple lines to the canvas. We are able to reduce protocol chatter and the number of\n requests needed by batching instead of calling the simpler `AddLine(...)` one line at a\n time.\n"]
1118    fn add_lines(
1119        &mut self,
1120
1121        request: ::fidl_next::Request<instance::AddLines, ___T>,
1122    ) -> impl ::core::future::Future<Output = ()>;
1123
1124    #[doc = " Rather than the server randomly performing draws, or trying to guess when to do so, the\n client must explicitly ask for them. This creates a bit of extra chatter with the additional\n method invocation, but allows much greater client-side control of when the canvas is \"ready\"\n for a view update, thereby eliminating unnecessary draws.\n\n This method also has the benefit of \"throttling\" the `-> OnDrawn(...)` event - rather than\n allowing a potentially unlimited flood of `-> OnDrawn(...)` calls, we now have the runtime\n enforced semantic that each `-> OnDrawn(...)` call must follow a unique `Ready() -> ()` call\n from the client. An unprompted `-> OnDrawn(...)` is invalid, and should cause the channel to\n immediately close.\n"]
1125    fn ready(
1126        &mut self,
1127
1128        responder: ::fidl_next::Responder<instance::Ready, ___T>,
1129    ) -> impl ::core::future::Future<Output = ()>;
1130
1131    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1132        ::core::future::ready(())
1133    }
1134}
1135
1136impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Instance
1137where
1138    ___H: InstanceLocalServerHandler<___T>,
1139    ___T: ::fidl_next::Transport,
1140    for<'de> crate::wire::InstanceAddLinesRequest<'de>: ::fidl_next::Decode<
1141            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1142            Constraint = (),
1143        >,
1144{
1145    async fn on_one_way(
1146        handler: &mut ___H,
1147        mut message: ::fidl_next::Message<___T>,
1148    ) -> ::core::result::Result<
1149        (),
1150        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1151    > {
1152        match *message.header().ordinal {
1153            6522039862237268950 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1154                Ok(decoded) => {
1155                    handler.add_lines(::fidl_next::Request::from_decoded(decoded)).await;
1156                    Ok(())
1157                }
1158                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1159                    ordinal: 6522039862237268950,
1160                    error,
1161                }),
1162            },
1163
1164            ordinal => {
1165                handler.on_unknown_interaction(ordinal).await;
1166                if ::core::matches!(
1167                    message.header().flexibility(),
1168                    ::fidl_next::protocol::Flexibility::Strict
1169                ) {
1170                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1171                } else {
1172                    Ok(())
1173                }
1174            }
1175        }
1176    }
1177
1178    async fn on_two_way(
1179        handler: &mut ___H,
1180        mut message: ::fidl_next::Message<___T>,
1181        responder: ::fidl_next::protocol::Responder<___T>,
1182    ) -> ::core::result::Result<
1183        (),
1184        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1185    > {
1186        match *message.header().ordinal {
1187            3772001797641023824 => {
1188                let responder = ::fidl_next::Responder::from_untyped(responder);
1189
1190                handler.ready(responder).await;
1191                Ok(())
1192            }
1193
1194            ordinal => {
1195                handler.on_unknown_interaction(ordinal).await;
1196                if ::core::matches!(
1197                    message.header().flexibility(),
1198                    ::fidl_next::protocol::Flexibility::Strict
1199                ) {
1200                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1201                } else {
1202                    responder
1203                        .respond_framework_error(
1204                            ordinal,
1205                            ::fidl_next::FrameworkError::UnknownMethod,
1206                        )
1207                        .expect("encoding a framework error should never fail")
1208                        .await?;
1209                    Ok(())
1210                }
1211            }
1212        }
1213    }
1214}
1215
1216/// A client handler for the Instance protocol.
1217///
1218/// See [`Instance`] for more details.
1219pub trait InstanceClientHandler<
1220    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1221    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1222>
1223{
1224    #[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"]
1225    fn on_drawn(
1226        &mut self,
1227
1228        request: ::fidl_next::Request<instance::OnDrawn, ___T>,
1229    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1230
1231    fn on_unknown_interaction(
1232        &mut self,
1233        ordinal: u64,
1234    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1235        ::core::future::ready(())
1236    }
1237}
1238
1239impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Instance
1240where
1241    ___H: InstanceClientHandler<___T> + ::core::marker::Send,
1242    ___T: ::fidl_next::Transport,
1243    for<'de> crate::wire::BoundingBox: ::fidl_next::Decode<
1244            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1245            Constraint = (),
1246        >,
1247{
1248    async fn on_event(
1249        handler: &mut ___H,
1250        mut message: ::fidl_next::Message<___T>,
1251    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1252        match *message.header().ordinal {
1253            2731108033267712410 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1254                Ok(decoded) => {
1255                    handler.on_drawn(::fidl_next::Request::from_decoded(decoded)).await;
1256                    Ok(())
1257                }
1258                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1259                    ordinal: 2731108033267712410,
1260                    error,
1261                }),
1262            },
1263
1264            ordinal => {
1265                handler.on_unknown_interaction(ordinal).await;
1266                if ::core::matches!(
1267                    message.header().flexibility(),
1268                    ::fidl_next::protocol::Flexibility::Strict
1269                ) {
1270                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1271                } else {
1272                    Ok(())
1273                }
1274            }
1275        }
1276    }
1277}
1278
1279/// A server handler for the Instance protocol.
1280///
1281/// See [`Instance`] for more details.
1282pub trait InstanceServerHandler<
1283    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1284    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1285>
1286{
1287    #[doc = " Add multiple lines to the canvas. We are able to reduce protocol chatter and the number of\n requests needed by batching instead of calling the simpler `AddLine(...)` one line at a\n time.\n"]
1288    fn add_lines(
1289        &mut self,
1290
1291        request: ::fidl_next::Request<instance::AddLines, ___T>,
1292    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1293
1294    #[doc = " Rather than the server randomly performing draws, or trying to guess when to do so, the\n client must explicitly ask for them. This creates a bit of extra chatter with the additional\n method invocation, but allows much greater client-side control of when the canvas is \"ready\"\n for a view update, thereby eliminating unnecessary draws.\n\n This method also has the benefit of \"throttling\" the `-> OnDrawn(...)` event - rather than\n allowing a potentially unlimited flood of `-> OnDrawn(...)` calls, we now have the runtime\n enforced semantic that each `-> OnDrawn(...)` call must follow a unique `Ready() -> ()` call\n from the client. An unprompted `-> OnDrawn(...)` is invalid, and should cause the channel to\n immediately close.\n"]
1295    fn ready(
1296        &mut self,
1297
1298        responder: ::fidl_next::Responder<instance::Ready, ___T>,
1299    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1300
1301    fn on_unknown_interaction(
1302        &mut self,
1303        ordinal: u64,
1304    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1305        ::core::future::ready(())
1306    }
1307}
1308
1309impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Instance
1310where
1311    ___H: InstanceServerHandler<___T> + ::core::marker::Send,
1312    ___T: ::fidl_next::Transport,
1313    for<'de> crate::wire::InstanceAddLinesRequest<'de>: ::fidl_next::Decode<
1314            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1315            Constraint = (),
1316        >,
1317{
1318    async fn on_one_way(
1319        handler: &mut ___H,
1320        mut message: ::fidl_next::Message<___T>,
1321    ) -> ::core::result::Result<
1322        (),
1323        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1324    > {
1325        match *message.header().ordinal {
1326            6522039862237268950 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1327                Ok(decoded) => {
1328                    handler.add_lines(::fidl_next::Request::from_decoded(decoded)).await;
1329                    Ok(())
1330                }
1331                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1332                    ordinal: 6522039862237268950,
1333                    error,
1334                }),
1335            },
1336
1337            ordinal => {
1338                handler.on_unknown_interaction(ordinal).await;
1339                if ::core::matches!(
1340                    message.header().flexibility(),
1341                    ::fidl_next::protocol::Flexibility::Strict
1342                ) {
1343                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1344                } else {
1345                    Ok(())
1346                }
1347            }
1348        }
1349    }
1350
1351    async fn on_two_way(
1352        handler: &mut ___H,
1353        mut message: ::fidl_next::Message<___T>,
1354        responder: ::fidl_next::protocol::Responder<___T>,
1355    ) -> ::core::result::Result<
1356        (),
1357        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1358    > {
1359        match *message.header().ordinal {
1360            3772001797641023824 => {
1361                let responder = ::fidl_next::Responder::from_untyped(responder);
1362
1363                handler.ready(responder).await;
1364                Ok(())
1365            }
1366
1367            ordinal => {
1368                handler.on_unknown_interaction(ordinal).await;
1369                if ::core::matches!(
1370                    message.header().flexibility(),
1371                    ::fidl_next::protocol::Flexibility::Strict
1372                ) {
1373                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1374                } else {
1375                    responder
1376                        .respond_framework_error(
1377                            ordinal,
1378                            ::fidl_next::FrameworkError::UnknownMethod,
1379                        )
1380                        .expect("encoding a framework error should never fail")
1381                        .await?;
1382                    Ok(())
1383                }
1384            }
1385        }
1386    }
1387}
1388
1389impl<___T> InstanceClientHandler<___T> for ::fidl_next::IgnoreEvents
1390where
1391    ___T: ::fidl_next::Transport,
1392{
1393    async fn on_drawn(&mut self, _: ::fidl_next::Request<instance::OnDrawn, ___T>) {}
1394
1395    async fn on_unknown_interaction(&mut self, _: u64) {}
1396}
1397
1398impl<___H, ___T> InstanceLocalClientHandler<___T> for ::fidl_next::Local<___H>
1399where
1400    ___H: InstanceClientHandler<___T>,
1401    ___T: ::fidl_next::Transport,
1402{
1403    async fn on_drawn(&mut self, request: ::fidl_next::Request<instance::OnDrawn, ___T>) {
1404        ___H::on_drawn(&mut self.0, request).await
1405    }
1406
1407    async fn on_unknown_interaction(&mut self, ordinal: u64) {
1408        ___H::on_unknown_interaction(&mut self.0, ordinal).await
1409    }
1410}
1411
1412impl<___H, ___T> InstanceLocalServerHandler<___T> for ::fidl_next::Local<___H>
1413where
1414    ___H: InstanceServerHandler<___T>,
1415    ___T: ::fidl_next::Transport,
1416{
1417    async fn add_lines(&mut self, request: ::fidl_next::Request<instance::AddLines, ___T>) {
1418        ___H::add_lines(&mut self.0, request).await
1419    }
1420
1421    async fn ready(&mut self, responder: ::fidl_next::Responder<instance::Ready, ___T>) {
1422        ___H::ready(&mut self.0, responder).await
1423    }
1424
1425    async fn on_unknown_interaction(&mut self, ordinal: u64) {
1426        ___H::on_unknown_interaction(&mut self.0, ordinal).await
1427    }
1428}