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