Skip to main content

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