Skip to main content

fidl_fuchsia_driver_development/
fidl_fuchsia_driver_development.rs

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