fidl_fuchsia_camera3/
fidl_fuchsia_camera3.rs

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