1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub use fidl_next_common_fuchsia_hardware_display_engine::natural::*;
8
9 #[derive(Debug, PartialEq)]
10 #[repr(C)]
11 pub struct EngineCompleteCoordinatorConnectionRequest {
12 pub engine_listener:
13 ::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::DriverChannel>,
14 }
15
16 unsafe impl<___E>
17 ::fidl_next::Encode<crate::wire::EngineCompleteCoordinatorConnectionRequest, ___E>
18 for EngineCompleteCoordinatorConnectionRequest
19 where
20 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21 ___E: ::fidl_next::fuchsia::HandleEncoder,
22 {
23 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
24 Self,
25 crate::wire::EngineCompleteCoordinatorConnectionRequest,
26 > = unsafe {
27 ::fidl_next::CopyOptimization::enable_if(
28 true
29
30 && <
31 ::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::DriverChannel> as ::fidl_next::Encode<::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::wire::DriverChannel>, ___E>
32 >::COPY_OPTIMIZATION.is_enabled()
33
34 )
35 };
36
37 #[inline]
38 fn encode(
39 self,
40 encoder_: &mut ___E,
41 out_: &mut ::core::mem::MaybeUninit<
42 crate::wire::EngineCompleteCoordinatorConnectionRequest,
43 >,
44 _: (),
45 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
46 ::fidl_next::munge! {
47 let crate::wire::EngineCompleteCoordinatorConnectionRequest {
48 engine_listener,
49
50 } = out_;
51 }
52
53 ::fidl_next::Encode::encode(self.engine_listener, encoder_, engine_listener, ())?;
54
55 let mut _field =
56 unsafe { ::fidl_next::Slot::new_unchecked(engine_listener.as_mut_ptr()) };
57
58 Ok(())
59 }
60 }
61
62 unsafe impl<___E>
63 ::fidl_next::EncodeOption<
64 ::fidl_next::wire::Box<
65 'static,
66 crate::wire::EngineCompleteCoordinatorConnectionRequest,
67 >,
68 ___E,
69 > for EngineCompleteCoordinatorConnectionRequest
70 where
71 ___E: ::fidl_next::Encoder + ?Sized,
72 EngineCompleteCoordinatorConnectionRequest:
73 ::fidl_next::Encode<crate::wire::EngineCompleteCoordinatorConnectionRequest, ___E>,
74 {
75 #[inline]
76 fn encode_option(
77 this: ::core::option::Option<Self>,
78 encoder: &mut ___E,
79 out: &mut ::core::mem::MaybeUninit<
80 ::fidl_next::wire::Box<
81 'static,
82 crate::wire::EngineCompleteCoordinatorConnectionRequest,
83 >,
84 >,
85 _: (),
86 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
87 if let Some(inner) = this {
88 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
89 ::fidl_next::wire::Box::encode_present(out);
90 } else {
91 ::fidl_next::wire::Box::encode_absent(out);
92 }
93
94 Ok(())
95 }
96 }
97
98 impl ::fidl_next::FromWire<crate::wire::EngineCompleteCoordinatorConnectionRequest>
99 for EngineCompleteCoordinatorConnectionRequest
100 {
101 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
102 crate::wire::EngineCompleteCoordinatorConnectionRequest,
103 Self,
104 > = unsafe {
105 ::fidl_next::CopyOptimization::enable_if(
106 true
107
108 && <
109 ::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::DriverChannel> as ::fidl_next::FromWire<::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::wire::DriverChannel>>
110 >::COPY_OPTIMIZATION.is_enabled()
111
112 )
113 };
114
115 #[inline]
116 fn from_wire(wire: crate::wire::EngineCompleteCoordinatorConnectionRequest) -> Self {
117 Self { engine_listener: ::fidl_next::FromWire::from_wire(wire.engine_listener) }
118 }
119 }
120
121 #[derive(Debug, PartialEq)]
122 pub struct EngineImportBufferCollectionRequest {
123 pub buffer_collection_id: crate::natural::BufferCollectionId,
124
125 pub collection_token: ::fidl_next::ClientEnd<
126 ::fidl_next_fuchsia_sysmem2::BufferCollectionToken,
127 ::fidl_next::fuchsia::zx::Channel,
128 >,
129 }
130
131 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EngineImportBufferCollectionRequest, ___E>
132 for EngineImportBufferCollectionRequest
133 where
134 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
135 ___E: ::fidl_next::fuchsia::HandleEncoder,
136 {
137 #[inline]
138 fn encode(
139 self,
140 encoder_: &mut ___E,
141 out_: &mut ::core::mem::MaybeUninit<crate::wire::EngineImportBufferCollectionRequest>,
142 _: (),
143 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
144 ::fidl_next::munge! {
145 let crate::wire::EngineImportBufferCollectionRequest {
146 buffer_collection_id,
147 collection_token,
148
149 } = out_;
150 }
151
152 ::fidl_next::Encode::encode(
153 self.buffer_collection_id,
154 encoder_,
155 buffer_collection_id,
156 (),
157 )?;
158
159 let mut _field =
160 unsafe { ::fidl_next::Slot::new_unchecked(buffer_collection_id.as_mut_ptr()) };
161
162 ::fidl_next::Encode::encode(self.collection_token, encoder_, collection_token, ())?;
163
164 let mut _field =
165 unsafe { ::fidl_next::Slot::new_unchecked(collection_token.as_mut_ptr()) };
166
167 Ok(())
168 }
169 }
170
171 unsafe impl<___E>
172 ::fidl_next::EncodeOption<
173 ::fidl_next::wire::Box<'static, crate::wire::EngineImportBufferCollectionRequest>,
174 ___E,
175 > for EngineImportBufferCollectionRequest
176 where
177 ___E: ::fidl_next::Encoder + ?Sized,
178 EngineImportBufferCollectionRequest:
179 ::fidl_next::Encode<crate::wire::EngineImportBufferCollectionRequest, ___E>,
180 {
181 #[inline]
182 fn encode_option(
183 this: ::core::option::Option<Self>,
184 encoder: &mut ___E,
185 out: &mut ::core::mem::MaybeUninit<
186 ::fidl_next::wire::Box<'static, crate::wire::EngineImportBufferCollectionRequest>,
187 >,
188 _: (),
189 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
190 if let Some(inner) = this {
191 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
192 ::fidl_next::wire::Box::encode_present(out);
193 } else {
194 ::fidl_next::wire::Box::encode_absent(out);
195 }
196
197 Ok(())
198 }
199 }
200
201 impl ::fidl_next::FromWire<crate::wire::EngineImportBufferCollectionRequest>
202 for EngineImportBufferCollectionRequest
203 {
204 #[inline]
205 fn from_wire(wire: crate::wire::EngineImportBufferCollectionRequest) -> Self {
206 Self {
207 buffer_collection_id: ::fidl_next::FromWire::from_wire(wire.buffer_collection_id),
208
209 collection_token: ::fidl_next::FromWire::from_wire(wire.collection_token),
210 }
211 }
212 }
213
214 #[doc = " Collects the information reported by the engine hardware about a display.\n\n The data representation closely matches the formats used by display engine\n hardware. The display coordinator is responsible for parsing these formats\n and converting the information into forms that are more suitable for\n higher-level software.\n"]
215 #[derive(Debug, Clone, PartialEq)]
216 pub struct RawDisplayInfo {
217 pub display_id: ::fidl_next_fuchsia_hardware_display_types::natural::DisplayId,
218
219 pub preferred_modes:
220 ::std::vec::Vec<::fidl_next_fuchsia_hardware_display_types::natural::Mode>,
221
222 pub edid_bytes: ::std::vec::Vec<u8>,
223
224 pub pixel_formats: ::std::vec::Vec<::fidl_next_fuchsia_images2::natural::PixelFormat>,
225 }
226
227 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RawDisplayInfo<'static>, ___E> for RawDisplayInfo
228 where
229 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
230 ___E: ::fidl_next::Encoder,
231 ___E: ::fidl_next::fuchsia::HandleEncoder,
232 {
233 #[inline]
234 fn encode(
235 self,
236 encoder_: &mut ___E,
237 out_: &mut ::core::mem::MaybeUninit<crate::wire::RawDisplayInfo<'static>>,
238 _: (),
239 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
240 ::fidl_next::munge! {
241 let crate::wire::RawDisplayInfo {
242 display_id,
243 preferred_modes,
244 edid_bytes,
245 pixel_formats,
246
247 } = out_;
248 }
249
250 ::fidl_next::Encode::encode(self.display_id, encoder_, display_id, ())?;
251
252 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(display_id.as_mut_ptr()) };
253
254 ::fidl_next::Encode::encode(self.preferred_modes, encoder_, preferred_modes, (32, ()))?;
255
256 let mut _field =
257 unsafe { ::fidl_next::Slot::new_unchecked(preferred_modes.as_mut_ptr()) };
258 ::fidl_next::Constrained::validate(_field, (32, ()))?;
259
260 ::fidl_next::Encode::encode(self.edid_bytes, encoder_, edid_bytes, (32768, ()))?;
261
262 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(edid_bytes.as_mut_ptr()) };
263 ::fidl_next::Constrained::validate(_field, (32768, ()))?;
264
265 ::fidl_next::Encode::encode(self.pixel_formats, encoder_, pixel_formats, (64, ()))?;
266
267 let mut _field =
268 unsafe { ::fidl_next::Slot::new_unchecked(pixel_formats.as_mut_ptr()) };
269 ::fidl_next::Constrained::validate(_field, (64, ()))?;
270
271 Ok(())
272 }
273 }
274
275 unsafe impl<___E>
276 ::fidl_next::EncodeOption<
277 ::fidl_next::wire::Box<'static, crate::wire::RawDisplayInfo<'static>>,
278 ___E,
279 > for RawDisplayInfo
280 where
281 ___E: ::fidl_next::Encoder + ?Sized,
282 RawDisplayInfo: ::fidl_next::Encode<crate::wire::RawDisplayInfo<'static>, ___E>,
283 {
284 #[inline]
285 fn encode_option(
286 this: ::core::option::Option<Self>,
287 encoder: &mut ___E,
288 out: &mut ::core::mem::MaybeUninit<
289 ::fidl_next::wire::Box<'static, crate::wire::RawDisplayInfo<'static>>,
290 >,
291 _: (),
292 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
293 if let Some(inner) = this {
294 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
295 ::fidl_next::wire::Box::encode_present(out);
296 } else {
297 ::fidl_next::wire::Box::encode_absent(out);
298 }
299
300 Ok(())
301 }
302 }
303
304 impl<'de> ::fidl_next::FromWire<crate::wire::RawDisplayInfo<'de>> for RawDisplayInfo {
305 #[inline]
306 fn from_wire(wire: crate::wire::RawDisplayInfo<'de>) -> Self {
307 Self {
308 display_id: ::fidl_next::FromWire::from_wire(wire.display_id),
309
310 preferred_modes: ::fidl_next::FromWire::from_wire(wire.preferred_modes),
311
312 edid_bytes: ::fidl_next::FromWire::from_wire(wire.edid_bytes),
313
314 pixel_formats: ::fidl_next::FromWire::from_wire(wire.pixel_formats),
315 }
316 }
317 }
318
319 #[derive(Debug, Clone, PartialEq)]
320 pub struct EngineListenerOnDisplayAddedRequest {
321 pub display_info: crate::natural::RawDisplayInfo,
322 }
323
324 unsafe impl<___E>
325 ::fidl_next::Encode<crate::wire::EngineListenerOnDisplayAddedRequest<'static>, ___E>
326 for EngineListenerOnDisplayAddedRequest
327 where
328 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
329 ___E: ::fidl_next::Encoder,
330 ___E: ::fidl_next::fuchsia::HandleEncoder,
331 {
332 #[inline]
333 fn encode(
334 self,
335 encoder_: &mut ___E,
336 out_: &mut ::core::mem::MaybeUninit<
337 crate::wire::EngineListenerOnDisplayAddedRequest<'static>,
338 >,
339 _: (),
340 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
341 ::fidl_next::munge! {
342 let crate::wire::EngineListenerOnDisplayAddedRequest {
343 display_info,
344
345 } = out_;
346 }
347
348 ::fidl_next::Encode::encode(self.display_info, encoder_, display_info, ())?;
349
350 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(display_info.as_mut_ptr()) };
351
352 Ok(())
353 }
354 }
355
356 unsafe impl<___E>
357 ::fidl_next::EncodeOption<
358 ::fidl_next::wire::Box<
359 'static,
360 crate::wire::EngineListenerOnDisplayAddedRequest<'static>,
361 >,
362 ___E,
363 > for EngineListenerOnDisplayAddedRequest
364 where
365 ___E: ::fidl_next::Encoder + ?Sized,
366 EngineListenerOnDisplayAddedRequest:
367 ::fidl_next::Encode<crate::wire::EngineListenerOnDisplayAddedRequest<'static>, ___E>,
368 {
369 #[inline]
370 fn encode_option(
371 this: ::core::option::Option<Self>,
372 encoder: &mut ___E,
373 out: &mut ::core::mem::MaybeUninit<
374 ::fidl_next::wire::Box<
375 'static,
376 crate::wire::EngineListenerOnDisplayAddedRequest<'static>,
377 >,
378 >,
379 _: (),
380 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
381 if let Some(inner) = this {
382 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
383 ::fidl_next::wire::Box::encode_present(out);
384 } else {
385 ::fidl_next::wire::Box::encode_absent(out);
386 }
387
388 Ok(())
389 }
390 }
391
392 impl<'de> ::fidl_next::FromWire<crate::wire::EngineListenerOnDisplayAddedRequest<'de>>
393 for EngineListenerOnDisplayAddedRequest
394 {
395 #[inline]
396 fn from_wire(wire: crate::wire::EngineListenerOnDisplayAddedRequest<'de>) -> Self {
397 Self { display_info: ::fidl_next::FromWire::from_wire(wire.display_info) }
398 }
399 }
400}
401
402pub mod wire {
403
404 pub use fidl_next_common_fuchsia_hardware_display_engine::wire::*;
405
406 #[derive(Debug)]
408 #[repr(C)]
409 pub struct EngineCompleteCoordinatorConnectionRequest {
410 pub engine_listener:
411 ::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::wire::DriverChannel>,
412 }
413
414 static_assertions::const_assert_eq!(
415 std::mem::size_of::<EngineCompleteCoordinatorConnectionRequest>(),
416 4
417 );
418 static_assertions::const_assert_eq!(
419 std::mem::align_of::<EngineCompleteCoordinatorConnectionRequest>(),
420 4
421 );
422
423 static_assertions::const_assert_eq!(
424 std::mem::offset_of!(EngineCompleteCoordinatorConnectionRequest, engine_listener),
425 0
426 );
427
428 impl ::fidl_next::Constrained for EngineCompleteCoordinatorConnectionRequest {
429 type Constraint = ();
430
431 fn validate(
432 _: ::fidl_next::Slot<'_, Self>,
433 _: Self::Constraint,
434 ) -> Result<(), ::fidl_next::ValidationError> {
435 Ok(())
436 }
437 }
438
439 unsafe impl ::fidl_next::Wire for EngineCompleteCoordinatorConnectionRequest {
440 type Narrowed<'de> = EngineCompleteCoordinatorConnectionRequest;
441
442 #[inline]
443 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
444 ::fidl_next::munge! {
445 let Self {
446 engine_listener,
447
448 } = &mut *out_;
449 }
450
451 ::fidl_next::Wire::zero_padding(engine_listener);
452 }
453 }
454
455 unsafe impl<___D> ::fidl_next::Decode<___D> for EngineCompleteCoordinatorConnectionRequest
456 where
457 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
458 ___D: ::fidl_next::fuchsia::HandleDecoder,
459 {
460 fn decode(
461 slot_: ::fidl_next::Slot<'_, Self>,
462 decoder_: &mut ___D,
463 _: (),
464 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
465 ::fidl_next::munge! {
466 let Self {
467 mut engine_listener,
468
469 } = slot_;
470 }
471
472 let _field = engine_listener.as_mut();
473
474 ::fidl_next::Decode::decode(engine_listener.as_mut(), decoder_, ())?;
475
476 Ok(())
477 }
478 }
479
480 impl ::fidl_next::IntoNatural for EngineCompleteCoordinatorConnectionRequest {
481 type Natural = crate::natural::EngineCompleteCoordinatorConnectionRequest;
482 }
483
484 #[derive(Debug)]
486 #[repr(C)]
487 pub struct EngineImportBufferCollectionRequest {
488 pub buffer_collection_id: crate::wire::BufferCollectionId,
489
490 pub collection_token: ::fidl_next::ClientEnd<
491 ::fidl_next_fuchsia_sysmem2::BufferCollectionToken,
492 ::fidl_next::wire::fuchsia::Channel,
493 >,
494 }
495
496 static_assertions::const_assert_eq!(
497 std::mem::size_of::<EngineImportBufferCollectionRequest>(),
498 16
499 );
500 static_assertions::const_assert_eq!(
501 std::mem::align_of::<EngineImportBufferCollectionRequest>(),
502 8
503 );
504
505 static_assertions::const_assert_eq!(
506 std::mem::offset_of!(EngineImportBufferCollectionRequest, buffer_collection_id),
507 0
508 );
509
510 static_assertions::const_assert_eq!(
511 std::mem::offset_of!(EngineImportBufferCollectionRequest, collection_token),
512 8
513 );
514
515 impl ::fidl_next::Constrained for EngineImportBufferCollectionRequest {
516 type Constraint = ();
517
518 fn validate(
519 _: ::fidl_next::Slot<'_, Self>,
520 _: Self::Constraint,
521 ) -> Result<(), ::fidl_next::ValidationError> {
522 Ok(())
523 }
524 }
525
526 unsafe impl ::fidl_next::Wire for EngineImportBufferCollectionRequest {
527 type Narrowed<'de> = EngineImportBufferCollectionRequest;
528
529 #[inline]
530 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
531 ::fidl_next::munge! {
532 let Self {
533 buffer_collection_id,
534 collection_token,
535
536 } = &mut *out_;
537 }
538
539 ::fidl_next::Wire::zero_padding(buffer_collection_id);
540
541 ::fidl_next::Wire::zero_padding(collection_token);
542
543 unsafe {
544 out_.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
545 }
546 }
547 }
548
549 unsafe impl<___D> ::fidl_next::Decode<___D> for EngineImportBufferCollectionRequest
550 where
551 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
552 ___D: ::fidl_next::fuchsia::HandleDecoder,
553 {
554 fn decode(
555 slot_: ::fidl_next::Slot<'_, Self>,
556 decoder_: &mut ___D,
557 _: (),
558 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
559 if slot_.as_bytes()[12..16] != [0u8; 4] {
560 return Err(::fidl_next::DecodeError::InvalidPadding);
561 }
562
563 ::fidl_next::munge! {
564 let Self {
565 mut buffer_collection_id,
566 mut collection_token,
567
568 } = slot_;
569 }
570
571 let _field = buffer_collection_id.as_mut();
572
573 ::fidl_next::Decode::decode(buffer_collection_id.as_mut(), decoder_, ())?;
574
575 let _field = collection_token.as_mut();
576
577 ::fidl_next::Decode::decode(collection_token.as_mut(), decoder_, ())?;
578
579 Ok(())
580 }
581 }
582
583 impl ::fidl_next::IntoNatural for EngineImportBufferCollectionRequest {
584 type Natural = crate::natural::EngineImportBufferCollectionRequest;
585 }
586
587 #[derive(Debug)]
589 #[repr(C)]
590 pub struct RawDisplayInfo<'de> {
591 pub display_id: ::fidl_next_fuchsia_hardware_display_types::wire::DisplayId,
592
593 pub preferred_modes:
594 ::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_hardware_display_types::wire::Mode>,
595
596 pub edid_bytes: ::fidl_next::wire::Vector<'de, u8>,
597
598 pub pixel_formats:
599 ::fidl_next::wire::Vector<'de, ::fidl_next_fuchsia_images2::wire::PixelFormat>,
600 }
601
602 static_assertions::const_assert_eq!(std::mem::size_of::<RawDisplayInfo<'_>>(), 56);
603 static_assertions::const_assert_eq!(std::mem::align_of::<RawDisplayInfo<'_>>(), 8);
604
605 static_assertions::const_assert_eq!(std::mem::offset_of!(RawDisplayInfo<'_>, display_id), 0);
606
607 static_assertions::const_assert_eq!(
608 std::mem::offset_of!(RawDisplayInfo<'_>, preferred_modes),
609 8
610 );
611
612 static_assertions::const_assert_eq!(std::mem::offset_of!(RawDisplayInfo<'_>, edid_bytes), 24);
613
614 static_assertions::const_assert_eq!(
615 std::mem::offset_of!(RawDisplayInfo<'_>, pixel_formats),
616 40
617 );
618
619 impl ::fidl_next::Constrained for RawDisplayInfo<'_> {
620 type Constraint = ();
621
622 fn validate(
623 _: ::fidl_next::Slot<'_, Self>,
624 _: Self::Constraint,
625 ) -> Result<(), ::fidl_next::ValidationError> {
626 Ok(())
627 }
628 }
629
630 unsafe impl ::fidl_next::Wire for RawDisplayInfo<'static> {
631 type Narrowed<'de> = RawDisplayInfo<'de>;
632
633 #[inline]
634 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
635 ::fidl_next::munge! {
636 let Self {
637 display_id,
638 preferred_modes,
639 edid_bytes,
640 pixel_formats,
641
642 } = &mut *out_;
643 }
644
645 ::fidl_next::Wire::zero_padding(display_id);
646
647 ::fidl_next::Wire::zero_padding(preferred_modes);
648
649 ::fidl_next::Wire::zero_padding(edid_bytes);
650
651 ::fidl_next::Wire::zero_padding(pixel_formats);
652 }
653 }
654
655 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for RawDisplayInfo<'de>
656 where
657 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
658 ___D: ::fidl_next::Decoder<'de>,
659 ___D: ::fidl_next::fuchsia::HandleDecoder,
660 {
661 fn decode(
662 slot_: ::fidl_next::Slot<'_, Self>,
663 decoder_: &mut ___D,
664 _: (),
665 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
666 ::fidl_next::munge! {
667 let Self {
668 mut display_id,
669 mut preferred_modes,
670 mut edid_bytes,
671 mut pixel_formats,
672
673 } = slot_;
674 }
675
676 let _field = display_id.as_mut();
677
678 ::fidl_next::Decode::decode(display_id.as_mut(), decoder_, ())?;
679
680 let _field = preferred_modes.as_mut();
681 ::fidl_next::Constrained::validate(_field, (32, ()))?;
682 ::fidl_next::Decode::decode(preferred_modes.as_mut(), decoder_, (32, ()))?;
683
684 let preferred_modes = unsafe { preferred_modes.deref_unchecked() };
685
686 if preferred_modes.len() > 32 {
687 return Err(::fidl_next::DecodeError::VectorTooLong {
688 size: preferred_modes.len() as u64,
689 limit: 32,
690 });
691 }
692
693 let _field = edid_bytes.as_mut();
694 ::fidl_next::Constrained::validate(_field, (32768, ()))?;
695 ::fidl_next::Decode::decode(edid_bytes.as_mut(), decoder_, (32768, ()))?;
696
697 let edid_bytes = unsafe { edid_bytes.deref_unchecked() };
698
699 if edid_bytes.len() > 32768 {
700 return Err(::fidl_next::DecodeError::VectorTooLong {
701 size: edid_bytes.len() as u64,
702 limit: 32768,
703 });
704 }
705
706 let _field = pixel_formats.as_mut();
707 ::fidl_next::Constrained::validate(_field, (64, ()))?;
708 ::fidl_next::Decode::decode(pixel_formats.as_mut(), decoder_, (64, ()))?;
709
710 let pixel_formats = unsafe { pixel_formats.deref_unchecked() };
711
712 if pixel_formats.len() > 64 {
713 return Err(::fidl_next::DecodeError::VectorTooLong {
714 size: pixel_formats.len() as u64,
715 limit: 64,
716 });
717 }
718
719 Ok(())
720 }
721 }
722
723 impl<'de> ::fidl_next::IntoNatural for RawDisplayInfo<'de> {
724 type Natural = crate::natural::RawDisplayInfo;
725 }
726
727 #[derive(Debug)]
729 #[repr(C)]
730 pub struct EngineListenerOnDisplayAddedRequest<'de> {
731 pub display_info: crate::wire::RawDisplayInfo<'de>,
732 }
733
734 static_assertions::const_assert_eq!(
735 std::mem::size_of::<EngineListenerOnDisplayAddedRequest<'_>>(),
736 56
737 );
738 static_assertions::const_assert_eq!(
739 std::mem::align_of::<EngineListenerOnDisplayAddedRequest<'_>>(),
740 8
741 );
742
743 static_assertions::const_assert_eq!(
744 std::mem::offset_of!(EngineListenerOnDisplayAddedRequest<'_>, display_info),
745 0
746 );
747
748 impl ::fidl_next::Constrained for EngineListenerOnDisplayAddedRequest<'_> {
749 type Constraint = ();
750
751 fn validate(
752 _: ::fidl_next::Slot<'_, Self>,
753 _: Self::Constraint,
754 ) -> Result<(), ::fidl_next::ValidationError> {
755 Ok(())
756 }
757 }
758
759 unsafe impl ::fidl_next::Wire for EngineListenerOnDisplayAddedRequest<'static> {
760 type Narrowed<'de> = EngineListenerOnDisplayAddedRequest<'de>;
761
762 #[inline]
763 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
764 ::fidl_next::munge! {
765 let Self {
766 display_info,
767
768 } = &mut *out_;
769 }
770
771 ::fidl_next::Wire::zero_padding(display_info);
772 }
773 }
774
775 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EngineListenerOnDisplayAddedRequest<'de>
776 where
777 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
778 ___D: ::fidl_next::Decoder<'de>,
779 ___D: ::fidl_next::fuchsia::HandleDecoder,
780 {
781 fn decode(
782 slot_: ::fidl_next::Slot<'_, Self>,
783 decoder_: &mut ___D,
784 _: (),
785 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
786 ::fidl_next::munge! {
787 let Self {
788 mut display_info,
789
790 } = slot_;
791 }
792
793 let _field = display_info.as_mut();
794
795 ::fidl_next::Decode::decode(display_info.as_mut(), decoder_, ())?;
796
797 Ok(())
798 }
799 }
800
801 impl<'de> ::fidl_next::IntoNatural for EngineListenerOnDisplayAddedRequest<'de> {
802 type Natural = crate::natural::EngineListenerOnDisplayAddedRequest;
803 }
804}
805
806pub mod wire_optional {
807
808 pub use fidl_next_common_fuchsia_hardware_display_engine::wire_optional::*;
809}
810
811pub mod generic {
812
813 pub use fidl_next_common_fuchsia_hardware_display_engine::generic::*;
814
815 pub struct EngineCompleteCoordinatorConnectionRequest<T0> {
817 pub engine_listener: T0,
818 }
819
820 unsafe impl<___E, T0>
821 ::fidl_next::Encode<crate::wire::EngineCompleteCoordinatorConnectionRequest, ___E>
822 for EngineCompleteCoordinatorConnectionRequest<T0>
823 where
824 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
825 ___E: ::fidl_next::fuchsia::HandleEncoder,
826 T0: ::fidl_next::Encode<
827 ::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::wire::DriverChannel>,
828 ___E,
829 >,
830 {
831 #[inline]
832 fn encode(
833 self,
834 encoder_: &mut ___E,
835 out_: &mut ::core::mem::MaybeUninit<
836 crate::wire::EngineCompleteCoordinatorConnectionRequest,
837 >,
838 _: (),
839 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
840 ::fidl_next::munge! {
841 let crate::wire::EngineCompleteCoordinatorConnectionRequest {
842 engine_listener,
843
844 } = out_;
845 }
846
847 ::fidl_next::Encode::encode(self.engine_listener, encoder_, engine_listener, ())?;
848
849 Ok(())
850 }
851 }
852
853 unsafe impl<'a, ___E, T0>
854 ::fidl_next::Encode<crate::wire::EngineCompleteCoordinatorConnectionRequest, ___E>
855 for &'a EngineCompleteCoordinatorConnectionRequest<T0>
856 where
857 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
858 ___E: ::fidl_next::fuchsia::HandleEncoder,
859 &'a T0: ::fidl_next::Encode<
860 ::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::wire::DriverChannel>,
861 ___E,
862 >,
863 {
864 #[inline]
865 fn encode(
866 self,
867 encoder_: &mut ___E,
868 out_: &mut ::core::mem::MaybeUninit<
869 crate::wire::EngineCompleteCoordinatorConnectionRequest,
870 >,
871 _: (),
872 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
873 ::fidl_next::munge! {
874 let crate::wire::EngineCompleteCoordinatorConnectionRequest {
875 engine_listener,
876
877 } = out_;
878 }
879
880 ::fidl_next::Encode::encode(&self.engine_listener, encoder_, engine_listener, ())?;
881
882 Ok(())
883 }
884 }
885
886 pub struct EngineImportBufferCollectionRequest<T0, T1> {
888 pub buffer_collection_id: T0,
889
890 pub collection_token: T1,
891 }
892
893 unsafe impl<___E, T0, T1>
894 ::fidl_next::Encode<crate::wire::EngineImportBufferCollectionRequest, ___E>
895 for EngineImportBufferCollectionRequest<T0, T1>
896 where
897 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
898 ___E: ::fidl_next::fuchsia::HandleEncoder,
899 T0: ::fidl_next::Encode<crate::wire::BufferCollectionId, ___E>,
900 T1: ::fidl_next::Encode<
901 ::fidl_next::ClientEnd<
902 ::fidl_next_fuchsia_sysmem2::BufferCollectionToken,
903 ::fidl_next::wire::fuchsia::Channel,
904 >,
905 ___E,
906 >,
907 {
908 #[inline]
909 fn encode(
910 self,
911 encoder_: &mut ___E,
912 out_: &mut ::core::mem::MaybeUninit<crate::wire::EngineImportBufferCollectionRequest>,
913 _: (),
914 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
915 ::fidl_next::munge! {
916 let crate::wire::EngineImportBufferCollectionRequest {
917 buffer_collection_id,
918 collection_token,
919
920 } = out_;
921 }
922
923 ::fidl_next::Encode::encode(
924 self.buffer_collection_id,
925 encoder_,
926 buffer_collection_id,
927 (),
928 )?;
929
930 ::fidl_next::Encode::encode(self.collection_token, encoder_, collection_token, ())?;
931
932 Ok(())
933 }
934 }
935
936 unsafe impl<'a, ___E, T0, T1>
937 ::fidl_next::Encode<crate::wire::EngineImportBufferCollectionRequest, ___E>
938 for &'a EngineImportBufferCollectionRequest<T0, T1>
939 where
940 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
941 ___E: ::fidl_next::fuchsia::HandleEncoder,
942 &'a T0: ::fidl_next::Encode<crate::wire::BufferCollectionId, ___E>,
943 &'a T1: ::fidl_next::Encode<
944 ::fidl_next::ClientEnd<
945 ::fidl_next_fuchsia_sysmem2::BufferCollectionToken,
946 ::fidl_next::wire::fuchsia::Channel,
947 >,
948 ___E,
949 >,
950 {
951 #[inline]
952 fn encode(
953 self,
954 encoder_: &mut ___E,
955 out_: &mut ::core::mem::MaybeUninit<crate::wire::EngineImportBufferCollectionRequest>,
956 _: (),
957 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
958 ::fidl_next::munge! {
959 let crate::wire::EngineImportBufferCollectionRequest {
960 buffer_collection_id,
961 collection_token,
962
963 } = out_;
964 }
965
966 ::fidl_next::Encode::encode(
967 &self.buffer_collection_id,
968 encoder_,
969 buffer_collection_id,
970 (),
971 )?;
972
973 ::fidl_next::Encode::encode(&self.collection_token, encoder_, collection_token, ())?;
974
975 Ok(())
976 }
977 }
978
979 pub struct RawDisplayInfo<T0, T1, T2, T3> {
981 pub display_id: T0,
982
983 pub preferred_modes: T1,
984
985 pub edid_bytes: T2,
986
987 pub pixel_formats: T3,
988 }
989
990 unsafe impl<___E, T0, T1, T2, T3>
991 ::fidl_next::Encode<crate::wire::RawDisplayInfo<'static>, ___E>
992 for RawDisplayInfo<T0, T1, T2, T3>
993 where
994 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
995 ___E: ::fidl_next::Encoder,
996 ___E: ::fidl_next::fuchsia::HandleEncoder,
997 T0: ::fidl_next::Encode<::fidl_next_fuchsia_hardware_display_types::wire::DisplayId, ___E>,
998 T1: ::fidl_next::Encode<
999 ::fidl_next::wire::Vector<
1000 'static,
1001 ::fidl_next_fuchsia_hardware_display_types::wire::Mode,
1002 >,
1003 ___E,
1004 >,
1005 T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1006 T3: ::fidl_next::Encode<
1007 ::fidl_next::wire::Vector<'static, ::fidl_next_fuchsia_images2::wire::PixelFormat>,
1008 ___E,
1009 >,
1010 {
1011 #[inline]
1012 fn encode(
1013 self,
1014 encoder_: &mut ___E,
1015 out_: &mut ::core::mem::MaybeUninit<crate::wire::RawDisplayInfo<'static>>,
1016 _: (),
1017 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1018 ::fidl_next::munge! {
1019 let crate::wire::RawDisplayInfo {
1020 display_id,
1021 preferred_modes,
1022 edid_bytes,
1023 pixel_formats,
1024
1025 } = out_;
1026 }
1027
1028 ::fidl_next::Encode::encode(self.display_id, encoder_, display_id, ())?;
1029
1030 ::fidl_next::Encode::encode(self.preferred_modes, encoder_, preferred_modes, (32, ()))?;
1031
1032 ::fidl_next::Encode::encode(self.edid_bytes, encoder_, edid_bytes, (32768, ()))?;
1033
1034 ::fidl_next::Encode::encode(self.pixel_formats, encoder_, pixel_formats, (64, ()))?;
1035
1036 Ok(())
1037 }
1038 }
1039
1040 unsafe impl<'a, ___E, T0, T1, T2, T3>
1041 ::fidl_next::Encode<crate::wire::RawDisplayInfo<'static>, ___E>
1042 for &'a RawDisplayInfo<T0, T1, T2, T3>
1043 where
1044 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1045 ___E: ::fidl_next::Encoder,
1046 ___E: ::fidl_next::fuchsia::HandleEncoder,
1047 &'a T0:
1048 ::fidl_next::Encode<::fidl_next_fuchsia_hardware_display_types::wire::DisplayId, ___E>,
1049 &'a T1: ::fidl_next::Encode<
1050 ::fidl_next::wire::Vector<
1051 'static,
1052 ::fidl_next_fuchsia_hardware_display_types::wire::Mode,
1053 >,
1054 ___E,
1055 >,
1056 &'a T2: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1057 &'a T3: ::fidl_next::Encode<
1058 ::fidl_next::wire::Vector<'static, ::fidl_next_fuchsia_images2::wire::PixelFormat>,
1059 ___E,
1060 >,
1061 {
1062 #[inline]
1063 fn encode(
1064 self,
1065 encoder_: &mut ___E,
1066 out_: &mut ::core::mem::MaybeUninit<crate::wire::RawDisplayInfo<'static>>,
1067 _: (),
1068 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1069 ::fidl_next::munge! {
1070 let crate::wire::RawDisplayInfo {
1071 display_id,
1072 preferred_modes,
1073 edid_bytes,
1074 pixel_formats,
1075
1076 } = out_;
1077 }
1078
1079 ::fidl_next::Encode::encode(&self.display_id, encoder_, display_id, ())?;
1080
1081 ::fidl_next::Encode::encode(
1082 &self.preferred_modes,
1083 encoder_,
1084 preferred_modes,
1085 (32, ()),
1086 )?;
1087
1088 ::fidl_next::Encode::encode(&self.edid_bytes, encoder_, edid_bytes, (32768, ()))?;
1089
1090 ::fidl_next::Encode::encode(&self.pixel_formats, encoder_, pixel_formats, (64, ()))?;
1091
1092 Ok(())
1093 }
1094 }
1095
1096 pub struct EngineListenerOnDisplayAddedRequest<T0> {
1098 pub display_info: T0,
1099 }
1100
1101 unsafe impl<___E, T0>
1102 ::fidl_next::Encode<crate::wire::EngineListenerOnDisplayAddedRequest<'static>, ___E>
1103 for EngineListenerOnDisplayAddedRequest<T0>
1104 where
1105 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1106 ___E: ::fidl_next::Encoder,
1107 ___E: ::fidl_next::fuchsia::HandleEncoder,
1108 T0: ::fidl_next::Encode<crate::wire::RawDisplayInfo<'static>, ___E>,
1109 {
1110 #[inline]
1111 fn encode(
1112 self,
1113 encoder_: &mut ___E,
1114 out_: &mut ::core::mem::MaybeUninit<
1115 crate::wire::EngineListenerOnDisplayAddedRequest<'static>,
1116 >,
1117 _: (),
1118 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1119 ::fidl_next::munge! {
1120 let crate::wire::EngineListenerOnDisplayAddedRequest {
1121 display_info,
1122
1123 } = out_;
1124 }
1125
1126 ::fidl_next::Encode::encode(self.display_info, encoder_, display_info, ())?;
1127
1128 Ok(())
1129 }
1130 }
1131
1132 unsafe impl<'a, ___E, T0>
1133 ::fidl_next::Encode<crate::wire::EngineListenerOnDisplayAddedRequest<'static>, ___E>
1134 for &'a EngineListenerOnDisplayAddedRequest<T0>
1135 where
1136 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1137 ___E: ::fidl_next::Encoder,
1138 ___E: ::fidl_next::fuchsia::HandleEncoder,
1139 &'a T0: ::fidl_next::Encode<crate::wire::RawDisplayInfo<'static>, ___E>,
1140 {
1141 #[inline]
1142 fn encode(
1143 self,
1144 encoder_: &mut ___E,
1145 out_: &mut ::core::mem::MaybeUninit<
1146 crate::wire::EngineListenerOnDisplayAddedRequest<'static>,
1147 >,
1148 _: (),
1149 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1150 ::fidl_next::munge! {
1151 let crate::wire::EngineListenerOnDisplayAddedRequest {
1152 display_info,
1153
1154 } = out_;
1155 }
1156
1157 ::fidl_next::Encode::encode(&self.display_info, encoder_, display_info, ())?;
1158
1159 Ok(())
1160 }
1161 }
1162}
1163
1164pub use self::natural::*;
1165
1166#[doc = " This protocol is `open` while under development.\n TODO(b/316631158): We should make it `closed` once the API is stabilized.\n"]
1168#[derive(PartialEq, Debug)]
1169pub struct Engine;
1170
1171impl ::fidl_next::Discoverable for Engine {
1172 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.display.engine.Engine";
1173}
1174
1175#[cfg(feature = "driver")]
1176impl ::fidl_next::HasTransport for Engine {
1177 type Transport = ::fdf_fidl::DriverChannel;
1178}
1179
1180pub mod engine {
1181 pub mod prelude {
1182 pub use crate::{
1183 Engine, EngineClientHandler, EngineLocalClientHandler, EngineLocalServerHandler,
1184 EngineServerHandler, engine,
1185 };
1186
1187 pub use crate::natural::EngineCheckConfigurationRequest;
1188
1189 pub use crate::natural::EngineCompleteCoordinatorConnectionRequest;
1190
1191 pub use crate::natural::EngineImportBufferCollectionRequest;
1192
1193 pub use crate::natural::EngineImportImageForCaptureRequest;
1194
1195 pub use crate::natural::EngineImportImageRequest;
1196
1197 pub use crate::natural::EngineReleaseBufferCollectionRequest;
1198
1199 pub use crate::natural::EngineReleaseCaptureRequest;
1200
1201 pub use crate::natural::EngineReleaseImageRequest;
1202
1203 pub use crate::natural::EngineSetBufferCollectionConstraintsRequest;
1204
1205 pub use crate::natural::EngineSetDisplayPowerModeRequest;
1206
1207 pub use crate::natural::EngineSetMinimumRgbRequest;
1208
1209 pub use crate::natural::EngineStartCaptureRequest;
1210
1211 pub use crate::natural::EngineSubmitConfigurationRequest;
1212
1213 pub use crate::natural::EngineCheckConfigurationResponse;
1214
1215 pub use crate::natural::EngineCompleteCoordinatorConnectionResponse;
1216
1217 pub use crate::natural::EngineImportBufferCollectionResponse;
1218
1219 pub use crate::natural::EngineImportImageForCaptureResponse;
1220
1221 pub use crate::natural::EngineImportImageResponse;
1222
1223 pub use crate::natural::EngineReleaseBufferCollectionResponse;
1224
1225 pub use crate::natural::EngineReleaseCaptureResponse;
1226
1227 pub use crate::natural::EngineSetBufferCollectionConstraintsResponse;
1228
1229 pub use crate::natural::EngineSetDisplayPowerModeResponse;
1230
1231 pub use crate::natural::EngineSetMinimumRgbResponse;
1232
1233 pub use crate::natural::EngineStartCaptureResponse;
1234
1235 pub use crate::natural::EngineSubmitConfigurationResponse;
1236
1237 pub use ::fidl_next_fuchsia_hardware_display_types::natural::ConfigResult;
1238 }
1239
1240 pub struct CompleteCoordinatorConnection;
1241
1242 impl ::fidl_next::Method for CompleteCoordinatorConnection {
1243 const ORDINAL: u64 = 4719180934271355554;
1244 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1245 ::fidl_next::protocol::Flexibility::Flexible;
1246
1247 type Protocol = crate::Engine;
1248
1249 type Request = crate::wire::EngineCompleteCoordinatorConnectionRequest;
1250 }
1251
1252 impl ::fidl_next::TwoWayMethod for CompleteCoordinatorConnection {
1253 type Response = ::fidl_next::wire::Flexible<
1254 'static,
1255 crate::wire::EngineCompleteCoordinatorConnectionResponse,
1256 >;
1257 }
1258
1259 impl<___R> ::fidl_next::Respond<___R> for CompleteCoordinatorConnection {
1260 type Output = ::fidl_next::Flexible<
1261 crate::generic::EngineCompleteCoordinatorConnectionResponse<___R>,
1262 >;
1263
1264 fn respond(response: ___R) -> Self::Output {
1265 ::fidl_next::Flexible(crate::generic::EngineCompleteCoordinatorConnectionResponse {
1266 engine_info: response,
1267 })
1268 }
1269 }
1270
1271 pub struct UnsetListener;
1272
1273 impl ::fidl_next::Method for UnsetListener {
1274 const ORDINAL: u64 = 4508514133213543013;
1275 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1276 ::fidl_next::protocol::Flexibility::Flexible;
1277
1278 type Protocol = crate::Engine;
1279
1280 type Request = ::fidl_next::wire::EmptyMessageBody;
1281 }
1282
1283 pub struct ImportBufferCollection;
1284
1285 impl ::fidl_next::Method for ImportBufferCollection {
1286 const ORDINAL: u64 = 8961031870138211399;
1287 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1288 ::fidl_next::protocol::Flexibility::Flexible;
1289
1290 type Protocol = crate::Engine;
1291
1292 type Request = crate::wire::EngineImportBufferCollectionRequest;
1293 }
1294
1295 impl ::fidl_next::TwoWayMethod for ImportBufferCollection {
1296 type Response = ::fidl_next::wire::Result<
1297 'static,
1298 crate::wire::EngineImportBufferCollectionResponse,
1299 ::fidl_next::wire::fuchsia::Status,
1300 >;
1301 }
1302
1303 impl<___R> ::fidl_next::Respond<___R> for ImportBufferCollection {
1304 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1305
1306 fn respond(response: ___R) -> Self::Output {
1307 ::core::result::Result::Ok(response)
1308 }
1309 }
1310
1311 impl<___R> ::fidl_next::RespondErr<___R> for ImportBufferCollection {
1312 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1313
1314 fn respond_err(response: ___R) -> Self::Output {
1315 ::core::result::Result::Err(response)
1316 }
1317 }
1318
1319 pub struct ReleaseBufferCollection;
1320
1321 impl ::fidl_next::Method for ReleaseBufferCollection {
1322 const ORDINAL: u64 = 2508731447035556384;
1323 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1324 ::fidl_next::protocol::Flexibility::Flexible;
1325
1326 type Protocol = crate::Engine;
1327
1328 type Request = crate::wire::EngineReleaseBufferCollectionRequest;
1329 }
1330
1331 impl ::fidl_next::TwoWayMethod for ReleaseBufferCollection {
1332 type Response = ::fidl_next::wire::Result<
1333 'static,
1334 crate::wire::EngineReleaseBufferCollectionResponse,
1335 ::fidl_next::wire::fuchsia::Status,
1336 >;
1337 }
1338
1339 impl<___R> ::fidl_next::Respond<___R> for ReleaseBufferCollection {
1340 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1341
1342 fn respond(response: ___R) -> Self::Output {
1343 ::core::result::Result::Ok(response)
1344 }
1345 }
1346
1347 impl<___R> ::fidl_next::RespondErr<___R> for ReleaseBufferCollection {
1348 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1349
1350 fn respond_err(response: ___R) -> Self::Output {
1351 ::core::result::Result::Err(response)
1352 }
1353 }
1354
1355 pub struct ImportImage;
1356
1357 impl ::fidl_next::Method for ImportImage {
1358 const ORDINAL: u64 = 1516259966324606179;
1359 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1360 ::fidl_next::protocol::Flexibility::Flexible;
1361
1362 type Protocol = crate::Engine;
1363
1364 type Request = crate::wire::EngineImportImageRequest;
1365 }
1366
1367 impl ::fidl_next::TwoWayMethod for ImportImage {
1368 type Response = ::fidl_next::wire::Result<
1369 'static,
1370 crate::wire::EngineImportImageResponse,
1371 ::fidl_next::wire::fuchsia::Status,
1372 >;
1373 }
1374
1375 impl<___R> ::fidl_next::Respond<___R> for ImportImage {
1376 type Output = ::core::result::Result<
1377 crate::generic::EngineImportImageResponse<___R>,
1378 ::fidl_next::never::Never,
1379 >;
1380
1381 fn respond(response: ___R) -> Self::Output {
1382 ::core::result::Result::Ok(crate::generic::EngineImportImageResponse {
1383 image_id: response,
1384 })
1385 }
1386 }
1387
1388 impl<___R> ::fidl_next::RespondErr<___R> for ImportImage {
1389 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1390
1391 fn respond_err(response: ___R) -> Self::Output {
1392 ::core::result::Result::Err(response)
1393 }
1394 }
1395
1396 pub struct ImportImageForCapture;
1397
1398 impl ::fidl_next::Method for ImportImageForCapture {
1399 const ORDINAL: u64 = 3283558293035659501;
1400 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1401 ::fidl_next::protocol::Flexibility::Flexible;
1402
1403 type Protocol = crate::Engine;
1404
1405 type Request = crate::wire::EngineImportImageForCaptureRequest;
1406 }
1407
1408 impl ::fidl_next::TwoWayMethod for ImportImageForCapture {
1409 type Response = ::fidl_next::wire::Result<
1410 'static,
1411 crate::wire::EngineImportImageForCaptureResponse,
1412 ::fidl_next::wire::fuchsia::Status,
1413 >;
1414 }
1415
1416 impl<___R> ::fidl_next::Respond<___R> for ImportImageForCapture {
1417 type Output = ::core::result::Result<
1418 crate::generic::EngineImportImageForCaptureResponse<___R>,
1419 ::fidl_next::never::Never,
1420 >;
1421
1422 fn respond(response: ___R) -> Self::Output {
1423 ::core::result::Result::Ok(crate::generic::EngineImportImageForCaptureResponse {
1424 capture_image_id: response,
1425 })
1426 }
1427 }
1428
1429 impl<___R> ::fidl_next::RespondErr<___R> for ImportImageForCapture {
1430 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1431
1432 fn respond_err(response: ___R) -> Self::Output {
1433 ::core::result::Result::Err(response)
1434 }
1435 }
1436
1437 pub struct ReleaseImage;
1438
1439 impl ::fidl_next::Method for ReleaseImage {
1440 const ORDINAL: u64 = 6459043979932149875;
1441 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1442 ::fidl_next::protocol::Flexibility::Flexible;
1443
1444 type Protocol = crate::Engine;
1445
1446 type Request = crate::wire::EngineReleaseImageRequest;
1447 }
1448
1449 pub struct CheckConfiguration;
1450
1451 impl ::fidl_next::Method for CheckConfiguration {
1452 const ORDINAL: u64 = 4576283536204609126;
1453 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1454 ::fidl_next::protocol::Flexibility::Flexible;
1455
1456 type Protocol = crate::Engine;
1457
1458 type Request = crate::wire::EngineCheckConfigurationRequest<'static>;
1459 }
1460
1461 impl ::fidl_next::TwoWayMethod for CheckConfiguration {
1462 type Response = ::fidl_next::wire::Result<
1463 'static,
1464 crate::wire::EngineCheckConfigurationResponse,
1465 ::fidl_next_fuchsia_hardware_display_types::wire::ConfigResult,
1466 >;
1467 }
1468
1469 impl<___R> ::fidl_next::Respond<___R> for CheckConfiguration {
1470 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1471
1472 fn respond(response: ___R) -> Self::Output {
1473 ::core::result::Result::Ok(response)
1474 }
1475 }
1476
1477 impl<___R> ::fidl_next::RespondErr<___R> for CheckConfiguration {
1478 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1479
1480 fn respond_err(response: ___R) -> Self::Output {
1481 ::core::result::Result::Err(response)
1482 }
1483 }
1484
1485 pub struct SubmitConfiguration;
1486
1487 impl ::fidl_next::Method for SubmitConfiguration {
1488 const ORDINAL: u64 = 9026752285186828733;
1489 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1490 ::fidl_next::protocol::Flexibility::Flexible;
1491
1492 type Protocol = crate::Engine;
1493
1494 type Request = crate::wire::EngineSubmitConfigurationRequest<'static>;
1495 }
1496
1497 impl ::fidl_next::TwoWayMethod for SubmitConfiguration {
1498 type Response =
1499 ::fidl_next::wire::Flexible<'static, crate::wire::EngineSubmitConfigurationResponse>;
1500 }
1501
1502 impl<___R> ::fidl_next::Respond<___R> for SubmitConfiguration {
1503 type Output = ::fidl_next::Flexible<___R>;
1504
1505 fn respond(response: ___R) -> Self::Output {
1506 ::fidl_next::Flexible(response)
1507 }
1508 }
1509
1510 pub struct SetBufferCollectionConstraints;
1511
1512 impl ::fidl_next::Method for SetBufferCollectionConstraints {
1513 const ORDINAL: u64 = 7576937804079032425;
1514 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1515 ::fidl_next::protocol::Flexibility::Flexible;
1516
1517 type Protocol = crate::Engine;
1518
1519 type Request = crate::wire::EngineSetBufferCollectionConstraintsRequest;
1520 }
1521
1522 impl ::fidl_next::TwoWayMethod for SetBufferCollectionConstraints {
1523 type Response = ::fidl_next::wire::Result<
1524 'static,
1525 crate::wire::EngineSetBufferCollectionConstraintsResponse,
1526 ::fidl_next::wire::fuchsia::Status,
1527 >;
1528 }
1529
1530 impl<___R> ::fidl_next::Respond<___R> for SetBufferCollectionConstraints {
1531 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1532
1533 fn respond(response: ___R) -> Self::Output {
1534 ::core::result::Result::Ok(response)
1535 }
1536 }
1537
1538 impl<___R> ::fidl_next::RespondErr<___R> for SetBufferCollectionConstraints {
1539 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1540
1541 fn respond_err(response: ___R) -> Self::Output {
1542 ::core::result::Result::Err(response)
1543 }
1544 }
1545
1546 pub struct SetDisplayPowerMode;
1547
1548 impl ::fidl_next::Method for SetDisplayPowerMode {
1549 const ORDINAL: u64 = 5705800673802517194;
1550 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1551 ::fidl_next::protocol::Flexibility::Flexible;
1552
1553 type Protocol = crate::Engine;
1554
1555 type Request = crate::wire::EngineSetDisplayPowerModeRequest;
1556 }
1557
1558 impl ::fidl_next::TwoWayMethod for SetDisplayPowerMode {
1559 type Response = ::fidl_next::wire::Result<
1560 'static,
1561 crate::wire::EngineSetDisplayPowerModeResponse,
1562 ::fidl_next::wire::fuchsia::Status,
1563 >;
1564 }
1565
1566 impl<___R> ::fidl_next::Respond<___R> for SetDisplayPowerMode {
1567 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1568
1569 fn respond(response: ___R) -> Self::Output {
1570 ::core::result::Result::Ok(response)
1571 }
1572 }
1573
1574 impl<___R> ::fidl_next::RespondErr<___R> for SetDisplayPowerMode {
1575 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1576
1577 fn respond_err(response: ___R) -> Self::Output {
1578 ::core::result::Result::Err(response)
1579 }
1580 }
1581
1582 pub struct SetMinimumRgb;
1583
1584 impl ::fidl_next::Method for SetMinimumRgb {
1585 const ORDINAL: u64 = 467617817871655038;
1586 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1587 ::fidl_next::protocol::Flexibility::Flexible;
1588
1589 type Protocol = crate::Engine;
1590
1591 type Request = crate::wire::EngineSetMinimumRgbRequest;
1592 }
1593
1594 impl ::fidl_next::TwoWayMethod for SetMinimumRgb {
1595 type Response = ::fidl_next::wire::Result<
1596 'static,
1597 crate::wire::EngineSetMinimumRgbResponse,
1598 ::fidl_next::wire::fuchsia::Status,
1599 >;
1600 }
1601
1602 impl<___R> ::fidl_next::Respond<___R> for SetMinimumRgb {
1603 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1604
1605 fn respond(response: ___R) -> Self::Output {
1606 ::core::result::Result::Ok(response)
1607 }
1608 }
1609
1610 impl<___R> ::fidl_next::RespondErr<___R> for SetMinimumRgb {
1611 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1612
1613 fn respond_err(response: ___R) -> Self::Output {
1614 ::core::result::Result::Err(response)
1615 }
1616 }
1617
1618 pub struct StartCapture;
1619
1620 impl ::fidl_next::Method for StartCapture {
1621 const ORDINAL: u64 = 5123505813133388436;
1622 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1623 ::fidl_next::protocol::Flexibility::Flexible;
1624
1625 type Protocol = crate::Engine;
1626
1627 type Request = crate::wire::EngineStartCaptureRequest;
1628 }
1629
1630 impl ::fidl_next::TwoWayMethod for StartCapture {
1631 type Response = ::fidl_next::wire::Result<
1632 'static,
1633 crate::wire::EngineStartCaptureResponse,
1634 ::fidl_next::wire::fuchsia::Status,
1635 >;
1636 }
1637
1638 impl<___R> ::fidl_next::Respond<___R> for StartCapture {
1639 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1640
1641 fn respond(response: ___R) -> Self::Output {
1642 ::core::result::Result::Ok(response)
1643 }
1644 }
1645
1646 impl<___R> ::fidl_next::RespondErr<___R> for StartCapture {
1647 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1648
1649 fn respond_err(response: ___R) -> Self::Output {
1650 ::core::result::Result::Err(response)
1651 }
1652 }
1653
1654 pub struct ReleaseCapture;
1655
1656 impl ::fidl_next::Method for ReleaseCapture {
1657 const ORDINAL: u64 = 3688105504043873248;
1658 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1659 ::fidl_next::protocol::Flexibility::Flexible;
1660
1661 type Protocol = crate::Engine;
1662
1663 type Request = crate::wire::EngineReleaseCaptureRequest;
1664 }
1665
1666 impl ::fidl_next::TwoWayMethod for ReleaseCapture {
1667 type Response = ::fidl_next::wire::Result<
1668 'static,
1669 crate::wire::EngineReleaseCaptureResponse,
1670 ::fidl_next::wire::fuchsia::Status,
1671 >;
1672 }
1673
1674 impl<___R> ::fidl_next::Respond<___R> for ReleaseCapture {
1675 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1676
1677 fn respond(response: ___R) -> Self::Output {
1678 ::core::result::Result::Ok(response)
1679 }
1680 }
1681
1682 impl<___R> ::fidl_next::RespondErr<___R> for ReleaseCapture {
1683 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1684
1685 fn respond_err(response: ___R) -> Self::Output {
1686 ::core::result::Result::Err(response)
1687 }
1688 }
1689
1690 mod ___detail {
1691 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Engine
1692 where
1693 ___T: ::fidl_next::Transport,
1694 {
1695 type Client = EngineClient<___T>;
1696 type Server = EngineServer<___T>;
1697 }
1698
1699 #[repr(transparent)]
1701 pub struct EngineClient<___T: ::fidl_next::Transport> {
1702 #[allow(dead_code)]
1703 client: ::fidl_next::protocol::Client<___T>,
1704 }
1705
1706 impl<___T> EngineClient<___T>
1707 where
1708 ___T: ::fidl_next::Transport,
1709 {
1710 #[doc = " Starts the information flow from the engine driver to the Coordinator.\n\n Must be called exactly once, before all the other calls below.\n"]
1711 pub fn complete_coordinator_connection(
1712 &self,
1713
1714 engine_listener: impl ::fidl_next::Encode<
1715 ::fidl_next::ClientEnd<crate::EngineListener, ::fdf_fidl::wire::DriverChannel>,
1716 <___T as ::fidl_next::Transport>::SendBuffer,
1717 >,
1718 ) -> ::fidl_next::TwoWayFuture<'_, super::CompleteCoordinatorConnection, ___T>
1719 where
1720 <___T as ::fidl_next::Transport>::SendBuffer:
1721 ::fidl_next::encoder::InternalHandleEncoder,
1722 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1723 {
1724 self.complete_coordinator_connection_with(
1725 crate::generic::EngineCompleteCoordinatorConnectionRequest { engine_listener },
1726 )
1727 }
1728
1729 #[doc = " Starts the information flow from the engine driver to the Coordinator.\n\n Must be called exactly once, before all the other calls below.\n"]
1730 pub fn complete_coordinator_connection_with<___R>(
1731 &self,
1732 request: ___R,
1733 ) -> ::fidl_next::TwoWayFuture<'_, super::CompleteCoordinatorConnection, ___T>
1734 where
1735 ___R: ::fidl_next::Encode<
1736 crate::wire::EngineCompleteCoordinatorConnectionRequest,
1737 <___T as ::fidl_next::Transport>::SendBuffer,
1738 >,
1739 {
1740 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1741 4719180934271355554,
1742 <super::CompleteCoordinatorConnection as ::fidl_next::Method>::FLEXIBILITY,
1743 request,
1744 ))
1745 }
1746
1747 #[doc = " Clears the `DisplayEngineListener` connection established by\n [`Engine.CompleteCoordinatorConnection`].\n"]
1748 pub fn unset_listener(&self) -> ::fidl_next::SendFuture<'_, ___T> {
1749 ::fidl_next::SendFuture::from_untyped(
1750 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
1751 4508514133213543013,
1752 <super::UnsetListener as ::fidl_next::Method>::FLEXIBILITY,
1753 (),
1754 ),
1755 )
1756 }
1757
1758 #[doc = " Sets up this driver to use a Sysmem BufferCollection.\n\n Fails with ZX_ERR_INTERNAL if any error occurs during the setup process,\n which mainly consists of communicating with the Sysmem service.\n"]
1759 pub fn import_buffer_collection(
1760 &self,
1761
1762 buffer_collection_id: impl ::fidl_next::Encode<
1763 crate::wire::BufferCollectionId,
1764 <___T as ::fidl_next::Transport>::SendBuffer,
1765 >,
1766
1767 collection_token: impl ::fidl_next::Encode<
1768 ::fidl_next::ClientEnd<
1769 ::fidl_next_fuchsia_sysmem2::BufferCollectionToken,
1770 ::fidl_next::wire::fuchsia::Channel,
1771 >,
1772 <___T as ::fidl_next::Transport>::SendBuffer,
1773 >,
1774 ) -> ::fidl_next::TwoWayFuture<'_, super::ImportBufferCollection, ___T>
1775 where
1776 <___T as ::fidl_next::Transport>::SendBuffer:
1777 ::fidl_next::encoder::InternalHandleEncoder,
1778 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1779 {
1780 self.import_buffer_collection_with(
1781 crate::generic::EngineImportBufferCollectionRequest {
1782 buffer_collection_id,
1783
1784 collection_token,
1785 },
1786 )
1787 }
1788
1789 #[doc = " Sets up this driver to use a Sysmem BufferCollection.\n\n Fails with ZX_ERR_INTERNAL if any error occurs during the setup process,\n which mainly consists of communicating with the Sysmem service.\n"]
1790 pub fn import_buffer_collection_with<___R>(
1791 &self,
1792 request: ___R,
1793 ) -> ::fidl_next::TwoWayFuture<'_, super::ImportBufferCollection, ___T>
1794 where
1795 ___R: ::fidl_next::Encode<
1796 crate::wire::EngineImportBufferCollectionRequest,
1797 <___T as ::fidl_next::Transport>::SendBuffer,
1798 >,
1799 {
1800 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1801 8961031870138211399,
1802 <super::ImportBufferCollection as ::fidl_next::Method>::FLEXIBILITY,
1803 request,
1804 ))
1805 }
1806
1807 #[doc = " Releases the resources needed to use a Sysmem BufferCollection.\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
1808 pub fn release_buffer_collection(
1809 &self,
1810
1811 buffer_collection_id: impl ::fidl_next::Encode<
1812 crate::wire::BufferCollectionId,
1813 <___T as ::fidl_next::Transport>::SendBuffer,
1814 >,
1815 ) -> ::fidl_next::TwoWayFuture<'_, super::ReleaseBufferCollection, ___T>
1816 where
1817 <___T as ::fidl_next::Transport>::SendBuffer:
1818 ::fidl_next::encoder::InternalHandleEncoder,
1819 {
1820 self.release_buffer_collection_with(
1821 crate::generic::EngineReleaseBufferCollectionRequest { buffer_collection_id },
1822 )
1823 }
1824
1825 #[doc = " Releases the resources needed to use a Sysmem BufferCollection.\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
1826 pub fn release_buffer_collection_with<___R>(
1827 &self,
1828 request: ___R,
1829 ) -> ::fidl_next::TwoWayFuture<'_, super::ReleaseBufferCollection, ___T>
1830 where
1831 ___R: ::fidl_next::Encode<
1832 crate::wire::EngineReleaseBufferCollectionRequest,
1833 <___T as ::fidl_next::Transport>::SendBuffer,
1834 >,
1835 {
1836 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1837 2508731447035556384,
1838 <super::ReleaseBufferCollection as ::fidl_next::Method>::FLEXIBILITY,
1839 request,
1840 ))
1841 }
1842
1843 #[doc = " Sets up the hardware to use a buffer as a display image data source.\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
1844 pub fn import_image(
1845 &self,
1846
1847 image_metadata: impl ::fidl_next::Encode<
1848 ::fidl_next_fuchsia_hardware_display_types::wire::ImageMetadata,
1849 <___T as ::fidl_next::Transport>::SendBuffer,
1850 >,
1851
1852 buffer_collection_id: impl ::fidl_next::Encode<
1853 crate::wire::BufferCollectionId,
1854 <___T as ::fidl_next::Transport>::SendBuffer,
1855 >,
1856
1857 buffer_collection_index: impl ::fidl_next::Encode<
1858 ::fidl_next::wire::Uint32,
1859 <___T as ::fidl_next::Transport>::SendBuffer,
1860 >,
1861 ) -> ::fidl_next::TwoWayFuture<'_, super::ImportImage, ___T>
1862 where
1863 <___T as ::fidl_next::Transport>::SendBuffer:
1864 ::fidl_next::encoder::InternalHandleEncoder,
1865 {
1866 self.import_image_with(crate::generic::EngineImportImageRequest {
1867 image_metadata,
1868
1869 buffer_collection_id,
1870
1871 buffer_collection_index,
1872 })
1873 }
1874
1875 #[doc = " Sets up the hardware to use a buffer as a display image data source.\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
1876 pub fn import_image_with<___R>(
1877 &self,
1878 request: ___R,
1879 ) -> ::fidl_next::TwoWayFuture<'_, super::ImportImage, ___T>
1880 where
1881 ___R: ::fidl_next::Encode<
1882 crate::wire::EngineImportImageRequest,
1883 <___T as ::fidl_next::Transport>::SendBuffer,
1884 >,
1885 {
1886 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1887 1516259966324606179,
1888 <super::ImportImage as ::fidl_next::Method>::FLEXIBILITY,
1889 request,
1890 ))
1891 }
1892
1893 #[doc = " Sets up the hardware to use a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
1894 pub fn import_image_for_capture(
1895 &self,
1896
1897 buffer_collection_id: impl ::fidl_next::Encode<
1898 crate::wire::BufferCollectionId,
1899 <___T as ::fidl_next::Transport>::SendBuffer,
1900 >,
1901
1902 buffer_collection_index: impl ::fidl_next::Encode<
1903 ::fidl_next::wire::Uint32,
1904 <___T as ::fidl_next::Transport>::SendBuffer,
1905 >,
1906 ) -> ::fidl_next::TwoWayFuture<'_, super::ImportImageForCapture, ___T>
1907 where
1908 <___T as ::fidl_next::Transport>::SendBuffer:
1909 ::fidl_next::encoder::InternalHandleEncoder,
1910 {
1911 self.import_image_for_capture_with(
1912 crate::generic::EngineImportImageForCaptureRequest {
1913 buffer_collection_id,
1914
1915 buffer_collection_index,
1916 },
1917 )
1918 }
1919
1920 #[doc = " Sets up the hardware to use a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
1921 pub fn import_image_for_capture_with<___R>(
1922 &self,
1923 request: ___R,
1924 ) -> ::fidl_next::TwoWayFuture<'_, super::ImportImageForCapture, ___T>
1925 where
1926 ___R: ::fidl_next::Encode<
1927 crate::wire::EngineImportImageForCaptureRequest,
1928 <___T as ::fidl_next::Transport>::SendBuffer,
1929 >,
1930 {
1931 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1932 3283558293035659501,
1933 <super::ImportImageForCapture as ::fidl_next::Method>::FLEXIBILITY,
1934 request,
1935 ))
1936 }
1937
1938 #[doc = " Releases resources for using a buffer as a display image data source.\n"]
1939 pub fn release_image(
1940 &self,
1941
1942 image_id: impl ::fidl_next::Encode<
1943 crate::wire::ImageId,
1944 <___T as ::fidl_next::Transport>::SendBuffer,
1945 >,
1946 ) -> ::fidl_next::SendFuture<'_, ___T>
1947 where
1948 <___T as ::fidl_next::Transport>::SendBuffer:
1949 ::fidl_next::encoder::InternalHandleEncoder,
1950 {
1951 self.release_image_with(crate::generic::EngineReleaseImageRequest { image_id })
1952 }
1953
1954 #[doc = " Releases resources for using a buffer as a display image data source.\n"]
1955 pub fn release_image_with<___R>(
1956 &self,
1957 request: ___R,
1958 ) -> ::fidl_next::SendFuture<'_, ___T>
1959 where
1960 ___R: ::fidl_next::Encode<
1961 crate::wire::EngineReleaseImageRequest,
1962 <___T as ::fidl_next::Transport>::SendBuffer,
1963 >,
1964 {
1965 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
1966 6459043979932149875,
1967 <super::ReleaseImage as ::fidl_next::Method>::FLEXIBILITY,
1968 request,
1969 ))
1970 }
1971
1972 #[doc = " Verifies that a configuration can be presented on a display.\n\n The verification result must be valid for any configuration derived from\n the given configuration.\n\n A derived configuration can be obtained from another configuration by\n applying one or more of the following operations. The list of operations\n is expected to slowly grow over time.\n\n * Replace an image ID with another image ID. The two IDs must identify\n images that were imported with the same metadata.\n"]
1973 pub fn check_configuration(
1974 &self,
1975
1976 display_config: impl ::fidl_next::Encode<
1977 crate::wire::DisplayConfig<'static>,
1978 <___T as ::fidl_next::Transport>::SendBuffer,
1979 >,
1980 ) -> ::fidl_next::TwoWayFuture<'_, super::CheckConfiguration, ___T>
1981 where
1982 <___T as ::fidl_next::Transport>::SendBuffer:
1983 ::fidl_next::encoder::InternalHandleEncoder,
1984 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1985 {
1986 self.check_configuration_with(crate::generic::EngineCheckConfigurationRequest {
1987 display_config,
1988 })
1989 }
1990
1991 #[doc = " Verifies that a configuration can be presented on a display.\n\n The verification result must be valid for any configuration derived from\n the given configuration.\n\n A derived configuration can be obtained from another configuration by\n applying one or more of the following operations. The list of operations\n is expected to slowly grow over time.\n\n * Replace an image ID with another image ID. The two IDs must identify\n images that were imported with the same metadata.\n"]
1992 pub fn check_configuration_with<___R>(
1993 &self,
1994 request: ___R,
1995 ) -> ::fidl_next::TwoWayFuture<'_, super::CheckConfiguration, ___T>
1996 where
1997 ___R: ::fidl_next::Encode<
1998 crate::wire::EngineCheckConfigurationRequest<'static>,
1999 <___T as ::fidl_next::Transport>::SendBuffer,
2000 >,
2001 {
2002 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2003 4576283536204609126,
2004 <super::CheckConfiguration as ::fidl_next::Method>::FLEXIBILITY,
2005 request,
2006 ))
2007 }
2008
2009 #[doc = " Submits a configuration for future presentation on a display.\n"]
2010 pub fn submit_configuration(
2011 &self,
2012
2013 display_config: impl ::fidl_next::Encode<
2014 crate::wire::DisplayConfig<'static>,
2015 <___T as ::fidl_next::Transport>::SendBuffer,
2016 >,
2017
2018 config_stamp: impl ::fidl_next::Encode<
2019 crate::wire::ConfigStamp,
2020 <___T as ::fidl_next::Transport>::SendBuffer,
2021 >,
2022 ) -> ::fidl_next::TwoWayFuture<'_, super::SubmitConfiguration, ___T>
2023 where
2024 <___T as ::fidl_next::Transport>::SendBuffer:
2025 ::fidl_next::encoder::InternalHandleEncoder,
2026 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2027 {
2028 self.submit_configuration_with(crate::generic::EngineSubmitConfigurationRequest {
2029 display_config,
2030
2031 config_stamp,
2032 })
2033 }
2034
2035 #[doc = " Submits a configuration for future presentation on a display.\n"]
2036 pub fn submit_configuration_with<___R>(
2037 &self,
2038 request: ___R,
2039 ) -> ::fidl_next::TwoWayFuture<'_, super::SubmitConfiguration, ___T>
2040 where
2041 ___R: ::fidl_next::Encode<
2042 crate::wire::EngineSubmitConfigurationRequest<'static>,
2043 <___T as ::fidl_next::Transport>::SendBuffer,
2044 >,
2045 {
2046 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2047 9026752285186828733,
2048 <super::SubmitConfiguration as ::fidl_next::Method>::FLEXIBILITY,
2049 request,
2050 ))
2051 }
2052
2053 #[doc = " Conveys the display hardware\'s limitations on image buffers to sysmem.\n\n Fails with ZX_ERR_INTERNAL if any error occurs while communicating with\n the the Sysmem service.\n"]
2054 pub fn set_buffer_collection_constraints(
2055 &self,
2056
2057 usage: impl ::fidl_next::Encode<
2058 ::fidl_next_fuchsia_hardware_display_types::wire::ImageBufferUsage,
2059 <___T as ::fidl_next::Transport>::SendBuffer,
2060 >,
2061
2062 buffer_collection_id: impl ::fidl_next::Encode<
2063 crate::wire::BufferCollectionId,
2064 <___T as ::fidl_next::Transport>::SendBuffer,
2065 >,
2066 ) -> ::fidl_next::TwoWayFuture<'_, super::SetBufferCollectionConstraints, ___T>
2067 where
2068 <___T as ::fidl_next::Transport>::SendBuffer:
2069 ::fidl_next::encoder::InternalHandleEncoder,
2070 {
2071 self.set_buffer_collection_constraints_with(
2072 crate::generic::EngineSetBufferCollectionConstraintsRequest {
2073 usage,
2074
2075 buffer_collection_id,
2076 },
2077 )
2078 }
2079
2080 #[doc = " Conveys the display hardware\'s limitations on image buffers to sysmem.\n\n Fails with ZX_ERR_INTERNAL if any error occurs while communicating with\n the the Sysmem service.\n"]
2081 pub fn set_buffer_collection_constraints_with<___R>(
2082 &self,
2083 request: ___R,
2084 ) -> ::fidl_next::TwoWayFuture<'_, super::SetBufferCollectionConstraints, ___T>
2085 where
2086 ___R: ::fidl_next::Encode<
2087 crate::wire::EngineSetBufferCollectionConstraintsRequest,
2088 <___T as ::fidl_next::Transport>::SendBuffer,
2089 >,
2090 {
2091 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2092 7576937804079032425,
2093 <super::SetBufferCollectionConstraints as ::fidl_next::Method>::FLEXIBILITY,
2094 request,
2095 ))
2096 }
2097
2098 #[doc = " Sets a display\'s power mode.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the display driver or hardware does\n not support the requested power mode.\n"]
2099 pub fn set_display_power_mode(
2100 &self,
2101
2102 display_id: impl ::fidl_next::Encode<
2103 ::fidl_next_fuchsia_hardware_display_types::wire::DisplayId,
2104 <___T as ::fidl_next::Transport>::SendBuffer,
2105 >,
2106
2107 power_mode: impl ::fidl_next::Encode<
2108 ::fidl_next_fuchsia_hardware_display_types::wire::PowerMode,
2109 <___T as ::fidl_next::Transport>::SendBuffer,
2110 >,
2111 ) -> ::fidl_next::TwoWayFuture<'_, super::SetDisplayPowerMode, ___T>
2112 where
2113 <___T as ::fidl_next::Transport>::SendBuffer:
2114 ::fidl_next::encoder::InternalHandleEncoder,
2115 {
2116 self.set_display_power_mode_with(crate::generic::EngineSetDisplayPowerModeRequest {
2117 display_id,
2118
2119 power_mode,
2120 })
2121 }
2122
2123 #[doc = " Sets a display\'s power mode.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the display driver or hardware does\n not support the requested power mode.\n"]
2124 pub fn set_display_power_mode_with<___R>(
2125 &self,
2126 request: ___R,
2127 ) -> ::fidl_next::TwoWayFuture<'_, super::SetDisplayPowerMode, ___T>
2128 where
2129 ___R: ::fidl_next::Encode<
2130 crate::wire::EngineSetDisplayPowerModeRequest,
2131 <___T as ::fidl_next::Transport>::SendBuffer,
2132 >,
2133 {
2134 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2135 5705800673802517194,
2136 <super::SetDisplayPowerMode as ::fidl_next::Method>::FLEXIBILITY,
2137 request,
2138 ))
2139 }
2140
2141 #[doc = " Set the minimum value of RGB channels.\n\n Fails with ZX_ERR_NOT_SUPPORTED if RGB clamping is not supported. Most\n engine drivers are expected to fail in this manner.\n"]
2142 pub fn set_minimum_rgb(
2143 &self,
2144
2145 minimum_rgb: impl ::fidl_next::Encode<u8, <___T as ::fidl_next::Transport>::SendBuffer>,
2146 ) -> ::fidl_next::TwoWayFuture<'_, super::SetMinimumRgb, ___T>
2147 where
2148 <___T as ::fidl_next::Transport>::SendBuffer:
2149 ::fidl_next::encoder::InternalHandleEncoder,
2150 {
2151 self.set_minimum_rgb_with(crate::generic::EngineSetMinimumRgbRequest {
2152 minimum_rgb,
2153 })
2154 }
2155
2156 #[doc = " Set the minimum value of RGB channels.\n\n Fails with ZX_ERR_NOT_SUPPORTED if RGB clamping is not supported. Most\n engine drivers are expected to fail in this manner.\n"]
2157 pub fn set_minimum_rgb_with<___R>(
2158 &self,
2159 request: ___R,
2160 ) -> ::fidl_next::TwoWayFuture<'_, super::SetMinimumRgb, ___T>
2161 where
2162 ___R: ::fidl_next::Encode<
2163 crate::wire::EngineSetMinimumRgbRequest,
2164 <___T as ::fidl_next::Transport>::SendBuffer,
2165 >,
2166 {
2167 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2168 467617817871655038,
2169 <super::SetMinimumRgb as ::fidl_next::Method>::FLEXIBILITY,
2170 request,
2171 ))
2172 }
2173
2174 #[doc = " Starts a display capture operation.\n\n The engine driver must not be performing another capture operation. The\n capture operation is considered to be in-progress from the moment when a\n successful call to [`DisplayEngine.StartCapture`] is issued, until the\n moment when the engine driver issues a call to\n [`DisplayEngineListener.OnCaptureComplete`].\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n This call must only be issued after a configuration has been submitted to\n the display.\n\n Fails with ZX_ERR_IO_REFUSED if the display engine hardware failed to\n start the capture. This error could point to a systemic issue, such as\n the system having insufficient DRAM bandwidth to capture the most recent\n submitted display configuration. This error could also be caused by a\n temporary hardware failure.\n"]
2175 pub fn start_capture(
2176 &self,
2177
2178 capture_image_id: impl ::fidl_next::Encode<
2179 crate::wire::ImageId,
2180 <___T as ::fidl_next::Transport>::SendBuffer,
2181 >,
2182 ) -> ::fidl_next::TwoWayFuture<'_, super::StartCapture, ___T>
2183 where
2184 <___T as ::fidl_next::Transport>::SendBuffer:
2185 ::fidl_next::encoder::InternalHandleEncoder,
2186 {
2187 self.start_capture_with(crate::generic::EngineStartCaptureRequest {
2188 capture_image_id,
2189 })
2190 }
2191
2192 #[doc = " Starts a display capture operation.\n\n The engine driver must not be performing another capture operation. The\n capture operation is considered to be in-progress from the moment when a\n successful call to [`DisplayEngine.StartCapture`] is issued, until the\n moment when the engine driver issues a call to\n [`DisplayEngineListener.OnCaptureComplete`].\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n This call must only be issued after a configuration has been submitted to\n the display.\n\n Fails with ZX_ERR_IO_REFUSED if the display engine hardware failed to\n start the capture. This error could point to a systemic issue, such as\n the system having insufficient DRAM bandwidth to capture the most recent\n submitted display configuration. This error could also be caused by a\n temporary hardware failure.\n"]
2193 pub fn start_capture_with<___R>(
2194 &self,
2195 request: ___R,
2196 ) -> ::fidl_next::TwoWayFuture<'_, super::StartCapture, ___T>
2197 where
2198 ___R: ::fidl_next::Encode<
2199 crate::wire::EngineStartCaptureRequest,
2200 <___T as ::fidl_next::Transport>::SendBuffer,
2201 >,
2202 {
2203 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2204 5123505813133388436,
2205 <super::StartCapture as ::fidl_next::Method>::FLEXIBILITY,
2206 request,
2207 ))
2208 }
2209
2210 #[doc = " Releases resources for using a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
2211 pub fn release_capture(
2212 &self,
2213
2214 capture_image_id: impl ::fidl_next::Encode<
2215 crate::wire::ImageId,
2216 <___T as ::fidl_next::Transport>::SendBuffer,
2217 >,
2218 ) -> ::fidl_next::TwoWayFuture<'_, super::ReleaseCapture, ___T>
2219 where
2220 <___T as ::fidl_next::Transport>::SendBuffer:
2221 ::fidl_next::encoder::InternalHandleEncoder,
2222 {
2223 self.release_capture_with(crate::generic::EngineReleaseCaptureRequest {
2224 capture_image_id,
2225 })
2226 }
2227
2228 #[doc = " Releases resources for using a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
2229 pub fn release_capture_with<___R>(
2230 &self,
2231 request: ___R,
2232 ) -> ::fidl_next::TwoWayFuture<'_, super::ReleaseCapture, ___T>
2233 where
2234 ___R: ::fidl_next::Encode<
2235 crate::wire::EngineReleaseCaptureRequest,
2236 <___T as ::fidl_next::Transport>::SendBuffer,
2237 >,
2238 {
2239 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2240 3688105504043873248,
2241 <super::ReleaseCapture as ::fidl_next::Method>::FLEXIBILITY,
2242 request,
2243 ))
2244 }
2245 }
2246
2247 #[repr(transparent)]
2249 pub struct EngineServer<___T: ::fidl_next::Transport> {
2250 server: ::fidl_next::protocol::Server<___T>,
2251 }
2252
2253 impl<___T> EngineServer<___T> where ___T: ::fidl_next::Transport {}
2254 }
2255}
2256
2257#[diagnostic::on_unimplemented(
2258 note = "If {Self} implements the non-local EngineClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2259)]
2260
2261pub trait EngineLocalClientHandler<
2265 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
2266 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
2267>
2268{
2269 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2270 ::core::future::ready(())
2271 }
2272}
2273
2274impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Engine
2275where
2276 ___H: EngineLocalClientHandler<___T>,
2277 ___T: ::fidl_next::Transport,
2278{
2279 async fn on_event(
2280 handler: &mut ___H,
2281 mut message: ::fidl_next::Message<___T>,
2282 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2283 match *message.header().ordinal {
2284 ordinal => {
2285 handler.on_unknown_interaction(ordinal).await;
2286 if ::core::matches!(
2287 message.header().flexibility(),
2288 ::fidl_next::protocol::Flexibility::Strict
2289 ) {
2290 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2291 } else {
2292 Ok(())
2293 }
2294 }
2295 }
2296 }
2297}
2298
2299#[diagnostic::on_unimplemented(
2300 note = "If {Self} implements the non-local EngineServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2301)]
2302
2303pub trait EngineLocalServerHandler<
2307 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
2308 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
2309>
2310{
2311 #[doc = " Starts the information flow from the engine driver to the Coordinator.\n\n Must be called exactly once, before all the other calls below.\n"]
2312 fn complete_coordinator_connection(
2313 &mut self,
2314
2315 request: ::fidl_next::Request<engine::CompleteCoordinatorConnection, ___T>,
2316
2317 responder: ::fidl_next::Responder<engine::CompleteCoordinatorConnection, ___T>,
2318 ) -> impl ::core::future::Future<Output = ()>;
2319
2320 #[doc = " Clears the `DisplayEngineListener` connection established by\n [`Engine.CompleteCoordinatorConnection`].\n"]
2321 fn unset_listener(&mut self) -> impl ::core::future::Future<Output = ()>;
2322
2323 #[doc = " Sets up this driver to use a Sysmem BufferCollection.\n\n Fails with ZX_ERR_INTERNAL if any error occurs during the setup process,\n which mainly consists of communicating with the Sysmem service.\n"]
2324 fn import_buffer_collection(
2325 &mut self,
2326
2327 request: ::fidl_next::Request<engine::ImportBufferCollection, ___T>,
2328
2329 responder: ::fidl_next::Responder<engine::ImportBufferCollection, ___T>,
2330 ) -> impl ::core::future::Future<Output = ()>;
2331
2332 #[doc = " Releases the resources needed to use a Sysmem BufferCollection.\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
2333 fn release_buffer_collection(
2334 &mut self,
2335
2336 request: ::fidl_next::Request<engine::ReleaseBufferCollection, ___T>,
2337
2338 responder: ::fidl_next::Responder<engine::ReleaseBufferCollection, ___T>,
2339 ) -> impl ::core::future::Future<Output = ()>;
2340
2341 #[doc = " Sets up the hardware to use a buffer as a display image data source.\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
2342 fn import_image(
2343 &mut self,
2344
2345 request: ::fidl_next::Request<engine::ImportImage, ___T>,
2346
2347 responder: ::fidl_next::Responder<engine::ImportImage, ___T>,
2348 ) -> impl ::core::future::Future<Output = ()>;
2349
2350 #[doc = " Sets up the hardware to use a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
2351 fn import_image_for_capture(
2352 &mut self,
2353
2354 request: ::fidl_next::Request<engine::ImportImageForCapture, ___T>,
2355
2356 responder: ::fidl_next::Responder<engine::ImportImageForCapture, ___T>,
2357 ) -> impl ::core::future::Future<Output = ()>;
2358
2359 #[doc = " Releases resources for using a buffer as a display image data source.\n"]
2360 fn release_image(
2361 &mut self,
2362
2363 request: ::fidl_next::Request<engine::ReleaseImage, ___T>,
2364 ) -> impl ::core::future::Future<Output = ()>;
2365
2366 #[doc = " Verifies that a configuration can be presented on a display.\n\n The verification result must be valid for any configuration derived from\n the given configuration.\n\n A derived configuration can be obtained from another configuration by\n applying one or more of the following operations. The list of operations\n is expected to slowly grow over time.\n\n * Replace an image ID with another image ID. The two IDs must identify\n images that were imported with the same metadata.\n"]
2367 fn check_configuration(
2368 &mut self,
2369
2370 request: ::fidl_next::Request<engine::CheckConfiguration, ___T>,
2371
2372 responder: ::fidl_next::Responder<engine::CheckConfiguration, ___T>,
2373 ) -> impl ::core::future::Future<Output = ()>;
2374
2375 #[doc = " Submits a configuration for future presentation on a display.\n"]
2376 fn submit_configuration(
2377 &mut self,
2378
2379 request: ::fidl_next::Request<engine::SubmitConfiguration, ___T>,
2380
2381 responder: ::fidl_next::Responder<engine::SubmitConfiguration, ___T>,
2382 ) -> impl ::core::future::Future<Output = ()>;
2383
2384 #[doc = " Conveys the display hardware\'s limitations on image buffers to sysmem.\n\n Fails with ZX_ERR_INTERNAL if any error occurs while communicating with\n the the Sysmem service.\n"]
2385 fn set_buffer_collection_constraints(
2386 &mut self,
2387
2388 request: ::fidl_next::Request<engine::SetBufferCollectionConstraints, ___T>,
2389
2390 responder: ::fidl_next::Responder<engine::SetBufferCollectionConstraints, ___T>,
2391 ) -> impl ::core::future::Future<Output = ()>;
2392
2393 #[doc = " Sets a display\'s power mode.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the display driver or hardware does\n not support the requested power mode.\n"]
2394 fn set_display_power_mode(
2395 &mut self,
2396
2397 request: ::fidl_next::Request<engine::SetDisplayPowerMode, ___T>,
2398
2399 responder: ::fidl_next::Responder<engine::SetDisplayPowerMode, ___T>,
2400 ) -> impl ::core::future::Future<Output = ()>;
2401
2402 #[doc = " Set the minimum value of RGB channels.\n\n Fails with ZX_ERR_NOT_SUPPORTED if RGB clamping is not supported. Most\n engine drivers are expected to fail in this manner.\n"]
2403 fn set_minimum_rgb(
2404 &mut self,
2405
2406 request: ::fidl_next::Request<engine::SetMinimumRgb, ___T>,
2407
2408 responder: ::fidl_next::Responder<engine::SetMinimumRgb, ___T>,
2409 ) -> impl ::core::future::Future<Output = ()>;
2410
2411 #[doc = " Starts a display capture operation.\n\n The engine driver must not be performing another capture operation. The\n capture operation is considered to be in-progress from the moment when a\n successful call to [`DisplayEngine.StartCapture`] is issued, until the\n moment when the engine driver issues a call to\n [`DisplayEngineListener.OnCaptureComplete`].\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n This call must only be issued after a configuration has been submitted to\n the display.\n\n Fails with ZX_ERR_IO_REFUSED if the display engine hardware failed to\n start the capture. This error could point to a systemic issue, such as\n the system having insufficient DRAM bandwidth to capture the most recent\n submitted display configuration. This error could also be caused by a\n temporary hardware failure.\n"]
2412 fn start_capture(
2413 &mut self,
2414
2415 request: ::fidl_next::Request<engine::StartCapture, ___T>,
2416
2417 responder: ::fidl_next::Responder<engine::StartCapture, ___T>,
2418 ) -> impl ::core::future::Future<Output = ()>;
2419
2420 #[doc = " Releases resources for using a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
2421 fn release_capture(
2422 &mut self,
2423
2424 request: ::fidl_next::Request<engine::ReleaseCapture, ___T>,
2425
2426 responder: ::fidl_next::Responder<engine::ReleaseCapture, ___T>,
2427 ) -> impl ::core::future::Future<Output = ()>;
2428
2429 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2430 ::core::future::ready(())
2431 }
2432}
2433
2434impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Engine
2435where
2436 ___H: EngineLocalServerHandler<___T>,
2437 ___T: ::fidl_next::Transport,
2438 for<'de> crate::wire::EngineCompleteCoordinatorConnectionRequest: ::fidl_next::Decode<
2439 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2440 Constraint = (),
2441 >,
2442 for<'de> crate::wire::EngineImportBufferCollectionRequest: ::fidl_next::Decode<
2443 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2444 Constraint = (),
2445 >,
2446 for<'de> crate::wire::EngineReleaseBufferCollectionRequest: ::fidl_next::Decode<
2447 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2448 Constraint = (),
2449 >,
2450 for<'de> crate::wire::EngineImportImageRequest: ::fidl_next::Decode<
2451 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2452 Constraint = (),
2453 >,
2454 for<'de> crate::wire::EngineImportImageForCaptureRequest: ::fidl_next::Decode<
2455 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2456 Constraint = (),
2457 >,
2458 for<'de> crate::wire::EngineReleaseImageRequest: ::fidl_next::Decode<
2459 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2460 Constraint = (),
2461 >,
2462 for<'de> crate::wire::EngineCheckConfigurationRequest<'de>: ::fidl_next::Decode<
2463 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2464 Constraint = (),
2465 >,
2466 for<'de> crate::wire::EngineSubmitConfigurationRequest<'de>: ::fidl_next::Decode<
2467 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2468 Constraint = (),
2469 >,
2470 for<'de> crate::wire::EngineSetBufferCollectionConstraintsRequest: ::fidl_next::Decode<
2471 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2472 Constraint = (),
2473 >,
2474 for<'de> crate::wire::EngineSetDisplayPowerModeRequest: ::fidl_next::Decode<
2475 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2476 Constraint = (),
2477 >,
2478 for<'de> crate::wire::EngineSetMinimumRgbRequest: ::fidl_next::Decode<
2479 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2480 Constraint = (),
2481 >,
2482 for<'de> crate::wire::EngineStartCaptureRequest: ::fidl_next::Decode<
2483 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2484 Constraint = (),
2485 >,
2486 for<'de> crate::wire::EngineReleaseCaptureRequest: ::fidl_next::Decode<
2487 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2488 Constraint = (),
2489 >,
2490{
2491 async fn on_one_way(
2492 handler: &mut ___H,
2493 mut message: ::fidl_next::Message<___T>,
2494 ) -> ::core::result::Result<
2495 (),
2496 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2497 > {
2498 match *message.header().ordinal {
2499 4508514133213543013 => {
2500 handler.unset_listener().await;
2501 Ok(())
2502 }
2503
2504 6459043979932149875 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2505 Ok(decoded) => {
2506 handler.release_image(::fidl_next::Request::from_decoded(decoded)).await;
2507 Ok(())
2508 }
2509 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2510 ordinal: 6459043979932149875,
2511 error,
2512 }),
2513 },
2514
2515 ordinal => {
2516 handler.on_unknown_interaction(ordinal).await;
2517 if ::core::matches!(
2518 message.header().flexibility(),
2519 ::fidl_next::protocol::Flexibility::Strict
2520 ) {
2521 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2522 } else {
2523 Ok(())
2524 }
2525 }
2526 }
2527 }
2528
2529 async fn on_two_way(
2530 handler: &mut ___H,
2531 mut message: ::fidl_next::Message<___T>,
2532 responder: ::fidl_next::protocol::Responder<___T>,
2533 ) -> ::core::result::Result<
2534 (),
2535 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2536 > {
2537 match *message.header().ordinal {
2538 4719180934271355554 => {
2539 let responder = ::fidl_next::Responder::from_untyped(responder);
2540
2541 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2542 Ok(decoded) => {
2543 handler
2544 .complete_coordinator_connection(
2545 ::fidl_next::Request::from_decoded(decoded),
2546 responder,
2547 )
2548 .await;
2549 Ok(())
2550 }
2551 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2552 ordinal: 4719180934271355554,
2553 error,
2554 }),
2555 }
2556 }
2557
2558 8961031870138211399 => {
2559 let responder = ::fidl_next::Responder::from_untyped(responder);
2560
2561 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2562 Ok(decoded) => {
2563 handler
2564 .import_buffer_collection(
2565 ::fidl_next::Request::from_decoded(decoded),
2566 responder,
2567 )
2568 .await;
2569 Ok(())
2570 }
2571 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2572 ordinal: 8961031870138211399,
2573 error,
2574 }),
2575 }
2576 }
2577
2578 2508731447035556384 => {
2579 let responder = ::fidl_next::Responder::from_untyped(responder);
2580
2581 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2582 Ok(decoded) => {
2583 handler
2584 .release_buffer_collection(
2585 ::fidl_next::Request::from_decoded(decoded),
2586 responder,
2587 )
2588 .await;
2589 Ok(())
2590 }
2591 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2592 ordinal: 2508731447035556384,
2593 error,
2594 }),
2595 }
2596 }
2597
2598 1516259966324606179 => {
2599 let responder = ::fidl_next::Responder::from_untyped(responder);
2600
2601 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2602 Ok(decoded) => {
2603 handler
2604 .import_image(::fidl_next::Request::from_decoded(decoded), responder)
2605 .await;
2606 Ok(())
2607 }
2608 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2609 ordinal: 1516259966324606179,
2610 error,
2611 }),
2612 }
2613 }
2614
2615 3283558293035659501 => {
2616 let responder = ::fidl_next::Responder::from_untyped(responder);
2617
2618 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2619 Ok(decoded) => {
2620 handler
2621 .import_image_for_capture(
2622 ::fidl_next::Request::from_decoded(decoded),
2623 responder,
2624 )
2625 .await;
2626 Ok(())
2627 }
2628 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2629 ordinal: 3283558293035659501,
2630 error,
2631 }),
2632 }
2633 }
2634
2635 4576283536204609126 => {
2636 let responder = ::fidl_next::Responder::from_untyped(responder);
2637
2638 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2639 Ok(decoded) => {
2640 handler
2641 .check_configuration(
2642 ::fidl_next::Request::from_decoded(decoded),
2643 responder,
2644 )
2645 .await;
2646 Ok(())
2647 }
2648 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2649 ordinal: 4576283536204609126,
2650 error,
2651 }),
2652 }
2653 }
2654
2655 9026752285186828733 => {
2656 let responder = ::fidl_next::Responder::from_untyped(responder);
2657
2658 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2659 Ok(decoded) => {
2660 handler
2661 .submit_configuration(
2662 ::fidl_next::Request::from_decoded(decoded),
2663 responder,
2664 )
2665 .await;
2666 Ok(())
2667 }
2668 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2669 ordinal: 9026752285186828733,
2670 error,
2671 }),
2672 }
2673 }
2674
2675 7576937804079032425 => {
2676 let responder = ::fidl_next::Responder::from_untyped(responder);
2677
2678 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2679 Ok(decoded) => {
2680 handler
2681 .set_buffer_collection_constraints(
2682 ::fidl_next::Request::from_decoded(decoded),
2683 responder,
2684 )
2685 .await;
2686 Ok(())
2687 }
2688 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2689 ordinal: 7576937804079032425,
2690 error,
2691 }),
2692 }
2693 }
2694
2695 5705800673802517194 => {
2696 let responder = ::fidl_next::Responder::from_untyped(responder);
2697
2698 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2699 Ok(decoded) => {
2700 handler
2701 .set_display_power_mode(
2702 ::fidl_next::Request::from_decoded(decoded),
2703 responder,
2704 )
2705 .await;
2706 Ok(())
2707 }
2708 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2709 ordinal: 5705800673802517194,
2710 error,
2711 }),
2712 }
2713 }
2714
2715 467617817871655038 => {
2716 let responder = ::fidl_next::Responder::from_untyped(responder);
2717
2718 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2719 Ok(decoded) => {
2720 handler
2721 .set_minimum_rgb(::fidl_next::Request::from_decoded(decoded), responder)
2722 .await;
2723 Ok(())
2724 }
2725 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2726 ordinal: 467617817871655038,
2727 error,
2728 }),
2729 }
2730 }
2731
2732 5123505813133388436 => {
2733 let responder = ::fidl_next::Responder::from_untyped(responder);
2734
2735 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2736 Ok(decoded) => {
2737 handler
2738 .start_capture(::fidl_next::Request::from_decoded(decoded), responder)
2739 .await;
2740 Ok(())
2741 }
2742 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2743 ordinal: 5123505813133388436,
2744 error,
2745 }),
2746 }
2747 }
2748
2749 3688105504043873248 => {
2750 let responder = ::fidl_next::Responder::from_untyped(responder);
2751
2752 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2753 Ok(decoded) => {
2754 handler
2755 .release_capture(::fidl_next::Request::from_decoded(decoded), responder)
2756 .await;
2757 Ok(())
2758 }
2759 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2760 ordinal: 3688105504043873248,
2761 error,
2762 }),
2763 }
2764 }
2765
2766 ordinal => {
2767 handler.on_unknown_interaction(ordinal).await;
2768 if ::core::matches!(
2769 message.header().flexibility(),
2770 ::fidl_next::protocol::Flexibility::Strict
2771 ) {
2772 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2773 } else {
2774 responder
2775 .respond_framework_error(
2776 ordinal,
2777 ::fidl_next::FrameworkError::UnknownMethod,
2778 )
2779 .expect("encoding a framework error should never fail")
2780 .await?;
2781 Ok(())
2782 }
2783 }
2784 }
2785 }
2786}
2787
2788pub trait EngineClientHandler<
2792 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
2793 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
2794>
2795{
2796 fn on_unknown_interaction(
2797 &mut self,
2798 ordinal: u64,
2799 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2800 ::core::future::ready(())
2801 }
2802}
2803
2804impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Engine
2805where
2806 ___H: EngineClientHandler<___T> + ::core::marker::Send,
2807 ___T: ::fidl_next::Transport,
2808{
2809 async fn on_event(
2810 handler: &mut ___H,
2811 mut message: ::fidl_next::Message<___T>,
2812 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2813 match *message.header().ordinal {
2814 ordinal => {
2815 handler.on_unknown_interaction(ordinal).await;
2816 if ::core::matches!(
2817 message.header().flexibility(),
2818 ::fidl_next::protocol::Flexibility::Strict
2819 ) {
2820 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2821 } else {
2822 Ok(())
2823 }
2824 }
2825 }
2826 }
2827}
2828
2829pub trait EngineServerHandler<
2833 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
2834 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
2835>
2836{
2837 #[doc = " Starts the information flow from the engine driver to the Coordinator.\n\n Must be called exactly once, before all the other calls below.\n"]
2838 fn complete_coordinator_connection(
2839 &mut self,
2840
2841 request: ::fidl_next::Request<engine::CompleteCoordinatorConnection, ___T>,
2842
2843 responder: ::fidl_next::Responder<engine::CompleteCoordinatorConnection, ___T>,
2844 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2845
2846 #[doc = " Clears the `DisplayEngineListener` connection established by\n [`Engine.CompleteCoordinatorConnection`].\n"]
2847 fn unset_listener(&mut self)
2848 -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2849
2850 #[doc = " Sets up this driver to use a Sysmem BufferCollection.\n\n Fails with ZX_ERR_INTERNAL if any error occurs during the setup process,\n which mainly consists of communicating with the Sysmem service.\n"]
2851 fn import_buffer_collection(
2852 &mut self,
2853
2854 request: ::fidl_next::Request<engine::ImportBufferCollection, ___T>,
2855
2856 responder: ::fidl_next::Responder<engine::ImportBufferCollection, ___T>,
2857 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2858
2859 #[doc = " Releases the resources needed to use a Sysmem BufferCollection.\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
2860 fn release_buffer_collection(
2861 &mut self,
2862
2863 request: ::fidl_next::Request<engine::ReleaseBufferCollection, ___T>,
2864
2865 responder: ::fidl_next::Responder<engine::ReleaseBufferCollection, ___T>,
2866 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2867
2868 #[doc = " Sets up the hardware to use a buffer as a display image data source.\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
2869 fn import_image(
2870 &mut self,
2871
2872 request: ::fidl_next::Request<engine::ImportImage, ___T>,
2873
2874 responder: ::fidl_next::Responder<engine::ImportImage, ___T>,
2875 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2876
2877 #[doc = " Sets up the hardware to use a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n Fails with ZX_ERR_SHOULD_WAIT if Sysmem reports that the\n BufferCollection\'s buffers are not yet allocated. Fails with\n ZX_ERR_INTERNAL if any other error occurs while obtaining the buffer\n from the Sysmem service.\n\n The implementation must ignore any Sysmem information around weak VMO\n handles. Display stack consumers are responsible for ensuring that weak\n VMOs are closed in a timely manner, which may involve calling\n [`Engine.ReleaseImage`] and [`Engine.SubmitConfiguration`].\n"]
2878 fn import_image_for_capture(
2879 &mut self,
2880
2881 request: ::fidl_next::Request<engine::ImportImageForCapture, ___T>,
2882
2883 responder: ::fidl_next::Responder<engine::ImportImageForCapture, ___T>,
2884 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2885
2886 #[doc = " Releases resources for using a buffer as a display image data source.\n"]
2887 fn release_image(
2888 &mut self,
2889
2890 request: ::fidl_next::Request<engine::ReleaseImage, ___T>,
2891 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2892
2893 #[doc = " Verifies that a configuration can be presented on a display.\n\n The verification result must be valid for any configuration derived from\n the given configuration.\n\n A derived configuration can be obtained from another configuration by\n applying one or more of the following operations. The list of operations\n is expected to slowly grow over time.\n\n * Replace an image ID with another image ID. The two IDs must identify\n images that were imported with the same metadata.\n"]
2894 fn check_configuration(
2895 &mut self,
2896
2897 request: ::fidl_next::Request<engine::CheckConfiguration, ___T>,
2898
2899 responder: ::fidl_next::Responder<engine::CheckConfiguration, ___T>,
2900 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2901
2902 #[doc = " Submits a configuration for future presentation on a display.\n"]
2903 fn submit_configuration(
2904 &mut self,
2905
2906 request: ::fidl_next::Request<engine::SubmitConfiguration, ___T>,
2907
2908 responder: ::fidl_next::Responder<engine::SubmitConfiguration, ___T>,
2909 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2910
2911 #[doc = " Conveys the display hardware\'s limitations on image buffers to sysmem.\n\n Fails with ZX_ERR_INTERNAL if any error occurs while communicating with\n the the Sysmem service.\n"]
2912 fn set_buffer_collection_constraints(
2913 &mut self,
2914
2915 request: ::fidl_next::Request<engine::SetBufferCollectionConstraints, ___T>,
2916
2917 responder: ::fidl_next::Responder<engine::SetBufferCollectionConstraints, ___T>,
2918 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2919
2920 #[doc = " Sets a display\'s power mode.\n\n Returns `ZX_ERR_NOT_SUPPORTED` if the display driver or hardware does\n not support the requested power mode.\n"]
2921 fn set_display_power_mode(
2922 &mut self,
2923
2924 request: ::fidl_next::Request<engine::SetDisplayPowerMode, ___T>,
2925
2926 responder: ::fidl_next::Responder<engine::SetDisplayPowerMode, ___T>,
2927 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2928
2929 #[doc = " Set the minimum value of RGB channels.\n\n Fails with ZX_ERR_NOT_SUPPORTED if RGB clamping is not supported. Most\n engine drivers are expected to fail in this manner.\n"]
2930 fn set_minimum_rgb(
2931 &mut self,
2932
2933 request: ::fidl_next::Request<engine::SetMinimumRgb, ___T>,
2934
2935 responder: ::fidl_next::Responder<engine::SetMinimumRgb, ___T>,
2936 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2937
2938 #[doc = " Starts a display capture operation.\n\n The engine driver must not be performing another capture operation. The\n capture operation is considered to be in-progress from the moment when a\n successful call to [`DisplayEngine.StartCapture`] is issued, until the\n moment when the engine driver issues a call to\n [`DisplayEngineListener.OnCaptureComplete`].\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n This call must only be issued after a configuration has been submitted to\n the display.\n\n Fails with ZX_ERR_IO_REFUSED if the display engine hardware failed to\n start the capture. This error could point to a systemic issue, such as\n the system having insufficient DRAM bandwidth to capture the most recent\n submitted display configuration. This error could also be caused by a\n temporary hardware failure.\n"]
2939 fn start_capture(
2940 &mut self,
2941
2942 request: ::fidl_next::Request<engine::StartCapture, ___T>,
2943
2944 responder: ::fidl_next::Responder<engine::StartCapture, ___T>,
2945 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2946
2947 #[doc = " Releases resources for using a buffer for display capture output.\n\n This call must only be issued when the engine driver supports capture.\n Capture support is reported in [`EngineInfo.is_capture_supported`]\n returned by [`Engine.CompleteCoordinatorConnection`].\n\n TODO(https://fxbug.dev/394954078): Make this method infallible.\n"]
2948 fn release_capture(
2949 &mut self,
2950
2951 request: ::fidl_next::Request<engine::ReleaseCapture, ___T>,
2952
2953 responder: ::fidl_next::Responder<engine::ReleaseCapture, ___T>,
2954 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2955
2956 fn on_unknown_interaction(
2957 &mut self,
2958 ordinal: u64,
2959 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2960 ::core::future::ready(())
2961 }
2962}
2963
2964impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Engine
2965where
2966 ___H: EngineServerHandler<___T> + ::core::marker::Send,
2967 ___T: ::fidl_next::Transport,
2968 for<'de> crate::wire::EngineCompleteCoordinatorConnectionRequest: ::fidl_next::Decode<
2969 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2970 Constraint = (),
2971 >,
2972 for<'de> crate::wire::EngineImportBufferCollectionRequest: ::fidl_next::Decode<
2973 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2974 Constraint = (),
2975 >,
2976 for<'de> crate::wire::EngineReleaseBufferCollectionRequest: ::fidl_next::Decode<
2977 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2978 Constraint = (),
2979 >,
2980 for<'de> crate::wire::EngineImportImageRequest: ::fidl_next::Decode<
2981 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2982 Constraint = (),
2983 >,
2984 for<'de> crate::wire::EngineImportImageForCaptureRequest: ::fidl_next::Decode<
2985 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2986 Constraint = (),
2987 >,
2988 for<'de> crate::wire::EngineReleaseImageRequest: ::fidl_next::Decode<
2989 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2990 Constraint = (),
2991 >,
2992 for<'de> crate::wire::EngineCheckConfigurationRequest<'de>: ::fidl_next::Decode<
2993 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2994 Constraint = (),
2995 >,
2996 for<'de> crate::wire::EngineSubmitConfigurationRequest<'de>: ::fidl_next::Decode<
2997 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2998 Constraint = (),
2999 >,
3000 for<'de> crate::wire::EngineSetBufferCollectionConstraintsRequest: ::fidl_next::Decode<
3001 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3002 Constraint = (),
3003 >,
3004 for<'de> crate::wire::EngineSetDisplayPowerModeRequest: ::fidl_next::Decode<
3005 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3006 Constraint = (),
3007 >,
3008 for<'de> crate::wire::EngineSetMinimumRgbRequest: ::fidl_next::Decode<
3009 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3010 Constraint = (),
3011 >,
3012 for<'de> crate::wire::EngineStartCaptureRequest: ::fidl_next::Decode<
3013 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3014 Constraint = (),
3015 >,
3016 for<'de> crate::wire::EngineReleaseCaptureRequest: ::fidl_next::Decode<
3017 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3018 Constraint = (),
3019 >,
3020{
3021 async fn on_one_way(
3022 handler: &mut ___H,
3023 mut message: ::fidl_next::Message<___T>,
3024 ) -> ::core::result::Result<
3025 (),
3026 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3027 > {
3028 match *message.header().ordinal {
3029 4508514133213543013 => {
3030 handler.unset_listener().await;
3031 Ok(())
3032 }
3033
3034 6459043979932149875 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3035 Ok(decoded) => {
3036 handler.release_image(::fidl_next::Request::from_decoded(decoded)).await;
3037 Ok(())
3038 }
3039 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3040 ordinal: 6459043979932149875,
3041 error,
3042 }),
3043 },
3044
3045 ordinal => {
3046 handler.on_unknown_interaction(ordinal).await;
3047 if ::core::matches!(
3048 message.header().flexibility(),
3049 ::fidl_next::protocol::Flexibility::Strict
3050 ) {
3051 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3052 } else {
3053 Ok(())
3054 }
3055 }
3056 }
3057 }
3058
3059 async fn on_two_way(
3060 handler: &mut ___H,
3061 mut message: ::fidl_next::Message<___T>,
3062 responder: ::fidl_next::protocol::Responder<___T>,
3063 ) -> ::core::result::Result<
3064 (),
3065 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3066 > {
3067 match *message.header().ordinal {
3068 4719180934271355554 => {
3069 let responder = ::fidl_next::Responder::from_untyped(responder);
3070
3071 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3072 Ok(decoded) => {
3073 handler
3074 .complete_coordinator_connection(
3075 ::fidl_next::Request::from_decoded(decoded),
3076 responder,
3077 )
3078 .await;
3079 Ok(())
3080 }
3081 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3082 ordinal: 4719180934271355554,
3083 error,
3084 }),
3085 }
3086 }
3087
3088 8961031870138211399 => {
3089 let responder = ::fidl_next::Responder::from_untyped(responder);
3090
3091 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3092 Ok(decoded) => {
3093 handler
3094 .import_buffer_collection(
3095 ::fidl_next::Request::from_decoded(decoded),
3096 responder,
3097 )
3098 .await;
3099 Ok(())
3100 }
3101 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3102 ordinal: 8961031870138211399,
3103 error,
3104 }),
3105 }
3106 }
3107
3108 2508731447035556384 => {
3109 let responder = ::fidl_next::Responder::from_untyped(responder);
3110
3111 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3112 Ok(decoded) => {
3113 handler
3114 .release_buffer_collection(
3115 ::fidl_next::Request::from_decoded(decoded),
3116 responder,
3117 )
3118 .await;
3119 Ok(())
3120 }
3121 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3122 ordinal: 2508731447035556384,
3123 error,
3124 }),
3125 }
3126 }
3127
3128 1516259966324606179 => {
3129 let responder = ::fidl_next::Responder::from_untyped(responder);
3130
3131 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3132 Ok(decoded) => {
3133 handler
3134 .import_image(::fidl_next::Request::from_decoded(decoded), responder)
3135 .await;
3136 Ok(())
3137 }
3138 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3139 ordinal: 1516259966324606179,
3140 error,
3141 }),
3142 }
3143 }
3144
3145 3283558293035659501 => {
3146 let responder = ::fidl_next::Responder::from_untyped(responder);
3147
3148 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3149 Ok(decoded) => {
3150 handler
3151 .import_image_for_capture(
3152 ::fidl_next::Request::from_decoded(decoded),
3153 responder,
3154 )
3155 .await;
3156 Ok(())
3157 }
3158 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3159 ordinal: 3283558293035659501,
3160 error,
3161 }),
3162 }
3163 }
3164
3165 4576283536204609126 => {
3166 let responder = ::fidl_next::Responder::from_untyped(responder);
3167
3168 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3169 Ok(decoded) => {
3170 handler
3171 .check_configuration(
3172 ::fidl_next::Request::from_decoded(decoded),
3173 responder,
3174 )
3175 .await;
3176 Ok(())
3177 }
3178 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3179 ordinal: 4576283536204609126,
3180 error,
3181 }),
3182 }
3183 }
3184
3185 9026752285186828733 => {
3186 let responder = ::fidl_next::Responder::from_untyped(responder);
3187
3188 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3189 Ok(decoded) => {
3190 handler
3191 .submit_configuration(
3192 ::fidl_next::Request::from_decoded(decoded),
3193 responder,
3194 )
3195 .await;
3196 Ok(())
3197 }
3198 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3199 ordinal: 9026752285186828733,
3200 error,
3201 }),
3202 }
3203 }
3204
3205 7576937804079032425 => {
3206 let responder = ::fidl_next::Responder::from_untyped(responder);
3207
3208 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3209 Ok(decoded) => {
3210 handler
3211 .set_buffer_collection_constraints(
3212 ::fidl_next::Request::from_decoded(decoded),
3213 responder,
3214 )
3215 .await;
3216 Ok(())
3217 }
3218 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3219 ordinal: 7576937804079032425,
3220 error,
3221 }),
3222 }
3223 }
3224
3225 5705800673802517194 => {
3226 let responder = ::fidl_next::Responder::from_untyped(responder);
3227
3228 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3229 Ok(decoded) => {
3230 handler
3231 .set_display_power_mode(
3232 ::fidl_next::Request::from_decoded(decoded),
3233 responder,
3234 )
3235 .await;
3236 Ok(())
3237 }
3238 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3239 ordinal: 5705800673802517194,
3240 error,
3241 }),
3242 }
3243 }
3244
3245 467617817871655038 => {
3246 let responder = ::fidl_next::Responder::from_untyped(responder);
3247
3248 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3249 Ok(decoded) => {
3250 handler
3251 .set_minimum_rgb(::fidl_next::Request::from_decoded(decoded), responder)
3252 .await;
3253 Ok(())
3254 }
3255 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3256 ordinal: 467617817871655038,
3257 error,
3258 }),
3259 }
3260 }
3261
3262 5123505813133388436 => {
3263 let responder = ::fidl_next::Responder::from_untyped(responder);
3264
3265 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3266 Ok(decoded) => {
3267 handler
3268 .start_capture(::fidl_next::Request::from_decoded(decoded), responder)
3269 .await;
3270 Ok(())
3271 }
3272 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3273 ordinal: 5123505813133388436,
3274 error,
3275 }),
3276 }
3277 }
3278
3279 3688105504043873248 => {
3280 let responder = ::fidl_next::Responder::from_untyped(responder);
3281
3282 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3283 Ok(decoded) => {
3284 handler
3285 .release_capture(::fidl_next::Request::from_decoded(decoded), responder)
3286 .await;
3287 Ok(())
3288 }
3289 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3290 ordinal: 3688105504043873248,
3291 error,
3292 }),
3293 }
3294 }
3295
3296 ordinal => {
3297 handler.on_unknown_interaction(ordinal).await;
3298 if ::core::matches!(
3299 message.header().flexibility(),
3300 ::fidl_next::protocol::Flexibility::Strict
3301 ) {
3302 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3303 } else {
3304 responder
3305 .respond_framework_error(
3306 ordinal,
3307 ::fidl_next::FrameworkError::UnknownMethod,
3308 )
3309 .expect("encoding a framework error should never fail")
3310 .await?;
3311 Ok(())
3312 }
3313 }
3314 }
3315 }
3316}
3317
3318impl<___T> EngineClientHandler<___T> for ::fidl_next::IgnoreEvents
3319where
3320 ___T: ::fidl_next::Transport,
3321{
3322 async fn on_unknown_interaction(&mut self, _: u64) {}
3323}
3324
3325impl<___H, ___T> EngineLocalClientHandler<___T> for ::fidl_next::Local<___H>
3326where
3327 ___H: EngineClientHandler<___T>,
3328 ___T: ::fidl_next::Transport,
3329{
3330 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3331 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3332 }
3333}
3334
3335impl<___H, ___T> EngineLocalServerHandler<___T> for ::fidl_next::Local<___H>
3336where
3337 ___H: EngineServerHandler<___T>,
3338 ___T: ::fidl_next::Transport,
3339{
3340 async fn complete_coordinator_connection(
3341 &mut self,
3342
3343 request: ::fidl_next::Request<engine::CompleteCoordinatorConnection, ___T>,
3344
3345 responder: ::fidl_next::Responder<engine::CompleteCoordinatorConnection, ___T>,
3346 ) {
3347 ___H::complete_coordinator_connection(&mut self.0, request, responder).await
3348 }
3349
3350 async fn unset_listener(&mut self) {
3351 ___H::unset_listener(&mut self.0).await
3352 }
3353
3354 async fn import_buffer_collection(
3355 &mut self,
3356
3357 request: ::fidl_next::Request<engine::ImportBufferCollection, ___T>,
3358
3359 responder: ::fidl_next::Responder<engine::ImportBufferCollection, ___T>,
3360 ) {
3361 ___H::import_buffer_collection(&mut self.0, request, responder).await
3362 }
3363
3364 async fn release_buffer_collection(
3365 &mut self,
3366
3367 request: ::fidl_next::Request<engine::ReleaseBufferCollection, ___T>,
3368
3369 responder: ::fidl_next::Responder<engine::ReleaseBufferCollection, ___T>,
3370 ) {
3371 ___H::release_buffer_collection(&mut self.0, request, responder).await
3372 }
3373
3374 async fn import_image(
3375 &mut self,
3376
3377 request: ::fidl_next::Request<engine::ImportImage, ___T>,
3378
3379 responder: ::fidl_next::Responder<engine::ImportImage, ___T>,
3380 ) {
3381 ___H::import_image(&mut self.0, request, responder).await
3382 }
3383
3384 async fn import_image_for_capture(
3385 &mut self,
3386
3387 request: ::fidl_next::Request<engine::ImportImageForCapture, ___T>,
3388
3389 responder: ::fidl_next::Responder<engine::ImportImageForCapture, ___T>,
3390 ) {
3391 ___H::import_image_for_capture(&mut self.0, request, responder).await
3392 }
3393
3394 async fn release_image(&mut self, request: ::fidl_next::Request<engine::ReleaseImage, ___T>) {
3395 ___H::release_image(&mut self.0, request).await
3396 }
3397
3398 async fn check_configuration(
3399 &mut self,
3400
3401 request: ::fidl_next::Request<engine::CheckConfiguration, ___T>,
3402
3403 responder: ::fidl_next::Responder<engine::CheckConfiguration, ___T>,
3404 ) {
3405 ___H::check_configuration(&mut self.0, request, responder).await
3406 }
3407
3408 async fn submit_configuration(
3409 &mut self,
3410
3411 request: ::fidl_next::Request<engine::SubmitConfiguration, ___T>,
3412
3413 responder: ::fidl_next::Responder<engine::SubmitConfiguration, ___T>,
3414 ) {
3415 ___H::submit_configuration(&mut self.0, request, responder).await
3416 }
3417
3418 async fn set_buffer_collection_constraints(
3419 &mut self,
3420
3421 request: ::fidl_next::Request<engine::SetBufferCollectionConstraints, ___T>,
3422
3423 responder: ::fidl_next::Responder<engine::SetBufferCollectionConstraints, ___T>,
3424 ) {
3425 ___H::set_buffer_collection_constraints(&mut self.0, request, responder).await
3426 }
3427
3428 async fn set_display_power_mode(
3429 &mut self,
3430
3431 request: ::fidl_next::Request<engine::SetDisplayPowerMode, ___T>,
3432
3433 responder: ::fidl_next::Responder<engine::SetDisplayPowerMode, ___T>,
3434 ) {
3435 ___H::set_display_power_mode(&mut self.0, request, responder).await
3436 }
3437
3438 async fn set_minimum_rgb(
3439 &mut self,
3440
3441 request: ::fidl_next::Request<engine::SetMinimumRgb, ___T>,
3442
3443 responder: ::fidl_next::Responder<engine::SetMinimumRgb, ___T>,
3444 ) {
3445 ___H::set_minimum_rgb(&mut self.0, request, responder).await
3446 }
3447
3448 async fn start_capture(
3449 &mut self,
3450
3451 request: ::fidl_next::Request<engine::StartCapture, ___T>,
3452
3453 responder: ::fidl_next::Responder<engine::StartCapture, ___T>,
3454 ) {
3455 ___H::start_capture(&mut self.0, request, responder).await
3456 }
3457
3458 async fn release_capture(
3459 &mut self,
3460
3461 request: ::fidl_next::Request<engine::ReleaseCapture, ___T>,
3462
3463 responder: ::fidl_next::Responder<engine::ReleaseCapture, ___T>,
3464 ) {
3465 ___H::release_capture(&mut self.0, request, responder).await
3466 }
3467
3468 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3469 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3470 }
3471}
3472
3473#[doc = " Receives events on a display engine.\n\n An [`EngineListener`] may be registered to the engine through the [`Engine`]\n protocol before it receives any events.\n\n This protocol only consists of one-way calls.\n\n This protocol is `open` while under development.\n TODO(https://fxbug.dev/316631158): Make it `closed` once the API is\n stabilized.\n"]
3475#[derive(PartialEq, Debug)]
3476pub struct EngineListener;
3477
3478#[cfg(feature = "driver")]
3479impl ::fidl_next::HasTransport for EngineListener {
3480 type Transport = ::fdf_fidl::DriverChannel;
3481}
3482
3483pub mod engine_listener {
3484 pub mod prelude {
3485 pub use crate::{
3486 EngineListener, EngineListenerClientHandler, EngineListenerLocalClientHandler,
3487 EngineListenerLocalServerHandler, EngineListenerServerHandler, engine_listener,
3488 };
3489
3490 pub use crate::natural::EngineListenerOnDisplayAddedRequest;
3491
3492 pub use crate::natural::EngineListenerOnDisplayRemovedRequest;
3493
3494 pub use crate::natural::EngineListenerOnDisplayVsyncRequest;
3495 }
3496
3497 pub struct OnDisplayAdded;
3498
3499 impl ::fidl_next::Method for OnDisplayAdded {
3500 const ORDINAL: u64 = 3220423251436056426;
3501 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3502 ::fidl_next::protocol::Flexibility::Flexible;
3503
3504 type Protocol = crate::EngineListener;
3505
3506 type Request = crate::wire::EngineListenerOnDisplayAddedRequest<'static>;
3507 }
3508
3509 pub struct OnDisplayRemoved;
3510
3511 impl ::fidl_next::Method for OnDisplayRemoved {
3512 const ORDINAL: u64 = 3153620152826807875;
3513 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3514 ::fidl_next::protocol::Flexibility::Flexible;
3515
3516 type Protocol = crate::EngineListener;
3517
3518 type Request = crate::wire::EngineListenerOnDisplayRemovedRequest;
3519 }
3520
3521 pub struct OnDisplayVsync;
3522
3523 impl ::fidl_next::Method for OnDisplayVsync {
3524 const ORDINAL: u64 = 6471622073769176491;
3525 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3526 ::fidl_next::protocol::Flexibility::Flexible;
3527
3528 type Protocol = crate::EngineListener;
3529
3530 type Request = crate::wire::EngineListenerOnDisplayVsyncRequest;
3531 }
3532
3533 pub struct OnCaptureComplete;
3534
3535 impl ::fidl_next::Method for OnCaptureComplete {
3536 const ORDINAL: u64 = 8243639424116846906;
3537 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3538 ::fidl_next::protocol::Flexibility::Flexible;
3539
3540 type Protocol = crate::EngineListener;
3541
3542 type Request = ::fidl_next::wire::EmptyMessageBody;
3543 }
3544
3545 mod ___detail {
3546 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::EngineListener
3547 where
3548 ___T: ::fidl_next::Transport,
3549 {
3550 type Client = EngineListenerClient<___T>;
3551 type Server = EngineListenerServer<___T>;
3552 }
3553
3554 #[repr(transparent)]
3556 pub struct EngineListenerClient<___T: ::fidl_next::Transport> {
3557 #[allow(dead_code)]
3558 client: ::fidl_next::protocol::Client<___T>,
3559 }
3560
3561 impl<___T> EngineListenerClient<___T>
3562 where
3563 ___T: ::fidl_next::Transport,
3564 {
3565 #[doc = " Called when a display is connected.\n\n Display Engine drivers must emit this event for all displays connected\n prior to initialization.\n"]
3566 pub fn on_display_added(
3567 &self,
3568
3569 display_info: impl ::fidl_next::Encode<
3570 crate::wire::RawDisplayInfo<'static>,
3571 <___T as ::fidl_next::Transport>::SendBuffer,
3572 >,
3573 ) -> ::fidl_next::SendFuture<'_, ___T>
3574 where
3575 <___T as ::fidl_next::Transport>::SendBuffer:
3576 ::fidl_next::encoder::InternalHandleEncoder,
3577 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3578 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3579 {
3580 self.on_display_added_with(crate::generic::EngineListenerOnDisplayAddedRequest {
3581 display_info,
3582 })
3583 }
3584
3585 #[doc = " Called when a display is connected.\n\n Display Engine drivers must emit this event for all displays connected\n prior to initialization.\n"]
3586 pub fn on_display_added_with<___R>(
3587 &self,
3588 request: ___R,
3589 ) -> ::fidl_next::SendFuture<'_, ___T>
3590 where
3591 ___R: ::fidl_next::Encode<
3592 crate::wire::EngineListenerOnDisplayAddedRequest<'static>,
3593 <___T as ::fidl_next::Transport>::SendBuffer,
3594 >,
3595 {
3596 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3597 3220423251436056426,
3598 <super::OnDisplayAdded as ::fidl_next::Method>::FLEXIBILITY,
3599 request,
3600 ))
3601 }
3602
3603 #[doc = " Called when a display is removed.\n\n Display Engine drivers must have finished accessing all images which\n were on the removed display before calling this method.\n"]
3604 pub fn on_display_removed(
3605 &self,
3606
3607 display_id: impl ::fidl_next::Encode<
3608 ::fidl_next_fuchsia_hardware_display_types::wire::DisplayId,
3609 <___T as ::fidl_next::Transport>::SendBuffer,
3610 >,
3611 ) -> ::fidl_next::SendFuture<'_, ___T>
3612 where
3613 <___T as ::fidl_next::Transport>::SendBuffer:
3614 ::fidl_next::encoder::InternalHandleEncoder,
3615 {
3616 self.on_display_removed_with(
3617 crate::generic::EngineListenerOnDisplayRemovedRequest { display_id },
3618 )
3619 }
3620
3621 #[doc = " Called when a display is removed.\n\n Display Engine drivers must have finished accessing all images which\n were on the removed display before calling this method.\n"]
3622 pub fn on_display_removed_with<___R>(
3623 &self,
3624 request: ___R,
3625 ) -> ::fidl_next::SendFuture<'_, ___T>
3626 where
3627 ___R: ::fidl_next::Encode<
3628 crate::wire::EngineListenerOnDisplayRemovedRequest,
3629 <___T as ::fidl_next::Transport>::SendBuffer,
3630 >,
3631 {
3632 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3633 3153620152826807875,
3634 <super::OnDisplayRemoved as ::fidl_next::Method>::FLEXIBILITY,
3635 request,
3636 ))
3637 }
3638
3639 #[doc = " Called when a display finished showing a configuration.\n"]
3640 pub fn on_display_vsync(
3641 &self,
3642
3643 display_id: impl ::fidl_next::Encode<
3644 ::fidl_next_fuchsia_hardware_display_types::wire::DisplayId,
3645 <___T as ::fidl_next::Transport>::SendBuffer,
3646 >,
3647
3648 timestamp: impl ::fidl_next::Encode<
3649 ::fidl_next::wire::Int64,
3650 <___T as ::fidl_next::Transport>::SendBuffer,
3651 >,
3652
3653 config_stamp: impl ::fidl_next::Encode<
3654 crate::wire::ConfigStamp,
3655 <___T as ::fidl_next::Transport>::SendBuffer,
3656 >,
3657 ) -> ::fidl_next::SendFuture<'_, ___T>
3658 where
3659 <___T as ::fidl_next::Transport>::SendBuffer:
3660 ::fidl_next::encoder::InternalHandleEncoder,
3661 {
3662 self.on_display_vsync_with(crate::generic::EngineListenerOnDisplayVsyncRequest {
3663 display_id,
3664
3665 timestamp,
3666
3667 config_stamp,
3668 })
3669 }
3670
3671 #[doc = " Called when a display finished showing a configuration.\n"]
3672 pub fn on_display_vsync_with<___R>(
3673 &self,
3674 request: ___R,
3675 ) -> ::fidl_next::SendFuture<'_, ___T>
3676 where
3677 ___R: ::fidl_next::Encode<
3678 crate::wire::EngineListenerOnDisplayVsyncRequest,
3679 <___T as ::fidl_next::Transport>::SendBuffer,
3680 >,
3681 {
3682 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3683 6471622073769176491,
3684 <super::OnDisplayVsync as ::fidl_next::Method>::FLEXIBILITY,
3685 request,
3686 ))
3687 }
3688
3689 #[doc = " Called when a previous display capture triggered by\n [`Engine.StartCapture`] is completed.\n\n The display engine only emits [`OnCaptureComplete`] events if capture is\n supported. Capture support is reported in\n [`EngineInfo.is_capture_supported`] returned by\n [`Engine.CompleteCoordinatorConnection`].\n"]
3690 pub fn on_capture_complete(&self) -> ::fidl_next::SendFuture<'_, ___T> {
3691 ::fidl_next::SendFuture::from_untyped(
3692 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
3693 8243639424116846906,
3694 <super::OnCaptureComplete as ::fidl_next::Method>::FLEXIBILITY,
3695 (),
3696 ),
3697 )
3698 }
3699 }
3700
3701 #[repr(transparent)]
3703 pub struct EngineListenerServer<___T: ::fidl_next::Transport> {
3704 server: ::fidl_next::protocol::Server<___T>,
3705 }
3706
3707 impl<___T> EngineListenerServer<___T> where ___T: ::fidl_next::Transport {}
3708 }
3709}
3710
3711#[diagnostic::on_unimplemented(
3712 note = "If {Self} implements the non-local EngineListenerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3713)]
3714
3715pub trait EngineListenerLocalClientHandler<
3719 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3720 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3721>
3722{
3723 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3724 ::core::future::ready(())
3725 }
3726}
3727
3728impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for EngineListener
3729where
3730 ___H: EngineListenerLocalClientHandler<___T>,
3731 ___T: ::fidl_next::Transport,
3732{
3733 async fn on_event(
3734 handler: &mut ___H,
3735 mut message: ::fidl_next::Message<___T>,
3736 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3737 match *message.header().ordinal {
3738 ordinal => {
3739 handler.on_unknown_interaction(ordinal).await;
3740 if ::core::matches!(
3741 message.header().flexibility(),
3742 ::fidl_next::protocol::Flexibility::Strict
3743 ) {
3744 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3745 } else {
3746 Ok(())
3747 }
3748 }
3749 }
3750 }
3751}
3752
3753#[diagnostic::on_unimplemented(
3754 note = "If {Self} implements the non-local EngineListenerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3755)]
3756
3757pub trait EngineListenerLocalServerHandler<
3761 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3762 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3763>
3764{
3765 #[doc = " Called when a display is connected.\n\n Display Engine drivers must emit this event for all displays connected\n prior to initialization.\n"]
3766 fn on_display_added(
3767 &mut self,
3768
3769 request: ::fidl_next::Request<engine_listener::OnDisplayAdded, ___T>,
3770 ) -> impl ::core::future::Future<Output = ()>;
3771
3772 #[doc = " Called when a display is removed.\n\n Display Engine drivers must have finished accessing all images which\n were on the removed display before calling this method.\n"]
3773 fn on_display_removed(
3774 &mut self,
3775
3776 request: ::fidl_next::Request<engine_listener::OnDisplayRemoved, ___T>,
3777 ) -> impl ::core::future::Future<Output = ()>;
3778
3779 #[doc = " Called when a display finished showing a configuration.\n"]
3780 fn on_display_vsync(
3781 &mut self,
3782
3783 request: ::fidl_next::Request<engine_listener::OnDisplayVsync, ___T>,
3784 ) -> impl ::core::future::Future<Output = ()>;
3785
3786 #[doc = " Called when a previous display capture triggered by\n [`Engine.StartCapture`] is completed.\n\n The display engine only emits [`OnCaptureComplete`] events if capture is\n supported. Capture support is reported in\n [`EngineInfo.is_capture_supported`] returned by\n [`Engine.CompleteCoordinatorConnection`].\n"]
3787 fn on_capture_complete(&mut self) -> impl ::core::future::Future<Output = ()>;
3788
3789 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3790 ::core::future::ready(())
3791 }
3792}
3793
3794impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for EngineListener
3795where
3796 ___H: EngineListenerLocalServerHandler<___T>,
3797 ___T: ::fidl_next::Transport,
3798 for<'de> crate::wire::EngineListenerOnDisplayAddedRequest<'de>: ::fidl_next::Decode<
3799 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3800 Constraint = (),
3801 >,
3802 for<'de> crate::wire::EngineListenerOnDisplayRemovedRequest: ::fidl_next::Decode<
3803 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3804 Constraint = (),
3805 >,
3806 for<'de> crate::wire::EngineListenerOnDisplayVsyncRequest: ::fidl_next::Decode<
3807 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3808 Constraint = (),
3809 >,
3810{
3811 async fn on_one_way(
3812 handler: &mut ___H,
3813 mut message: ::fidl_next::Message<___T>,
3814 ) -> ::core::result::Result<
3815 (),
3816 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3817 > {
3818 match *message.header().ordinal {
3819 3220423251436056426 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3820 Ok(decoded) => {
3821 handler.on_display_added(::fidl_next::Request::from_decoded(decoded)).await;
3822 Ok(())
3823 }
3824 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3825 ordinal: 3220423251436056426,
3826 error,
3827 }),
3828 },
3829
3830 3153620152826807875 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3831 Ok(decoded) => {
3832 handler.on_display_removed(::fidl_next::Request::from_decoded(decoded)).await;
3833 Ok(())
3834 }
3835 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3836 ordinal: 3153620152826807875,
3837 error,
3838 }),
3839 },
3840
3841 6471622073769176491 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3842 Ok(decoded) => {
3843 handler.on_display_vsync(::fidl_next::Request::from_decoded(decoded)).await;
3844 Ok(())
3845 }
3846 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3847 ordinal: 6471622073769176491,
3848 error,
3849 }),
3850 },
3851
3852 8243639424116846906 => {
3853 handler.on_capture_complete().await;
3854 Ok(())
3855 }
3856
3857 ordinal => {
3858 handler.on_unknown_interaction(ordinal).await;
3859 if ::core::matches!(
3860 message.header().flexibility(),
3861 ::fidl_next::protocol::Flexibility::Strict
3862 ) {
3863 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3864 } else {
3865 Ok(())
3866 }
3867 }
3868 }
3869 }
3870
3871 async fn on_two_way(
3872 handler: &mut ___H,
3873 mut message: ::fidl_next::Message<___T>,
3874 responder: ::fidl_next::protocol::Responder<___T>,
3875 ) -> ::core::result::Result<
3876 (),
3877 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3878 > {
3879 match *message.header().ordinal {
3880 ordinal => {
3881 handler.on_unknown_interaction(ordinal).await;
3882 if ::core::matches!(
3883 message.header().flexibility(),
3884 ::fidl_next::protocol::Flexibility::Strict
3885 ) {
3886 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3887 } else {
3888 responder
3889 .respond_framework_error(
3890 ordinal,
3891 ::fidl_next::FrameworkError::UnknownMethod,
3892 )
3893 .expect("encoding a framework error should never fail")
3894 .await?;
3895 Ok(())
3896 }
3897 }
3898 }
3899 }
3900}
3901
3902pub trait EngineListenerClientHandler<
3906 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3907 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3908>
3909{
3910 fn on_unknown_interaction(
3911 &mut self,
3912 ordinal: u64,
3913 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3914 ::core::future::ready(())
3915 }
3916}
3917
3918impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for EngineListener
3919where
3920 ___H: EngineListenerClientHandler<___T> + ::core::marker::Send,
3921 ___T: ::fidl_next::Transport,
3922{
3923 async fn on_event(
3924 handler: &mut ___H,
3925 mut message: ::fidl_next::Message<___T>,
3926 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3927 match *message.header().ordinal {
3928 ordinal => {
3929 handler.on_unknown_interaction(ordinal).await;
3930 if ::core::matches!(
3931 message.header().flexibility(),
3932 ::fidl_next::protocol::Flexibility::Strict
3933 ) {
3934 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3935 } else {
3936 Ok(())
3937 }
3938 }
3939 }
3940 }
3941}
3942
3943pub trait EngineListenerServerHandler<
3947 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3948 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3949>
3950{
3951 #[doc = " Called when a display is connected.\n\n Display Engine drivers must emit this event for all displays connected\n prior to initialization.\n"]
3952 fn on_display_added(
3953 &mut self,
3954
3955 request: ::fidl_next::Request<engine_listener::OnDisplayAdded, ___T>,
3956 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3957
3958 #[doc = " Called when a display is removed.\n\n Display Engine drivers must have finished accessing all images which\n were on the removed display before calling this method.\n"]
3959 fn on_display_removed(
3960 &mut self,
3961
3962 request: ::fidl_next::Request<engine_listener::OnDisplayRemoved, ___T>,
3963 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3964
3965 #[doc = " Called when a display finished showing a configuration.\n"]
3966 fn on_display_vsync(
3967 &mut self,
3968
3969 request: ::fidl_next::Request<engine_listener::OnDisplayVsync, ___T>,
3970 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3971
3972 #[doc = " Called when a previous display capture triggered by\n [`Engine.StartCapture`] is completed.\n\n The display engine only emits [`OnCaptureComplete`] events if capture is\n supported. Capture support is reported in\n [`EngineInfo.is_capture_supported`] returned by\n [`Engine.CompleteCoordinatorConnection`].\n"]
3973 fn on_capture_complete(
3974 &mut self,
3975 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3976
3977 fn on_unknown_interaction(
3978 &mut self,
3979 ordinal: u64,
3980 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3981 ::core::future::ready(())
3982 }
3983}
3984
3985impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for EngineListener
3986where
3987 ___H: EngineListenerServerHandler<___T> + ::core::marker::Send,
3988 ___T: ::fidl_next::Transport,
3989 for<'de> crate::wire::EngineListenerOnDisplayAddedRequest<'de>: ::fidl_next::Decode<
3990 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3991 Constraint = (),
3992 >,
3993 for<'de> crate::wire::EngineListenerOnDisplayRemovedRequest: ::fidl_next::Decode<
3994 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3995 Constraint = (),
3996 >,
3997 for<'de> crate::wire::EngineListenerOnDisplayVsyncRequest: ::fidl_next::Decode<
3998 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3999 Constraint = (),
4000 >,
4001{
4002 async fn on_one_way(
4003 handler: &mut ___H,
4004 mut message: ::fidl_next::Message<___T>,
4005 ) -> ::core::result::Result<
4006 (),
4007 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4008 > {
4009 match *message.header().ordinal {
4010 3220423251436056426 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4011 Ok(decoded) => {
4012 handler.on_display_added(::fidl_next::Request::from_decoded(decoded)).await;
4013 Ok(())
4014 }
4015 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4016 ordinal: 3220423251436056426,
4017 error,
4018 }),
4019 },
4020
4021 3153620152826807875 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4022 Ok(decoded) => {
4023 handler.on_display_removed(::fidl_next::Request::from_decoded(decoded)).await;
4024 Ok(())
4025 }
4026 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4027 ordinal: 3153620152826807875,
4028 error,
4029 }),
4030 },
4031
4032 6471622073769176491 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4033 Ok(decoded) => {
4034 handler.on_display_vsync(::fidl_next::Request::from_decoded(decoded)).await;
4035 Ok(())
4036 }
4037 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4038 ordinal: 6471622073769176491,
4039 error,
4040 }),
4041 },
4042
4043 8243639424116846906 => {
4044 handler.on_capture_complete().await;
4045 Ok(())
4046 }
4047
4048 ordinal => {
4049 handler.on_unknown_interaction(ordinal).await;
4050 if ::core::matches!(
4051 message.header().flexibility(),
4052 ::fidl_next::protocol::Flexibility::Strict
4053 ) {
4054 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4055 } else {
4056 Ok(())
4057 }
4058 }
4059 }
4060 }
4061
4062 async fn on_two_way(
4063 handler: &mut ___H,
4064 mut message: ::fidl_next::Message<___T>,
4065 responder: ::fidl_next::protocol::Responder<___T>,
4066 ) -> ::core::result::Result<
4067 (),
4068 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4069 > {
4070 match *message.header().ordinal {
4071 ordinal => {
4072 handler.on_unknown_interaction(ordinal).await;
4073 if ::core::matches!(
4074 message.header().flexibility(),
4075 ::fidl_next::protocol::Flexibility::Strict
4076 ) {
4077 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4078 } else {
4079 responder
4080 .respond_framework_error(
4081 ordinal,
4082 ::fidl_next::FrameworkError::UnknownMethod,
4083 )
4084 .expect("encoding a framework error should never fail")
4085 .await?;
4086 Ok(())
4087 }
4088 }
4089 }
4090 }
4091}
4092
4093impl<___T> EngineListenerClientHandler<___T> for ::fidl_next::IgnoreEvents
4094where
4095 ___T: ::fidl_next::Transport,
4096{
4097 async fn on_unknown_interaction(&mut self, _: u64) {}
4098}
4099
4100impl<___H, ___T> EngineListenerLocalClientHandler<___T> for ::fidl_next::Local<___H>
4101where
4102 ___H: EngineListenerClientHandler<___T>,
4103 ___T: ::fidl_next::Transport,
4104{
4105 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4106 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4107 }
4108}
4109
4110impl<___H, ___T> EngineListenerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4111where
4112 ___H: EngineListenerServerHandler<___T>,
4113 ___T: ::fidl_next::Transport,
4114{
4115 async fn on_display_added(
4116 &mut self,
4117
4118 request: ::fidl_next::Request<engine_listener::OnDisplayAdded, ___T>,
4119 ) {
4120 ___H::on_display_added(&mut self.0, request).await
4121 }
4122
4123 async fn on_display_removed(
4124 &mut self,
4125
4126 request: ::fidl_next::Request<engine_listener::OnDisplayRemoved, ___T>,
4127 ) {
4128 ___H::on_display_removed(&mut self.0, request).await
4129 }
4130
4131 async fn on_display_vsync(
4132 &mut self,
4133
4134 request: ::fidl_next::Request<engine_listener::OnDisplayVsync, ___T>,
4135 ) {
4136 ___H::on_display_vsync(&mut self.0, request).await
4137 }
4138
4139 async fn on_capture_complete(&mut self) {
4140 ___H::on_capture_complete(&mut self.0).await
4141 }
4142
4143 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4144 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4145 }
4146}
4147
4148#[derive(Debug)]
4150pub struct Service;
4151
4152impl ::fidl_next::DiscoverableService for Service {
4153 const SERVICE_NAME: &'static str = "fuchsia.hardware.display.engine.Service";
4154 const MEMBER_NAMES: &'static [&'static str] = &["engine"];
4155}
4156
4157impl ::fidl_next::HasServiceRequest<::fdf_fidl::DriverChannel> for Service {}
4158
4159impl<___C> ::fidl_next::Service<___C> for Service
4160where
4161 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
4162{
4163 type Connector = ServiceConnector<___C>;
4164}
4165
4166#[repr(transparent)]
4168pub struct ServiceConnector<___C> {
4169 #[allow(dead_code)]
4170 connector: ___C,
4171}
4172
4173impl<___C> ServiceConnector<___C>
4174where
4175 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
4176{
4177 pub fn engine(
4179 &self,
4180 server_end: ::fidl_next::ServerEnd<crate::Engine, ::fdf_fidl::DriverChannel>,
4181 ) -> ::core::result::Result<
4182 (),
4183 <___C as ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>>::Error,
4184 > {
4185 ::fidl_next::protocol::ServiceConnector::<::fdf_fidl::DriverChannel>::connect_to_member(
4186 &self.connector,
4187 "engine",
4188 server_end.into_untyped(),
4189 )
4190 }
4191}
4192
4193pub trait ServiceHandler {
4195 fn engine(&self, server_end: ::fidl_next::ServerEnd<crate::Engine, ::fdf_fidl::DriverChannel>);
4197}
4198
4199impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
4200where
4201 ___H: ServiceHandler,
4202 ::fdf_fidl::DriverChannel: ::fidl_next::InstanceFromServiceTransport<___T>,
4203{
4204 fn on_connection(handler: &___H, member: &str, server_end: ___T) {
4205 use ::fidl_next::InstanceFromServiceTransport;
4206 match member {
4207 "engine" => handler.engine(::fidl_next::ServerEnd::from_untyped(
4208 ::fdf_fidl::DriverChannel::from_service_transport(server_end),
4209 )),
4210
4211 _ => unreachable!(),
4212 }
4213 }
4214}
4215
4216pub use fidl_next_common_fuchsia_hardware_display_engine::*;