1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_camera3_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DeviceConnectToStreamRequest {
16 pub index: u32,
17 pub request: fidl::endpoints::ServerEnd<Stream_Marker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for DeviceConnectToStreamRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct DeviceRebindRequest {
27 pub request: fidl::endpoints::ServerEnd<DeviceMarker>,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DeviceRebindRequest {}
31
32#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33pub struct DeviceWatcherConnectToDeviceRequest {
34 pub id: u64,
35 pub request: fidl::endpoints::ServerEnd<DeviceMarker>,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39 for DeviceWatcherConnectToDeviceRequest
40{
41}
42
43#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
45pub struct FrameInfo {
46 pub buffer_index: u32,
49 pub frame_counter: u64,
53 pub timestamp: i64,
56 pub release_fence: fidl::EventPair,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo {}
61
62#[derive(Debug, PartialEq)]
63pub struct StreamGetNextFrame2Response {
64 pub info: FrameInfo2,
65}
66
67impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
68 for StreamGetNextFrame2Response
69{
70}
71
72#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73pub struct StreamGetNextFrameResponse {
74 pub info: FrameInfo,
75}
76
77impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
78 for StreamGetNextFrameResponse
79{
80}
81
82#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
83pub struct StreamRebindRequest {
84 pub request: fidl::endpoints::ServerEnd<Stream_Marker>,
85}
86
87impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StreamRebindRequest {}
88
89#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
90pub struct StreamSetBufferCollection2Request {
91 pub token:
92 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>>,
93}
94
95impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
96 for StreamSetBufferCollection2Request
97{
98}
99
100#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
101pub struct StreamSetBufferCollectionRequest {
102 pub token: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
103}
104
105impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
106 for StreamSetBufferCollectionRequest
107{
108}
109
110#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111pub struct StreamWatchBufferCollection2Response {
112 pub token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
113}
114
115impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
116 for StreamWatchBufferCollection2Response
117{
118}
119
120#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121pub struct StreamWatchBufferCollectionResponse {
122 pub token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
123}
124
125impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
126 for StreamWatchBufferCollectionResponse
127{
128}
129
130#[derive(Debug, Default, PartialEq)]
132pub struct FrameInfo2 {
133 pub buffer_index: Option<u32>,
136 pub frame_counter: Option<u64>,
140 pub timestamp: Option<i64>,
143 pub capture_timestamp: Option<i64>,
146 pub release_fence: Option<fidl::EventPair>,
148 #[doc(hidden)]
149 pub __source_breaking: fidl::marker::SourceBreaking,
150}
151
152impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo2 {}
153
154#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
155pub struct DeviceMarker;
156
157impl fidl::endpoints::ProtocolMarker for DeviceMarker {
158 type Proxy = DeviceProxy;
159 type RequestStream = DeviceRequestStream;
160 #[cfg(target_os = "fuchsia")]
161 type SynchronousProxy = DeviceSynchronousProxy;
162
163 const DEBUG_NAME: &'static str = "(anonymous) Device";
164}
165
166pub trait DeviceProxyInterface: Send + Sync {
167 type GetIdentifierResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
168 + Send;
169 fn r#get_identifier(&self) -> Self::GetIdentifierResponseFut;
170 type GetConfigurationsResponseFut: std::future::Future<Output = Result<Vec<Configuration>, fidl::Error>>
171 + Send;
172 fn r#get_configurations(&self) -> Self::GetConfigurationsResponseFut;
173 type GetConfigurations2ResponseFut: std::future::Future<Output = Result<Vec<Configuration2>, fidl::Error>>
174 + Send;
175 fn r#get_configurations2(&self) -> Self::GetConfigurations2ResponseFut;
176 type WatchCurrentConfigurationResponseFut: std::future::Future<Output = Result<u32, fidl::Error>>
177 + Send;
178 fn r#watch_current_configuration(&self) -> Self::WatchCurrentConfigurationResponseFut;
179 fn r#set_current_configuration(&self, index: u32) -> Result<(), fidl::Error>;
180 type WatchMuteStateResponseFut: std::future::Future<Output = Result<(bool, bool), fidl::Error>>
181 + Send;
182 fn r#watch_mute_state(&self) -> Self::WatchMuteStateResponseFut;
183 type SetSoftwareMuteStateResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
184 + Send;
185 fn r#set_software_mute_state(&self, muted: bool) -> Self::SetSoftwareMuteStateResponseFut;
186 fn r#connect_to_stream(
187 &self,
188 index: u32,
189 request: fidl::endpoints::ServerEnd<Stream_Marker>,
190 ) -> Result<(), fidl::Error>;
191 fn r#rebind(
192 &self,
193 request: fidl::endpoints::ServerEnd<DeviceMarker>,
194 ) -> Result<(), fidl::Error>;
195}
196#[derive(Debug)]
197#[cfg(target_os = "fuchsia")]
198pub struct DeviceSynchronousProxy {
199 client: fidl::client::sync::Client,
200}
201
202#[cfg(target_os = "fuchsia")]
203impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
204 type Proxy = DeviceProxy;
205 type Protocol = DeviceMarker;
206
207 fn from_channel(inner: fidl::Channel) -> Self {
208 Self::new(inner)
209 }
210
211 fn into_channel(self) -> fidl::Channel {
212 self.client.into_channel()
213 }
214
215 fn as_channel(&self) -> &fidl::Channel {
216 self.client.as_channel()
217 }
218}
219
220#[cfg(target_os = "fuchsia")]
221impl DeviceSynchronousProxy {
222 pub fn new(channel: fidl::Channel) -> Self {
223 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
224 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
225 }
226
227 pub fn into_channel(self) -> fidl::Channel {
228 self.client.into_channel()
229 }
230
231 pub fn wait_for_event(
234 &self,
235 deadline: zx::MonotonicInstant,
236 ) -> Result<DeviceEvent, fidl::Error> {
237 DeviceEvent::decode(self.client.wait_for_event(deadline)?)
238 }
239
240 pub fn r#get_identifier(
244 &self,
245 ___deadline: zx::MonotonicInstant,
246 ) -> Result<Option<String>, fidl::Error> {
247 let _response =
248 self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetIdentifierResponse>(
249 (),
250 0x1417d1af92667e47,
251 fidl::encoding::DynamicFlags::empty(),
252 ___deadline,
253 )?;
254 Ok(_response.identifier)
255 }
256
257 pub fn r#get_configurations(
261 &self,
262 ___deadline: zx::MonotonicInstant,
263 ) -> Result<Vec<Configuration>, fidl::Error> {
264 let _response = self
265 .client
266 .send_query::<fidl::encoding::EmptyPayload, DeviceGetConfigurationsResponse>(
267 (),
268 0x26c7a180d8eef786,
269 fidl::encoding::DynamicFlags::empty(),
270 ___deadline,
271 )?;
272 Ok(_response.configurations)
273 }
274
275 pub fn r#get_configurations2(
279 &self,
280 ___deadline: zx::MonotonicInstant,
281 ) -> Result<Vec<Configuration2>, fidl::Error> {
282 let _response = self
283 .client
284 .send_query::<fidl::encoding::EmptyPayload, DeviceGetConfigurations2Response>(
285 (),
286 0x2667155e740fb9ff,
287 fidl::encoding::DynamicFlags::empty(),
288 ___deadline,
289 )?;
290 Ok(_response.configurations)
291 }
292
293 pub fn r#watch_current_configuration(
296 &self,
297 ___deadline: zx::MonotonicInstant,
298 ) -> Result<u32, fidl::Error> {
299 let _response = self
300 .client
301 .send_query::<fidl::encoding::EmptyPayload, DeviceWatchCurrentConfigurationResponse>(
302 (),
303 0x7a82832a127834b7,
304 fidl::encoding::DynamicFlags::empty(),
305 ___deadline,
306 )?;
307 Ok(_response.index)
308 }
309
310 pub fn r#set_current_configuration(&self, mut index: u32) -> Result<(), fidl::Error> {
314 self.client.send::<DeviceSetCurrentConfigurationRequest>(
315 (index,),
316 0x11d65c8f92593b87,
317 fidl::encoding::DynamicFlags::empty(),
318 )
319 }
320
321 pub fn r#watch_mute_state(
326 &self,
327 ___deadline: zx::MonotonicInstant,
328 ) -> Result<(bool, bool), fidl::Error> {
329 let _response =
330 self.client.send_query::<fidl::encoding::EmptyPayload, DeviceWatchMuteStateResponse>(
331 (),
332 0x2bafd68e6e7ef2fb,
333 fidl::encoding::DynamicFlags::empty(),
334 ___deadline,
335 )?;
336 Ok((_response.software_muted, _response.hardware_muted))
337 }
338
339 pub fn r#set_software_mute_state(
343 &self,
344 mut muted: bool,
345 ___deadline: zx::MonotonicInstant,
346 ) -> Result<(), fidl::Error> {
347 let _response = self
348 .client
349 .send_query::<DeviceSetSoftwareMuteStateRequest, fidl::encoding::EmptyPayload>(
350 (muted,),
351 0x6bb19cb687f560a5,
352 fidl::encoding::DynamicFlags::empty(),
353 ___deadline,
354 )?;
355 Ok(_response)
356 }
357
358 pub fn r#connect_to_stream(
361 &self,
362 mut index: u32,
363 mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
364 ) -> Result<(), fidl::Error> {
365 self.client.send::<DeviceConnectToStreamRequest>(
366 (index, request),
367 0x290a86763174c4c3,
368 fidl::encoding::DynamicFlags::empty(),
369 )
370 }
371
372 pub fn r#rebind(
375 &self,
376 mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
377 ) -> Result<(), fidl::Error> {
378 self.client.send::<DeviceRebindRequest>(
379 (request,),
380 0x24811b7cee5c51c3,
381 fidl::encoding::DynamicFlags::empty(),
382 )
383 }
384}
385
386#[cfg(target_os = "fuchsia")]
387impl From<DeviceSynchronousProxy> for zx::Handle {
388 fn from(value: DeviceSynchronousProxy) -> Self {
389 value.into_channel().into()
390 }
391}
392
393#[cfg(target_os = "fuchsia")]
394impl From<fidl::Channel> for DeviceSynchronousProxy {
395 fn from(value: fidl::Channel) -> Self {
396 Self::new(value)
397 }
398}
399
400#[derive(Debug, Clone)]
401pub struct DeviceProxy {
402 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
403}
404
405impl fidl::endpoints::Proxy for DeviceProxy {
406 type Protocol = DeviceMarker;
407
408 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
409 Self::new(inner)
410 }
411
412 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
413 self.client.into_channel().map_err(|client| Self { client })
414 }
415
416 fn as_channel(&self) -> &::fidl::AsyncChannel {
417 self.client.as_channel()
418 }
419}
420
421impl DeviceProxy {
422 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
424 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
425 Self { client: fidl::client::Client::new(channel, protocol_name) }
426 }
427
428 pub fn take_event_stream(&self) -> DeviceEventStream {
434 DeviceEventStream { event_receiver: self.client.take_event_receiver() }
435 }
436
437 pub fn r#get_identifier(
441 &self,
442 ) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
443 {
444 DeviceProxyInterface::r#get_identifier(self)
445 }
446
447 pub fn r#get_configurations(
451 &self,
452 ) -> fidl::client::QueryResponseFut<
453 Vec<Configuration>,
454 fidl::encoding::DefaultFuchsiaResourceDialect,
455 > {
456 DeviceProxyInterface::r#get_configurations(self)
457 }
458
459 pub fn r#get_configurations2(
463 &self,
464 ) -> fidl::client::QueryResponseFut<
465 Vec<Configuration2>,
466 fidl::encoding::DefaultFuchsiaResourceDialect,
467 > {
468 DeviceProxyInterface::r#get_configurations2(self)
469 }
470
471 pub fn r#watch_current_configuration(
474 &self,
475 ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
476 DeviceProxyInterface::r#watch_current_configuration(self)
477 }
478
479 pub fn r#set_current_configuration(&self, mut index: u32) -> Result<(), fidl::Error> {
483 DeviceProxyInterface::r#set_current_configuration(self, index)
484 }
485
486 pub fn r#watch_mute_state(
491 &self,
492 ) -> fidl::client::QueryResponseFut<(bool, bool), fidl::encoding::DefaultFuchsiaResourceDialect>
493 {
494 DeviceProxyInterface::r#watch_mute_state(self)
495 }
496
497 pub fn r#set_software_mute_state(
501 &self,
502 mut muted: bool,
503 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
504 DeviceProxyInterface::r#set_software_mute_state(self, muted)
505 }
506
507 pub fn r#connect_to_stream(
510 &self,
511 mut index: u32,
512 mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
513 ) -> Result<(), fidl::Error> {
514 DeviceProxyInterface::r#connect_to_stream(self, index, request)
515 }
516
517 pub fn r#rebind(
520 &self,
521 mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
522 ) -> Result<(), fidl::Error> {
523 DeviceProxyInterface::r#rebind(self, request)
524 }
525}
526
527impl DeviceProxyInterface for DeviceProxy {
528 type GetIdentifierResponseFut = fidl::client::QueryResponseFut<
529 Option<String>,
530 fidl::encoding::DefaultFuchsiaResourceDialect,
531 >;
532 fn r#get_identifier(&self) -> Self::GetIdentifierResponseFut {
533 fn _decode(
534 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
535 ) -> Result<Option<String>, fidl::Error> {
536 let _response = fidl::client::decode_transaction_body::<
537 DeviceGetIdentifierResponse,
538 fidl::encoding::DefaultFuchsiaResourceDialect,
539 0x1417d1af92667e47,
540 >(_buf?)?;
541 Ok(_response.identifier)
542 }
543 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Option<String>>(
544 (),
545 0x1417d1af92667e47,
546 fidl::encoding::DynamicFlags::empty(),
547 _decode,
548 )
549 }
550
551 type GetConfigurationsResponseFut = fidl::client::QueryResponseFut<
552 Vec<Configuration>,
553 fidl::encoding::DefaultFuchsiaResourceDialect,
554 >;
555 fn r#get_configurations(&self) -> Self::GetConfigurationsResponseFut {
556 fn _decode(
557 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
558 ) -> Result<Vec<Configuration>, fidl::Error> {
559 let _response = fidl::client::decode_transaction_body::<
560 DeviceGetConfigurationsResponse,
561 fidl::encoding::DefaultFuchsiaResourceDialect,
562 0x26c7a180d8eef786,
563 >(_buf?)?;
564 Ok(_response.configurations)
565 }
566 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Configuration>>(
567 (),
568 0x26c7a180d8eef786,
569 fidl::encoding::DynamicFlags::empty(),
570 _decode,
571 )
572 }
573
574 type GetConfigurations2ResponseFut = fidl::client::QueryResponseFut<
575 Vec<Configuration2>,
576 fidl::encoding::DefaultFuchsiaResourceDialect,
577 >;
578 fn r#get_configurations2(&self) -> Self::GetConfigurations2ResponseFut {
579 fn _decode(
580 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
581 ) -> Result<Vec<Configuration2>, fidl::Error> {
582 let _response = fidl::client::decode_transaction_body::<
583 DeviceGetConfigurations2Response,
584 fidl::encoding::DefaultFuchsiaResourceDialect,
585 0x2667155e740fb9ff,
586 >(_buf?)?;
587 Ok(_response.configurations)
588 }
589 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Configuration2>>(
590 (),
591 0x2667155e740fb9ff,
592 fidl::encoding::DynamicFlags::empty(),
593 _decode,
594 )
595 }
596
597 type WatchCurrentConfigurationResponseFut =
598 fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
599 fn r#watch_current_configuration(&self) -> Self::WatchCurrentConfigurationResponseFut {
600 fn _decode(
601 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
602 ) -> Result<u32, fidl::Error> {
603 let _response = fidl::client::decode_transaction_body::<
604 DeviceWatchCurrentConfigurationResponse,
605 fidl::encoding::DefaultFuchsiaResourceDialect,
606 0x7a82832a127834b7,
607 >(_buf?)?;
608 Ok(_response.index)
609 }
610 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
611 (),
612 0x7a82832a127834b7,
613 fidl::encoding::DynamicFlags::empty(),
614 _decode,
615 )
616 }
617
618 fn r#set_current_configuration(&self, mut index: u32) -> Result<(), fidl::Error> {
619 self.client.send::<DeviceSetCurrentConfigurationRequest>(
620 (index,),
621 0x11d65c8f92593b87,
622 fidl::encoding::DynamicFlags::empty(),
623 )
624 }
625
626 type WatchMuteStateResponseFut =
627 fidl::client::QueryResponseFut<(bool, bool), fidl::encoding::DefaultFuchsiaResourceDialect>;
628 fn r#watch_mute_state(&self) -> Self::WatchMuteStateResponseFut {
629 fn _decode(
630 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
631 ) -> Result<(bool, bool), fidl::Error> {
632 let _response = fidl::client::decode_transaction_body::<
633 DeviceWatchMuteStateResponse,
634 fidl::encoding::DefaultFuchsiaResourceDialect,
635 0x2bafd68e6e7ef2fb,
636 >(_buf?)?;
637 Ok((_response.software_muted, _response.hardware_muted))
638 }
639 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (bool, bool)>(
640 (),
641 0x2bafd68e6e7ef2fb,
642 fidl::encoding::DynamicFlags::empty(),
643 _decode,
644 )
645 }
646
647 type SetSoftwareMuteStateResponseFut =
648 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
649 fn r#set_software_mute_state(&self, mut muted: bool) -> Self::SetSoftwareMuteStateResponseFut {
650 fn _decode(
651 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
652 ) -> Result<(), fidl::Error> {
653 let _response = fidl::client::decode_transaction_body::<
654 fidl::encoding::EmptyPayload,
655 fidl::encoding::DefaultFuchsiaResourceDialect,
656 0x6bb19cb687f560a5,
657 >(_buf?)?;
658 Ok(_response)
659 }
660 self.client.send_query_and_decode::<DeviceSetSoftwareMuteStateRequest, ()>(
661 (muted,),
662 0x6bb19cb687f560a5,
663 fidl::encoding::DynamicFlags::empty(),
664 _decode,
665 )
666 }
667
668 fn r#connect_to_stream(
669 &self,
670 mut index: u32,
671 mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
672 ) -> Result<(), fidl::Error> {
673 self.client.send::<DeviceConnectToStreamRequest>(
674 (index, request),
675 0x290a86763174c4c3,
676 fidl::encoding::DynamicFlags::empty(),
677 )
678 }
679
680 fn r#rebind(
681 &self,
682 mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
683 ) -> Result<(), fidl::Error> {
684 self.client.send::<DeviceRebindRequest>(
685 (request,),
686 0x24811b7cee5c51c3,
687 fidl::encoding::DynamicFlags::empty(),
688 )
689 }
690}
691
692pub struct DeviceEventStream {
693 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
694}
695
696impl std::marker::Unpin for DeviceEventStream {}
697
698impl futures::stream::FusedStream for DeviceEventStream {
699 fn is_terminated(&self) -> bool {
700 self.event_receiver.is_terminated()
701 }
702}
703
704impl futures::Stream for DeviceEventStream {
705 type Item = Result<DeviceEvent, fidl::Error>;
706
707 fn poll_next(
708 mut self: std::pin::Pin<&mut Self>,
709 cx: &mut std::task::Context<'_>,
710 ) -> std::task::Poll<Option<Self::Item>> {
711 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
712 &mut self.event_receiver,
713 cx
714 )?) {
715 Some(buf) => std::task::Poll::Ready(Some(DeviceEvent::decode(buf))),
716 None => std::task::Poll::Ready(None),
717 }
718 }
719}
720
721#[derive(Debug)]
722pub enum DeviceEvent {}
723
724impl DeviceEvent {
725 fn decode(
727 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
728 ) -> Result<DeviceEvent, fidl::Error> {
729 let (bytes, _handles) = buf.split_mut();
730 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
731 debug_assert_eq!(tx_header.tx_id, 0);
732 match tx_header.ordinal {
733 _ => Err(fidl::Error::UnknownOrdinal {
734 ordinal: tx_header.ordinal,
735 protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
736 }),
737 }
738 }
739}
740
741pub struct DeviceRequestStream {
743 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
744 is_terminated: bool,
745}
746
747impl std::marker::Unpin for DeviceRequestStream {}
748
749impl futures::stream::FusedStream for DeviceRequestStream {
750 fn is_terminated(&self) -> bool {
751 self.is_terminated
752 }
753}
754
755impl fidl::endpoints::RequestStream for DeviceRequestStream {
756 type Protocol = DeviceMarker;
757 type ControlHandle = DeviceControlHandle;
758
759 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
760 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
761 }
762
763 fn control_handle(&self) -> Self::ControlHandle {
764 DeviceControlHandle { inner: self.inner.clone() }
765 }
766
767 fn into_inner(
768 self,
769 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
770 {
771 (self.inner, self.is_terminated)
772 }
773
774 fn from_inner(
775 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
776 is_terminated: bool,
777 ) -> Self {
778 Self { inner, is_terminated }
779 }
780}
781
782impl futures::Stream for DeviceRequestStream {
783 type Item = Result<DeviceRequest, fidl::Error>;
784
785 fn poll_next(
786 mut self: std::pin::Pin<&mut Self>,
787 cx: &mut std::task::Context<'_>,
788 ) -> std::task::Poll<Option<Self::Item>> {
789 let this = &mut *self;
790 if this.inner.check_shutdown(cx) {
791 this.is_terminated = true;
792 return std::task::Poll::Ready(None);
793 }
794 if this.is_terminated {
795 panic!("polled DeviceRequestStream after completion");
796 }
797 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
798 |bytes, handles| {
799 match this.inner.channel().read_etc(cx, bytes, handles) {
800 std::task::Poll::Ready(Ok(())) => {}
801 std::task::Poll::Pending => return std::task::Poll::Pending,
802 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
803 this.is_terminated = true;
804 return std::task::Poll::Ready(None);
805 }
806 std::task::Poll::Ready(Err(e)) => {
807 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
808 e.into(),
809 ))))
810 }
811 }
812
813 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
815
816 std::task::Poll::Ready(Some(match header.ordinal {
817 0x1417d1af92667e47 => {
818 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
819 let mut req = fidl::new_empty!(
820 fidl::encoding::EmptyPayload,
821 fidl::encoding::DefaultFuchsiaResourceDialect
822 );
823 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
824 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
825 Ok(DeviceRequest::GetIdentifier {
826 responder: DeviceGetIdentifierResponder {
827 control_handle: std::mem::ManuallyDrop::new(control_handle),
828 tx_id: header.tx_id,
829 },
830 })
831 }
832 0x26c7a180d8eef786 => {
833 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
834 let mut req = fidl::new_empty!(
835 fidl::encoding::EmptyPayload,
836 fidl::encoding::DefaultFuchsiaResourceDialect
837 );
838 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
839 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
840 Ok(DeviceRequest::GetConfigurations {
841 responder: DeviceGetConfigurationsResponder {
842 control_handle: std::mem::ManuallyDrop::new(control_handle),
843 tx_id: header.tx_id,
844 },
845 })
846 }
847 0x2667155e740fb9ff => {
848 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
849 let mut req = fidl::new_empty!(
850 fidl::encoding::EmptyPayload,
851 fidl::encoding::DefaultFuchsiaResourceDialect
852 );
853 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
854 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
855 Ok(DeviceRequest::GetConfigurations2 {
856 responder: DeviceGetConfigurations2Responder {
857 control_handle: std::mem::ManuallyDrop::new(control_handle),
858 tx_id: header.tx_id,
859 },
860 })
861 }
862 0x7a82832a127834b7 => {
863 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
864 let mut req = fidl::new_empty!(
865 fidl::encoding::EmptyPayload,
866 fidl::encoding::DefaultFuchsiaResourceDialect
867 );
868 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
869 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
870 Ok(DeviceRequest::WatchCurrentConfiguration {
871 responder: DeviceWatchCurrentConfigurationResponder {
872 control_handle: std::mem::ManuallyDrop::new(control_handle),
873 tx_id: header.tx_id,
874 },
875 })
876 }
877 0x11d65c8f92593b87 => {
878 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
879 let mut req = fidl::new_empty!(
880 DeviceSetCurrentConfigurationRequest,
881 fidl::encoding::DefaultFuchsiaResourceDialect
882 );
883 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceSetCurrentConfigurationRequest>(&header, _body_bytes, handles, &mut req)?;
884 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
885 Ok(DeviceRequest::SetCurrentConfiguration {
886 index: req.index,
887
888 control_handle,
889 })
890 }
891 0x2bafd68e6e7ef2fb => {
892 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
893 let mut req = fidl::new_empty!(
894 fidl::encoding::EmptyPayload,
895 fidl::encoding::DefaultFuchsiaResourceDialect
896 );
897 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
898 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
899 Ok(DeviceRequest::WatchMuteState {
900 responder: DeviceWatchMuteStateResponder {
901 control_handle: std::mem::ManuallyDrop::new(control_handle),
902 tx_id: header.tx_id,
903 },
904 })
905 }
906 0x6bb19cb687f560a5 => {
907 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
908 let mut req = fidl::new_empty!(
909 DeviceSetSoftwareMuteStateRequest,
910 fidl::encoding::DefaultFuchsiaResourceDialect
911 );
912 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceSetSoftwareMuteStateRequest>(&header, _body_bytes, handles, &mut req)?;
913 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
914 Ok(DeviceRequest::SetSoftwareMuteState {
915 muted: req.muted,
916
917 responder: DeviceSetSoftwareMuteStateResponder {
918 control_handle: std::mem::ManuallyDrop::new(control_handle),
919 tx_id: header.tx_id,
920 },
921 })
922 }
923 0x290a86763174c4c3 => {
924 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
925 let mut req = fidl::new_empty!(
926 DeviceConnectToStreamRequest,
927 fidl::encoding::DefaultFuchsiaResourceDialect
928 );
929 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectToStreamRequest>(&header, _body_bytes, handles, &mut req)?;
930 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
931 Ok(DeviceRequest::ConnectToStream {
932 index: req.index,
933 request: req.request,
934
935 control_handle,
936 })
937 }
938 0x24811b7cee5c51c3 => {
939 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
940 let mut req = fidl::new_empty!(
941 DeviceRebindRequest,
942 fidl::encoding::DefaultFuchsiaResourceDialect
943 );
944 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceRebindRequest>(&header, _body_bytes, handles, &mut req)?;
945 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
946 Ok(DeviceRequest::Rebind { request: req.request, control_handle })
947 }
948 _ => Err(fidl::Error::UnknownOrdinal {
949 ordinal: header.ordinal,
950 protocol_name:
951 <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
952 }),
953 }))
954 },
955 )
956 }
957}
958
959#[derive(Debug)]
963pub enum DeviceRequest {
964 GetIdentifier { responder: DeviceGetIdentifierResponder },
968 GetConfigurations { responder: DeviceGetConfigurationsResponder },
972 GetConfigurations2 { responder: DeviceGetConfigurations2Responder },
976 WatchCurrentConfiguration { responder: DeviceWatchCurrentConfigurationResponder },
979 SetCurrentConfiguration { index: u32, control_handle: DeviceControlHandle },
983 WatchMuteState { responder: DeviceWatchMuteStateResponder },
988 SetSoftwareMuteState { muted: bool, responder: DeviceSetSoftwareMuteStateResponder },
992 ConnectToStream {
995 index: u32,
996 request: fidl::endpoints::ServerEnd<Stream_Marker>,
997 control_handle: DeviceControlHandle,
998 },
999 Rebind {
1002 request: fidl::endpoints::ServerEnd<DeviceMarker>,
1003 control_handle: DeviceControlHandle,
1004 },
1005}
1006
1007impl DeviceRequest {
1008 #[allow(irrefutable_let_patterns)]
1009 pub fn into_get_identifier(self) -> Option<(DeviceGetIdentifierResponder)> {
1010 if let DeviceRequest::GetIdentifier { responder } = self {
1011 Some((responder))
1012 } else {
1013 None
1014 }
1015 }
1016
1017 #[allow(irrefutable_let_patterns)]
1018 pub fn into_get_configurations(self) -> Option<(DeviceGetConfigurationsResponder)> {
1019 if let DeviceRequest::GetConfigurations { responder } = self {
1020 Some((responder))
1021 } else {
1022 None
1023 }
1024 }
1025
1026 #[allow(irrefutable_let_patterns)]
1027 pub fn into_get_configurations2(self) -> Option<(DeviceGetConfigurations2Responder)> {
1028 if let DeviceRequest::GetConfigurations2 { responder } = self {
1029 Some((responder))
1030 } else {
1031 None
1032 }
1033 }
1034
1035 #[allow(irrefutable_let_patterns)]
1036 pub fn into_watch_current_configuration(
1037 self,
1038 ) -> Option<(DeviceWatchCurrentConfigurationResponder)> {
1039 if let DeviceRequest::WatchCurrentConfiguration { responder } = self {
1040 Some((responder))
1041 } else {
1042 None
1043 }
1044 }
1045
1046 #[allow(irrefutable_let_patterns)]
1047 pub fn into_set_current_configuration(self) -> Option<(u32, DeviceControlHandle)> {
1048 if let DeviceRequest::SetCurrentConfiguration { index, control_handle } = self {
1049 Some((index, control_handle))
1050 } else {
1051 None
1052 }
1053 }
1054
1055 #[allow(irrefutable_let_patterns)]
1056 pub fn into_watch_mute_state(self) -> Option<(DeviceWatchMuteStateResponder)> {
1057 if let DeviceRequest::WatchMuteState { responder } = self {
1058 Some((responder))
1059 } else {
1060 None
1061 }
1062 }
1063
1064 #[allow(irrefutable_let_patterns)]
1065 pub fn into_set_software_mute_state(
1066 self,
1067 ) -> Option<(bool, DeviceSetSoftwareMuteStateResponder)> {
1068 if let DeviceRequest::SetSoftwareMuteState { muted, responder } = self {
1069 Some((muted, responder))
1070 } else {
1071 None
1072 }
1073 }
1074
1075 #[allow(irrefutable_let_patterns)]
1076 pub fn into_connect_to_stream(
1077 self,
1078 ) -> Option<(u32, fidl::endpoints::ServerEnd<Stream_Marker>, DeviceControlHandle)> {
1079 if let DeviceRequest::ConnectToStream { index, request, control_handle } = self {
1080 Some((index, request, control_handle))
1081 } else {
1082 None
1083 }
1084 }
1085
1086 #[allow(irrefutable_let_patterns)]
1087 pub fn into_rebind(
1088 self,
1089 ) -> Option<(fidl::endpoints::ServerEnd<DeviceMarker>, DeviceControlHandle)> {
1090 if let DeviceRequest::Rebind { request, control_handle } = self {
1091 Some((request, control_handle))
1092 } else {
1093 None
1094 }
1095 }
1096
1097 pub fn method_name(&self) -> &'static str {
1099 match *self {
1100 DeviceRequest::GetIdentifier { .. } => "get_identifier",
1101 DeviceRequest::GetConfigurations { .. } => "get_configurations",
1102 DeviceRequest::GetConfigurations2 { .. } => "get_configurations2",
1103 DeviceRequest::WatchCurrentConfiguration { .. } => "watch_current_configuration",
1104 DeviceRequest::SetCurrentConfiguration { .. } => "set_current_configuration",
1105 DeviceRequest::WatchMuteState { .. } => "watch_mute_state",
1106 DeviceRequest::SetSoftwareMuteState { .. } => "set_software_mute_state",
1107 DeviceRequest::ConnectToStream { .. } => "connect_to_stream",
1108 DeviceRequest::Rebind { .. } => "rebind",
1109 }
1110 }
1111}
1112
1113#[derive(Debug, Clone)]
1114pub struct DeviceControlHandle {
1115 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1116}
1117
1118impl fidl::endpoints::ControlHandle for DeviceControlHandle {
1119 fn shutdown(&self) {
1120 self.inner.shutdown()
1121 }
1122 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1123 self.inner.shutdown_with_epitaph(status)
1124 }
1125
1126 fn is_closed(&self) -> bool {
1127 self.inner.channel().is_closed()
1128 }
1129 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1130 self.inner.channel().on_closed()
1131 }
1132
1133 #[cfg(target_os = "fuchsia")]
1134 fn signal_peer(
1135 &self,
1136 clear_mask: zx::Signals,
1137 set_mask: zx::Signals,
1138 ) -> Result<(), zx_status::Status> {
1139 use fidl::Peered;
1140 self.inner.channel().signal_peer(clear_mask, set_mask)
1141 }
1142}
1143
1144impl DeviceControlHandle {}
1145
1146#[must_use = "FIDL methods require a response to be sent"]
1147#[derive(Debug)]
1148pub struct DeviceGetIdentifierResponder {
1149 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1150 tx_id: u32,
1151}
1152
1153impl std::ops::Drop for DeviceGetIdentifierResponder {
1157 fn drop(&mut self) {
1158 self.control_handle.shutdown();
1159 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1161 }
1162}
1163
1164impl fidl::endpoints::Responder for DeviceGetIdentifierResponder {
1165 type ControlHandle = DeviceControlHandle;
1166
1167 fn control_handle(&self) -> &DeviceControlHandle {
1168 &self.control_handle
1169 }
1170
1171 fn drop_without_shutdown(mut self) {
1172 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1174 std::mem::forget(self);
1176 }
1177}
1178
1179impl DeviceGetIdentifierResponder {
1180 pub fn send(self, mut identifier: Option<&str>) -> Result<(), fidl::Error> {
1184 let _result = self.send_raw(identifier);
1185 if _result.is_err() {
1186 self.control_handle.shutdown();
1187 }
1188 self.drop_without_shutdown();
1189 _result
1190 }
1191
1192 pub fn send_no_shutdown_on_err(self, mut identifier: Option<&str>) -> Result<(), fidl::Error> {
1194 let _result = self.send_raw(identifier);
1195 self.drop_without_shutdown();
1196 _result
1197 }
1198
1199 fn send_raw(&self, mut identifier: Option<&str>) -> Result<(), fidl::Error> {
1200 self.control_handle.inner.send::<DeviceGetIdentifierResponse>(
1201 (identifier,),
1202 self.tx_id,
1203 0x1417d1af92667e47,
1204 fidl::encoding::DynamicFlags::empty(),
1205 )
1206 }
1207}
1208
1209#[must_use = "FIDL methods require a response to be sent"]
1210#[derive(Debug)]
1211pub struct DeviceGetConfigurationsResponder {
1212 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1213 tx_id: u32,
1214}
1215
1216impl std::ops::Drop for DeviceGetConfigurationsResponder {
1220 fn drop(&mut self) {
1221 self.control_handle.shutdown();
1222 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1224 }
1225}
1226
1227impl fidl::endpoints::Responder for DeviceGetConfigurationsResponder {
1228 type ControlHandle = DeviceControlHandle;
1229
1230 fn control_handle(&self) -> &DeviceControlHandle {
1231 &self.control_handle
1232 }
1233
1234 fn drop_without_shutdown(mut self) {
1235 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1237 std::mem::forget(self);
1239 }
1240}
1241
1242impl DeviceGetConfigurationsResponder {
1243 pub fn send(self, mut configurations: &[Configuration]) -> Result<(), fidl::Error> {
1247 let _result = self.send_raw(configurations);
1248 if _result.is_err() {
1249 self.control_handle.shutdown();
1250 }
1251 self.drop_without_shutdown();
1252 _result
1253 }
1254
1255 pub fn send_no_shutdown_on_err(
1257 self,
1258 mut configurations: &[Configuration],
1259 ) -> Result<(), fidl::Error> {
1260 let _result = self.send_raw(configurations);
1261 self.drop_without_shutdown();
1262 _result
1263 }
1264
1265 fn send_raw(&self, mut configurations: &[Configuration]) -> Result<(), fidl::Error> {
1266 self.control_handle.inner.send::<DeviceGetConfigurationsResponse>(
1267 (configurations,),
1268 self.tx_id,
1269 0x26c7a180d8eef786,
1270 fidl::encoding::DynamicFlags::empty(),
1271 )
1272 }
1273}
1274
1275#[must_use = "FIDL methods require a response to be sent"]
1276#[derive(Debug)]
1277pub struct DeviceGetConfigurations2Responder {
1278 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1279 tx_id: u32,
1280}
1281
1282impl std::ops::Drop for DeviceGetConfigurations2Responder {
1286 fn drop(&mut self) {
1287 self.control_handle.shutdown();
1288 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1290 }
1291}
1292
1293impl fidl::endpoints::Responder for DeviceGetConfigurations2Responder {
1294 type ControlHandle = DeviceControlHandle;
1295
1296 fn control_handle(&self) -> &DeviceControlHandle {
1297 &self.control_handle
1298 }
1299
1300 fn drop_without_shutdown(mut self) {
1301 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1303 std::mem::forget(self);
1305 }
1306}
1307
1308impl DeviceGetConfigurations2Responder {
1309 pub fn send(self, mut configurations: &[Configuration2]) -> Result<(), fidl::Error> {
1313 let _result = self.send_raw(configurations);
1314 if _result.is_err() {
1315 self.control_handle.shutdown();
1316 }
1317 self.drop_without_shutdown();
1318 _result
1319 }
1320
1321 pub fn send_no_shutdown_on_err(
1323 self,
1324 mut configurations: &[Configuration2],
1325 ) -> Result<(), fidl::Error> {
1326 let _result = self.send_raw(configurations);
1327 self.drop_without_shutdown();
1328 _result
1329 }
1330
1331 fn send_raw(&self, mut configurations: &[Configuration2]) -> Result<(), fidl::Error> {
1332 self.control_handle.inner.send::<DeviceGetConfigurations2Response>(
1333 (configurations,),
1334 self.tx_id,
1335 0x2667155e740fb9ff,
1336 fidl::encoding::DynamicFlags::empty(),
1337 )
1338 }
1339}
1340
1341#[must_use = "FIDL methods require a response to be sent"]
1342#[derive(Debug)]
1343pub struct DeviceWatchCurrentConfigurationResponder {
1344 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1345 tx_id: u32,
1346}
1347
1348impl std::ops::Drop for DeviceWatchCurrentConfigurationResponder {
1352 fn drop(&mut self) {
1353 self.control_handle.shutdown();
1354 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1356 }
1357}
1358
1359impl fidl::endpoints::Responder for DeviceWatchCurrentConfigurationResponder {
1360 type ControlHandle = DeviceControlHandle;
1361
1362 fn control_handle(&self) -> &DeviceControlHandle {
1363 &self.control_handle
1364 }
1365
1366 fn drop_without_shutdown(mut self) {
1367 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1369 std::mem::forget(self);
1371 }
1372}
1373
1374impl DeviceWatchCurrentConfigurationResponder {
1375 pub fn send(self, mut index: u32) -> Result<(), fidl::Error> {
1379 let _result = self.send_raw(index);
1380 if _result.is_err() {
1381 self.control_handle.shutdown();
1382 }
1383 self.drop_without_shutdown();
1384 _result
1385 }
1386
1387 pub fn send_no_shutdown_on_err(self, mut index: u32) -> Result<(), fidl::Error> {
1389 let _result = self.send_raw(index);
1390 self.drop_without_shutdown();
1391 _result
1392 }
1393
1394 fn send_raw(&self, mut index: u32) -> Result<(), fidl::Error> {
1395 self.control_handle.inner.send::<DeviceWatchCurrentConfigurationResponse>(
1396 (index,),
1397 self.tx_id,
1398 0x7a82832a127834b7,
1399 fidl::encoding::DynamicFlags::empty(),
1400 )
1401 }
1402}
1403
1404#[must_use = "FIDL methods require a response to be sent"]
1405#[derive(Debug)]
1406pub struct DeviceWatchMuteStateResponder {
1407 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1408 tx_id: u32,
1409}
1410
1411impl std::ops::Drop for DeviceWatchMuteStateResponder {
1415 fn drop(&mut self) {
1416 self.control_handle.shutdown();
1417 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1419 }
1420}
1421
1422impl fidl::endpoints::Responder for DeviceWatchMuteStateResponder {
1423 type ControlHandle = DeviceControlHandle;
1424
1425 fn control_handle(&self) -> &DeviceControlHandle {
1426 &self.control_handle
1427 }
1428
1429 fn drop_without_shutdown(mut self) {
1430 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1432 std::mem::forget(self);
1434 }
1435}
1436
1437impl DeviceWatchMuteStateResponder {
1438 pub fn send(
1442 self,
1443 mut software_muted: bool,
1444 mut hardware_muted: bool,
1445 ) -> Result<(), fidl::Error> {
1446 let _result = self.send_raw(software_muted, hardware_muted);
1447 if _result.is_err() {
1448 self.control_handle.shutdown();
1449 }
1450 self.drop_without_shutdown();
1451 _result
1452 }
1453
1454 pub fn send_no_shutdown_on_err(
1456 self,
1457 mut software_muted: bool,
1458 mut hardware_muted: bool,
1459 ) -> Result<(), fidl::Error> {
1460 let _result = self.send_raw(software_muted, hardware_muted);
1461 self.drop_without_shutdown();
1462 _result
1463 }
1464
1465 fn send_raw(
1466 &self,
1467 mut software_muted: bool,
1468 mut hardware_muted: bool,
1469 ) -> Result<(), fidl::Error> {
1470 self.control_handle.inner.send::<DeviceWatchMuteStateResponse>(
1471 (software_muted, hardware_muted),
1472 self.tx_id,
1473 0x2bafd68e6e7ef2fb,
1474 fidl::encoding::DynamicFlags::empty(),
1475 )
1476 }
1477}
1478
1479#[must_use = "FIDL methods require a response to be sent"]
1480#[derive(Debug)]
1481pub struct DeviceSetSoftwareMuteStateResponder {
1482 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1483 tx_id: u32,
1484}
1485
1486impl std::ops::Drop for DeviceSetSoftwareMuteStateResponder {
1490 fn drop(&mut self) {
1491 self.control_handle.shutdown();
1492 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1494 }
1495}
1496
1497impl fidl::endpoints::Responder for DeviceSetSoftwareMuteStateResponder {
1498 type ControlHandle = DeviceControlHandle;
1499
1500 fn control_handle(&self) -> &DeviceControlHandle {
1501 &self.control_handle
1502 }
1503
1504 fn drop_without_shutdown(mut self) {
1505 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1507 std::mem::forget(self);
1509 }
1510}
1511
1512impl DeviceSetSoftwareMuteStateResponder {
1513 pub fn send(self) -> Result<(), fidl::Error> {
1517 let _result = self.send_raw();
1518 if _result.is_err() {
1519 self.control_handle.shutdown();
1520 }
1521 self.drop_without_shutdown();
1522 _result
1523 }
1524
1525 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1527 let _result = self.send_raw();
1528 self.drop_without_shutdown();
1529 _result
1530 }
1531
1532 fn send_raw(&self) -> Result<(), fidl::Error> {
1533 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1534 (),
1535 self.tx_id,
1536 0x6bb19cb687f560a5,
1537 fidl::encoding::DynamicFlags::empty(),
1538 )
1539 }
1540}
1541
1542#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1543pub struct DeviceWatcherMarker;
1544
1545impl fidl::endpoints::ProtocolMarker for DeviceWatcherMarker {
1546 type Proxy = DeviceWatcherProxy;
1547 type RequestStream = DeviceWatcherRequestStream;
1548 #[cfg(target_os = "fuchsia")]
1549 type SynchronousProxy = DeviceWatcherSynchronousProxy;
1550
1551 const DEBUG_NAME: &'static str = "fuchsia.camera3.DeviceWatcher";
1552}
1553impl fidl::endpoints::DiscoverableProtocolMarker for DeviceWatcherMarker {}
1554
1555pub trait DeviceWatcherProxyInterface: Send + Sync {
1556 type WatchDevicesResponseFut: std::future::Future<Output = Result<Vec<WatchDevicesEvent>, fidl::Error>>
1557 + Send;
1558 fn r#watch_devices(&self) -> Self::WatchDevicesResponseFut;
1559 fn r#connect_to_device(
1560 &self,
1561 id: u64,
1562 request: fidl::endpoints::ServerEnd<DeviceMarker>,
1563 ) -> Result<(), fidl::Error>;
1564}
1565#[derive(Debug)]
1566#[cfg(target_os = "fuchsia")]
1567pub struct DeviceWatcherSynchronousProxy {
1568 client: fidl::client::sync::Client,
1569}
1570
1571#[cfg(target_os = "fuchsia")]
1572impl fidl::endpoints::SynchronousProxy for DeviceWatcherSynchronousProxy {
1573 type Proxy = DeviceWatcherProxy;
1574 type Protocol = DeviceWatcherMarker;
1575
1576 fn from_channel(inner: fidl::Channel) -> Self {
1577 Self::new(inner)
1578 }
1579
1580 fn into_channel(self) -> fidl::Channel {
1581 self.client.into_channel()
1582 }
1583
1584 fn as_channel(&self) -> &fidl::Channel {
1585 self.client.as_channel()
1586 }
1587}
1588
1589#[cfg(target_os = "fuchsia")]
1590impl DeviceWatcherSynchronousProxy {
1591 pub fn new(channel: fidl::Channel) -> Self {
1592 let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1593 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1594 }
1595
1596 pub fn into_channel(self) -> fidl::Channel {
1597 self.client.into_channel()
1598 }
1599
1600 pub fn wait_for_event(
1603 &self,
1604 deadline: zx::MonotonicInstant,
1605 ) -> Result<DeviceWatcherEvent, fidl::Error> {
1606 DeviceWatcherEvent::decode(self.client.wait_for_event(deadline)?)
1607 }
1608
1609 pub fn r#watch_devices(
1624 &self,
1625 ___deadline: zx::MonotonicInstant,
1626 ) -> Result<Vec<WatchDevicesEvent>, fidl::Error> {
1627 let _response = self
1628 .client
1629 .send_query::<fidl::encoding::EmptyPayload, DeviceWatcherWatchDevicesResponse>(
1630 (),
1631 0x5f38542e295e8575,
1632 fidl::encoding::DynamicFlags::empty(),
1633 ___deadline,
1634 )?;
1635 Ok(_response.events)
1636 }
1637
1638 pub fn r#connect_to_device(
1641 &self,
1642 mut id: u64,
1643 mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
1644 ) -> Result<(), fidl::Error> {
1645 self.client.send::<DeviceWatcherConnectToDeviceRequest>(
1646 (id, request),
1647 0x5f175a8283b26b2d,
1648 fidl::encoding::DynamicFlags::empty(),
1649 )
1650 }
1651}
1652
1653#[cfg(target_os = "fuchsia")]
1654impl From<DeviceWatcherSynchronousProxy> for zx::Handle {
1655 fn from(value: DeviceWatcherSynchronousProxy) -> Self {
1656 value.into_channel().into()
1657 }
1658}
1659
1660#[cfg(target_os = "fuchsia")]
1661impl From<fidl::Channel> for DeviceWatcherSynchronousProxy {
1662 fn from(value: fidl::Channel) -> Self {
1663 Self::new(value)
1664 }
1665}
1666
1667#[derive(Debug, Clone)]
1668pub struct DeviceWatcherProxy {
1669 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1670}
1671
1672impl fidl::endpoints::Proxy for DeviceWatcherProxy {
1673 type Protocol = DeviceWatcherMarker;
1674
1675 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1676 Self::new(inner)
1677 }
1678
1679 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1680 self.client.into_channel().map_err(|client| Self { client })
1681 }
1682
1683 fn as_channel(&self) -> &::fidl::AsyncChannel {
1684 self.client.as_channel()
1685 }
1686}
1687
1688impl DeviceWatcherProxy {
1689 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1691 let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1692 Self { client: fidl::client::Client::new(channel, protocol_name) }
1693 }
1694
1695 pub fn take_event_stream(&self) -> DeviceWatcherEventStream {
1701 DeviceWatcherEventStream { event_receiver: self.client.take_event_receiver() }
1702 }
1703
1704 pub fn r#watch_devices(
1719 &self,
1720 ) -> fidl::client::QueryResponseFut<
1721 Vec<WatchDevicesEvent>,
1722 fidl::encoding::DefaultFuchsiaResourceDialect,
1723 > {
1724 DeviceWatcherProxyInterface::r#watch_devices(self)
1725 }
1726
1727 pub fn r#connect_to_device(
1730 &self,
1731 mut id: u64,
1732 mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
1733 ) -> Result<(), fidl::Error> {
1734 DeviceWatcherProxyInterface::r#connect_to_device(self, id, request)
1735 }
1736}
1737
1738impl DeviceWatcherProxyInterface for DeviceWatcherProxy {
1739 type WatchDevicesResponseFut = fidl::client::QueryResponseFut<
1740 Vec<WatchDevicesEvent>,
1741 fidl::encoding::DefaultFuchsiaResourceDialect,
1742 >;
1743 fn r#watch_devices(&self) -> Self::WatchDevicesResponseFut {
1744 fn _decode(
1745 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1746 ) -> Result<Vec<WatchDevicesEvent>, fidl::Error> {
1747 let _response = fidl::client::decode_transaction_body::<
1748 DeviceWatcherWatchDevicesResponse,
1749 fidl::encoding::DefaultFuchsiaResourceDialect,
1750 0x5f38542e295e8575,
1751 >(_buf?)?;
1752 Ok(_response.events)
1753 }
1754 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<WatchDevicesEvent>>(
1755 (),
1756 0x5f38542e295e8575,
1757 fidl::encoding::DynamicFlags::empty(),
1758 _decode,
1759 )
1760 }
1761
1762 fn r#connect_to_device(
1763 &self,
1764 mut id: u64,
1765 mut request: fidl::endpoints::ServerEnd<DeviceMarker>,
1766 ) -> Result<(), fidl::Error> {
1767 self.client.send::<DeviceWatcherConnectToDeviceRequest>(
1768 (id, request),
1769 0x5f175a8283b26b2d,
1770 fidl::encoding::DynamicFlags::empty(),
1771 )
1772 }
1773}
1774
1775pub struct DeviceWatcherEventStream {
1776 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1777}
1778
1779impl std::marker::Unpin for DeviceWatcherEventStream {}
1780
1781impl futures::stream::FusedStream for DeviceWatcherEventStream {
1782 fn is_terminated(&self) -> bool {
1783 self.event_receiver.is_terminated()
1784 }
1785}
1786
1787impl futures::Stream for DeviceWatcherEventStream {
1788 type Item = Result<DeviceWatcherEvent, fidl::Error>;
1789
1790 fn poll_next(
1791 mut self: std::pin::Pin<&mut Self>,
1792 cx: &mut std::task::Context<'_>,
1793 ) -> std::task::Poll<Option<Self::Item>> {
1794 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1795 &mut self.event_receiver,
1796 cx
1797 )?) {
1798 Some(buf) => std::task::Poll::Ready(Some(DeviceWatcherEvent::decode(buf))),
1799 None => std::task::Poll::Ready(None),
1800 }
1801 }
1802}
1803
1804#[derive(Debug)]
1805pub enum DeviceWatcherEvent {}
1806
1807impl DeviceWatcherEvent {
1808 fn decode(
1810 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1811 ) -> Result<DeviceWatcherEvent, fidl::Error> {
1812 let (bytes, _handles) = buf.split_mut();
1813 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1814 debug_assert_eq!(tx_header.tx_id, 0);
1815 match tx_header.ordinal {
1816 _ => Err(fidl::Error::UnknownOrdinal {
1817 ordinal: tx_header.ordinal,
1818 protocol_name: <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1819 }),
1820 }
1821 }
1822}
1823
1824pub struct DeviceWatcherRequestStream {
1826 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1827 is_terminated: bool,
1828}
1829
1830impl std::marker::Unpin for DeviceWatcherRequestStream {}
1831
1832impl futures::stream::FusedStream for DeviceWatcherRequestStream {
1833 fn is_terminated(&self) -> bool {
1834 self.is_terminated
1835 }
1836}
1837
1838impl fidl::endpoints::RequestStream for DeviceWatcherRequestStream {
1839 type Protocol = DeviceWatcherMarker;
1840 type ControlHandle = DeviceWatcherControlHandle;
1841
1842 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1843 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1844 }
1845
1846 fn control_handle(&self) -> Self::ControlHandle {
1847 DeviceWatcherControlHandle { inner: self.inner.clone() }
1848 }
1849
1850 fn into_inner(
1851 self,
1852 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1853 {
1854 (self.inner, self.is_terminated)
1855 }
1856
1857 fn from_inner(
1858 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1859 is_terminated: bool,
1860 ) -> Self {
1861 Self { inner, is_terminated }
1862 }
1863}
1864
1865impl futures::Stream for DeviceWatcherRequestStream {
1866 type Item = Result<DeviceWatcherRequest, fidl::Error>;
1867
1868 fn poll_next(
1869 mut self: std::pin::Pin<&mut Self>,
1870 cx: &mut std::task::Context<'_>,
1871 ) -> std::task::Poll<Option<Self::Item>> {
1872 let this = &mut *self;
1873 if this.inner.check_shutdown(cx) {
1874 this.is_terminated = true;
1875 return std::task::Poll::Ready(None);
1876 }
1877 if this.is_terminated {
1878 panic!("polled DeviceWatcherRequestStream after completion");
1879 }
1880 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1881 |bytes, handles| {
1882 match this.inner.channel().read_etc(cx, bytes, handles) {
1883 std::task::Poll::Ready(Ok(())) => {}
1884 std::task::Poll::Pending => return std::task::Poll::Pending,
1885 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1886 this.is_terminated = true;
1887 return std::task::Poll::Ready(None);
1888 }
1889 std::task::Poll::Ready(Err(e)) => {
1890 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1891 e.into(),
1892 ))))
1893 }
1894 }
1895
1896 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1898
1899 std::task::Poll::Ready(Some(match header.ordinal {
1900 0x5f38542e295e8575 => {
1901 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1902 let mut req = fidl::new_empty!(
1903 fidl::encoding::EmptyPayload,
1904 fidl::encoding::DefaultFuchsiaResourceDialect
1905 );
1906 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1907 let control_handle =
1908 DeviceWatcherControlHandle { inner: this.inner.clone() };
1909 Ok(DeviceWatcherRequest::WatchDevices {
1910 responder: DeviceWatcherWatchDevicesResponder {
1911 control_handle: std::mem::ManuallyDrop::new(control_handle),
1912 tx_id: header.tx_id,
1913 },
1914 })
1915 }
1916 0x5f175a8283b26b2d => {
1917 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1918 let mut req = fidl::new_empty!(
1919 DeviceWatcherConnectToDeviceRequest,
1920 fidl::encoding::DefaultFuchsiaResourceDialect
1921 );
1922 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherConnectToDeviceRequest>(&header, _body_bytes, handles, &mut req)?;
1923 let control_handle =
1924 DeviceWatcherControlHandle { inner: this.inner.clone() };
1925 Ok(DeviceWatcherRequest::ConnectToDevice {
1926 id: req.id,
1927 request: req.request,
1928
1929 control_handle,
1930 })
1931 }
1932 _ => Err(fidl::Error::UnknownOrdinal {
1933 ordinal: header.ordinal,
1934 protocol_name:
1935 <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1936 }),
1937 }))
1938 },
1939 )
1940 }
1941}
1942
1943#[derive(Debug)]
1949pub enum DeviceWatcherRequest {
1950 WatchDevices { responder: DeviceWatcherWatchDevicesResponder },
1965 ConnectToDevice {
1968 id: u64,
1969 request: fidl::endpoints::ServerEnd<DeviceMarker>,
1970 control_handle: DeviceWatcherControlHandle,
1971 },
1972}
1973
1974impl DeviceWatcherRequest {
1975 #[allow(irrefutable_let_patterns)]
1976 pub fn into_watch_devices(self) -> Option<(DeviceWatcherWatchDevicesResponder)> {
1977 if let DeviceWatcherRequest::WatchDevices { responder } = self {
1978 Some((responder))
1979 } else {
1980 None
1981 }
1982 }
1983
1984 #[allow(irrefutable_let_patterns)]
1985 pub fn into_connect_to_device(
1986 self,
1987 ) -> Option<(u64, fidl::endpoints::ServerEnd<DeviceMarker>, DeviceWatcherControlHandle)> {
1988 if let DeviceWatcherRequest::ConnectToDevice { id, request, control_handle } = self {
1989 Some((id, request, control_handle))
1990 } else {
1991 None
1992 }
1993 }
1994
1995 pub fn method_name(&self) -> &'static str {
1997 match *self {
1998 DeviceWatcherRequest::WatchDevices { .. } => "watch_devices",
1999 DeviceWatcherRequest::ConnectToDevice { .. } => "connect_to_device",
2000 }
2001 }
2002}
2003
2004#[derive(Debug, Clone)]
2005pub struct DeviceWatcherControlHandle {
2006 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2007}
2008
2009impl fidl::endpoints::ControlHandle for DeviceWatcherControlHandle {
2010 fn shutdown(&self) {
2011 self.inner.shutdown()
2012 }
2013 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2014 self.inner.shutdown_with_epitaph(status)
2015 }
2016
2017 fn is_closed(&self) -> bool {
2018 self.inner.channel().is_closed()
2019 }
2020 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2021 self.inner.channel().on_closed()
2022 }
2023
2024 #[cfg(target_os = "fuchsia")]
2025 fn signal_peer(
2026 &self,
2027 clear_mask: zx::Signals,
2028 set_mask: zx::Signals,
2029 ) -> Result<(), zx_status::Status> {
2030 use fidl::Peered;
2031 self.inner.channel().signal_peer(clear_mask, set_mask)
2032 }
2033}
2034
2035impl DeviceWatcherControlHandle {}
2036
2037#[must_use = "FIDL methods require a response to be sent"]
2038#[derive(Debug)]
2039pub struct DeviceWatcherWatchDevicesResponder {
2040 control_handle: std::mem::ManuallyDrop<DeviceWatcherControlHandle>,
2041 tx_id: u32,
2042}
2043
2044impl std::ops::Drop for DeviceWatcherWatchDevicesResponder {
2048 fn drop(&mut self) {
2049 self.control_handle.shutdown();
2050 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2052 }
2053}
2054
2055impl fidl::endpoints::Responder for DeviceWatcherWatchDevicesResponder {
2056 type ControlHandle = DeviceWatcherControlHandle;
2057
2058 fn control_handle(&self) -> &DeviceWatcherControlHandle {
2059 &self.control_handle
2060 }
2061
2062 fn drop_without_shutdown(mut self) {
2063 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2065 std::mem::forget(self);
2067 }
2068}
2069
2070impl DeviceWatcherWatchDevicesResponder {
2071 pub fn send(self, mut events: &[WatchDevicesEvent]) -> Result<(), fidl::Error> {
2075 let _result = self.send_raw(events);
2076 if _result.is_err() {
2077 self.control_handle.shutdown();
2078 }
2079 self.drop_without_shutdown();
2080 _result
2081 }
2082
2083 pub fn send_no_shutdown_on_err(
2085 self,
2086 mut events: &[WatchDevicesEvent],
2087 ) -> Result<(), fidl::Error> {
2088 let _result = self.send_raw(events);
2089 self.drop_without_shutdown();
2090 _result
2091 }
2092
2093 fn send_raw(&self, mut events: &[WatchDevicesEvent]) -> Result<(), fidl::Error> {
2094 self.control_handle.inner.send::<DeviceWatcherWatchDevicesResponse>(
2095 (events,),
2096 self.tx_id,
2097 0x5f38542e295e8575,
2098 fidl::encoding::DynamicFlags::empty(),
2099 )
2100 }
2101}
2102
2103#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2104pub struct Stream_Marker;
2105
2106impl fidl::endpoints::ProtocolMarker for Stream_Marker {
2107 type Proxy = Stream_Proxy;
2108 type RequestStream = Stream_RequestStream;
2109 #[cfg(target_os = "fuchsia")]
2110 type SynchronousProxy = Stream_SynchronousProxy;
2111
2112 const DEBUG_NAME: &'static str = "(anonymous) Stream_";
2113}
2114
2115pub trait Stream_ProxyInterface: Send + Sync {
2116 type GetPropertiesResponseFut: std::future::Future<Output = Result<StreamProperties, fidl::Error>>
2117 + Send;
2118 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
2119 type GetProperties2ResponseFut: std::future::Future<Output = Result<StreamProperties2, fidl::Error>>
2120 + Send;
2121 fn r#get_properties2(&self) -> Self::GetProperties2ResponseFut;
2122 fn r#set_crop_region(
2123 &self,
2124 region: Option<&fidl_fuchsia_math::RectF>,
2125 ) -> Result<(), fidl::Error>;
2126 type WatchCropRegionResponseFut: std::future::Future<Output = Result<Option<Box<fidl_fuchsia_math::RectF>>, fidl::Error>>
2127 + Send;
2128 fn r#watch_crop_region(&self) -> Self::WatchCropRegionResponseFut;
2129 fn r#set_resolution(&self, coded_size: &fidl_fuchsia_math::Size) -> Result<(), fidl::Error>;
2130 type WatchResolutionResponseFut: std::future::Future<Output = Result<fidl_fuchsia_math::Size, fidl::Error>>
2131 + Send;
2132 fn r#watch_resolution(&self) -> Self::WatchResolutionResponseFut;
2133 fn r#set_buffer_collection2(
2134 &self,
2135 token: Option<
2136 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2137 >,
2138 ) -> Result<(), fidl::Error>;
2139 fn r#set_buffer_collection(
2140 &self,
2141 token: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
2142 ) -> Result<(), fidl::Error>;
2143 type WatchBufferCollection2ResponseFut: std::future::Future<
2144 Output = Result<
2145 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2146 fidl::Error,
2147 >,
2148 > + Send;
2149 fn r#watch_buffer_collection2(&self) -> Self::WatchBufferCollection2ResponseFut;
2150 type WatchBufferCollectionResponseFut: std::future::Future<
2151 Output = Result<
2152 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2153 fidl::Error,
2154 >,
2155 > + Send;
2156 fn r#watch_buffer_collection(&self) -> Self::WatchBufferCollectionResponseFut;
2157 type WatchOrientationResponseFut: std::future::Future<Output = Result<Orientation, fidl::Error>>
2158 + Send;
2159 fn r#watch_orientation(&self) -> Self::WatchOrientationResponseFut;
2160 type GetNextFrameResponseFut: std::future::Future<Output = Result<FrameInfo, fidl::Error>>
2161 + Send;
2162 fn r#get_next_frame(&self) -> Self::GetNextFrameResponseFut;
2163 type GetNextFrame2ResponseFut: std::future::Future<Output = Result<FrameInfo2, fidl::Error>>
2164 + Send;
2165 fn r#get_next_frame2(&self) -> Self::GetNextFrame2ResponseFut;
2166 fn r#rebind(
2167 &self,
2168 request: fidl::endpoints::ServerEnd<Stream_Marker>,
2169 ) -> Result<(), fidl::Error>;
2170}
2171#[derive(Debug)]
2172#[cfg(target_os = "fuchsia")]
2173pub struct Stream_SynchronousProxy {
2174 client: fidl::client::sync::Client,
2175}
2176
2177#[cfg(target_os = "fuchsia")]
2178impl fidl::endpoints::SynchronousProxy for Stream_SynchronousProxy {
2179 type Proxy = Stream_Proxy;
2180 type Protocol = Stream_Marker;
2181
2182 fn from_channel(inner: fidl::Channel) -> Self {
2183 Self::new(inner)
2184 }
2185
2186 fn into_channel(self) -> fidl::Channel {
2187 self.client.into_channel()
2188 }
2189
2190 fn as_channel(&self) -> &fidl::Channel {
2191 self.client.as_channel()
2192 }
2193}
2194
2195#[cfg(target_os = "fuchsia")]
2196impl Stream_SynchronousProxy {
2197 pub fn new(channel: fidl::Channel) -> Self {
2198 let protocol_name = <Stream_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2199 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2200 }
2201
2202 pub fn into_channel(self) -> fidl::Channel {
2203 self.client.into_channel()
2204 }
2205
2206 pub fn wait_for_event(
2209 &self,
2210 deadline: zx::MonotonicInstant,
2211 ) -> Result<Stream_Event, fidl::Error> {
2212 Stream_Event::decode(self.client.wait_for_event(deadline)?)
2213 }
2214
2215 pub fn r#get_properties(
2218 &self,
2219 ___deadline: zx::MonotonicInstant,
2220 ) -> Result<StreamProperties, fidl::Error> {
2221 let _response =
2222 self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetPropertiesResponse>(
2223 (),
2224 0x13662921504b55f7,
2225 fidl::encoding::DynamicFlags::empty(),
2226 ___deadline,
2227 )?;
2228 Ok(_response.properties)
2229 }
2230
2231 pub fn r#get_properties2(
2234 &self,
2235 ___deadline: zx::MonotonicInstant,
2236 ) -> Result<StreamProperties2, fidl::Error> {
2237 let _response =
2238 self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetProperties2Response>(
2239 (),
2240 0x70346d69a8cbc391,
2241 fidl::encoding::DynamicFlags::empty(),
2242 ___deadline,
2243 )?;
2244 Ok(_response.properties)
2245 }
2246
2247 pub fn r#set_crop_region(
2256 &self,
2257 mut region: Option<&fidl_fuchsia_math::RectF>,
2258 ) -> Result<(), fidl::Error> {
2259 self.client.send::<StreamSetCropRegionRequest>(
2260 (region,),
2261 0x72dde73bf7a94302,
2262 fidl::encoding::DynamicFlags::empty(),
2263 )
2264 }
2265
2266 pub fn r#watch_crop_region(
2270 &self,
2271 ___deadline: zx::MonotonicInstant,
2272 ) -> Result<Option<Box<fidl_fuchsia_math::RectF>>, fidl::Error> {
2273 let _response =
2274 self.client.send_query::<fidl::encoding::EmptyPayload, StreamWatchCropRegionResponse>(
2275 (),
2276 0x4c28250035dbbb90,
2277 fidl::encoding::DynamicFlags::empty(),
2278 ___deadline,
2279 )?;
2280 Ok(_response.region)
2281 }
2282
2283 pub fn r#set_resolution(
2287 &self,
2288 mut coded_size: &fidl_fuchsia_math::Size,
2289 ) -> Result<(), fidl::Error> {
2290 self.client.send::<StreamSetResolutionRequest>(
2291 (coded_size,),
2292 0x6ef2c207ff2b74e3,
2293 fidl::encoding::DynamicFlags::empty(),
2294 )
2295 }
2296
2297 pub fn r#watch_resolution(
2301 &self,
2302 ___deadline: zx::MonotonicInstant,
2303 ) -> Result<fidl_fuchsia_math::Size, fidl::Error> {
2304 let _response =
2305 self.client.send_query::<fidl::encoding::EmptyPayload, StreamWatchResolutionResponse>(
2306 (),
2307 0x6c7b28be2b72ea7f,
2308 fidl::encoding::DynamicFlags::empty(),
2309 ___deadline,
2310 )?;
2311 Ok(_response.coded_size)
2312 }
2313
2314 pub fn r#set_buffer_collection2(
2321 &self,
2322 mut token: Option<
2323 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2324 >,
2325 ) -> Result<(), fidl::Error> {
2326 self.client.send::<StreamSetBufferCollection2Request>(
2327 (token,),
2328 0x6691d2eed219c8e6,
2329 fidl::encoding::DynamicFlags::empty(),
2330 )
2331 }
2332
2333 pub fn r#set_buffer_collection(
2334 &self,
2335 mut token: Option<
2336 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2337 >,
2338 ) -> Result<(), fidl::Error> {
2339 self.client.send::<StreamSetBufferCollectionRequest>(
2340 (token,),
2341 0x730ab5c4ee023c6d,
2342 fidl::encoding::DynamicFlags::empty(),
2343 )
2344 }
2345
2346 pub fn r#watch_buffer_collection2(
2354 &self,
2355 ___deadline: zx::MonotonicInstant,
2356 ) -> Result<
2357 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2358 fidl::Error,
2359 > {
2360 let _response = self
2361 .client
2362 .send_query::<fidl::encoding::EmptyPayload, StreamWatchBufferCollection2Response>(
2363 (),
2364 0x60c9daa36b3d2cf1,
2365 fidl::encoding::DynamicFlags::empty(),
2366 ___deadline,
2367 )?;
2368 Ok(_response.token)
2369 }
2370
2371 pub fn r#watch_buffer_collection(
2372 &self,
2373 ___deadline: zx::MonotonicInstant,
2374 ) -> Result<
2375 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2376 fidl::Error,
2377 > {
2378 let _response = self
2379 .client
2380 .send_query::<fidl::encoding::EmptyPayload, StreamWatchBufferCollectionResponse>(
2381 (),
2382 0x35d855a45e19e5d6,
2383 fidl::encoding::DynamicFlags::empty(),
2384 ___deadline,
2385 )?;
2386 Ok(_response.token)
2387 }
2388
2389 pub fn r#watch_orientation(
2393 &self,
2394 ___deadline: zx::MonotonicInstant,
2395 ) -> Result<Orientation, fidl::Error> {
2396 let _response = self
2397 .client
2398 .send_query::<fidl::encoding::EmptyPayload, StreamWatchOrientationResponse>(
2399 (),
2400 0x1f0d1cd93daa1dd4,
2401 fidl::encoding::DynamicFlags::empty(),
2402 ___deadline,
2403 )?;
2404 Ok(_response.orientation)
2405 }
2406
2407 pub fn r#get_next_frame(
2409 &self,
2410 ___deadline: zx::MonotonicInstant,
2411 ) -> Result<FrameInfo, fidl::Error> {
2412 let _response =
2413 self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetNextFrameResponse>(
2414 (),
2415 0x4b06b8dfbcbdc658,
2416 fidl::encoding::DynamicFlags::empty(),
2417 ___deadline,
2418 )?;
2419 Ok(_response.info)
2420 }
2421
2422 pub fn r#get_next_frame2(
2429 &self,
2430 ___deadline: zx::MonotonicInstant,
2431 ) -> Result<FrameInfo2, fidl::Error> {
2432 let _response =
2433 self.client.send_query::<fidl::encoding::EmptyPayload, StreamGetNextFrame2Response>(
2434 (),
2435 0x7142a7a6aa6a6f10,
2436 fidl::encoding::DynamicFlags::empty(),
2437 ___deadline,
2438 )?;
2439 Ok(_response.info)
2440 }
2441
2442 pub fn r#rebind(
2446 &self,
2447 mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
2448 ) -> Result<(), fidl::Error> {
2449 self.client.send::<StreamRebindRequest>(
2450 (request,),
2451 0x75b84fa09b68dbef,
2452 fidl::encoding::DynamicFlags::empty(),
2453 )
2454 }
2455}
2456
2457#[cfg(target_os = "fuchsia")]
2458impl From<Stream_SynchronousProxy> for zx::Handle {
2459 fn from(value: Stream_SynchronousProxy) -> Self {
2460 value.into_channel().into()
2461 }
2462}
2463
2464#[cfg(target_os = "fuchsia")]
2465impl From<fidl::Channel> for Stream_SynchronousProxy {
2466 fn from(value: fidl::Channel) -> Self {
2467 Self::new(value)
2468 }
2469}
2470
2471#[derive(Debug, Clone)]
2472pub struct Stream_Proxy {
2473 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2474}
2475
2476impl fidl::endpoints::Proxy for Stream_Proxy {
2477 type Protocol = Stream_Marker;
2478
2479 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2480 Self::new(inner)
2481 }
2482
2483 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2484 self.client.into_channel().map_err(|client| Self { client })
2485 }
2486
2487 fn as_channel(&self) -> &::fidl::AsyncChannel {
2488 self.client.as_channel()
2489 }
2490}
2491
2492impl Stream_Proxy {
2493 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2495 let protocol_name = <Stream_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2496 Self { client: fidl::client::Client::new(channel, protocol_name) }
2497 }
2498
2499 pub fn take_event_stream(&self) -> Stream_EventStream {
2505 Stream_EventStream { event_receiver: self.client.take_event_receiver() }
2506 }
2507
2508 pub fn r#get_properties(
2511 &self,
2512 ) -> fidl::client::QueryResponseFut<
2513 StreamProperties,
2514 fidl::encoding::DefaultFuchsiaResourceDialect,
2515 > {
2516 Stream_ProxyInterface::r#get_properties(self)
2517 }
2518
2519 pub fn r#get_properties2(
2522 &self,
2523 ) -> fidl::client::QueryResponseFut<
2524 StreamProperties2,
2525 fidl::encoding::DefaultFuchsiaResourceDialect,
2526 > {
2527 Stream_ProxyInterface::r#get_properties2(self)
2528 }
2529
2530 pub fn r#set_crop_region(
2539 &self,
2540 mut region: Option<&fidl_fuchsia_math::RectF>,
2541 ) -> Result<(), fidl::Error> {
2542 Stream_ProxyInterface::r#set_crop_region(self, region)
2543 }
2544
2545 pub fn r#watch_crop_region(
2549 &self,
2550 ) -> fidl::client::QueryResponseFut<
2551 Option<Box<fidl_fuchsia_math::RectF>>,
2552 fidl::encoding::DefaultFuchsiaResourceDialect,
2553 > {
2554 Stream_ProxyInterface::r#watch_crop_region(self)
2555 }
2556
2557 pub fn r#set_resolution(
2561 &self,
2562 mut coded_size: &fidl_fuchsia_math::Size,
2563 ) -> Result<(), fidl::Error> {
2564 Stream_ProxyInterface::r#set_resolution(self, coded_size)
2565 }
2566
2567 pub fn r#watch_resolution(
2571 &self,
2572 ) -> fidl::client::QueryResponseFut<
2573 fidl_fuchsia_math::Size,
2574 fidl::encoding::DefaultFuchsiaResourceDialect,
2575 > {
2576 Stream_ProxyInterface::r#watch_resolution(self)
2577 }
2578
2579 pub fn r#set_buffer_collection2(
2586 &self,
2587 mut token: Option<
2588 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2589 >,
2590 ) -> Result<(), fidl::Error> {
2591 Stream_ProxyInterface::r#set_buffer_collection2(self, token)
2592 }
2593
2594 pub fn r#set_buffer_collection(
2595 &self,
2596 mut token: Option<
2597 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2598 >,
2599 ) -> Result<(), fidl::Error> {
2600 Stream_ProxyInterface::r#set_buffer_collection(self, token)
2601 }
2602
2603 pub fn r#watch_buffer_collection2(
2611 &self,
2612 ) -> fidl::client::QueryResponseFut<
2613 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2614 fidl::encoding::DefaultFuchsiaResourceDialect,
2615 > {
2616 Stream_ProxyInterface::r#watch_buffer_collection2(self)
2617 }
2618
2619 pub fn r#watch_buffer_collection(
2620 &self,
2621 ) -> fidl::client::QueryResponseFut<
2622 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2623 fidl::encoding::DefaultFuchsiaResourceDialect,
2624 > {
2625 Stream_ProxyInterface::r#watch_buffer_collection(self)
2626 }
2627
2628 pub fn r#watch_orientation(
2632 &self,
2633 ) -> fidl::client::QueryResponseFut<Orientation, fidl::encoding::DefaultFuchsiaResourceDialect>
2634 {
2635 Stream_ProxyInterface::r#watch_orientation(self)
2636 }
2637
2638 pub fn r#get_next_frame(
2640 &self,
2641 ) -> fidl::client::QueryResponseFut<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
2642 {
2643 Stream_ProxyInterface::r#get_next_frame(self)
2644 }
2645
2646 pub fn r#get_next_frame2(
2653 &self,
2654 ) -> fidl::client::QueryResponseFut<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>
2655 {
2656 Stream_ProxyInterface::r#get_next_frame2(self)
2657 }
2658
2659 pub fn r#rebind(
2663 &self,
2664 mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
2665 ) -> Result<(), fidl::Error> {
2666 Stream_ProxyInterface::r#rebind(self, request)
2667 }
2668}
2669
2670impl Stream_ProxyInterface for Stream_Proxy {
2671 type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
2672 StreamProperties,
2673 fidl::encoding::DefaultFuchsiaResourceDialect,
2674 >;
2675 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
2676 fn _decode(
2677 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2678 ) -> Result<StreamProperties, fidl::Error> {
2679 let _response = fidl::client::decode_transaction_body::<
2680 StreamGetPropertiesResponse,
2681 fidl::encoding::DefaultFuchsiaResourceDialect,
2682 0x13662921504b55f7,
2683 >(_buf?)?;
2684 Ok(_response.properties)
2685 }
2686 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StreamProperties>(
2687 (),
2688 0x13662921504b55f7,
2689 fidl::encoding::DynamicFlags::empty(),
2690 _decode,
2691 )
2692 }
2693
2694 type GetProperties2ResponseFut = fidl::client::QueryResponseFut<
2695 StreamProperties2,
2696 fidl::encoding::DefaultFuchsiaResourceDialect,
2697 >;
2698 fn r#get_properties2(&self) -> Self::GetProperties2ResponseFut {
2699 fn _decode(
2700 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2701 ) -> Result<StreamProperties2, fidl::Error> {
2702 let _response = fidl::client::decode_transaction_body::<
2703 StreamGetProperties2Response,
2704 fidl::encoding::DefaultFuchsiaResourceDialect,
2705 0x70346d69a8cbc391,
2706 >(_buf?)?;
2707 Ok(_response.properties)
2708 }
2709 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StreamProperties2>(
2710 (),
2711 0x70346d69a8cbc391,
2712 fidl::encoding::DynamicFlags::empty(),
2713 _decode,
2714 )
2715 }
2716
2717 fn r#set_crop_region(
2718 &self,
2719 mut region: Option<&fidl_fuchsia_math::RectF>,
2720 ) -> Result<(), fidl::Error> {
2721 self.client.send::<StreamSetCropRegionRequest>(
2722 (region,),
2723 0x72dde73bf7a94302,
2724 fidl::encoding::DynamicFlags::empty(),
2725 )
2726 }
2727
2728 type WatchCropRegionResponseFut = fidl::client::QueryResponseFut<
2729 Option<Box<fidl_fuchsia_math::RectF>>,
2730 fidl::encoding::DefaultFuchsiaResourceDialect,
2731 >;
2732 fn r#watch_crop_region(&self) -> Self::WatchCropRegionResponseFut {
2733 fn _decode(
2734 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2735 ) -> Result<Option<Box<fidl_fuchsia_math::RectF>>, fidl::Error> {
2736 let _response = fidl::client::decode_transaction_body::<
2737 StreamWatchCropRegionResponse,
2738 fidl::encoding::DefaultFuchsiaResourceDialect,
2739 0x4c28250035dbbb90,
2740 >(_buf?)?;
2741 Ok(_response.region)
2742 }
2743 self.client.send_query_and_decode::<
2744 fidl::encoding::EmptyPayload,
2745 Option<Box<fidl_fuchsia_math::RectF>>,
2746 >(
2747 (),
2748 0x4c28250035dbbb90,
2749 fidl::encoding::DynamicFlags::empty(),
2750 _decode,
2751 )
2752 }
2753
2754 fn r#set_resolution(
2755 &self,
2756 mut coded_size: &fidl_fuchsia_math::Size,
2757 ) -> Result<(), fidl::Error> {
2758 self.client.send::<StreamSetResolutionRequest>(
2759 (coded_size,),
2760 0x6ef2c207ff2b74e3,
2761 fidl::encoding::DynamicFlags::empty(),
2762 )
2763 }
2764
2765 type WatchResolutionResponseFut = fidl::client::QueryResponseFut<
2766 fidl_fuchsia_math::Size,
2767 fidl::encoding::DefaultFuchsiaResourceDialect,
2768 >;
2769 fn r#watch_resolution(&self) -> Self::WatchResolutionResponseFut {
2770 fn _decode(
2771 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2772 ) -> Result<fidl_fuchsia_math::Size, fidl::Error> {
2773 let _response = fidl::client::decode_transaction_body::<
2774 StreamWatchResolutionResponse,
2775 fidl::encoding::DefaultFuchsiaResourceDialect,
2776 0x6c7b28be2b72ea7f,
2777 >(_buf?)?;
2778 Ok(_response.coded_size)
2779 }
2780 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_math::Size>(
2781 (),
2782 0x6c7b28be2b72ea7f,
2783 fidl::encoding::DynamicFlags::empty(),
2784 _decode,
2785 )
2786 }
2787
2788 fn r#set_buffer_collection2(
2789 &self,
2790 mut token: Option<
2791 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2792 >,
2793 ) -> Result<(), fidl::Error> {
2794 self.client.send::<StreamSetBufferCollection2Request>(
2795 (token,),
2796 0x6691d2eed219c8e6,
2797 fidl::encoding::DynamicFlags::empty(),
2798 )
2799 }
2800
2801 fn r#set_buffer_collection(
2802 &self,
2803 mut token: Option<
2804 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2805 >,
2806 ) -> Result<(), fidl::Error> {
2807 self.client.send::<StreamSetBufferCollectionRequest>(
2808 (token,),
2809 0x730ab5c4ee023c6d,
2810 fidl::encoding::DynamicFlags::empty(),
2811 )
2812 }
2813
2814 type WatchBufferCollection2ResponseFut = fidl::client::QueryResponseFut<
2815 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2816 fidl::encoding::DefaultFuchsiaResourceDialect,
2817 >;
2818 fn r#watch_buffer_collection2(&self) -> Self::WatchBufferCollection2ResponseFut {
2819 fn _decode(
2820 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2821 ) -> Result<
2822 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2823 fidl::Error,
2824 > {
2825 let _response = fidl::client::decode_transaction_body::<
2826 StreamWatchBufferCollection2Response,
2827 fidl::encoding::DefaultFuchsiaResourceDialect,
2828 0x60c9daa36b3d2cf1,
2829 >(_buf?)?;
2830 Ok(_response.token)
2831 }
2832 self.client.send_query_and_decode::<
2833 fidl::encoding::EmptyPayload,
2834 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2835 >(
2836 (),
2837 0x60c9daa36b3d2cf1,
2838 fidl::encoding::DynamicFlags::empty(),
2839 _decode,
2840 )
2841 }
2842
2843 type WatchBufferCollectionResponseFut = fidl::client::QueryResponseFut<
2844 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2845 fidl::encoding::DefaultFuchsiaResourceDialect,
2846 >;
2847 fn r#watch_buffer_collection(&self) -> Self::WatchBufferCollectionResponseFut {
2848 fn _decode(
2849 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2850 ) -> Result<
2851 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2852 fidl::Error,
2853 > {
2854 let _response = fidl::client::decode_transaction_body::<
2855 StreamWatchBufferCollectionResponse,
2856 fidl::encoding::DefaultFuchsiaResourceDialect,
2857 0x35d855a45e19e5d6,
2858 >(_buf?)?;
2859 Ok(_response.token)
2860 }
2861 self.client.send_query_and_decode::<
2862 fidl::encoding::EmptyPayload,
2863 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2864 >(
2865 (),
2866 0x35d855a45e19e5d6,
2867 fidl::encoding::DynamicFlags::empty(),
2868 _decode,
2869 )
2870 }
2871
2872 type WatchOrientationResponseFut =
2873 fidl::client::QueryResponseFut<Orientation, fidl::encoding::DefaultFuchsiaResourceDialect>;
2874 fn r#watch_orientation(&self) -> Self::WatchOrientationResponseFut {
2875 fn _decode(
2876 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2877 ) -> Result<Orientation, fidl::Error> {
2878 let _response = fidl::client::decode_transaction_body::<
2879 StreamWatchOrientationResponse,
2880 fidl::encoding::DefaultFuchsiaResourceDialect,
2881 0x1f0d1cd93daa1dd4,
2882 >(_buf?)?;
2883 Ok(_response.orientation)
2884 }
2885 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Orientation>(
2886 (),
2887 0x1f0d1cd93daa1dd4,
2888 fidl::encoding::DynamicFlags::empty(),
2889 _decode,
2890 )
2891 }
2892
2893 type GetNextFrameResponseFut =
2894 fidl::client::QueryResponseFut<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
2895 fn r#get_next_frame(&self) -> Self::GetNextFrameResponseFut {
2896 fn _decode(
2897 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2898 ) -> Result<FrameInfo, fidl::Error> {
2899 let _response = fidl::client::decode_transaction_body::<
2900 StreamGetNextFrameResponse,
2901 fidl::encoding::DefaultFuchsiaResourceDialect,
2902 0x4b06b8dfbcbdc658,
2903 >(_buf?)?;
2904 Ok(_response.info)
2905 }
2906 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FrameInfo>(
2907 (),
2908 0x4b06b8dfbcbdc658,
2909 fidl::encoding::DynamicFlags::empty(),
2910 _decode,
2911 )
2912 }
2913
2914 type GetNextFrame2ResponseFut =
2915 fidl::client::QueryResponseFut<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>;
2916 fn r#get_next_frame2(&self) -> Self::GetNextFrame2ResponseFut {
2917 fn _decode(
2918 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2919 ) -> Result<FrameInfo2, fidl::Error> {
2920 let _response = fidl::client::decode_transaction_body::<
2921 StreamGetNextFrame2Response,
2922 fidl::encoding::DefaultFuchsiaResourceDialect,
2923 0x7142a7a6aa6a6f10,
2924 >(_buf?)?;
2925 Ok(_response.info)
2926 }
2927 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FrameInfo2>(
2928 (),
2929 0x7142a7a6aa6a6f10,
2930 fidl::encoding::DynamicFlags::empty(),
2931 _decode,
2932 )
2933 }
2934
2935 fn r#rebind(
2936 &self,
2937 mut request: fidl::endpoints::ServerEnd<Stream_Marker>,
2938 ) -> Result<(), fidl::Error> {
2939 self.client.send::<StreamRebindRequest>(
2940 (request,),
2941 0x75b84fa09b68dbef,
2942 fidl::encoding::DynamicFlags::empty(),
2943 )
2944 }
2945}
2946
2947pub struct Stream_EventStream {
2948 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2949}
2950
2951impl std::marker::Unpin for Stream_EventStream {}
2952
2953impl futures::stream::FusedStream for Stream_EventStream {
2954 fn is_terminated(&self) -> bool {
2955 self.event_receiver.is_terminated()
2956 }
2957}
2958
2959impl futures::Stream for Stream_EventStream {
2960 type Item = Result<Stream_Event, fidl::Error>;
2961
2962 fn poll_next(
2963 mut self: std::pin::Pin<&mut Self>,
2964 cx: &mut std::task::Context<'_>,
2965 ) -> std::task::Poll<Option<Self::Item>> {
2966 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2967 &mut self.event_receiver,
2968 cx
2969 )?) {
2970 Some(buf) => std::task::Poll::Ready(Some(Stream_Event::decode(buf))),
2971 None => std::task::Poll::Ready(None),
2972 }
2973 }
2974}
2975
2976#[derive(Debug)]
2977pub enum Stream_Event {}
2978
2979impl Stream_Event {
2980 fn decode(
2982 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2983 ) -> Result<Stream_Event, fidl::Error> {
2984 let (bytes, _handles) = buf.split_mut();
2985 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2986 debug_assert_eq!(tx_header.tx_id, 0);
2987 match tx_header.ordinal {
2988 _ => Err(fidl::Error::UnknownOrdinal {
2989 ordinal: tx_header.ordinal,
2990 protocol_name: <Stream_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2991 }),
2992 }
2993 }
2994}
2995
2996pub struct Stream_RequestStream {
2998 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2999 is_terminated: bool,
3000}
3001
3002impl std::marker::Unpin for Stream_RequestStream {}
3003
3004impl futures::stream::FusedStream for Stream_RequestStream {
3005 fn is_terminated(&self) -> bool {
3006 self.is_terminated
3007 }
3008}
3009
3010impl fidl::endpoints::RequestStream for Stream_RequestStream {
3011 type Protocol = Stream_Marker;
3012 type ControlHandle = Stream_ControlHandle;
3013
3014 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3015 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3016 }
3017
3018 fn control_handle(&self) -> Self::ControlHandle {
3019 Stream_ControlHandle { inner: self.inner.clone() }
3020 }
3021
3022 fn into_inner(
3023 self,
3024 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3025 {
3026 (self.inner, self.is_terminated)
3027 }
3028
3029 fn from_inner(
3030 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3031 is_terminated: bool,
3032 ) -> Self {
3033 Self { inner, is_terminated }
3034 }
3035}
3036
3037impl futures::Stream for Stream_RequestStream {
3038 type Item = Result<Stream_Request, fidl::Error>;
3039
3040 fn poll_next(
3041 mut self: std::pin::Pin<&mut Self>,
3042 cx: &mut std::task::Context<'_>,
3043 ) -> std::task::Poll<Option<Self::Item>> {
3044 let this = &mut *self;
3045 if this.inner.check_shutdown(cx) {
3046 this.is_terminated = true;
3047 return std::task::Poll::Ready(None);
3048 }
3049 if this.is_terminated {
3050 panic!("polled Stream_RequestStream after completion");
3051 }
3052 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3053 |bytes, handles| {
3054 match this.inner.channel().read_etc(cx, bytes, handles) {
3055 std::task::Poll::Ready(Ok(())) => {}
3056 std::task::Poll::Pending => return std::task::Poll::Pending,
3057 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3058 this.is_terminated = true;
3059 return std::task::Poll::Ready(None);
3060 }
3061 std::task::Poll::Ready(Err(e)) => {
3062 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3063 e.into(),
3064 ))))
3065 }
3066 }
3067
3068 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3070
3071 std::task::Poll::Ready(Some(match header.ordinal {
3072 0x13662921504b55f7 => {
3073 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3074 let mut req = fidl::new_empty!(
3075 fidl::encoding::EmptyPayload,
3076 fidl::encoding::DefaultFuchsiaResourceDialect
3077 );
3078 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3079 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3080 Ok(Stream_Request::GetProperties {
3081 responder: Stream_GetPropertiesResponder {
3082 control_handle: std::mem::ManuallyDrop::new(control_handle),
3083 tx_id: header.tx_id,
3084 },
3085 })
3086 }
3087 0x70346d69a8cbc391 => {
3088 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3089 let mut req = fidl::new_empty!(
3090 fidl::encoding::EmptyPayload,
3091 fidl::encoding::DefaultFuchsiaResourceDialect
3092 );
3093 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3094 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3095 Ok(Stream_Request::GetProperties2 {
3096 responder: Stream_GetProperties2Responder {
3097 control_handle: std::mem::ManuallyDrop::new(control_handle),
3098 tx_id: header.tx_id,
3099 },
3100 })
3101 }
3102 0x72dde73bf7a94302 => {
3103 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3104 let mut req = fidl::new_empty!(
3105 StreamSetCropRegionRequest,
3106 fidl::encoding::DefaultFuchsiaResourceDialect
3107 );
3108 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetCropRegionRequest>(&header, _body_bytes, handles, &mut req)?;
3109 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3110 Ok(Stream_Request::SetCropRegion { region: req.region, control_handle })
3111 }
3112 0x4c28250035dbbb90 => {
3113 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3114 let mut req = fidl::new_empty!(
3115 fidl::encoding::EmptyPayload,
3116 fidl::encoding::DefaultFuchsiaResourceDialect
3117 );
3118 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3119 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3120 Ok(Stream_Request::WatchCropRegion {
3121 responder: Stream_WatchCropRegionResponder {
3122 control_handle: std::mem::ManuallyDrop::new(control_handle),
3123 tx_id: header.tx_id,
3124 },
3125 })
3126 }
3127 0x6ef2c207ff2b74e3 => {
3128 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3129 let mut req = fidl::new_empty!(
3130 StreamSetResolutionRequest,
3131 fidl::encoding::DefaultFuchsiaResourceDialect
3132 );
3133 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetResolutionRequest>(&header, _body_bytes, handles, &mut req)?;
3134 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3135 Ok(Stream_Request::SetResolution {
3136 coded_size: req.coded_size,
3137
3138 control_handle,
3139 })
3140 }
3141 0x6c7b28be2b72ea7f => {
3142 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3143 let mut req = fidl::new_empty!(
3144 fidl::encoding::EmptyPayload,
3145 fidl::encoding::DefaultFuchsiaResourceDialect
3146 );
3147 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3148 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3149 Ok(Stream_Request::WatchResolution {
3150 responder: Stream_WatchResolutionResponder {
3151 control_handle: std::mem::ManuallyDrop::new(control_handle),
3152 tx_id: header.tx_id,
3153 },
3154 })
3155 }
3156 0x6691d2eed219c8e6 => {
3157 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3158 let mut req = fidl::new_empty!(
3159 StreamSetBufferCollection2Request,
3160 fidl::encoding::DefaultFuchsiaResourceDialect
3161 );
3162 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetBufferCollection2Request>(&header, _body_bytes, handles, &mut req)?;
3163 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3164 Ok(Stream_Request::SetBufferCollection2 {
3165 token: req.token,
3166
3167 control_handle,
3168 })
3169 }
3170 0x730ab5c4ee023c6d => {
3171 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3172 let mut req = fidl::new_empty!(
3173 StreamSetBufferCollectionRequest,
3174 fidl::encoding::DefaultFuchsiaResourceDialect
3175 );
3176 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamSetBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
3177 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3178 Ok(Stream_Request::SetBufferCollection { token: req.token, control_handle })
3179 }
3180 0x60c9daa36b3d2cf1 => {
3181 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3182 let mut req = fidl::new_empty!(
3183 fidl::encoding::EmptyPayload,
3184 fidl::encoding::DefaultFuchsiaResourceDialect
3185 );
3186 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3187 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3188 Ok(Stream_Request::WatchBufferCollection2 {
3189 responder: Stream_WatchBufferCollection2Responder {
3190 control_handle: std::mem::ManuallyDrop::new(control_handle),
3191 tx_id: header.tx_id,
3192 },
3193 })
3194 }
3195 0x35d855a45e19e5d6 => {
3196 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3197 let mut req = fidl::new_empty!(
3198 fidl::encoding::EmptyPayload,
3199 fidl::encoding::DefaultFuchsiaResourceDialect
3200 );
3201 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3202 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3203 Ok(Stream_Request::WatchBufferCollection {
3204 responder: Stream_WatchBufferCollectionResponder {
3205 control_handle: std::mem::ManuallyDrop::new(control_handle),
3206 tx_id: header.tx_id,
3207 },
3208 })
3209 }
3210 0x1f0d1cd93daa1dd4 => {
3211 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3212 let mut req = fidl::new_empty!(
3213 fidl::encoding::EmptyPayload,
3214 fidl::encoding::DefaultFuchsiaResourceDialect
3215 );
3216 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3217 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3218 Ok(Stream_Request::WatchOrientation {
3219 responder: Stream_WatchOrientationResponder {
3220 control_handle: std::mem::ManuallyDrop::new(control_handle),
3221 tx_id: header.tx_id,
3222 },
3223 })
3224 }
3225 0x4b06b8dfbcbdc658 => {
3226 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3227 let mut req = fidl::new_empty!(
3228 fidl::encoding::EmptyPayload,
3229 fidl::encoding::DefaultFuchsiaResourceDialect
3230 );
3231 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3232 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3233 Ok(Stream_Request::GetNextFrame {
3234 responder: Stream_GetNextFrameResponder {
3235 control_handle: std::mem::ManuallyDrop::new(control_handle),
3236 tx_id: header.tx_id,
3237 },
3238 })
3239 }
3240 0x7142a7a6aa6a6f10 => {
3241 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3242 let mut req = fidl::new_empty!(
3243 fidl::encoding::EmptyPayload,
3244 fidl::encoding::DefaultFuchsiaResourceDialect
3245 );
3246 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3247 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3248 Ok(Stream_Request::GetNextFrame2 {
3249 responder: Stream_GetNextFrame2Responder {
3250 control_handle: std::mem::ManuallyDrop::new(control_handle),
3251 tx_id: header.tx_id,
3252 },
3253 })
3254 }
3255 0x75b84fa09b68dbef => {
3256 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3257 let mut req = fidl::new_empty!(
3258 StreamRebindRequest,
3259 fidl::encoding::DefaultFuchsiaResourceDialect
3260 );
3261 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamRebindRequest>(&header, _body_bytes, handles, &mut req)?;
3262 let control_handle = Stream_ControlHandle { inner: this.inner.clone() };
3263 Ok(Stream_Request::Rebind { request: req.request, control_handle })
3264 }
3265 _ => Err(fidl::Error::UnknownOrdinal {
3266 ordinal: header.ordinal,
3267 protocol_name:
3268 <Stream_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3269 }),
3270 }))
3271 },
3272 )
3273 }
3274}
3275
3276#[derive(Debug)]
3279pub enum Stream_Request {
3280 GetProperties {
3283 responder: Stream_GetPropertiesResponder,
3284 },
3285 GetProperties2 {
3288 responder: Stream_GetProperties2Responder,
3289 },
3290 SetCropRegion {
3299 region: Option<Box<fidl_fuchsia_math::RectF>>,
3300 control_handle: Stream_ControlHandle,
3301 },
3302 WatchCropRegion {
3306 responder: Stream_WatchCropRegionResponder,
3307 },
3308 SetResolution {
3312 coded_size: fidl_fuchsia_math::Size,
3313 control_handle: Stream_ControlHandle,
3314 },
3315 WatchResolution {
3319 responder: Stream_WatchResolutionResponder,
3320 },
3321 SetBufferCollection2 {
3328 token:
3329 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>>,
3330 control_handle: Stream_ControlHandle,
3331 },
3332 SetBufferCollection {
3333 token: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
3334 control_handle: Stream_ControlHandle,
3335 },
3336 WatchBufferCollection2 {
3344 responder: Stream_WatchBufferCollection2Responder,
3345 },
3346 WatchBufferCollection {
3347 responder: Stream_WatchBufferCollectionResponder,
3348 },
3349 WatchOrientation {
3353 responder: Stream_WatchOrientationResponder,
3354 },
3355 GetNextFrame {
3357 responder: Stream_GetNextFrameResponder,
3358 },
3359 GetNextFrame2 {
3366 responder: Stream_GetNextFrame2Responder,
3367 },
3368 Rebind {
3372 request: fidl::endpoints::ServerEnd<Stream_Marker>,
3373 control_handle: Stream_ControlHandle,
3374 },
3375}
3376
3377impl Stream_Request {
3378 #[allow(irrefutable_let_patterns)]
3379 pub fn into_get_properties(self) -> Option<(Stream_GetPropertiesResponder)> {
3380 if let Stream_Request::GetProperties { responder } = self {
3381 Some((responder))
3382 } else {
3383 None
3384 }
3385 }
3386
3387 #[allow(irrefutable_let_patterns)]
3388 pub fn into_get_properties2(self) -> Option<(Stream_GetProperties2Responder)> {
3389 if let Stream_Request::GetProperties2 { responder } = self {
3390 Some((responder))
3391 } else {
3392 None
3393 }
3394 }
3395
3396 #[allow(irrefutable_let_patterns)]
3397 pub fn into_set_crop_region(
3398 self,
3399 ) -> Option<(Option<Box<fidl_fuchsia_math::RectF>>, Stream_ControlHandle)> {
3400 if let Stream_Request::SetCropRegion { region, control_handle } = self {
3401 Some((region, control_handle))
3402 } else {
3403 None
3404 }
3405 }
3406
3407 #[allow(irrefutable_let_patterns)]
3408 pub fn into_watch_crop_region(self) -> Option<(Stream_WatchCropRegionResponder)> {
3409 if let Stream_Request::WatchCropRegion { responder } = self {
3410 Some((responder))
3411 } else {
3412 None
3413 }
3414 }
3415
3416 #[allow(irrefutable_let_patterns)]
3417 pub fn into_set_resolution(self) -> Option<(fidl_fuchsia_math::Size, Stream_ControlHandle)> {
3418 if let Stream_Request::SetResolution { coded_size, control_handle } = self {
3419 Some((coded_size, control_handle))
3420 } else {
3421 None
3422 }
3423 }
3424
3425 #[allow(irrefutable_let_patterns)]
3426 pub fn into_watch_resolution(self) -> Option<(Stream_WatchResolutionResponder)> {
3427 if let Stream_Request::WatchResolution { responder } = self {
3428 Some((responder))
3429 } else {
3430 None
3431 }
3432 }
3433
3434 #[allow(irrefutable_let_patterns)]
3435 pub fn into_set_buffer_collection2(
3436 self,
3437 ) -> Option<(
3438 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>>,
3439 Stream_ControlHandle,
3440 )> {
3441 if let Stream_Request::SetBufferCollection2 { token, control_handle } = self {
3442 Some((token, control_handle))
3443 } else {
3444 None
3445 }
3446 }
3447
3448 #[allow(irrefutable_let_patterns)]
3449 pub fn into_set_buffer_collection(
3450 self,
3451 ) -> Option<(
3452 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>>,
3453 Stream_ControlHandle,
3454 )> {
3455 if let Stream_Request::SetBufferCollection { token, control_handle } = self {
3456 Some((token, control_handle))
3457 } else {
3458 None
3459 }
3460 }
3461
3462 #[allow(irrefutable_let_patterns)]
3463 pub fn into_watch_buffer_collection2(self) -> Option<(Stream_WatchBufferCollection2Responder)> {
3464 if let Stream_Request::WatchBufferCollection2 { responder } = self {
3465 Some((responder))
3466 } else {
3467 None
3468 }
3469 }
3470
3471 #[allow(irrefutable_let_patterns)]
3472 pub fn into_watch_buffer_collection(self) -> Option<(Stream_WatchBufferCollectionResponder)> {
3473 if let Stream_Request::WatchBufferCollection { responder } = self {
3474 Some((responder))
3475 } else {
3476 None
3477 }
3478 }
3479
3480 #[allow(irrefutable_let_patterns)]
3481 pub fn into_watch_orientation(self) -> Option<(Stream_WatchOrientationResponder)> {
3482 if let Stream_Request::WatchOrientation { responder } = self {
3483 Some((responder))
3484 } else {
3485 None
3486 }
3487 }
3488
3489 #[allow(irrefutable_let_patterns)]
3490 pub fn into_get_next_frame(self) -> Option<(Stream_GetNextFrameResponder)> {
3491 if let Stream_Request::GetNextFrame { responder } = self {
3492 Some((responder))
3493 } else {
3494 None
3495 }
3496 }
3497
3498 #[allow(irrefutable_let_patterns)]
3499 pub fn into_get_next_frame2(self) -> Option<(Stream_GetNextFrame2Responder)> {
3500 if let Stream_Request::GetNextFrame2 { responder } = self {
3501 Some((responder))
3502 } else {
3503 None
3504 }
3505 }
3506
3507 #[allow(irrefutable_let_patterns)]
3508 pub fn into_rebind(
3509 self,
3510 ) -> Option<(fidl::endpoints::ServerEnd<Stream_Marker>, Stream_ControlHandle)> {
3511 if let Stream_Request::Rebind { request, control_handle } = self {
3512 Some((request, control_handle))
3513 } else {
3514 None
3515 }
3516 }
3517
3518 pub fn method_name(&self) -> &'static str {
3520 match *self {
3521 Stream_Request::GetProperties { .. } => "get_properties",
3522 Stream_Request::GetProperties2 { .. } => "get_properties2",
3523 Stream_Request::SetCropRegion { .. } => "set_crop_region",
3524 Stream_Request::WatchCropRegion { .. } => "watch_crop_region",
3525 Stream_Request::SetResolution { .. } => "set_resolution",
3526 Stream_Request::WatchResolution { .. } => "watch_resolution",
3527 Stream_Request::SetBufferCollection2 { .. } => "set_buffer_collection2",
3528 Stream_Request::SetBufferCollection { .. } => "set_buffer_collection",
3529 Stream_Request::WatchBufferCollection2 { .. } => "watch_buffer_collection2",
3530 Stream_Request::WatchBufferCollection { .. } => "watch_buffer_collection",
3531 Stream_Request::WatchOrientation { .. } => "watch_orientation",
3532 Stream_Request::GetNextFrame { .. } => "get_next_frame",
3533 Stream_Request::GetNextFrame2 { .. } => "get_next_frame2",
3534 Stream_Request::Rebind { .. } => "rebind",
3535 }
3536 }
3537}
3538
3539#[derive(Debug, Clone)]
3540pub struct Stream_ControlHandle {
3541 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3542}
3543
3544impl fidl::endpoints::ControlHandle for Stream_ControlHandle {
3545 fn shutdown(&self) {
3546 self.inner.shutdown()
3547 }
3548 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3549 self.inner.shutdown_with_epitaph(status)
3550 }
3551
3552 fn is_closed(&self) -> bool {
3553 self.inner.channel().is_closed()
3554 }
3555 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3556 self.inner.channel().on_closed()
3557 }
3558
3559 #[cfg(target_os = "fuchsia")]
3560 fn signal_peer(
3561 &self,
3562 clear_mask: zx::Signals,
3563 set_mask: zx::Signals,
3564 ) -> Result<(), zx_status::Status> {
3565 use fidl::Peered;
3566 self.inner.channel().signal_peer(clear_mask, set_mask)
3567 }
3568}
3569
3570impl Stream_ControlHandle {}
3571
3572#[must_use = "FIDL methods require a response to be sent"]
3573#[derive(Debug)]
3574pub struct Stream_GetPropertiesResponder {
3575 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
3576 tx_id: u32,
3577}
3578
3579impl std::ops::Drop for Stream_GetPropertiesResponder {
3583 fn drop(&mut self) {
3584 self.control_handle.shutdown();
3585 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3587 }
3588}
3589
3590impl fidl::endpoints::Responder for Stream_GetPropertiesResponder {
3591 type ControlHandle = Stream_ControlHandle;
3592
3593 fn control_handle(&self) -> &Stream_ControlHandle {
3594 &self.control_handle
3595 }
3596
3597 fn drop_without_shutdown(mut self) {
3598 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3600 std::mem::forget(self);
3602 }
3603}
3604
3605impl Stream_GetPropertiesResponder {
3606 pub fn send(self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
3610 let _result = self.send_raw(properties);
3611 if _result.is_err() {
3612 self.control_handle.shutdown();
3613 }
3614 self.drop_without_shutdown();
3615 _result
3616 }
3617
3618 pub fn send_no_shutdown_on_err(
3620 self,
3621 mut properties: &StreamProperties,
3622 ) -> Result<(), fidl::Error> {
3623 let _result = self.send_raw(properties);
3624 self.drop_without_shutdown();
3625 _result
3626 }
3627
3628 fn send_raw(&self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
3629 self.control_handle.inner.send::<StreamGetPropertiesResponse>(
3630 (properties,),
3631 self.tx_id,
3632 0x13662921504b55f7,
3633 fidl::encoding::DynamicFlags::empty(),
3634 )
3635 }
3636}
3637
3638#[must_use = "FIDL methods require a response to be sent"]
3639#[derive(Debug)]
3640pub struct Stream_GetProperties2Responder {
3641 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
3642 tx_id: u32,
3643}
3644
3645impl std::ops::Drop for Stream_GetProperties2Responder {
3649 fn drop(&mut self) {
3650 self.control_handle.shutdown();
3651 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3653 }
3654}
3655
3656impl fidl::endpoints::Responder for Stream_GetProperties2Responder {
3657 type ControlHandle = Stream_ControlHandle;
3658
3659 fn control_handle(&self) -> &Stream_ControlHandle {
3660 &self.control_handle
3661 }
3662
3663 fn drop_without_shutdown(mut self) {
3664 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3666 std::mem::forget(self);
3668 }
3669}
3670
3671impl Stream_GetProperties2Responder {
3672 pub fn send(self, mut properties: &StreamProperties2) -> Result<(), fidl::Error> {
3676 let _result = self.send_raw(properties);
3677 if _result.is_err() {
3678 self.control_handle.shutdown();
3679 }
3680 self.drop_without_shutdown();
3681 _result
3682 }
3683
3684 pub fn send_no_shutdown_on_err(
3686 self,
3687 mut properties: &StreamProperties2,
3688 ) -> Result<(), fidl::Error> {
3689 let _result = self.send_raw(properties);
3690 self.drop_without_shutdown();
3691 _result
3692 }
3693
3694 fn send_raw(&self, mut properties: &StreamProperties2) -> Result<(), fidl::Error> {
3695 self.control_handle.inner.send::<StreamGetProperties2Response>(
3696 (properties,),
3697 self.tx_id,
3698 0x70346d69a8cbc391,
3699 fidl::encoding::DynamicFlags::empty(),
3700 )
3701 }
3702}
3703
3704#[must_use = "FIDL methods require a response to be sent"]
3705#[derive(Debug)]
3706pub struct Stream_WatchCropRegionResponder {
3707 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
3708 tx_id: u32,
3709}
3710
3711impl std::ops::Drop for Stream_WatchCropRegionResponder {
3715 fn drop(&mut self) {
3716 self.control_handle.shutdown();
3717 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3719 }
3720}
3721
3722impl fidl::endpoints::Responder for Stream_WatchCropRegionResponder {
3723 type ControlHandle = Stream_ControlHandle;
3724
3725 fn control_handle(&self) -> &Stream_ControlHandle {
3726 &self.control_handle
3727 }
3728
3729 fn drop_without_shutdown(mut self) {
3730 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3732 std::mem::forget(self);
3734 }
3735}
3736
3737impl Stream_WatchCropRegionResponder {
3738 pub fn send(self, mut region: Option<&fidl_fuchsia_math::RectF>) -> Result<(), fidl::Error> {
3742 let _result = self.send_raw(region);
3743 if _result.is_err() {
3744 self.control_handle.shutdown();
3745 }
3746 self.drop_without_shutdown();
3747 _result
3748 }
3749
3750 pub fn send_no_shutdown_on_err(
3752 self,
3753 mut region: Option<&fidl_fuchsia_math::RectF>,
3754 ) -> Result<(), fidl::Error> {
3755 let _result = self.send_raw(region);
3756 self.drop_without_shutdown();
3757 _result
3758 }
3759
3760 fn send_raw(&self, mut region: Option<&fidl_fuchsia_math::RectF>) -> Result<(), fidl::Error> {
3761 self.control_handle.inner.send::<StreamWatchCropRegionResponse>(
3762 (region,),
3763 self.tx_id,
3764 0x4c28250035dbbb90,
3765 fidl::encoding::DynamicFlags::empty(),
3766 )
3767 }
3768}
3769
3770#[must_use = "FIDL methods require a response to be sent"]
3771#[derive(Debug)]
3772pub struct Stream_WatchResolutionResponder {
3773 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
3774 tx_id: u32,
3775}
3776
3777impl std::ops::Drop for Stream_WatchResolutionResponder {
3781 fn drop(&mut self) {
3782 self.control_handle.shutdown();
3783 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3785 }
3786}
3787
3788impl fidl::endpoints::Responder for Stream_WatchResolutionResponder {
3789 type ControlHandle = Stream_ControlHandle;
3790
3791 fn control_handle(&self) -> &Stream_ControlHandle {
3792 &self.control_handle
3793 }
3794
3795 fn drop_without_shutdown(mut self) {
3796 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3798 std::mem::forget(self);
3800 }
3801}
3802
3803impl Stream_WatchResolutionResponder {
3804 pub fn send(self, mut coded_size: &fidl_fuchsia_math::Size) -> Result<(), fidl::Error> {
3808 let _result = self.send_raw(coded_size);
3809 if _result.is_err() {
3810 self.control_handle.shutdown();
3811 }
3812 self.drop_without_shutdown();
3813 _result
3814 }
3815
3816 pub fn send_no_shutdown_on_err(
3818 self,
3819 mut coded_size: &fidl_fuchsia_math::Size,
3820 ) -> Result<(), fidl::Error> {
3821 let _result = self.send_raw(coded_size);
3822 self.drop_without_shutdown();
3823 _result
3824 }
3825
3826 fn send_raw(&self, mut coded_size: &fidl_fuchsia_math::Size) -> Result<(), fidl::Error> {
3827 self.control_handle.inner.send::<StreamWatchResolutionResponse>(
3828 (coded_size,),
3829 self.tx_id,
3830 0x6c7b28be2b72ea7f,
3831 fidl::encoding::DynamicFlags::empty(),
3832 )
3833 }
3834}
3835
3836#[must_use = "FIDL methods require a response to be sent"]
3837#[derive(Debug)]
3838pub struct Stream_WatchBufferCollection2Responder {
3839 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
3840 tx_id: u32,
3841}
3842
3843impl std::ops::Drop for Stream_WatchBufferCollection2Responder {
3847 fn drop(&mut self) {
3848 self.control_handle.shutdown();
3849 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3851 }
3852}
3853
3854impl fidl::endpoints::Responder for Stream_WatchBufferCollection2Responder {
3855 type ControlHandle = Stream_ControlHandle;
3856
3857 fn control_handle(&self) -> &Stream_ControlHandle {
3858 &self.control_handle
3859 }
3860
3861 fn drop_without_shutdown(mut self) {
3862 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3864 std::mem::forget(self);
3866 }
3867}
3868
3869impl Stream_WatchBufferCollection2Responder {
3870 pub fn send(
3874 self,
3875 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
3876 ) -> Result<(), fidl::Error> {
3877 let _result = self.send_raw(token);
3878 if _result.is_err() {
3879 self.control_handle.shutdown();
3880 }
3881 self.drop_without_shutdown();
3882 _result
3883 }
3884
3885 pub fn send_no_shutdown_on_err(
3887 self,
3888 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
3889 ) -> Result<(), fidl::Error> {
3890 let _result = self.send_raw(token);
3891 self.drop_without_shutdown();
3892 _result
3893 }
3894
3895 fn send_raw(
3896 &self,
3897 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
3898 ) -> Result<(), fidl::Error> {
3899 self.control_handle.inner.send::<StreamWatchBufferCollection2Response>(
3900 (token,),
3901 self.tx_id,
3902 0x60c9daa36b3d2cf1,
3903 fidl::encoding::DynamicFlags::empty(),
3904 )
3905 }
3906}
3907
3908#[must_use = "FIDL methods require a response to be sent"]
3909#[derive(Debug)]
3910pub struct Stream_WatchBufferCollectionResponder {
3911 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
3912 tx_id: u32,
3913}
3914
3915impl std::ops::Drop for Stream_WatchBufferCollectionResponder {
3919 fn drop(&mut self) {
3920 self.control_handle.shutdown();
3921 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3923 }
3924}
3925
3926impl fidl::endpoints::Responder for Stream_WatchBufferCollectionResponder {
3927 type ControlHandle = Stream_ControlHandle;
3928
3929 fn control_handle(&self) -> &Stream_ControlHandle {
3930 &self.control_handle
3931 }
3932
3933 fn drop_without_shutdown(mut self) {
3934 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3936 std::mem::forget(self);
3938 }
3939}
3940
3941impl Stream_WatchBufferCollectionResponder {
3942 pub fn send(
3946 self,
3947 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
3948 ) -> Result<(), fidl::Error> {
3949 let _result = self.send_raw(token);
3950 if _result.is_err() {
3951 self.control_handle.shutdown();
3952 }
3953 self.drop_without_shutdown();
3954 _result
3955 }
3956
3957 pub fn send_no_shutdown_on_err(
3959 self,
3960 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
3961 ) -> Result<(), fidl::Error> {
3962 let _result = self.send_raw(token);
3963 self.drop_without_shutdown();
3964 _result
3965 }
3966
3967 fn send_raw(
3968 &self,
3969 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
3970 ) -> Result<(), fidl::Error> {
3971 self.control_handle.inner.send::<StreamWatchBufferCollectionResponse>(
3972 (token,),
3973 self.tx_id,
3974 0x35d855a45e19e5d6,
3975 fidl::encoding::DynamicFlags::empty(),
3976 )
3977 }
3978}
3979
3980#[must_use = "FIDL methods require a response to be sent"]
3981#[derive(Debug)]
3982pub struct Stream_WatchOrientationResponder {
3983 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
3984 tx_id: u32,
3985}
3986
3987impl std::ops::Drop for Stream_WatchOrientationResponder {
3991 fn drop(&mut self) {
3992 self.control_handle.shutdown();
3993 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3995 }
3996}
3997
3998impl fidl::endpoints::Responder for Stream_WatchOrientationResponder {
3999 type ControlHandle = Stream_ControlHandle;
4000
4001 fn control_handle(&self) -> &Stream_ControlHandle {
4002 &self.control_handle
4003 }
4004
4005 fn drop_without_shutdown(mut self) {
4006 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4008 std::mem::forget(self);
4010 }
4011}
4012
4013impl Stream_WatchOrientationResponder {
4014 pub fn send(self, mut orientation: Orientation) -> Result<(), fidl::Error> {
4018 let _result = self.send_raw(orientation);
4019 if _result.is_err() {
4020 self.control_handle.shutdown();
4021 }
4022 self.drop_without_shutdown();
4023 _result
4024 }
4025
4026 pub fn send_no_shutdown_on_err(self, mut orientation: Orientation) -> Result<(), fidl::Error> {
4028 let _result = self.send_raw(orientation);
4029 self.drop_without_shutdown();
4030 _result
4031 }
4032
4033 fn send_raw(&self, mut orientation: Orientation) -> Result<(), fidl::Error> {
4034 self.control_handle.inner.send::<StreamWatchOrientationResponse>(
4035 (orientation,),
4036 self.tx_id,
4037 0x1f0d1cd93daa1dd4,
4038 fidl::encoding::DynamicFlags::empty(),
4039 )
4040 }
4041}
4042
4043#[must_use = "FIDL methods require a response to be sent"]
4044#[derive(Debug)]
4045pub struct Stream_GetNextFrameResponder {
4046 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
4047 tx_id: u32,
4048}
4049
4050impl std::ops::Drop for Stream_GetNextFrameResponder {
4054 fn drop(&mut self) {
4055 self.control_handle.shutdown();
4056 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4058 }
4059}
4060
4061impl fidl::endpoints::Responder for Stream_GetNextFrameResponder {
4062 type ControlHandle = Stream_ControlHandle;
4063
4064 fn control_handle(&self) -> &Stream_ControlHandle {
4065 &self.control_handle
4066 }
4067
4068 fn drop_without_shutdown(mut self) {
4069 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4071 std::mem::forget(self);
4073 }
4074}
4075
4076impl Stream_GetNextFrameResponder {
4077 pub fn send(self, mut info: FrameInfo) -> Result<(), fidl::Error> {
4081 let _result = self.send_raw(info);
4082 if _result.is_err() {
4083 self.control_handle.shutdown();
4084 }
4085 self.drop_without_shutdown();
4086 _result
4087 }
4088
4089 pub fn send_no_shutdown_on_err(self, mut info: FrameInfo) -> Result<(), fidl::Error> {
4091 let _result = self.send_raw(info);
4092 self.drop_without_shutdown();
4093 _result
4094 }
4095
4096 fn send_raw(&self, mut info: FrameInfo) -> Result<(), fidl::Error> {
4097 self.control_handle.inner.send::<StreamGetNextFrameResponse>(
4098 (&mut info,),
4099 self.tx_id,
4100 0x4b06b8dfbcbdc658,
4101 fidl::encoding::DynamicFlags::empty(),
4102 )
4103 }
4104}
4105
4106#[must_use = "FIDL methods require a response to be sent"]
4107#[derive(Debug)]
4108pub struct Stream_GetNextFrame2Responder {
4109 control_handle: std::mem::ManuallyDrop<Stream_ControlHandle>,
4110 tx_id: u32,
4111}
4112
4113impl std::ops::Drop for Stream_GetNextFrame2Responder {
4117 fn drop(&mut self) {
4118 self.control_handle.shutdown();
4119 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4121 }
4122}
4123
4124impl fidl::endpoints::Responder for Stream_GetNextFrame2Responder {
4125 type ControlHandle = Stream_ControlHandle;
4126
4127 fn control_handle(&self) -> &Stream_ControlHandle {
4128 &self.control_handle
4129 }
4130
4131 fn drop_without_shutdown(mut self) {
4132 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4134 std::mem::forget(self);
4136 }
4137}
4138
4139impl Stream_GetNextFrame2Responder {
4140 pub fn send(self, mut info: FrameInfo2) -> Result<(), fidl::Error> {
4144 let _result = self.send_raw(info);
4145 if _result.is_err() {
4146 self.control_handle.shutdown();
4147 }
4148 self.drop_without_shutdown();
4149 _result
4150 }
4151
4152 pub fn send_no_shutdown_on_err(self, mut info: FrameInfo2) -> Result<(), fidl::Error> {
4154 let _result = self.send_raw(info);
4155 self.drop_without_shutdown();
4156 _result
4157 }
4158
4159 fn send_raw(&self, mut info: FrameInfo2) -> Result<(), fidl::Error> {
4160 self.control_handle.inner.send::<StreamGetNextFrame2Response>(
4161 (&mut info,),
4162 self.tx_id,
4163 0x7142a7a6aa6a6f10,
4164 fidl::encoding::DynamicFlags::empty(),
4165 )
4166 }
4167}
4168
4169mod internal {
4170 use super::*;
4171
4172 impl fidl::encoding::ResourceTypeMarker for DeviceConnectToStreamRequest {
4173 type Borrowed<'a> = &'a mut Self;
4174 fn take_or_borrow<'a>(
4175 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4176 ) -> Self::Borrowed<'a> {
4177 value
4178 }
4179 }
4180
4181 unsafe impl fidl::encoding::TypeMarker for DeviceConnectToStreamRequest {
4182 type Owned = Self;
4183
4184 #[inline(always)]
4185 fn inline_align(_context: fidl::encoding::Context) -> usize {
4186 4
4187 }
4188
4189 #[inline(always)]
4190 fn inline_size(_context: fidl::encoding::Context) -> usize {
4191 8
4192 }
4193 }
4194
4195 unsafe impl
4196 fidl::encoding::Encode<
4197 DeviceConnectToStreamRequest,
4198 fidl::encoding::DefaultFuchsiaResourceDialect,
4199 > for &mut DeviceConnectToStreamRequest
4200 {
4201 #[inline]
4202 unsafe fn encode(
4203 self,
4204 encoder: &mut fidl::encoding::Encoder<
4205 '_,
4206 fidl::encoding::DefaultFuchsiaResourceDialect,
4207 >,
4208 offset: usize,
4209 _depth: fidl::encoding::Depth,
4210 ) -> fidl::Result<()> {
4211 encoder.debug_check_bounds::<DeviceConnectToStreamRequest>(offset);
4212 fidl::encoding::Encode::<DeviceConnectToStreamRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4214 (
4215 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
4216 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
4217 ),
4218 encoder, offset, _depth
4219 )
4220 }
4221 }
4222 unsafe impl<
4223 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
4224 T1: fidl::encoding::Encode<
4225 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
4226 fidl::encoding::DefaultFuchsiaResourceDialect,
4227 >,
4228 >
4229 fidl::encoding::Encode<
4230 DeviceConnectToStreamRequest,
4231 fidl::encoding::DefaultFuchsiaResourceDialect,
4232 > for (T0, T1)
4233 {
4234 #[inline]
4235 unsafe fn encode(
4236 self,
4237 encoder: &mut fidl::encoding::Encoder<
4238 '_,
4239 fidl::encoding::DefaultFuchsiaResourceDialect,
4240 >,
4241 offset: usize,
4242 depth: fidl::encoding::Depth,
4243 ) -> fidl::Result<()> {
4244 encoder.debug_check_bounds::<DeviceConnectToStreamRequest>(offset);
4245 self.0.encode(encoder, offset + 0, depth)?;
4249 self.1.encode(encoder, offset + 4, depth)?;
4250 Ok(())
4251 }
4252 }
4253
4254 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4255 for DeviceConnectToStreamRequest
4256 {
4257 #[inline(always)]
4258 fn new_empty() -> Self {
4259 Self {
4260 index: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
4261 request: fidl::new_empty!(
4262 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
4263 fidl::encoding::DefaultFuchsiaResourceDialect
4264 ),
4265 }
4266 }
4267
4268 #[inline]
4269 unsafe fn decode(
4270 &mut self,
4271 decoder: &mut fidl::encoding::Decoder<
4272 '_,
4273 fidl::encoding::DefaultFuchsiaResourceDialect,
4274 >,
4275 offset: usize,
4276 _depth: fidl::encoding::Depth,
4277 ) -> fidl::Result<()> {
4278 decoder.debug_check_bounds::<Self>(offset);
4279 fidl::decode!(
4281 u32,
4282 fidl::encoding::DefaultFuchsiaResourceDialect,
4283 &mut self.index,
4284 decoder,
4285 offset + 0,
4286 _depth
4287 )?;
4288 fidl::decode!(
4289 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
4290 fidl::encoding::DefaultFuchsiaResourceDialect,
4291 &mut self.request,
4292 decoder,
4293 offset + 4,
4294 _depth
4295 )?;
4296 Ok(())
4297 }
4298 }
4299
4300 impl fidl::encoding::ResourceTypeMarker for DeviceRebindRequest {
4301 type Borrowed<'a> = &'a mut Self;
4302 fn take_or_borrow<'a>(
4303 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4304 ) -> Self::Borrowed<'a> {
4305 value
4306 }
4307 }
4308
4309 unsafe impl fidl::encoding::TypeMarker for DeviceRebindRequest {
4310 type Owned = Self;
4311
4312 #[inline(always)]
4313 fn inline_align(_context: fidl::encoding::Context) -> usize {
4314 4
4315 }
4316
4317 #[inline(always)]
4318 fn inline_size(_context: fidl::encoding::Context) -> usize {
4319 4
4320 }
4321 }
4322
4323 unsafe impl
4324 fidl::encoding::Encode<DeviceRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4325 for &mut DeviceRebindRequest
4326 {
4327 #[inline]
4328 unsafe fn encode(
4329 self,
4330 encoder: &mut fidl::encoding::Encoder<
4331 '_,
4332 fidl::encoding::DefaultFuchsiaResourceDialect,
4333 >,
4334 offset: usize,
4335 _depth: fidl::encoding::Depth,
4336 ) -> fidl::Result<()> {
4337 encoder.debug_check_bounds::<DeviceRebindRequest>(offset);
4338 fidl::encoding::Encode::<DeviceRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4340 (
4341 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
4342 ),
4343 encoder, offset, _depth
4344 )
4345 }
4346 }
4347 unsafe impl<
4348 T0: fidl::encoding::Encode<
4349 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
4350 fidl::encoding::DefaultFuchsiaResourceDialect,
4351 >,
4352 >
4353 fidl::encoding::Encode<DeviceRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4354 for (T0,)
4355 {
4356 #[inline]
4357 unsafe fn encode(
4358 self,
4359 encoder: &mut fidl::encoding::Encoder<
4360 '_,
4361 fidl::encoding::DefaultFuchsiaResourceDialect,
4362 >,
4363 offset: usize,
4364 depth: fidl::encoding::Depth,
4365 ) -> fidl::Result<()> {
4366 encoder.debug_check_bounds::<DeviceRebindRequest>(offset);
4367 self.0.encode(encoder, offset + 0, depth)?;
4371 Ok(())
4372 }
4373 }
4374
4375 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4376 for DeviceRebindRequest
4377 {
4378 #[inline(always)]
4379 fn new_empty() -> Self {
4380 Self {
4381 request: fidl::new_empty!(
4382 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
4383 fidl::encoding::DefaultFuchsiaResourceDialect
4384 ),
4385 }
4386 }
4387
4388 #[inline]
4389 unsafe fn decode(
4390 &mut self,
4391 decoder: &mut fidl::encoding::Decoder<
4392 '_,
4393 fidl::encoding::DefaultFuchsiaResourceDialect,
4394 >,
4395 offset: usize,
4396 _depth: fidl::encoding::Depth,
4397 ) -> fidl::Result<()> {
4398 decoder.debug_check_bounds::<Self>(offset);
4399 fidl::decode!(
4401 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
4402 fidl::encoding::DefaultFuchsiaResourceDialect,
4403 &mut self.request,
4404 decoder,
4405 offset + 0,
4406 _depth
4407 )?;
4408 Ok(())
4409 }
4410 }
4411
4412 impl fidl::encoding::ResourceTypeMarker for DeviceWatcherConnectToDeviceRequest {
4413 type Borrowed<'a> = &'a mut Self;
4414 fn take_or_borrow<'a>(
4415 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4416 ) -> Self::Borrowed<'a> {
4417 value
4418 }
4419 }
4420
4421 unsafe impl fidl::encoding::TypeMarker for DeviceWatcherConnectToDeviceRequest {
4422 type Owned = Self;
4423
4424 #[inline(always)]
4425 fn inline_align(_context: fidl::encoding::Context) -> usize {
4426 8
4427 }
4428
4429 #[inline(always)]
4430 fn inline_size(_context: fidl::encoding::Context) -> usize {
4431 16
4432 }
4433 }
4434
4435 unsafe impl
4436 fidl::encoding::Encode<
4437 DeviceWatcherConnectToDeviceRequest,
4438 fidl::encoding::DefaultFuchsiaResourceDialect,
4439 > for &mut DeviceWatcherConnectToDeviceRequest
4440 {
4441 #[inline]
4442 unsafe fn encode(
4443 self,
4444 encoder: &mut fidl::encoding::Encoder<
4445 '_,
4446 fidl::encoding::DefaultFuchsiaResourceDialect,
4447 >,
4448 offset: usize,
4449 _depth: fidl::encoding::Depth,
4450 ) -> fidl::Result<()> {
4451 encoder.debug_check_bounds::<DeviceWatcherConnectToDeviceRequest>(offset);
4452 fidl::encoding::Encode::<DeviceWatcherConnectToDeviceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4454 (
4455 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4456 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
4457 ),
4458 encoder, offset, _depth
4459 )
4460 }
4461 }
4462 unsafe impl<
4463 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4464 T1: fidl::encoding::Encode<
4465 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
4466 fidl::encoding::DefaultFuchsiaResourceDialect,
4467 >,
4468 >
4469 fidl::encoding::Encode<
4470 DeviceWatcherConnectToDeviceRequest,
4471 fidl::encoding::DefaultFuchsiaResourceDialect,
4472 > for (T0, T1)
4473 {
4474 #[inline]
4475 unsafe fn encode(
4476 self,
4477 encoder: &mut fidl::encoding::Encoder<
4478 '_,
4479 fidl::encoding::DefaultFuchsiaResourceDialect,
4480 >,
4481 offset: usize,
4482 depth: fidl::encoding::Depth,
4483 ) -> fidl::Result<()> {
4484 encoder.debug_check_bounds::<DeviceWatcherConnectToDeviceRequest>(offset);
4485 unsafe {
4488 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4489 (ptr as *mut u64).write_unaligned(0);
4490 }
4491 self.0.encode(encoder, offset + 0, depth)?;
4493 self.1.encode(encoder, offset + 8, depth)?;
4494 Ok(())
4495 }
4496 }
4497
4498 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4499 for DeviceWatcherConnectToDeviceRequest
4500 {
4501 #[inline(always)]
4502 fn new_empty() -> Self {
4503 Self {
4504 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
4505 request: fidl::new_empty!(
4506 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
4507 fidl::encoding::DefaultFuchsiaResourceDialect
4508 ),
4509 }
4510 }
4511
4512 #[inline]
4513 unsafe fn decode(
4514 &mut self,
4515 decoder: &mut fidl::encoding::Decoder<
4516 '_,
4517 fidl::encoding::DefaultFuchsiaResourceDialect,
4518 >,
4519 offset: usize,
4520 _depth: fidl::encoding::Depth,
4521 ) -> fidl::Result<()> {
4522 decoder.debug_check_bounds::<Self>(offset);
4523 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4525 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4526 let mask = 0xffffffff00000000u64;
4527 let maskedval = padval & mask;
4528 if maskedval != 0 {
4529 return Err(fidl::Error::NonZeroPadding {
4530 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4531 });
4532 }
4533 fidl::decode!(
4534 u64,
4535 fidl::encoding::DefaultFuchsiaResourceDialect,
4536 &mut self.id,
4537 decoder,
4538 offset + 0,
4539 _depth
4540 )?;
4541 fidl::decode!(
4542 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
4543 fidl::encoding::DefaultFuchsiaResourceDialect,
4544 &mut self.request,
4545 decoder,
4546 offset + 8,
4547 _depth
4548 )?;
4549 Ok(())
4550 }
4551 }
4552
4553 impl fidl::encoding::ResourceTypeMarker for FrameInfo {
4554 type Borrowed<'a> = &'a mut Self;
4555 fn take_or_borrow<'a>(
4556 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4557 ) -> Self::Borrowed<'a> {
4558 value
4559 }
4560 }
4561
4562 unsafe impl fidl::encoding::TypeMarker for FrameInfo {
4563 type Owned = Self;
4564
4565 #[inline(always)]
4566 fn inline_align(_context: fidl::encoding::Context) -> usize {
4567 8
4568 }
4569
4570 #[inline(always)]
4571 fn inline_size(_context: fidl::encoding::Context) -> usize {
4572 32
4573 }
4574 }
4575
4576 unsafe impl fidl::encoding::Encode<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
4577 for &mut FrameInfo
4578 {
4579 #[inline]
4580 unsafe fn encode(
4581 self,
4582 encoder: &mut fidl::encoding::Encoder<
4583 '_,
4584 fidl::encoding::DefaultFuchsiaResourceDialect,
4585 >,
4586 offset: usize,
4587 _depth: fidl::encoding::Depth,
4588 ) -> fidl::Result<()> {
4589 encoder.debug_check_bounds::<FrameInfo>(offset);
4590 fidl::encoding::Encode::<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4592 (
4593 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_index),
4594 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_counter),
4595 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
4596 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.release_fence),
4597 ),
4598 encoder, offset, _depth
4599 )
4600 }
4601 }
4602 unsafe impl<
4603 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
4604 T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4605 T2: fidl::encoding::Encode<i64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4606 T3: fidl::encoding::Encode<
4607 fidl::encoding::HandleType<
4608 fidl::EventPair,
4609 { fidl::ObjectType::EVENTPAIR.into_raw() },
4610 2147483648,
4611 >,
4612 fidl::encoding::DefaultFuchsiaResourceDialect,
4613 >,
4614 > fidl::encoding::Encode<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
4615 for (T0, T1, T2, T3)
4616 {
4617 #[inline]
4618 unsafe fn encode(
4619 self,
4620 encoder: &mut fidl::encoding::Encoder<
4621 '_,
4622 fidl::encoding::DefaultFuchsiaResourceDialect,
4623 >,
4624 offset: usize,
4625 depth: fidl::encoding::Depth,
4626 ) -> fidl::Result<()> {
4627 encoder.debug_check_bounds::<FrameInfo>(offset);
4628 unsafe {
4631 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4632 (ptr as *mut u64).write_unaligned(0);
4633 }
4634 unsafe {
4635 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
4636 (ptr as *mut u64).write_unaligned(0);
4637 }
4638 self.0.encode(encoder, offset + 0, depth)?;
4640 self.1.encode(encoder, offset + 8, depth)?;
4641 self.2.encode(encoder, offset + 16, depth)?;
4642 self.3.encode(encoder, offset + 24, depth)?;
4643 Ok(())
4644 }
4645 }
4646
4647 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo {
4648 #[inline(always)]
4649 fn new_empty() -> Self {
4650 Self {
4651 buffer_index: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
4652 frame_counter: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
4653 timestamp: fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect),
4654 release_fence: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4655 }
4656 }
4657
4658 #[inline]
4659 unsafe fn decode(
4660 &mut self,
4661 decoder: &mut fidl::encoding::Decoder<
4662 '_,
4663 fidl::encoding::DefaultFuchsiaResourceDialect,
4664 >,
4665 offset: usize,
4666 _depth: fidl::encoding::Depth,
4667 ) -> fidl::Result<()> {
4668 decoder.debug_check_bounds::<Self>(offset);
4669 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4671 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4672 let mask = 0xffffffff00000000u64;
4673 let maskedval = padval & mask;
4674 if maskedval != 0 {
4675 return Err(fidl::Error::NonZeroPadding {
4676 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4677 });
4678 }
4679 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
4680 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4681 let mask = 0xffffffff00000000u64;
4682 let maskedval = padval & mask;
4683 if maskedval != 0 {
4684 return Err(fidl::Error::NonZeroPadding {
4685 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
4686 });
4687 }
4688 fidl::decode!(
4689 u32,
4690 fidl::encoding::DefaultFuchsiaResourceDialect,
4691 &mut self.buffer_index,
4692 decoder,
4693 offset + 0,
4694 _depth
4695 )?;
4696 fidl::decode!(
4697 u64,
4698 fidl::encoding::DefaultFuchsiaResourceDialect,
4699 &mut self.frame_counter,
4700 decoder,
4701 offset + 8,
4702 _depth
4703 )?;
4704 fidl::decode!(
4705 i64,
4706 fidl::encoding::DefaultFuchsiaResourceDialect,
4707 &mut self.timestamp,
4708 decoder,
4709 offset + 16,
4710 _depth
4711 )?;
4712 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.release_fence, decoder, offset + 24, _depth)?;
4713 Ok(())
4714 }
4715 }
4716
4717 impl fidl::encoding::ResourceTypeMarker for StreamGetNextFrame2Response {
4718 type Borrowed<'a> = &'a mut Self;
4719 fn take_or_borrow<'a>(
4720 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4721 ) -> Self::Borrowed<'a> {
4722 value
4723 }
4724 }
4725
4726 unsafe impl fidl::encoding::TypeMarker for StreamGetNextFrame2Response {
4727 type Owned = Self;
4728
4729 #[inline(always)]
4730 fn inline_align(_context: fidl::encoding::Context) -> usize {
4731 8
4732 }
4733
4734 #[inline(always)]
4735 fn inline_size(_context: fidl::encoding::Context) -> usize {
4736 16
4737 }
4738 }
4739
4740 unsafe impl
4741 fidl::encoding::Encode<
4742 StreamGetNextFrame2Response,
4743 fidl::encoding::DefaultFuchsiaResourceDialect,
4744 > for &mut StreamGetNextFrame2Response
4745 {
4746 #[inline]
4747 unsafe fn encode(
4748 self,
4749 encoder: &mut fidl::encoding::Encoder<
4750 '_,
4751 fidl::encoding::DefaultFuchsiaResourceDialect,
4752 >,
4753 offset: usize,
4754 _depth: fidl::encoding::Depth,
4755 ) -> fidl::Result<()> {
4756 encoder.debug_check_bounds::<StreamGetNextFrame2Response>(offset);
4757 fidl::encoding::Encode::<
4759 StreamGetNextFrame2Response,
4760 fidl::encoding::DefaultFuchsiaResourceDialect,
4761 >::encode(
4762 (<FrameInfo2 as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4763 &mut self.info,
4764 ),),
4765 encoder,
4766 offset,
4767 _depth,
4768 )
4769 }
4770 }
4771 unsafe impl<T0: fidl::encoding::Encode<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>>
4772 fidl::encoding::Encode<
4773 StreamGetNextFrame2Response,
4774 fidl::encoding::DefaultFuchsiaResourceDialect,
4775 > for (T0,)
4776 {
4777 #[inline]
4778 unsafe fn encode(
4779 self,
4780 encoder: &mut fidl::encoding::Encoder<
4781 '_,
4782 fidl::encoding::DefaultFuchsiaResourceDialect,
4783 >,
4784 offset: usize,
4785 depth: fidl::encoding::Depth,
4786 ) -> fidl::Result<()> {
4787 encoder.debug_check_bounds::<StreamGetNextFrame2Response>(offset);
4788 self.0.encode(encoder, offset + 0, depth)?;
4792 Ok(())
4793 }
4794 }
4795
4796 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4797 for StreamGetNextFrame2Response
4798 {
4799 #[inline(always)]
4800 fn new_empty() -> Self {
4801 Self {
4802 info: fidl::new_empty!(FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect),
4803 }
4804 }
4805
4806 #[inline]
4807 unsafe fn decode(
4808 &mut self,
4809 decoder: &mut fidl::encoding::Decoder<
4810 '_,
4811 fidl::encoding::DefaultFuchsiaResourceDialect,
4812 >,
4813 offset: usize,
4814 _depth: fidl::encoding::Depth,
4815 ) -> fidl::Result<()> {
4816 decoder.debug_check_bounds::<Self>(offset);
4817 fidl::decode!(
4819 FrameInfo2,
4820 fidl::encoding::DefaultFuchsiaResourceDialect,
4821 &mut self.info,
4822 decoder,
4823 offset + 0,
4824 _depth
4825 )?;
4826 Ok(())
4827 }
4828 }
4829
4830 impl fidl::encoding::ResourceTypeMarker for StreamGetNextFrameResponse {
4831 type Borrowed<'a> = &'a mut Self;
4832 fn take_or_borrow<'a>(
4833 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4834 ) -> Self::Borrowed<'a> {
4835 value
4836 }
4837 }
4838
4839 unsafe impl fidl::encoding::TypeMarker for StreamGetNextFrameResponse {
4840 type Owned = Self;
4841
4842 #[inline(always)]
4843 fn inline_align(_context: fidl::encoding::Context) -> usize {
4844 8
4845 }
4846
4847 #[inline(always)]
4848 fn inline_size(_context: fidl::encoding::Context) -> usize {
4849 32
4850 }
4851 }
4852
4853 unsafe impl
4854 fidl::encoding::Encode<
4855 StreamGetNextFrameResponse,
4856 fidl::encoding::DefaultFuchsiaResourceDialect,
4857 > for &mut StreamGetNextFrameResponse
4858 {
4859 #[inline]
4860 unsafe fn encode(
4861 self,
4862 encoder: &mut fidl::encoding::Encoder<
4863 '_,
4864 fidl::encoding::DefaultFuchsiaResourceDialect,
4865 >,
4866 offset: usize,
4867 _depth: fidl::encoding::Depth,
4868 ) -> fidl::Result<()> {
4869 encoder.debug_check_bounds::<StreamGetNextFrameResponse>(offset);
4870 fidl::encoding::Encode::<
4872 StreamGetNextFrameResponse,
4873 fidl::encoding::DefaultFuchsiaResourceDialect,
4874 >::encode(
4875 (<FrameInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),),
4876 encoder,
4877 offset,
4878 _depth,
4879 )
4880 }
4881 }
4882 unsafe impl<T0: fidl::encoding::Encode<FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>>
4883 fidl::encoding::Encode<
4884 StreamGetNextFrameResponse,
4885 fidl::encoding::DefaultFuchsiaResourceDialect,
4886 > for (T0,)
4887 {
4888 #[inline]
4889 unsafe fn encode(
4890 self,
4891 encoder: &mut fidl::encoding::Encoder<
4892 '_,
4893 fidl::encoding::DefaultFuchsiaResourceDialect,
4894 >,
4895 offset: usize,
4896 depth: fidl::encoding::Depth,
4897 ) -> fidl::Result<()> {
4898 encoder.debug_check_bounds::<StreamGetNextFrameResponse>(offset);
4899 self.0.encode(encoder, offset + 0, depth)?;
4903 Ok(())
4904 }
4905 }
4906
4907 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4908 for StreamGetNextFrameResponse
4909 {
4910 #[inline(always)]
4911 fn new_empty() -> Self {
4912 Self {
4913 info: fidl::new_empty!(FrameInfo, fidl::encoding::DefaultFuchsiaResourceDialect),
4914 }
4915 }
4916
4917 #[inline]
4918 unsafe fn decode(
4919 &mut self,
4920 decoder: &mut fidl::encoding::Decoder<
4921 '_,
4922 fidl::encoding::DefaultFuchsiaResourceDialect,
4923 >,
4924 offset: usize,
4925 _depth: fidl::encoding::Depth,
4926 ) -> fidl::Result<()> {
4927 decoder.debug_check_bounds::<Self>(offset);
4928 fidl::decode!(
4930 FrameInfo,
4931 fidl::encoding::DefaultFuchsiaResourceDialect,
4932 &mut self.info,
4933 decoder,
4934 offset + 0,
4935 _depth
4936 )?;
4937 Ok(())
4938 }
4939 }
4940
4941 impl fidl::encoding::ResourceTypeMarker for StreamRebindRequest {
4942 type Borrowed<'a> = &'a mut Self;
4943 fn take_or_borrow<'a>(
4944 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4945 ) -> Self::Borrowed<'a> {
4946 value
4947 }
4948 }
4949
4950 unsafe impl fidl::encoding::TypeMarker for StreamRebindRequest {
4951 type Owned = Self;
4952
4953 #[inline(always)]
4954 fn inline_align(_context: fidl::encoding::Context) -> usize {
4955 4
4956 }
4957
4958 #[inline(always)]
4959 fn inline_size(_context: fidl::encoding::Context) -> usize {
4960 4
4961 }
4962 }
4963
4964 unsafe impl
4965 fidl::encoding::Encode<StreamRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4966 for &mut StreamRebindRequest
4967 {
4968 #[inline]
4969 unsafe fn encode(
4970 self,
4971 encoder: &mut fidl::encoding::Encoder<
4972 '_,
4973 fidl::encoding::DefaultFuchsiaResourceDialect,
4974 >,
4975 offset: usize,
4976 _depth: fidl::encoding::Depth,
4977 ) -> fidl::Result<()> {
4978 encoder.debug_check_bounds::<StreamRebindRequest>(offset);
4979 fidl::encoding::Encode::<StreamRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4981 (
4982 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
4983 ),
4984 encoder, offset, _depth
4985 )
4986 }
4987 }
4988 unsafe impl<
4989 T0: fidl::encoding::Encode<
4990 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
4991 fidl::encoding::DefaultFuchsiaResourceDialect,
4992 >,
4993 >
4994 fidl::encoding::Encode<StreamRebindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4995 for (T0,)
4996 {
4997 #[inline]
4998 unsafe fn encode(
4999 self,
5000 encoder: &mut fidl::encoding::Encoder<
5001 '_,
5002 fidl::encoding::DefaultFuchsiaResourceDialect,
5003 >,
5004 offset: usize,
5005 depth: fidl::encoding::Depth,
5006 ) -> fidl::Result<()> {
5007 encoder.debug_check_bounds::<StreamRebindRequest>(offset);
5008 self.0.encode(encoder, offset + 0, depth)?;
5012 Ok(())
5013 }
5014 }
5015
5016 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5017 for StreamRebindRequest
5018 {
5019 #[inline(always)]
5020 fn new_empty() -> Self {
5021 Self {
5022 request: fidl::new_empty!(
5023 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
5024 fidl::encoding::DefaultFuchsiaResourceDialect
5025 ),
5026 }
5027 }
5028
5029 #[inline]
5030 unsafe fn decode(
5031 &mut self,
5032 decoder: &mut fidl::encoding::Decoder<
5033 '_,
5034 fidl::encoding::DefaultFuchsiaResourceDialect,
5035 >,
5036 offset: usize,
5037 _depth: fidl::encoding::Depth,
5038 ) -> fidl::Result<()> {
5039 decoder.debug_check_bounds::<Self>(offset);
5040 fidl::decode!(
5042 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Stream_Marker>>,
5043 fidl::encoding::DefaultFuchsiaResourceDialect,
5044 &mut self.request,
5045 decoder,
5046 offset + 0,
5047 _depth
5048 )?;
5049 Ok(())
5050 }
5051 }
5052
5053 impl fidl::encoding::ResourceTypeMarker for StreamSetBufferCollection2Request {
5054 type Borrowed<'a> = &'a mut Self;
5055 fn take_or_borrow<'a>(
5056 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5057 ) -> Self::Borrowed<'a> {
5058 value
5059 }
5060 }
5061
5062 unsafe impl fidl::encoding::TypeMarker for StreamSetBufferCollection2Request {
5063 type Owned = Self;
5064
5065 #[inline(always)]
5066 fn inline_align(_context: fidl::encoding::Context) -> usize {
5067 4
5068 }
5069
5070 #[inline(always)]
5071 fn inline_size(_context: fidl::encoding::Context) -> usize {
5072 4
5073 }
5074 }
5075
5076 unsafe impl
5077 fidl::encoding::Encode<
5078 StreamSetBufferCollection2Request,
5079 fidl::encoding::DefaultFuchsiaResourceDialect,
5080 > for &mut StreamSetBufferCollection2Request
5081 {
5082 #[inline]
5083 unsafe fn encode(
5084 self,
5085 encoder: &mut fidl::encoding::Encoder<
5086 '_,
5087 fidl::encoding::DefaultFuchsiaResourceDialect,
5088 >,
5089 offset: usize,
5090 _depth: fidl::encoding::Depth,
5091 ) -> fidl::Result<()> {
5092 encoder.debug_check_bounds::<StreamSetBufferCollection2Request>(offset);
5093 fidl::encoding::Encode::<
5095 StreamSetBufferCollection2Request,
5096 fidl::encoding::DefaultFuchsiaResourceDialect,
5097 >::encode(
5098 (<fidl::encoding::Optional<
5099 fidl::encoding::Endpoint<
5100 fidl::endpoints::ClientEnd<
5101 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5102 >,
5103 >,
5104 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5105 &mut self.token
5106 ),),
5107 encoder,
5108 offset,
5109 _depth,
5110 )
5111 }
5112 }
5113 unsafe impl<
5114 T0: fidl::encoding::Encode<
5115 fidl::encoding::Optional<
5116 fidl::encoding::Endpoint<
5117 fidl::endpoints::ClientEnd<
5118 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5119 >,
5120 >,
5121 >,
5122 fidl::encoding::DefaultFuchsiaResourceDialect,
5123 >,
5124 >
5125 fidl::encoding::Encode<
5126 StreamSetBufferCollection2Request,
5127 fidl::encoding::DefaultFuchsiaResourceDialect,
5128 > for (T0,)
5129 {
5130 #[inline]
5131 unsafe fn encode(
5132 self,
5133 encoder: &mut fidl::encoding::Encoder<
5134 '_,
5135 fidl::encoding::DefaultFuchsiaResourceDialect,
5136 >,
5137 offset: usize,
5138 depth: fidl::encoding::Depth,
5139 ) -> fidl::Result<()> {
5140 encoder.debug_check_bounds::<StreamSetBufferCollection2Request>(offset);
5141 self.0.encode(encoder, offset + 0, depth)?;
5145 Ok(())
5146 }
5147 }
5148
5149 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5150 for StreamSetBufferCollection2Request
5151 {
5152 #[inline(always)]
5153 fn new_empty() -> Self {
5154 Self {
5155 token: fidl::new_empty!(
5156 fidl::encoding::Optional<
5157 fidl::encoding::Endpoint<
5158 fidl::endpoints::ClientEnd<
5159 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5160 >,
5161 >,
5162 >,
5163 fidl::encoding::DefaultFuchsiaResourceDialect
5164 ),
5165 }
5166 }
5167
5168 #[inline]
5169 unsafe fn decode(
5170 &mut self,
5171 decoder: &mut fidl::encoding::Decoder<
5172 '_,
5173 fidl::encoding::DefaultFuchsiaResourceDialect,
5174 >,
5175 offset: usize,
5176 _depth: fidl::encoding::Depth,
5177 ) -> fidl::Result<()> {
5178 decoder.debug_check_bounds::<Self>(offset);
5179 fidl::decode!(
5181 fidl::encoding::Optional<
5182 fidl::encoding::Endpoint<
5183 fidl::endpoints::ClientEnd<
5184 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5185 >,
5186 >,
5187 >,
5188 fidl::encoding::DefaultFuchsiaResourceDialect,
5189 &mut self.token,
5190 decoder,
5191 offset + 0,
5192 _depth
5193 )?;
5194 Ok(())
5195 }
5196 }
5197
5198 impl fidl::encoding::ResourceTypeMarker for StreamSetBufferCollectionRequest {
5199 type Borrowed<'a> = &'a mut Self;
5200 fn take_or_borrow<'a>(
5201 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5202 ) -> Self::Borrowed<'a> {
5203 value
5204 }
5205 }
5206
5207 unsafe impl fidl::encoding::TypeMarker for StreamSetBufferCollectionRequest {
5208 type Owned = Self;
5209
5210 #[inline(always)]
5211 fn inline_align(_context: fidl::encoding::Context) -> usize {
5212 4
5213 }
5214
5215 #[inline(always)]
5216 fn inline_size(_context: fidl::encoding::Context) -> usize {
5217 4
5218 }
5219 }
5220
5221 unsafe impl
5222 fidl::encoding::Encode<
5223 StreamSetBufferCollectionRequest,
5224 fidl::encoding::DefaultFuchsiaResourceDialect,
5225 > for &mut StreamSetBufferCollectionRequest
5226 {
5227 #[inline]
5228 unsafe fn encode(
5229 self,
5230 encoder: &mut fidl::encoding::Encoder<
5231 '_,
5232 fidl::encoding::DefaultFuchsiaResourceDialect,
5233 >,
5234 offset: usize,
5235 _depth: fidl::encoding::Depth,
5236 ) -> fidl::Result<()> {
5237 encoder.debug_check_bounds::<StreamSetBufferCollectionRequest>(offset);
5238 fidl::encoding::Encode::<
5240 StreamSetBufferCollectionRequest,
5241 fidl::encoding::DefaultFuchsiaResourceDialect,
5242 >::encode(
5243 (<fidl::encoding::Optional<
5244 fidl::encoding::Endpoint<
5245 fidl::endpoints::ClientEnd<
5246 fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
5247 >,
5248 >,
5249 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5250 &mut self.token
5251 ),),
5252 encoder,
5253 offset,
5254 _depth,
5255 )
5256 }
5257 }
5258 unsafe impl<
5259 T0: fidl::encoding::Encode<
5260 fidl::encoding::Optional<
5261 fidl::encoding::Endpoint<
5262 fidl::endpoints::ClientEnd<
5263 fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
5264 >,
5265 >,
5266 >,
5267 fidl::encoding::DefaultFuchsiaResourceDialect,
5268 >,
5269 >
5270 fidl::encoding::Encode<
5271 StreamSetBufferCollectionRequest,
5272 fidl::encoding::DefaultFuchsiaResourceDialect,
5273 > for (T0,)
5274 {
5275 #[inline]
5276 unsafe fn encode(
5277 self,
5278 encoder: &mut fidl::encoding::Encoder<
5279 '_,
5280 fidl::encoding::DefaultFuchsiaResourceDialect,
5281 >,
5282 offset: usize,
5283 depth: fidl::encoding::Depth,
5284 ) -> fidl::Result<()> {
5285 encoder.debug_check_bounds::<StreamSetBufferCollectionRequest>(offset);
5286 self.0.encode(encoder, offset + 0, depth)?;
5290 Ok(())
5291 }
5292 }
5293
5294 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5295 for StreamSetBufferCollectionRequest
5296 {
5297 #[inline(always)]
5298 fn new_empty() -> Self {
5299 Self {
5300 token: fidl::new_empty!(
5301 fidl::encoding::Optional<
5302 fidl::encoding::Endpoint<
5303 fidl::endpoints::ClientEnd<
5304 fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
5305 >,
5306 >,
5307 >,
5308 fidl::encoding::DefaultFuchsiaResourceDialect
5309 ),
5310 }
5311 }
5312
5313 #[inline]
5314 unsafe fn decode(
5315 &mut self,
5316 decoder: &mut fidl::encoding::Decoder<
5317 '_,
5318 fidl::encoding::DefaultFuchsiaResourceDialect,
5319 >,
5320 offset: usize,
5321 _depth: fidl::encoding::Depth,
5322 ) -> fidl::Result<()> {
5323 decoder.debug_check_bounds::<Self>(offset);
5324 fidl::decode!(
5326 fidl::encoding::Optional<
5327 fidl::encoding::Endpoint<
5328 fidl::endpoints::ClientEnd<
5329 fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
5330 >,
5331 >,
5332 >,
5333 fidl::encoding::DefaultFuchsiaResourceDialect,
5334 &mut self.token,
5335 decoder,
5336 offset + 0,
5337 _depth
5338 )?;
5339 Ok(())
5340 }
5341 }
5342
5343 impl fidl::encoding::ResourceTypeMarker for StreamWatchBufferCollection2Response {
5344 type Borrowed<'a> = &'a mut Self;
5345 fn take_or_borrow<'a>(
5346 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5347 ) -> Self::Borrowed<'a> {
5348 value
5349 }
5350 }
5351
5352 unsafe impl fidl::encoding::TypeMarker for StreamWatchBufferCollection2Response {
5353 type Owned = Self;
5354
5355 #[inline(always)]
5356 fn inline_align(_context: fidl::encoding::Context) -> usize {
5357 4
5358 }
5359
5360 #[inline(always)]
5361 fn inline_size(_context: fidl::encoding::Context) -> usize {
5362 4
5363 }
5364 }
5365
5366 unsafe impl
5367 fidl::encoding::Encode<
5368 StreamWatchBufferCollection2Response,
5369 fidl::encoding::DefaultFuchsiaResourceDialect,
5370 > for &mut StreamWatchBufferCollection2Response
5371 {
5372 #[inline]
5373 unsafe fn encode(
5374 self,
5375 encoder: &mut fidl::encoding::Encoder<
5376 '_,
5377 fidl::encoding::DefaultFuchsiaResourceDialect,
5378 >,
5379 offset: usize,
5380 _depth: fidl::encoding::Depth,
5381 ) -> fidl::Result<()> {
5382 encoder.debug_check_bounds::<StreamWatchBufferCollection2Response>(offset);
5383 fidl::encoding::Encode::<
5385 StreamWatchBufferCollection2Response,
5386 fidl::encoding::DefaultFuchsiaResourceDialect,
5387 >::encode(
5388 (<fidl::encoding::Endpoint<
5389 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5390 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5391 &mut self.token
5392 ),),
5393 encoder,
5394 offset,
5395 _depth,
5396 )
5397 }
5398 }
5399 unsafe impl<
5400 T0: fidl::encoding::Encode<
5401 fidl::encoding::Endpoint<
5402 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5403 >,
5404 fidl::encoding::DefaultFuchsiaResourceDialect,
5405 >,
5406 >
5407 fidl::encoding::Encode<
5408 StreamWatchBufferCollection2Response,
5409 fidl::encoding::DefaultFuchsiaResourceDialect,
5410 > for (T0,)
5411 {
5412 #[inline]
5413 unsafe fn encode(
5414 self,
5415 encoder: &mut fidl::encoding::Encoder<
5416 '_,
5417 fidl::encoding::DefaultFuchsiaResourceDialect,
5418 >,
5419 offset: usize,
5420 depth: fidl::encoding::Depth,
5421 ) -> fidl::Result<()> {
5422 encoder.debug_check_bounds::<StreamWatchBufferCollection2Response>(offset);
5423 self.0.encode(encoder, offset + 0, depth)?;
5427 Ok(())
5428 }
5429 }
5430
5431 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5432 for StreamWatchBufferCollection2Response
5433 {
5434 #[inline(always)]
5435 fn new_empty() -> Self {
5436 Self {
5437 token: fidl::new_empty!(
5438 fidl::encoding::Endpoint<
5439 fidl::endpoints::ClientEnd<
5440 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5441 >,
5442 >,
5443 fidl::encoding::DefaultFuchsiaResourceDialect
5444 ),
5445 }
5446 }
5447
5448 #[inline]
5449 unsafe fn decode(
5450 &mut self,
5451 decoder: &mut fidl::encoding::Decoder<
5452 '_,
5453 fidl::encoding::DefaultFuchsiaResourceDialect,
5454 >,
5455 offset: usize,
5456 _depth: fidl::encoding::Depth,
5457 ) -> fidl::Result<()> {
5458 decoder.debug_check_bounds::<Self>(offset);
5459 fidl::decode!(
5461 fidl::encoding::Endpoint<
5462 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5463 >,
5464 fidl::encoding::DefaultFuchsiaResourceDialect,
5465 &mut self.token,
5466 decoder,
5467 offset + 0,
5468 _depth
5469 )?;
5470 Ok(())
5471 }
5472 }
5473
5474 impl fidl::encoding::ResourceTypeMarker for StreamWatchBufferCollectionResponse {
5475 type Borrowed<'a> = &'a mut Self;
5476 fn take_or_borrow<'a>(
5477 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5478 ) -> Self::Borrowed<'a> {
5479 value
5480 }
5481 }
5482
5483 unsafe impl fidl::encoding::TypeMarker for StreamWatchBufferCollectionResponse {
5484 type Owned = Self;
5485
5486 #[inline(always)]
5487 fn inline_align(_context: fidl::encoding::Context) -> usize {
5488 4
5489 }
5490
5491 #[inline(always)]
5492 fn inline_size(_context: fidl::encoding::Context) -> usize {
5493 4
5494 }
5495 }
5496
5497 unsafe impl
5498 fidl::encoding::Encode<
5499 StreamWatchBufferCollectionResponse,
5500 fidl::encoding::DefaultFuchsiaResourceDialect,
5501 > for &mut StreamWatchBufferCollectionResponse
5502 {
5503 #[inline]
5504 unsafe fn encode(
5505 self,
5506 encoder: &mut fidl::encoding::Encoder<
5507 '_,
5508 fidl::encoding::DefaultFuchsiaResourceDialect,
5509 >,
5510 offset: usize,
5511 _depth: fidl::encoding::Depth,
5512 ) -> fidl::Result<()> {
5513 encoder.debug_check_bounds::<StreamWatchBufferCollectionResponse>(offset);
5514 fidl::encoding::Encode::<
5516 StreamWatchBufferCollectionResponse,
5517 fidl::encoding::DefaultFuchsiaResourceDialect,
5518 >::encode(
5519 (<fidl::encoding::Endpoint<
5520 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
5521 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5522 &mut self.token
5523 ),),
5524 encoder,
5525 offset,
5526 _depth,
5527 )
5528 }
5529 }
5530 unsafe impl<
5531 T0: fidl::encoding::Encode<
5532 fidl::encoding::Endpoint<
5533 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
5534 >,
5535 fidl::encoding::DefaultFuchsiaResourceDialect,
5536 >,
5537 >
5538 fidl::encoding::Encode<
5539 StreamWatchBufferCollectionResponse,
5540 fidl::encoding::DefaultFuchsiaResourceDialect,
5541 > for (T0,)
5542 {
5543 #[inline]
5544 unsafe fn encode(
5545 self,
5546 encoder: &mut fidl::encoding::Encoder<
5547 '_,
5548 fidl::encoding::DefaultFuchsiaResourceDialect,
5549 >,
5550 offset: usize,
5551 depth: fidl::encoding::Depth,
5552 ) -> fidl::Result<()> {
5553 encoder.debug_check_bounds::<StreamWatchBufferCollectionResponse>(offset);
5554 self.0.encode(encoder, offset + 0, depth)?;
5558 Ok(())
5559 }
5560 }
5561
5562 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5563 for StreamWatchBufferCollectionResponse
5564 {
5565 #[inline(always)]
5566 fn new_empty() -> Self {
5567 Self {
5568 token: fidl::new_empty!(
5569 fidl::encoding::Endpoint<
5570 fidl::endpoints::ClientEnd<
5571 fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
5572 >,
5573 >,
5574 fidl::encoding::DefaultFuchsiaResourceDialect
5575 ),
5576 }
5577 }
5578
5579 #[inline]
5580 unsafe fn decode(
5581 &mut self,
5582 decoder: &mut fidl::encoding::Decoder<
5583 '_,
5584 fidl::encoding::DefaultFuchsiaResourceDialect,
5585 >,
5586 offset: usize,
5587 _depth: fidl::encoding::Depth,
5588 ) -> fidl::Result<()> {
5589 decoder.debug_check_bounds::<Self>(offset);
5590 fidl::decode!(
5592 fidl::encoding::Endpoint<
5593 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
5594 >,
5595 fidl::encoding::DefaultFuchsiaResourceDialect,
5596 &mut self.token,
5597 decoder,
5598 offset + 0,
5599 _depth
5600 )?;
5601 Ok(())
5602 }
5603 }
5604
5605 impl FrameInfo2 {
5606 #[inline(always)]
5607 fn max_ordinal_present(&self) -> u64 {
5608 if let Some(_) = self.release_fence {
5609 return 5;
5610 }
5611 if let Some(_) = self.capture_timestamp {
5612 return 4;
5613 }
5614 if let Some(_) = self.timestamp {
5615 return 3;
5616 }
5617 if let Some(_) = self.frame_counter {
5618 return 2;
5619 }
5620 if let Some(_) = self.buffer_index {
5621 return 1;
5622 }
5623 0
5624 }
5625 }
5626
5627 impl fidl::encoding::ResourceTypeMarker for FrameInfo2 {
5628 type Borrowed<'a> = &'a mut Self;
5629 fn take_or_borrow<'a>(
5630 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5631 ) -> Self::Borrowed<'a> {
5632 value
5633 }
5634 }
5635
5636 unsafe impl fidl::encoding::TypeMarker for FrameInfo2 {
5637 type Owned = Self;
5638
5639 #[inline(always)]
5640 fn inline_align(_context: fidl::encoding::Context) -> usize {
5641 8
5642 }
5643
5644 #[inline(always)]
5645 fn inline_size(_context: fidl::encoding::Context) -> usize {
5646 16
5647 }
5648 }
5649
5650 unsafe impl fidl::encoding::Encode<FrameInfo2, fidl::encoding::DefaultFuchsiaResourceDialect>
5651 for &mut FrameInfo2
5652 {
5653 unsafe fn encode(
5654 self,
5655 encoder: &mut fidl::encoding::Encoder<
5656 '_,
5657 fidl::encoding::DefaultFuchsiaResourceDialect,
5658 >,
5659 offset: usize,
5660 mut depth: fidl::encoding::Depth,
5661 ) -> fidl::Result<()> {
5662 encoder.debug_check_bounds::<FrameInfo2>(offset);
5663 let max_ordinal: u64 = self.max_ordinal_present();
5665 encoder.write_num(max_ordinal, offset);
5666 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5667 if max_ordinal == 0 {
5669 return Ok(());
5670 }
5671 depth.increment()?;
5672 let envelope_size = 8;
5673 let bytes_len = max_ordinal as usize * envelope_size;
5674 #[allow(unused_variables)]
5675 let offset = encoder.out_of_line_offset(bytes_len);
5676 let mut _prev_end_offset: usize = 0;
5677 if 1 > max_ordinal {
5678 return Ok(());
5679 }
5680
5681 let cur_offset: usize = (1 - 1) * envelope_size;
5684
5685 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5687
5688 fidl::encoding::encode_in_envelope_optional::<
5693 u32,
5694 fidl::encoding::DefaultFuchsiaResourceDialect,
5695 >(
5696 self.buffer_index.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
5697 encoder,
5698 offset + cur_offset,
5699 depth,
5700 )?;
5701
5702 _prev_end_offset = cur_offset + envelope_size;
5703 if 2 > max_ordinal {
5704 return Ok(());
5705 }
5706
5707 let cur_offset: usize = (2 - 1) * envelope_size;
5710
5711 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5713
5714 fidl::encoding::encode_in_envelope_optional::<
5719 u64,
5720 fidl::encoding::DefaultFuchsiaResourceDialect,
5721 >(
5722 self.frame_counter.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5723 encoder,
5724 offset + cur_offset,
5725 depth,
5726 )?;
5727
5728 _prev_end_offset = cur_offset + envelope_size;
5729 if 3 > max_ordinal {
5730 return Ok(());
5731 }
5732
5733 let cur_offset: usize = (3 - 1) * envelope_size;
5736
5737 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5739
5740 fidl::encoding::encode_in_envelope_optional::<
5745 i64,
5746 fidl::encoding::DefaultFuchsiaResourceDialect,
5747 >(
5748 self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5749 encoder,
5750 offset + cur_offset,
5751 depth,
5752 )?;
5753
5754 _prev_end_offset = cur_offset + envelope_size;
5755 if 4 > max_ordinal {
5756 return Ok(());
5757 }
5758
5759 let cur_offset: usize = (4 - 1) * envelope_size;
5762
5763 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5765
5766 fidl::encoding::encode_in_envelope_optional::<
5771 i64,
5772 fidl::encoding::DefaultFuchsiaResourceDialect,
5773 >(
5774 self.capture_timestamp
5775 .as_ref()
5776 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5777 encoder,
5778 offset + cur_offset,
5779 depth,
5780 )?;
5781
5782 _prev_end_offset = cur_offset + envelope_size;
5783 if 5 > max_ordinal {
5784 return Ok(());
5785 }
5786
5787 let cur_offset: usize = (5 - 1) * envelope_size;
5790
5791 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5793
5794 fidl::encoding::encode_in_envelope_optional::<
5799 fidl::encoding::HandleType<
5800 fidl::EventPair,
5801 { fidl::ObjectType::EVENTPAIR.into_raw() },
5802 2147483648,
5803 >,
5804 fidl::encoding::DefaultFuchsiaResourceDialect,
5805 >(
5806 self.release_fence.as_mut().map(
5807 <fidl::encoding::HandleType<
5808 fidl::EventPair,
5809 { fidl::ObjectType::EVENTPAIR.into_raw() },
5810 2147483648,
5811 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5812 ),
5813 encoder,
5814 offset + cur_offset,
5815 depth,
5816 )?;
5817
5818 _prev_end_offset = cur_offset + envelope_size;
5819
5820 Ok(())
5821 }
5822 }
5823
5824 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FrameInfo2 {
5825 #[inline(always)]
5826 fn new_empty() -> Self {
5827 Self::default()
5828 }
5829
5830 unsafe fn decode(
5831 &mut self,
5832 decoder: &mut fidl::encoding::Decoder<
5833 '_,
5834 fidl::encoding::DefaultFuchsiaResourceDialect,
5835 >,
5836 offset: usize,
5837 mut depth: fidl::encoding::Depth,
5838 ) -> fidl::Result<()> {
5839 decoder.debug_check_bounds::<Self>(offset);
5840 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5841 None => return Err(fidl::Error::NotNullable),
5842 Some(len) => len,
5843 };
5844 if len == 0 {
5846 return Ok(());
5847 };
5848 depth.increment()?;
5849 let envelope_size = 8;
5850 let bytes_len = len * envelope_size;
5851 let offset = decoder.out_of_line_offset(bytes_len)?;
5852 let mut _next_ordinal_to_read = 0;
5854 let mut next_offset = offset;
5855 let end_offset = offset + bytes_len;
5856 _next_ordinal_to_read += 1;
5857 if next_offset >= end_offset {
5858 return Ok(());
5859 }
5860
5861 while _next_ordinal_to_read < 1 {
5863 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5864 _next_ordinal_to_read += 1;
5865 next_offset += envelope_size;
5866 }
5867
5868 let next_out_of_line = decoder.next_out_of_line();
5869 let handles_before = decoder.remaining_handles();
5870 if let Some((inlined, num_bytes, num_handles)) =
5871 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5872 {
5873 let member_inline_size =
5874 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5875 if inlined != (member_inline_size <= 4) {
5876 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5877 }
5878 let inner_offset;
5879 let mut inner_depth = depth.clone();
5880 if inlined {
5881 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5882 inner_offset = next_offset;
5883 } else {
5884 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5885 inner_depth.increment()?;
5886 }
5887 let val_ref = self.buffer_index.get_or_insert_with(|| {
5888 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
5889 });
5890 fidl::decode!(
5891 u32,
5892 fidl::encoding::DefaultFuchsiaResourceDialect,
5893 val_ref,
5894 decoder,
5895 inner_offset,
5896 inner_depth
5897 )?;
5898 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5899 {
5900 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5901 }
5902 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5903 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5904 }
5905 }
5906
5907 next_offset += envelope_size;
5908 _next_ordinal_to_read += 1;
5909 if next_offset >= end_offset {
5910 return Ok(());
5911 }
5912
5913 while _next_ordinal_to_read < 2 {
5915 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5916 _next_ordinal_to_read += 1;
5917 next_offset += envelope_size;
5918 }
5919
5920 let next_out_of_line = decoder.next_out_of_line();
5921 let handles_before = decoder.remaining_handles();
5922 if let Some((inlined, num_bytes, num_handles)) =
5923 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5924 {
5925 let member_inline_size =
5926 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5927 if inlined != (member_inline_size <= 4) {
5928 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5929 }
5930 let inner_offset;
5931 let mut inner_depth = depth.clone();
5932 if inlined {
5933 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5934 inner_offset = next_offset;
5935 } else {
5936 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5937 inner_depth.increment()?;
5938 }
5939 let val_ref = self.frame_counter.get_or_insert_with(|| {
5940 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
5941 });
5942 fidl::decode!(
5943 u64,
5944 fidl::encoding::DefaultFuchsiaResourceDialect,
5945 val_ref,
5946 decoder,
5947 inner_offset,
5948 inner_depth
5949 )?;
5950 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5951 {
5952 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5953 }
5954 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5955 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5956 }
5957 }
5958
5959 next_offset += envelope_size;
5960 _next_ordinal_to_read += 1;
5961 if next_offset >= end_offset {
5962 return Ok(());
5963 }
5964
5965 while _next_ordinal_to_read < 3 {
5967 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5968 _next_ordinal_to_read += 1;
5969 next_offset += envelope_size;
5970 }
5971
5972 let next_out_of_line = decoder.next_out_of_line();
5973 let handles_before = decoder.remaining_handles();
5974 if let Some((inlined, num_bytes, num_handles)) =
5975 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5976 {
5977 let member_inline_size =
5978 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5979 if inlined != (member_inline_size <= 4) {
5980 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5981 }
5982 let inner_offset;
5983 let mut inner_depth = depth.clone();
5984 if inlined {
5985 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5986 inner_offset = next_offset;
5987 } else {
5988 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5989 inner_depth.increment()?;
5990 }
5991 let val_ref = self.timestamp.get_or_insert_with(|| {
5992 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
5993 });
5994 fidl::decode!(
5995 i64,
5996 fidl::encoding::DefaultFuchsiaResourceDialect,
5997 val_ref,
5998 decoder,
5999 inner_offset,
6000 inner_depth
6001 )?;
6002 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6003 {
6004 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6005 }
6006 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6007 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6008 }
6009 }
6010
6011 next_offset += envelope_size;
6012 _next_ordinal_to_read += 1;
6013 if next_offset >= end_offset {
6014 return Ok(());
6015 }
6016
6017 while _next_ordinal_to_read < 4 {
6019 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6020 _next_ordinal_to_read += 1;
6021 next_offset += envelope_size;
6022 }
6023
6024 let next_out_of_line = decoder.next_out_of_line();
6025 let handles_before = decoder.remaining_handles();
6026 if let Some((inlined, num_bytes, num_handles)) =
6027 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6028 {
6029 let member_inline_size =
6030 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6031 if inlined != (member_inline_size <= 4) {
6032 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6033 }
6034 let inner_offset;
6035 let mut inner_depth = depth.clone();
6036 if inlined {
6037 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6038 inner_offset = next_offset;
6039 } else {
6040 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6041 inner_depth.increment()?;
6042 }
6043 let val_ref = self.capture_timestamp.get_or_insert_with(|| {
6044 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
6045 });
6046 fidl::decode!(
6047 i64,
6048 fidl::encoding::DefaultFuchsiaResourceDialect,
6049 val_ref,
6050 decoder,
6051 inner_offset,
6052 inner_depth
6053 )?;
6054 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6055 {
6056 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6057 }
6058 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6059 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6060 }
6061 }
6062
6063 next_offset += envelope_size;
6064 _next_ordinal_to_read += 1;
6065 if next_offset >= end_offset {
6066 return Ok(());
6067 }
6068
6069 while _next_ordinal_to_read < 5 {
6071 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6072 _next_ordinal_to_read += 1;
6073 next_offset += envelope_size;
6074 }
6075
6076 let next_out_of_line = decoder.next_out_of_line();
6077 let handles_before = decoder.remaining_handles();
6078 if let Some((inlined, num_bytes, num_handles)) =
6079 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6080 {
6081 let member_inline_size = <fidl::encoding::HandleType<
6082 fidl::EventPair,
6083 { fidl::ObjectType::EVENTPAIR.into_raw() },
6084 2147483648,
6085 > as fidl::encoding::TypeMarker>::inline_size(
6086 decoder.context
6087 );
6088 if inlined != (member_inline_size <= 4) {
6089 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6090 }
6091 let inner_offset;
6092 let mut inner_depth = depth.clone();
6093 if inlined {
6094 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6095 inner_offset = next_offset;
6096 } else {
6097 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6098 inner_depth.increment()?;
6099 }
6100 let val_ref =
6101 self.release_fence.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
6102 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6103 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6104 {
6105 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6106 }
6107 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6108 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6109 }
6110 }
6111
6112 next_offset += envelope_size;
6113
6114 while next_offset < end_offset {
6116 _next_ordinal_to_read += 1;
6117 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6118 next_offset += envelope_size;
6119 }
6120
6121 Ok(())
6122 }
6123 }
6124}