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