fidl_fuchsia_driver_development/
fidl_fuchsia_driver_development.rs

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