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