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